Plugin Lien Saisie

This commit is contained in:
Michael RICOIS 2016-05-12 16:36:45 +02:00
parent d2174d00c6
commit 399d6caf32

View File

@ -0,0 +1,46 @@
<?php
class Application_Controller_Plugin_Input extends Zend_Controller_Plugin_Abstract
{
public function preDispatch(Zend_Controller_Request_Abstract $request)
{
$module = $request->getModuleName();
$controller = $request->getControllerName();
$action = $request->getActionName();
if ($module == 'default' && $controller == 'index' && $action = 'index') {
return;
}
if ($module == 'auth') {
return;
}
Zend_Registry::get('firebug')->info('PLUGIN INPUT - START');
/**
* Avec le mode edition
* - uniquement lorsque layout activé
* - activer le menu saisie
* - préparer les liens de saisie pour les pages les pages
*/
$layout = Zend_Layout::getMVCInstance();
if ($layout->isEnabled()) {
$view = $layout->getView();
$auth = Zend_Auth::getInstance();
if ($auth->hasIdentity()) {
$identity = $auth->getIdentity();
// --- Params User
$view->UserProfil = $identity->profil;
$view->UserModeEdit = $identity->modeEdition;
// --- Menu Edition
if ($view->UserModeEdit) {
$menu = array();
}
}
}
Zend_Registry::get('firebug')->info('PLUGIN INPUT - END');
}
}