Пример #1
0
 public function actionInstall($id)
 {
     $model = new Modularity();
     $model->id = $id;
     $model->enable_admin = 0;
     $model->enable_home = 0;
     $model->save();
     $modules = $this->modularityService->getAllModules();
     if (isset($modules[$id]) && $modules[$id]['instance'] !== null) {
         $modules[$id]['instance']->install();
     }
     return $this->redirect(['index']);
 }
Пример #2
0
 public function actionInstall($id)
 {
     $model = new Modularity();
     $model->id = $id;
     $model->enable_admin = 0;
     $model->enable_home = 0;
     $model->save();
     $moduleManager = LuLu::$app->moduleManager;
     $modules = $moduleManager->loadModules();
     if (isset($modules[$id]) && $modules[$id]['instance'] !== null) {
         $modules[$id]['instance']->install();
     }
     return $this->redirect(['index']);
 }
Пример #3
0
 /**
  * 安装模块
  * 'canInstall' => false
  * 'canUninstall' => true
  * 'hasAdmin' => true
  * 'hasHome' => true
  * 'canActiveAdmin' => true
  * 'canActiveHome' => true
  * @param type $id
  */
 public function actionInstall($id)
 {
     $lastBreadcrumb = "Install Modularity";
     $this->setMenus(12, $lastBreadcrumb);
     $model = new Modularity();
     $model->id = $id;
     $model->is_system = 0;
     $model->is_content = 0;
     $model->enable_admin = 0;
     $model->enable_home = 0;
     if ($model->save()) {
         $modules = $this->modularityService->getAllModules();
         if (isset($modules[$id]) && $modules[$id]['instance'] !== null) {
             $modules[$id]['instance']->install();
         }
         $this->redirect(['index', 'message' => \Yii::t('yii', '{attribute} Success', ['attribute' => LsYii::gT($lastBreadcrumb)])]);
     } else {
         $this->redirect(['index', 'message' => \Yii::t('yii', '{attribute} Error', ['attribute' => LsYii::gT($lastBreadcrumb)]), 'msgType' => 2]);
     }
 }