/** * Creates the portaleditor toolbar at top of the page * * @param array $arrContent * * @return string */ public function getPeInactiveElement($arrContent) { $strAdminSkin = class_carrier::getInstance()->getObjSession()->getAdminSkin(); $strTemplateID = $this->objTemplate->readTemplate(class_adminskin_helper::getPathForSkin($strAdminSkin) . "/elements.tpl", "pe_inactiveElement", true); $strReturn = $this->objTemplate->fillTemplate($arrContent, $strTemplateID); return $strReturn; }
/** * Looks up the real filename of a template passed. * The filename is the relative path, so adding /templates/[packname] is not required and not allowed. * * @param string $strTemplateName * @param bool $bitScanAdminSkin * * @throws class_exception * @return string The path on the filesystem, relative to the root-folder. Null if the file could not be mapped. */ public function getTemplate($strTemplateName, $bitScanAdminSkin = false) { $strTemplateName = removeDirectoryTraversals($strTemplateName); if (isset($this->arrTemplates[$strTemplateName])) { return $this->arrTemplates[$strTemplateName]; } $this->bitCacheSaveRequired = true; $strFilename = null; //first try: load the file in the current template-pack $strDefaultTemplate = class_module_system_setting::getConfigValue("_packagemanager_defaulttemplate_"); if (is_file(_realpath_ . _templatepath_ . "/" . $strDefaultTemplate . "/tpl" . $strTemplateName)) { $this->arrTemplates[$strTemplateName] = _templatepath_ . "/" . $strDefaultTemplate . "/tpl" . $strTemplateName; return _templatepath_ . "/" . $strDefaultTemplate . "/tpl" . $strTemplateName; } //second try: load the file from the default-pack if (is_file(_realpath_ . _templatepath_ . "/default/tpl" . $strTemplateName)) { $this->arrTemplates[$strTemplateName] = _templatepath_ . "/default/tpl" . $strTemplateName; return _templatepath_ . "/default/tpl" . $strTemplateName; } //third try: try to load the file from a given module foreach ($this->arrModules as $strCorePath => $strOneModule) { if (is_file(_realpath_ . "/" . $strCorePath . "/templates/default/tpl" . $strTemplateName)) { $strFilename = "/" . $strCorePath . "/templates/default/tpl" . $strTemplateName; break; } } if ($bitScanAdminSkin) { if (is_file(_realpath_ . class_adminskin_helper::getPathForSkin(class_session::getInstance()->getAdminSkin()) . $strTemplateName)) { $strFilename = class_adminskin_helper::getPathForSkin(class_session::getInstance()->getAdminSkin()) . $strTemplateName; } } if ($strFilename === null) { throw new class_exception("Required file " . $strTemplateName . " could not be mapped on the filesystem.", class_exception::$level_ERROR); } $this->arrTemplates[$strTemplateName] = $strFilename; return $strFilename; }
/** * 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); }