public function getLatestHumHubVersion()
 {
     $onlineModuleManager = new \humhub\modules\admin\libs\OnlineModuleManager();
     return $onlineModuleManager->getLatestHumHubVersion();
 }
 /**
  * Modules
  */
 public function actionModules()
 {
     // Only showed purchased modules
     $marketplace = new \humhub\modules\admin\libs\OnlineModuleManager();
     $modules = $marketplace->getModules(false);
     foreach ($modules as $i => $module) {
         if (!isset($module['useCases']) || strpos($module['useCases'], Yii::$app->settings->get('useCase')) === false) {
             unset($modules[$i]);
         }
     }
     if (Yii::$app->request->method == 'POST') {
         $enableModules = Yii::$app->request->post('enableModules');
         if (is_array($enableModules)) {
             foreach (array_keys($enableModules) as $moduleId) {
                 $marketplace->install($moduleId);
                 $module = Yii::$app->moduleManager->getModule($moduleId);
                 if ($module !== null) {
                     $module->enable();
                 }
             }
         }
         return $this->redirect(Yii::$app->getModule('installer')->getNextConfigStepUrl());
     }
     /*
      if (Yii::$app->request->get('ok') == 1) {
      return $this->redirect(Yii::$app->getModule('installer')->getNextConfigStepUrl());
      }
     */
     if (Yii::$app->settings->get("useCase") == self::USECASE_OTHER) {
         return $this->redirect(Yii::$app->getModule('installer')->getNextConfigStepUrl());
     } else {
         return $this->render('modules', array('modules' => $modules));
     }
 }