1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
| <?php
header('Content-type: text/html; charset=UTF-8');
Class module_menu extends abstract_moduleembedded{
public function _index(){
$tLink=array(
'article' => array(
'lister' => 'article::list',
'créer' => 'article::new',
'modifier' => 'article::edit',
'montrer' => 'article::show',
'détruire' => 'article::delete',
),
'auteur' => array(
'lister' => 'auteur::list',
'créer' => 'auteur::new',
),
'comment' => array(
'lister' => 'comment::list',
'créer' => 'comment::new',
),
); //fin de $tLink=array
foreach($tLink as $sLabelPrim => $sLink){
if (is_array($sLink)){
foreach($sLink as $sLabelSec=>$sSousMenu){
if(!_root::getACL()->can('ACCESS',$sSousMenu)) {
unset($tLink[$sLabelPrim][$sLabelSec]);
}
}
}else{
if(!_root::getACL()->can('ACCESS',$sLink)){
unset($tLink[$sLabelPrim]);
}
}
} // fin du foreach
$oView=new _view('menu::index');
$oView->tLink=$tLink;
return $oView;
} // fin de _index
} // fin de module_menu |
Partager