Plugin Lien Saisie
This commit is contained in:
parent
d2174d00c6
commit
399d6caf32
46
library/Application/Controller/Plugin/Input.php
Normal file
46
library/Application/Controller/Plugin/Input.php
Normal 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');
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user