40 lines
1.3 KiB
PHP
40 lines
1.3 KiB
PHP
<?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', null);
|
|
if (empty($siret) && empty($id)) {
|
|
require_once 'Scores/SessionEntreprise.php';
|
|
$session = new SessionEntreprise($siret);
|
|
$siret = $session->getSiret();
|
|
$id = $session->getId();
|
|
}
|
|
$layout = Zend_Layout::getMVCInstance();
|
|
if ($layout->isEnabled() && $request->getControllerName()!='print') {
|
|
require_once 'Scores/Menu.php';
|
|
$computeMenu = new Menu($siret, $id);
|
|
$menu = $computeMenu->getMenu();
|
|
$view = $layout->getView();
|
|
$view->navigation($menu);
|
|
|
|
//Gestion affichage Lien PDF
|
|
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());
|
|
}
|
|
|
|
//Gestion affichage Lien XML
|
|
}
|
|
}
|
|
} |