Exemplo n.º 1
0
 public function init()
 {
     parent::init();
     RbacAsset::register($this->view);
     $pid = 5874;
     $this->tabs = SystemConfig::GetArrayValue("THIRDMENU", $pid, "USER");
 }
Exemplo n.º 2
0
 /**
  * 获取已经安装的插件
  */
 public static function GetSetupedPlugins()
 {
     if (empty(self::$_setupedplugins)) {
         $cfg_name = "PLUGIN_ID";
         self::$_setupedplugins = SystemConfig::GetArrayValue($cfg_name, null, "USER");
     }
     return self::$_setupedplugins;
 }
Exemplo n.º 3
0
 public function actionLocal($tab = "all", $page = 1)
 {
     SystemEvent::GetAdminMenu();
     $tab = in_array($tab, array('all', 'setuped', 'new')) ? $tab : 'all';
     $pid = 145;
     //插件管理的id(s_config的主键)
     $tabs = SystemConfig::GetArrayValue("THIRDMENU", $pid, "USER");
     //获取插件
     $pageSize = 20;
     $result = Mplugin::GetPlugins($tab, $page, $pageSize);
     return $this->render("local", array('tabs' => $tabs, 'tab' => $tab, 'result' => $result));
 }
Exemplo n.º 4
0
 public static function GetAdminMenu()
 {
     //获取主菜单
     Yii::$app->params['MAINMENU'] = SystemConfig::Get("MAINMENU", null, 'USER');
     //获取子菜单
     $submenus = array();
     foreach (Yii::$app->params['MAINMENU'] as $i => $menu) {
         if (!self::CheckAccessMenu($menu['cfg_value'])) {
             unset(Yii::$app->params['MAINMENU'][$i]);
         }
         $submenu = SystemConfig::GetArrayValue("SUBMENU", $menu['id'], 'USER');
         if (!empty($submenu)) {
             foreach ($submenu as $url => $label) {
                 if (!self::CheckAccessMenu($url)) {
                     unset($submenu[$url]);
                 }
             }
             if (!empty($submenu)) {
                 $submenus[$menu['id']] = $submenu;
             }
             if (!isset($submenus[$menu['id']]) || empty($submenus[$menu['id']])) {
                 unset(Yii::$app->params['MAINMENU'][$i]);
             }
         }
     }
     Yii::$app->params['SUBMENU'] = $submenus;
     //获取ICONS
     Yii::$app->params['ICONS'] = SystemConfig::GetArrayValue("ICONS", null, 'USER');
 }