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; }
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); }
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); }