コード例 #1
0
ファイル: Menu.php プロジェクト: ariol/adminshop
 protected function render_item(&$next_id, $name, $cfg, $parent)
 {
     $menu = '';
     if ($parent == -1) {
         $menu .= Ext::menu_begin($name);
     }
     if (is_array($cfg)) {
         $cur_id = $next_id;
         $cur_menu = '';
         if ($parent != -1) {
             $cur_menu .= Ext::menu_row($next_id, $name, NULL, $parent);
         }
         $next_id++;
         $cur_menu_subitems = '';
         foreach ($cfg as $subname => $subcfg) {
             $cur_menu_subitems .= $this->render_item($next_id, $subname, $subcfg, $cur_id);
         }
         if (!empty($cur_menu_subitems)) {
             $menu .= $cur_menu . $cur_menu_subitems;
         }
     } else {
         if (ACL::is_route_allowed($cfg)) {
             $menu .= Ext::menu_row($next_id, $name, $cfg, $parent);
             if ($this->is_route_active($cfg)) {
                 $this->_active_id = $next_id;
             }
         }
         $next_id++;
     }
     if ($parent == -1) {
         $menu .= Ext::menu_end($this->_active_id);
     }
     return $menu;
 }
コード例 #2
0
ファイル: Link.php プロジェクト: ariol/adminshop
 protected function _field($obj)
 {
     $route_str = Extasy::obj_placeholders($obj, $this->_route_str);
     if (!ACL::is_route_allowed($route_str)) {
         return '<td></td>';
     }
     return $this->_draw_field($obj);
 }
コード例 #3
0
ファイル: Actions.php プロジェクト: ariol/adminshop
 public function render()
 {
     foreach ($this->_actions as $key => $cfg) {
         if (!ACL::is_route_allowed($cfg['route'])) {
             unset($this->_actions[$key]);
         }
     }
     return Ext::actions($this->_actions);
 }