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)
|
|
|
|
{
|
2011-04-27 12:09:12 +00:00
|
|
|
$layout = Zend_Layout::getMVCInstance();
|
2011-06-08 07:40:11 +00:00
|
|
|
if ($layout->isEnabled() && $request->getControllerName()!='print')
|
|
|
|
{
|
2012-12-21 11:34:30 +00:00
|
|
|
//Override SIRET to complete with zero by left
|
|
|
|
$siret = $request->getParam('siret');
|
|
|
|
if ( intval($siret)>100 ) {
|
|
|
|
$request->setParam('siret', str_pad($siret, 9, '0', STR_PAD_LEFT));
|
|
|
|
}
|
|
|
|
|
|
|
|
//Génération du menu
|
2011-04-15 09:05:30 +00:00
|
|
|
require_once 'Scores/Menu.php';
|
2012-11-15 13:30:33 +00:00
|
|
|
$computeMenu = new Menu($request->getParams());
|
2011-04-15 09:05:30 +00:00
|
|
|
$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);
|
2011-06-08 07:40:11 +00:00
|
|
|
|
|
|
|
//Génération identifiant Menu
|
|
|
|
$view->menuId = $computeMenu->getIdMenu($request->getControllerName(), $request->getActionName());
|
2012-12-21 11:34:30 +00:00
|
|
|
|
2011-05-24 06:25:58 +00:00
|
|
|
//Gestion affichage Lien Print / PDF / XML
|
2011-04-29 07:46:29 +00:00
|
|
|
require_once 'Scores/PagePrint.php';
|
|
|
|
$page = new PagePrint($request->getControllerName(), $request->getActionName());
|
2012-12-21 11:34:30 +00:00
|
|
|
|
2011-04-29 07:46:29 +00:00
|
|
|
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
|
|
|
}
|
2011-10-07 09:02:17 +00:00
|
|
|
//Icone d'aide
|
|
|
|
if ($layout->isEnabled() && $request->getControllerName()!='recherche')
|
|
|
|
{
|
2012-01-20 07:59:18 +00:00
|
|
|
//$view->aide = true;
|
2012-11-15 13:30:33 +00:00
|
|
|
}
|
2011-04-15 09:05:30 +00:00
|
|
|
}
|
|
|
|
}
|