Пример #1
0
 /**
  * Basic controller method invoking all further methods in order to generate an admin view.
  * Takes care of generating the navigation, title, common JS variables, loading quickhelp texts,...
  *
  * @throws class_exception
  * @return string
  * @final
  * @todo could be moved to a general admin-skin helper
  */
 public final function getModuleOutput()
 {
     //skip rendering everything if we just want to redirect...
     if ($this->strOutput == "" && class_response_object::getInstance()->getStrRedirectUrl() != "") {
         return "";
     }
     $this->validateAndUpdateCurrentAspect();
     //Calling the content-setter, including a default dialog
     $this->arrOutput["content"] = $this->strOutput;
     if ($this->getArrModule("template") != "/folderview.tpl") {
         $this->arrOutput["path"] = class_admin_helper::getAdminPathNavi($this->getArrOutputNaviEntries(), $this->getArrModule("modul"));
         $this->arrOutput["moduleSitemap"] = $this->objToolkit->getAdminSitemap($this->getArrModule("modul"));
         $this->arrOutput["moduletitle"] = $this->getOutputModuleTitle();
         $this->arrOutput["actionTitle"] = $this->getOutputActionTitle();
         if (class_module_system_aspect::getActiveObjectCount() > 1) {
             $this->arrOutput["aspectChooser"] = $this->objToolkit->getAspectChooser($this->getArrModule("modul"), $this->getAction(), $this->getSystemid());
         }
         $this->arrOutput["login"] = $this->getOutputLogin();
         $this->arrOutput["quickhelp"] = $this->getQuickHelp();
     }
     $this->arrOutput["languageswitch"] = class_module_system_module::getModuleByName("languages") != null ? class_module_system_module::getModuleByName("languages")->getAdminInstanceOfConcreteModule()->getLanguageSwitch() : "";
     $this->arrOutput["module_id"] = $this->getArrModule("moduleId");
     $this->arrOutput["webpathTitle"] = urldecode(str_replace(array("http://", "https://"), array("", ""), _webpath_));
     $this->arrOutput["head"] = "<script type=\"text/javascript\">KAJONA_DEBUG = " . $this->objConfig->getDebug("debuglevel") . "; KAJONA_WEBPATH = '" . _webpath_ . "'; KAJONA_BROWSER_CACHEBUSTER = " . class_module_system_setting::getConfigValue("_system_browser_cachebuster_") . ";</script>";
     //see if there are any hooks to be called
     $this->onRenderOutput($this->arrOutput);
     //Loading the desired Template
     //if requested the pe, load different template
     $strTemplateID = "";
     if ($this->getParam("peClose") == 1 || $this->getParam("pe") == 1) {
         //add suffix
         try {
             $strTemplate = "/folderview.tpl";
             $strTemplateID = $this->objTemplate->readTemplate($strTemplate, "", false, true);
         } catch (class_exception $objException) {
             //An error occurred. In most cases, this is because the user ist not logged in, so the login-template was requested.
             if ($this->getArrModule("template") == "/login.tpl") {
                 throw new class_exception("You have to be logged in to use the portal editor!!!", class_exception::$level_ERROR);
             }
         }
     } else {
         $strTemplateID = $this->objTemplate->readTemplate(class_adminskin_helper::getPathForSkin($this->objSession->getAdminSkin()) . $this->getArrModule("template"), "", true);
     }
     return $this->objTemplate->fillTemplate($this->arrOutput, $strTemplateID);
 }
 /**
  * @return string
  * @throws class_exception
  * @permissions edit
  */
 protected function actionSwitchToUser()
 {
     $strReturn = "";
     if (class_module_system_module::getModuleByName("system")->rightEdit() && class_carrier::getInstance()->getObjSession()->isSuperAdmin()) {
         //reset the aspect
         $strAddon = "";
         $objDefaultAspect = class_module_system_aspect::getDefaultAspect();
         if ($objDefaultAspect !== null) {
             $strAddon = "&aspect=" . $objDefaultAspect->getSystemid();
         }
         $objNewUser = new class_module_user_user($this->getSystemid());
         if ($this->objSession->switchSessionToUser($objNewUser)) {
             class_admin_helper::flushActionNavigationCache();
             $this->adminReload(class_link::getLinkAdminHref("dashboard", "", $strAddon));
             return "";
         } else {
             throw new class_exception("session switch failed", class_exception::$level_ERROR);
         }
     } else {
         $strReturn .= $this->getLang("commons_error_permissions");
     }
     return $strReturn;
 }
Пример #3
0
 /**
  * The v4 way of generating a backend-navigation.
  *
  * @param string $strCurrentModule
  *
  * @return string
  */
 public function getAdminSitemap($strCurrentModule = "")
 {
     $strWrapperID = $this->objTemplate->readTemplate("/elements.tpl", "sitemap_wrapper");
     $strModuleID = $this->objTemplate->readTemplate("/elements.tpl", "sitemap_module_wrapper");
     $strModuleActiveID = $this->objTemplate->readTemplate("/elements.tpl", "sitemap_module_wrapper_active");
     $strActionID = $this->objTemplate->readTemplate("/elements.tpl", "sitemap_action_entry");
     $strDividerID = $this->objTemplate->readTemplate("/elements.tpl", "sitemap_divider_entry");
     $strModules = "";
     if ($strCurrentModule == "elemente") {
         $strCurrentModule = "pages";
     }
     $arrModules = class_module_system_module::getModulesInNaviAsArray(class_module_system_aspect::getCurrentAspectId());
     /** @var $arrNaviInstances class_module_system_module[] */
     $arrNaviInstances = array();
     foreach ($arrModules as $arrModule) {
         $objModule = class_module_system_module::getModuleBySystemid($arrModule["module_id"]);
         if ($objModule->rightView()) {
             $arrNaviInstances[] = $objModule;
         }
     }
     foreach ($arrNaviInstances as $objOneInstance) {
         $arrActions = class_admin_helper::getModuleActionNaviHelper($objOneInstance);
         $strActions = "";
         foreach ($arrActions as $strOneAction) {
             if (trim($strOneAction) != "") {
                 $arrActionEntries = array("action" => $strOneAction);
                 $strActions .= $this->objTemplate->fillTemplate($arrActionEntries, $strActionID);
             } else {
                 $strActions .= $this->objTemplate->fillTemplate(array(), $strDividerID);
             }
         }
         $arrModuleLevel = array("module" => class_link::getLinkAdmin($objOneInstance->getStrName(), "", "", class_carrier::getInstance()->getObjLang()->getLang("modul_titel", $objOneInstance->getStrName())), "actions" => $strActions, "systemid" => $objOneInstance->getSystemid(), "moduleTitle" => $objOneInstance->getStrName(), "moduleName" => class_carrier::getInstance()->getObjLang()->getLang("modul_titel", $objOneInstance->getStrName()), "moduleHref" => class_link::getLinkAdminHref($objOneInstance->getStrName(), ""));
         if ($strCurrentModule == $objOneInstance->getStrName()) {
             $strModules .= $this->objTemplate->fillTemplate($arrModuleLevel, $strModuleActiveID);
         } else {
             $strModules .= $this->objTemplate->fillTemplate($arrModuleLevel, $strModuleID);
         }
     }
     return $this->objTemplate->fillTemplate(array("level" => $strModules), $strWrapperID);
 }