getPerspectivesConfig() 공개 정적인 메소드

public static getPerspectivesConfig ( ) : mixed | Zend_Config
리턴 mixed | Zend_Config
예제 #1
0
파일: Admin.php 프로젝트: solverat/pimcore
 /**
  * @param Model\User $user
  * @return $this
  */
 public function setUser(Model\User $user)
 {
     $this->user = $user;
     \Zend_Registry::set("pimcore_admin_user", $this->user);
     $this->setLanguage($this->user->getLanguage());
     // update perspective settings
     $requestedPerspective = $this->getParam("perspective");
     if ($requestedPerspective) {
         if ($requestedPerspective != $user->getActivePerspective()) {
             $existingPerspectives = array_keys(Config::getPerspectivesConfig()->toArray());
             if (!in_array($requestedPerspective, $existingPerspectives)) {
                 $requestedPerspective = null;
             }
         }
     }
     if (!$requestedPerspective) {
         $requestedPerspective = $user->getActivePerspective();
     }
     //TODO check if perspective is still allowed
     if ($requestedPerspective != $user->getActivePerspective()) {
         $user->setActivePerspective($requestedPerspective);
         $user->save();
     }
     return $this;
 }
예제 #2
0
파일: Admin.php 프로젝트: pimcore/pimcore
 /**
  * @param Model\User $user
  * @return $this
  */
 public function setUser(Model\User $user)
 {
     $this->user = $user;
     \Zend_Registry::set("pimcore_admin_user", $this->user);
     $this->setLanguage($this->user->getLanguage());
     // update perspective settings
     $requestedPerspective = $this->getParam("perspective");
     if ($requestedPerspective) {
         if ($requestedPerspective != $user->getActivePerspective()) {
             $existingPerspectives = array_keys(Config::getPerspectivesConfig()->toArray());
             if (!in_array($requestedPerspective, $existingPerspectives)) {
                 $requestedPerspective = null;
             }
         }
     }
     if (!$requestedPerspective || !$user->isAllowed($requestedPerspective, "perspective")) {
         //choose active perspective or a first allowed
         $requestedPerspective = $user->isAllowed($user->getActivePerspective(), "perspective") ? $user->getActivePerspective() : $user->getFirstAllowedPerspective();
     }
     if ($requestedPerspective != $user->getActivePerspective()) {
         $user->setActivePerspective($requestedPerspective);
         $user->save();
     }
     return $this;
 }