示例#1
0
 public function init()
 {
     $this->appendPageTitle(\Yii::t('SearchModule.base', 'Search'));
     return parent::init();
 }
示例#2
0
 public function init()
 {
     $this->appendPageTitle(\Yii::t('AdminModule.base', 'Administration'));
     return parent::init();
 }
示例#3
0
 public function init()
 {
     $this->appendPageTitle(\Yii::t('DirectoryModule.base', 'Directory'));
     return parent::init();
 }
 public function init()
 {
     $this->appendPageTitle(\Yii::t('DashboardModule.base', 'Dashboard'));
     return parent::init();
 }
 public function init()
 {
     $this->appendPageTitle(\Yii::t('UserModule.base', 'My Account'));
     return parent::init();
 }
 /**
  * Automatically loads the underlying contentContainer (User/Space) by using
  * the uguid/sguid request parameter
  *
  * @return boolean
  */
 public function init()
 {
     $spaceGuid = Yii::$app->request->get('sguid', '');
     $userGuid = Yii::$app->request->get('uguid', '');
     if ($spaceGuid != "") {
         $this->contentContainer = Space::findOne(['guid' => $spaceGuid]);
         if ($this->contentContainer == null) {
             throw new \yii\web\HttpException(404, Yii::t('base', 'Space not found!'));
         }
         $this->attachBehavior('SpaceControllerBehavior', array('class' => \humhub\modules\space\behaviors\SpaceController::className(), 'space' => $this->contentContainer));
         $this->subLayout = "@humhub/modules/space/views/space/_layout";
     } elseif ($userGuid != "") {
         $this->contentContainer = User::findOne(['guid' => $userGuid]);
         if ($this->contentContainer == null) {
             throw new \yii\web\HttpException(404, Yii::t('base', 'User not found!'));
         }
         $this->attachBehavior('ProfileControllerBehavior', ['class' => \humhub\modules\user\behaviors\ProfileController::className(), 'user' => $this->contentContainer]);
         $this->subLayout = "@humhub/modules/user/views/profile/_layout";
     } else {
         throw new \yii\web\HttpException(500, Yii::t('base', 'Could not determine content container!'));
     }
     /**
      * Auto check access rights to this container
      */
     if ($this->contentContainer != null) {
         if ($this->autoCheckContainerAccess) {
             $this->checkContainerAccess();
         }
     }
     if (!$this->checkModuleIsEnabled()) {
         throw new HttpException(405, Yii::t('base', 'Module is not enabled on this content container!'));
     }
     return parent::init();
 }