51 lines
1.7 KiB
PHP
Raw Normal View History

2011-04-15 09:05:30 +00:00
<?php
class Application_Controller_Plugin_Menu extends Zend_Controller_Plugin_Abstract
{
/**
* Créer le menu en fonction des besoins et des paramètres en entrée
* @param Zend_Controller_Request_Abstract $request
*/
public function postDispatch(Zend_Controller_Request_Abstract $request)
{
$siret = $request->getParam('siret', null);
$id = $request->getParam('id', 0);
if (empty($siret) && empty($id)) {
require_once 'Scores/SessionEntreprise.php';
$session = new SessionEntreprise($siret, $id);
$siret = $session->getSiret();
$id = $session->getId();
}
2011-04-27 12:09:12 +00:00
$layout = Zend_Layout::getMVCInstance();
if ($layout->isEnabled() && $request->getControllerName()!='print')
{
//Génération du menu
2011-04-15 09:05:30 +00:00
require_once 'Scores/Menu.php';
$computeMenu = new Menu($siret, $id);
$menu = $computeMenu->getMenu();
2011-04-22 15:10:03 +00:00
$view = $layout->getView();
2011-04-15 09:05:30 +00:00
$view->navigation($menu);
//Génération identifiant Menu
$view->menuId = $computeMenu->getIdMenu($request->getControllerName(), $request->getActionName());
2011-05-24 06:25:58 +00:00
//Gestion affichage Lien Print / PDF / XML
require_once 'Scores/PagePrint.php';
$page = new PagePrint($request->getControllerName(), $request->getActionName());
if ($page->exportable('print')){
$view->print = $page->filename('print', $request->getParams());
}
if ($page->exportable('pdf')){
$view->pdf = $page->filename('pdf', $request->getParams());
}
2011-05-24 06:25:58 +00:00
if ($page->exportable('xml')){
$view->xml = $page->filename('xml', $request->getParams());
}
2011-04-15 09:05:30 +00:00
}
//Icone d'aide
if ($layout->isEnabled() && $request->getControllerName()!='recherche')
{
2012-01-20 07:59:18 +00:00
//$view->aide = true;
}
2011-04-15 09:05:30 +00:00
}
}