protected function renderAdditionalActions(class_model $objListEntry) { if ($objListEntry instanceof class_module_tags_tag) { $arrButtons = array(); $arrButtons[] = $this->objToolkit->listButton(class_link::getLinkAdmin($this->getArrModule("modul"), "showAssignedRecords", "&systemid=" . $objListEntry->getSystemid(), $this->getLang("action_show_assigned_records"), $this->getLang("action_show_assigned_records"), "icon_folderActionOpen")); if ($objListEntry->rightRight1()) { $strJs = "<script type='text/javascript'>KAJONA.admin.loader.loadFile('" . class_resourceloader::getInstance()->getCorePathForModule("module_tags") . "/module_tags/admin/scripts/tags.js', function() {\n KAJONA.admin.tags.createFavoriteEnabledIcon = '" . addslashes(class_adminskin_helper::getAdminImage("icon_favorite", $this->getLang("tag_favorite_remove"))) . "';\n KAJONA.admin.tags.createFavoriteDisabledIcon = '" . addslashes(class_adminskin_helper::getAdminImage("icon_favoriteDisabled", $this->getLang("tag_favorite_add"))) . "';\n });</script>"; $strImage = class_module_tags_favorite::getAllFavoritesForUserAndTag($this->objSession->getUserID(), $objListEntry->getSystemid()) != null ? class_adminskin_helper::getAdminImage("icon_favorite", $this->getLang("tag_favorite_remove")) : class_adminskin_helper::getAdminImage("icon_favoriteDisabled", $this->getLang("tag_favorite_add")); $arrButtons[] = $strJs . $this->objToolkit->listButton("<a href=\"#\" onclick=\"KAJONA.admin.tags.createFavorite('" . $objListEntry->getSystemid() . "', this); return false;\">" . $strImage . "</a>"); } return $arrButtons; } else { return array(); } }
public function testAdminModules() { class_adminskin_helper::defineSkinWebpath(); class_carrier::getInstance()->getObjRights()->setBitTestMode(true); //load all admin-classes $arrFiles = class_resourceloader::getInstance()->getFolderContent("/admin", array(".php"), false, function ($strOneFile) { if (preg_match("/class_module_(.*)_admin.php/i", $strOneFile)) { $strClassname = uniSubstr($strOneFile, 0, -4); $objReflection = new ReflectionClass($strClassname); if (!$objReflection->isAbstract()) { return true; } } return false; }, function (&$strOneFile) { $strOneFile = uniSubstr($strOneFile, 0, -4); $strOneFile = new $strOneFile(); }); foreach ($arrFiles as $objAdminInstance) { $this->runSingleFile($objAdminInstance); } class_carrier::getInstance()->getObjRights()->setBitTestMode(false); }
/** * @param class_model $objListEntry * @param string $strAltActive tooltip text for the icon if record is active * @param string $strAltInactive tooltip text for the icon if record is inactive * * @return string */ protected function renderStatusAction(class_model $objListEntry, $strAltActive = "", $strAltInactive = "") { if ($objListEntry instanceof class_module_workflows_handler) { return ""; } if ($objListEntry instanceof class_module_workflows_workflow) { $strStatusIcon = ""; if ($objListEntry->getIntState() == class_module_workflows_workflow::$INT_STATE_NEW) { $strStatusIcon = class_adminskin_helper::getAdminImage("icon_workflowNew", $this->getLang("workflow_status_" . $objListEntry->getIntState())); } if ($objListEntry->getIntState() == class_module_workflows_workflow::$INT_STATE_SCHEDULED) { $strStatusIcon = class_adminskin_helper::getAdminImage("icon_workflowScheduled", $this->getLang("workflow_status_" . $objListEntry->getIntState())); } if ($objListEntry->getIntState() == class_module_workflows_workflow::$INT_STATE_EXECUTED) { $strStatusIcon = class_adminskin_helper::getAdminImage("icon_workflowExecuted", $this->getLang("workflow_status_" . $objListEntry->getIntState())); } if ($strStatusIcon != "") { return $this->objToolkit->listButton($strStatusIcon); } } return parent::renderStatusAction($objListEntry, $strAltActive, $strAltInactive); }
/** * @param class_model|interface_admin_listable|interface_model|class_module_pages_pageelement $objOneIterable * @param string $strListIdentifier * * @return string */ public function getActionIcons($objOneIterable, $strListIdentifier = "") { $strActions = ""; if ($objOneIterable instanceof class_module_pages_pageelement) { $objLockmanager = $objOneIterable->getLockManager(); //Create a row to handle the element, check all necessary stuff such as locking etc $strActions = ""; //First step - Record locked? Offer button to unlock? But just as admin! For the user, who locked the record, the unlock-button //won't be visible if (!$objLockmanager->isAccessibleForCurrentUser()) { //So, return a button, if we have an admin in front of us if ($objLockmanager->isUnlockableForCurrentUser()) { $strActions .= $this->objToolkit->listButton(class_link::getLinkAdmin("pages_content", "list", "&systemid=" . $this->getSystemid() . "&adminunlockid=" . $objOneIterable->getSystemid(), "", $this->getLang("ds_entsperren"), "icon_lockerOpen")); } //If the Element is locked, then its not allowed to edit or delete the record, so disable the icons if ($objOneIterable->rightEdit()) { $strActions .= $this->objToolkit->listButton(class_adminskin_helper::getAdminImage("icon_editLocked", $this->getLang("ds_gesperrt"))); } if ($objOneIterable->rightDelete()) { $strActions .= $this->objToolkit->listButton(class_adminskin_helper::getAdminImage("icon_deleteLocked", $this->getLang("ds_gesperrt"))); } } else { if ($objOneIterable->rightEdit()) { $strActions .= $this->objToolkit->listButton(class_link::getLinkAdmin("pages_content", "edit", "&systemid=" . $objOneIterable->getSystemid(), "", $this->getLang("element_bearbeiten"), "icon_edit")); } if ($objOneIterable->rightDelete()) { $strActions .= $this->objToolkit->listDeleteButton($objOneIterable->getStrName() . ($objOneIterable->getConcreteAdminInstance()->getContentTitle() != "" ? " - " . $objOneIterable->getConcreteAdminInstance()->getContentTitle() : "") . ($objOneIterable->getStrTitle() != "" ? " - " . $objOneIterable->getStrTitle() : ""), $this->getLang("element_loeschen_frage"), class_link::getLinkAdminHref("pages_content", "deleteElementFinal", "&systemid=" . $objOneIterable->getSystemid() . ($this->getParam("pe") == "" ? "" : "&peClose=" . $this->getParam("pe")))); } } //The Icons to sort the list and to copy the element $strActions .= $this->objToolkit->listButton(class_link::getLinkAdminDialog("pages_content", "copyElement", "&systemid=" . $objOneIterable->getSystemid(), "", $this->getLang("element_copy"), "icon_copy")); //The status-icons $strActions .= $this->objToolkit->listStatusButton($objOneIterable->getSystemid()); } else { if ($objOneIterable instanceof class_module_pages_element) { $objAdminInstance = class_module_system_module::getModuleByName("pages")->getAdminInstanceOfConcreteModule(); if ($objAdminInstance != null && $objAdminInstance instanceof class_admin_simple) { return $objAdminInstance->getActionIcons($objOneIterable); } } } return $strActions; }
/** * 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; }
/** * @param string $strListIdentifier * * @return array */ protected function getBatchActionHandlers($strListIdentifier) { $arrDefault = array(); $arrDefault[] = new class_admin_batchaction(class_adminskin_helper::getAdminImage("icon_text"), class_link::getLinkAdminXml("packageserver", "updateDataFromMetadata", "&systemid=%systemid%"), $this->getLang("batchaction_metadata")); return $arrDefault; }
/** * @return array */ protected function getDefaultActionHandlers() { $arrReturn = array(); if ($this->getObjModule()->rightDelete()) { $arrReturn[] = new class_admin_batchaction(class_adminskin_helper::getAdminImage("icon_delete"), class_link::getLinkAdminXml("system", "delete", "&systemid=%systemid%"), $this->getLang("commons_batchaction_delete")); } if ($this->getObjModule()->rightEdit()) { $arrReturn[] = new class_admin_batchaction(class_adminskin_helper::getAdminImage("icon_enabled"), class_link::getLinkAdminXml("system", "setStatus", "&systemid=%systemid%&status=1"), $this->getLang("commons_batchaction_enable")); $arrReturn[] = new class_admin_batchaction(class_adminskin_helper::getAdminImage("icon_disabled"), class_link::getLinkAdminXml("system", "setStatus", "&systemid=%systemid%&status=0"), $this->getLang("commons_batchaction_disable")); } return $arrReturn; }
/** * Generates a link opening in a dialog in admin-area * * @param string $strModule * @param string $strAction * @param string $strParams * @param string $strText * @param string $strAlt * @param string $strImage * @param string $strTitle * @param bool $bitTooltip * @param bool $bitPortalEditor * @param bool|string $strOnClick * @param null|int $intWidth * @param null|int $intHeight * @return string */ public static function getLinkAdminDialog($strModule, $strAction, $strParams = "", $strText = "", $strAlt = "", $strImage = "", $strTitle = "", $bitTooltip = true, $bitPortalEditor = false, $strOnClick = "", $intWidth = null, $intHeight = null) { $strLink = ""; $strTitle = addslashes(uniStrReplace(array("\n", "\r"), array(), strip_tags(nl2br($strTitle)))); if ($bitPortalEditor) { $strParams .= "&pe=1"; } //urlencoding $strModule = urlencode($strModule); $strAction = urlencode($strAction); if ($strOnClick == "") { if ($intWidth !== null && $intHeight !== null) { $strOnClick = "KAJONA.admin.folderview.dialog.setContentIFrame('" . class_link::getLinkAdminHref($strModule, $strAction, $strParams) . "'); KAJONA.admin.folderview.dialog.setTitle('" . $strTitle . "'); " . "KAJONA.admin.folderview.dialog.init('" . $intWidth . "', '" . $intHeight . "'); return false;"; } else { $strOnClick = "KAJONA.admin.folderview.dialog.setContentIFrame('" . class_link::getLinkAdminHref($strModule, $strAction, $strParams) . "'); KAJONA.admin.folderview.dialog.setTitle('" . $strTitle . "'); " . "KAJONA.admin.folderview.dialog.init(); return false;"; } } if ($strImage != "") { if ($strAlt == "") { $strAlt = $strAction; } if (!$bitTooltip) { $strLink = "<a href=\"#\" onclick=\"" . $strOnClick . "\" title=\"" . $strAlt . "\">" . class_adminskin_helper::getAdminImage($strImage, $strAlt, true) . "</a>"; } else { $strLink = "<a href=\"#\" onclick=\"" . $strOnClick . "\" title=\"" . $strAlt . "\" rel=\"tooltip\">" . class_adminskin_helper::getAdminImage($strImage, $strAlt, true) . "</a>"; } } if ($strImage == "" && $strText != "") { if ($strAlt == "") { $strAlt = $strText; } $strLink = "<a href=\"#\" " . ($bitPortalEditor ? "class=\"pe_link\"" : "") . " " . ($bitTooltip ? "title=\"" . $strAlt . "\" rel=\"tooltip\" " : "") . " onclick=\"" . $strOnClick . "\">" . $strText . "</a>"; } return $strLink; }
/** * 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); }
/** * Makes use of the admin-skin image-mapper to resolve an image-name into a * real image-tag / script / whatever * * @param string $strName * @param string $strAlt * @param bool $bitBlockTooltip * @param string $strEntryId * * @return string */ public static function getAdminImage($strName, $strAlt = "", $bitBlockTooltip = false, $strEntryId = "") { if (is_array($strName) && count($strName) == 2) { $strAlt = $strName[1]; $strName = $strName[0]; } if (self::$objAdminImageResolver == null) { if (!is_file(_realpath_ . self::getPathForSkin(class_carrier::getInstance()->getObjSession()->getAdminSkin()) . "/class_adminskin_imageresolver.php")) { return "<img src=\"" . _skinwebpath_ . "/pics/" . $strName . "\" alt=\"" . $strAlt . "\" " . (!$bitBlockTooltip ? "rel=\"tooltip\" title=\"" . $strAlt . "\" " : "") . " " . ($strEntryId != "" ? " id=\"" . $strEntryId . "\" " : "") . " />"; } else { include_once _realpath_ . self::getPathForSkin(class_carrier::getInstance()->getObjSession()->getAdminSkin()) . "/class_adminskin_imageresolver.php"; } self::$objAdminImageResolver = new class_adminskin_imageresolver(); } return self::$objAdminImageResolver->getImage($strName, $strAlt, $bitBlockTooltip, $strEntryId); }
/** * Adds the portal-editor code to the current page-output - if all requirements are given * * @param class_module_pages_page $objPageData * @param bool $bitEditPermissionOnMasterPage * @param string $strPageContent * * @return string */ private function renderPortalEditorCode(class_module_pages_page $objPageData, $bitEditPermissionOnMasterPage, $strPageContent) { //add the portaleditor toolbar if (class_module_system_setting::getConfigValue("_pages_portaleditor_") == "false") { return $strPageContent; } if (!$this->objSession->isAdmin()) { return $strPageContent; } if (!$objPageData->rightEdit() && !$bitEditPermissionOnMasterPage) { return $strPageContent; } class_adminskin_helper::defineSkinWebpath(); //save back the current portal text language and set the admin-one $strPortalLanguage = class_carrier::getInstance()->getObjLang()->getStrTextLanguage(); class_carrier::getInstance()->getObjLang()->setStrTextLanguage($this->objSession->getAdminLanguage()); if ($this->objSession->getSession("pe_disable") != "true") { $strPeToolbar = ""; $arrPeContents = array(); $arrPeContents["pe_status_page_val"] = $objPageData->getStrName(); $arrPeContents["pe_status_status_val"] = $objPageData->getIntRecordStatus() == 1 ? "active" : "inactive"; $arrPeContents["pe_status_autor_val"] = $objPageData->getLastEditUser(); $arrPeContents["pe_status_time_val"] = timeToString($objPageData->getIntLmTime(), false); $arrPeContents["pe_dialog_close_warning"] = $this->getLang("pe_dialog_close_warning", "pages"); //Add an iconbar $arrPeContents["pe_iconbar"] = ""; $arrPeContents["pe_iconbar"] .= class_link::getLinkAdmin("pages_content", "list", "&systemid=" . $objPageData->getSystemid() . "&language=" . $strPortalLanguage, $this->getLang("pe_icon_edit"), $this->getLang("pe_icon_edit", "pages"), "icon_page"); $arrPeContents["pe_iconbar"] .= " "; $strEditUrl = class_link::getLinkAdminHref("pages", "editPage", "&systemid=" . $objPageData->getSystemid() . "&language=" . $strPortalLanguage . "&pe=1"); $arrPeContents["pe_iconbar"] .= "<a href=\"#\" onclick=\"KAJONA.admin.portaleditor.openDialog('" . $strEditUrl . "'); return false;\">" . class_adminskin_helper::getAdminImage("icon_edit", $this->getLang("pe_icon_page", "pages")) . "</a>"; $arrPeContents["pe_iconbar"] .= " "; $strEditUrl = class_link::getLinkAdminHref("pages", "newPage", "&systemid=" . $objPageData->getSystemid() . "&language=" . $strPortalLanguage . "&pe=1"); $arrPeContents["pe_iconbar"] .= "<a href=\"#\" onclick=\"KAJONA.admin.portaleditor.openDialog('" . $strEditUrl . "'); return false;\">" . class_adminskin_helper::getAdminImage("icon_new", $this->getLang("pe_icon_new", "pages")) . "</a>"; $arrPeContents["pe_disable"] = "<a href=\"#\" onclick=\"KAJONA.admin.portaleditor.switchEnabled(false); return false;\" title=\"\">" . class_adminskin_helper::getAdminImage("icon_enabled", $this->getLang("pe_disable", "pages")) . "</a>"; //Load portaleditor javascript (even if it's maybe already loaded in portal and init the ckeditor) $strTemplateInitID = $this->objTemplate->readTemplate("/elements.tpl", "wysiwyg_ckeditor_inits"); $strSkinInit = $this->objTemplate->fillTemplate(array(), $strTemplateInitID); $strConfigFile = "'config_kajona_standard.js'"; if (is_file(_realpath_ . "/project/admin/scripts/ckeditor/config_kajona_standard.js")) { $strConfigFile = "KAJONA_WEBPATH+'/project/admin/scripts/ckeditor/config_kajona_standard.js'"; } $strPeToolbar .= "<script type='text/javascript'>\n KAJONA.admin.lang.pe_rte_unsavedChanges = '" . $this->getLang("pe_rte_unsavedChanges", "pages") . "';\n\n if(\$) {\n KAJONA.portal.loader.loadFile([\n '/core/module_pages/admin/scripts/kajona_portaleditor.js',\n '/core/module_system/admin/scripts/jqueryui/jquery-ui.custom.min.js',\n '/core/module_system/admin/scripts/jqueryui/css/smoothness/jquery-ui.custom.css'\n ], function() {\n KAJONA.admin.portaleditor.RTE.config = {\n language : '" . (class_session::getInstance()->getAdminLanguage() != "" ? class_session::getInstance()->getAdminLanguage() : "en") . "',\n filebrowserBrowseUrl : '" . uniStrReplace("&", "&", class_link::getLinkAdminHref("folderview", "browserChooser", "&form_element=ckeditor")) . "',\n filebrowserImageBrowseUrl : '" . uniStrReplace("&", "&", class_link::getLinkAdminHref("mediamanager", "folderContentFolderviewMode", "systemid=" . class_module_system_setting::getConfigValue("_mediamanager_default_imagesrepoid_") . "&form_element=ckeditor&bit_link=1")) . "',\n customConfig : {$strConfigFile},\n " . $strSkinInit . "\n }\n \$(KAJONA.admin.portaleditor.initPortaleditor);\n });\n }\n else {\n KAJONA.portal.loader.loadFile([\n '/core/module_system/admin/scripts/jquery/jquery.min.js',\n '/core/module_system/admin/scripts/jqueryui/jquery-ui.custom.min.js',\n '/core/module_pages/admin/scripts/kajona_portaleditor.js',\n '/core/module_system/admin/scripts/jqueryui/css/smoothness/jquery-ui.custom.css'\n ], function() {\n KAJONA.admin.portaleditor.RTE.config = {\n language : '" . (class_session::getInstance()->getAdminLanguage() != "" ? class_session::getInstance()->getAdminLanguage() : "en") . "',\n filebrowserBrowseUrl : '" . uniStrReplace("&", "&", class_link::getLinkAdminHref("folderview", "browserChooser", "&form_element=ckeditor")) . "',\n filebrowserImageBrowseUrl : '" . uniStrReplace("&", "&", class_link::getLinkAdminHref("mediamanager", "folderContentFolderviewMode", "systemid=" . class_module_system_setting::getConfigValue("_mediamanager_default_imagesrepoid_") . "&form_element=ckeditor&bit_link=1")) . "',\n " . $strSkinInit . "\n }\n \$(KAJONA.admin.portaleditor.initPortaleditor);\n });\n }\n </script>"; //Load portaleditor styles $strPeToolbar .= $this->objToolkit->getPeBasicData(); $strPeToolbar .= $this->objToolkit->getPeToolbar($arrPeContents); $objScriptlets = new class_scriptlet_helper(); $strPeToolbar = $objScriptlets->processString($strPeToolbar, interface_scriptlet::BIT_CONTEXT_ADMIN); //The toolbar has to be added right after the body-tag - to generate correct html-code $strTemp = uniSubstr($strPageContent, uniStrpos($strPageContent, "<body")); //find closing bracket $intTemp = uniStrpos($strTemp, ">") + 1; //and insert the code $strPageContent = uniSubstr($strPageContent, 0, uniStrpos($strPageContent, "<body") + $intTemp) . $strPeToolbar . uniSubstr($strPageContent, uniStrpos($strPageContent, "<body") + $intTemp); } else { //Button to enable the toolbar & pe $strEnableButton = "<div id=\"peEnableButton\" style=\"z-index: 1000; position: fixed; top: 0px; right: 0px;\"><a href=\"#\" onclick=\"KAJONA.admin.portaleditor.switchEnabled(true); return false;\" title=\"\">" . getImageAdmin("icon_disabled", $this->getLang("pe_enable", "pages")) . "</a></div>"; //Load portaleditor javascript $strEnableButton .= "\n<script type=\"text/javascript\" src=\"" . _webpath_ . "/core/module_pages/admin/scripts/kajona_portaleditor.js?" . class_module_system_setting::getConfigValue("_system_browser_cachebuster_") . "\"></script>"; $strEnableButton .= $this->objToolkit->getPeBasicData(); //Load portaleditor styles //The toobar has to be added right after the body-tag - to generate correct html-code $strTemp = uniSubstr($strPageContent, uniStripos($strPageContent, "<body")); //find closing bracket $intTemp = uniStripos($strTemp, ">") + 1; //and insert the code $strPageContent = uniSubstr($strPageContent, 0, uniStrpos($strPageContent, "<body") + $intTemp) . $strEnableButton . uniSubstr($strPageContent, uniStrpos($strPageContent, "<body") + $intTemp); } //reset the portal texts language class_carrier::getInstance()->getObjLang()->setStrTextLanguage($strPortalLanguage); return $strPageContent; }
/** * Renders the list of changes for the passed systemrecord. * May be called from other modules in order to get the rendered list for a single record. * In most cases rendered as a overlay, so in folderview mode * * @param string $strSystemid sytemid to filter * @param string $strSourceModule source-module, required for a working pageview * @param string $strSourceAction source-action, required for a working pageview * @param bool $bitBlockFolderview * * @return string * @since 3.4.0 * @autoTestable * @permissions changelog */ public function actionGenericChangelog($strSystemid = "", $strSourceModule = "system", $strSourceAction = "genericChangelog", $bitBlockFolderview = false) { if (!$bitBlockFolderview && $this->getParam("bitBlockFolderview") == "") { $this->setArrModuleEntry("template", "/folderview.tpl"); } if ($strSystemid == "") { $strSystemid = $this->getSystemid(); } if (!validateSystemid($strSystemid) && $this->getObjModule()->rightChangelog()) { $strReturn = $this->objToolkit->warningBox($this->getLang("generic_changelog_no_systemid")); $strReturn .= $this->objToolkit->formHeader(getLinkAdminHref("system", "genericChangeLog", "bitBlockFolderview=1")); $strReturn .= $this->objToolkit->formInputText("systemid", "systemid"); $strReturn .= $this->objToolkit->formInputSubmit(); $strReturn .= $this->objToolkit->formClose(); return $strReturn; // return "asd"; } $strReturn = ""; // check needed rights - done twice since public and callable by not only the controller // if(!class_carrier::getInstance()->getObjRights()->validatePermissionString(class_rights::$STR_RIGHT_CHANGELOG, $this->getObjModule())) // return $this->getLang("commons_error_permissions"); //showing a list using the pageview $objArraySectionIterator = new class_array_section_iterator(class_module_system_changelog::getLogEntriesCount($strSystemid)); $objArraySectionIterator->setPageNumber((int) ($this->getParam("pv") != "" ? $this->getParam("pv") : 1)); $objArraySectionIterator->setArraySection(class_module_system_changelog::getLogEntries($strSystemid, $objArraySectionIterator->calculateStartPos(), $objArraySectionIterator->calculateEndPos())); $arrData = array(); $arrHeader = array(); $arrHeader[] = $this->getLang("commons_date"); $arrHeader[] = $this->getLang("change_user"); if ($strSystemid == "") { $arrHeader[] = $this->getLang("change_module"); } if ($strSystemid == "") { $arrHeader[] = $this->getLang("change_record"); } $arrHeader[] = $this->getLang("change_action"); $arrHeader[] = $this->getLang("change_property"); $arrHeader[] = $this->getLang("change_oldvalue"); $arrHeader[] = $this->getLang("change_newvalue"); /** @var $objOneEntry class_changelog_container */ foreach ($objArraySectionIterator as $objOneEntry) { $arrRowData = array(); /** @var interface_versionable|class_model $objTarget */ $objTarget = $objOneEntry->getObjTarget(); $strOldValue = $objOneEntry->getStrOldValue(); $strNewValue = $objOneEntry->getStrNewValue(); if ($objTarget != null) { $strOldValue = $objTarget->renderVersionValue($objOneEntry->getStrProperty(), $strOldValue); $strNewValue = $objTarget->renderVersionValue($objOneEntry->getStrProperty(), $strNewValue); } $strOldValue = htmlStripTags($strOldValue); $strNewValue = htmlStripTags($strNewValue); $arrRowData[] = dateToString($objOneEntry->getObjDate()); $arrRowData[] = $this->objToolkit->getTooltipText(uniStrTrim($objOneEntry->getStrUsername(), 15), $objOneEntry->getStrUsername()); if ($strSystemid == "") { $arrRowData[] = $objTarget != null ? $objTarget->getArrModule("modul") : ""; } if ($strSystemid == "") { $arrRowData[] = $objTarget != null ? $this->objToolkit->getTooltipText(uniStrTrim($objTarget->getVersionRecordName(), 20), $objTarget->getVersionRecordName() . " " . $objOneEntry->getStrSystemid()) : ""; } $arrRowData[] = $objTarget != null ? $this->objToolkit->getTooltipText(uniStrTrim($objTarget->getVersionActionName($objOneEntry->getStrAction()), 15), $objTarget->getVersionActionName($objOneEntry->getStrAction())) : ""; $arrRowData[] = $objTarget != null ? $this->objToolkit->getTooltipText(uniStrTrim($objTarget->getVersionPropertyName($objOneEntry->getStrProperty()), 20), $objTarget->getVersionPropertyName($objOneEntry->getStrProperty())) : ""; $arrRowData[] = $this->objToolkit->getTooltipText(uniStrTrim($strOldValue, 20), $strOldValue); $arrRowData[] = $this->objToolkit->getTooltipText(uniStrTrim($strNewValue, 20), $strNewValue); $arrData[] = $arrRowData; } $objManager = new class_module_packagemanager_manager(); if ($objManager->getPackage("phpexcel") != null) { $strReturn .= $this->objToolkit->getContentToolbar(array(class_link::getLinkAdmin($this->getArrModule("modul"), "genericChangelogExportExcel", "&systemid=" . $strSystemid, class_adminskin_helper::getAdminImage("icon_excel") . " " . $this->getLang("change_export_excel"), "", "", false))); } $strReturn .= $this->objToolkit->dataTable($arrHeader, $arrData); $strReturn .= $this->objToolkit->getPageview($objArraySectionIterator, $strSourceModule, $strSourceAction, "&systemid=" . $strSystemid . "&bitBlockFolderview=" . $this->getParam("bitBlockFolderview")); return $strReturn; }
/** * Renders a single tag (including the options to remove the tag again) * * @param class_module_tags_tag $objTag * @param string $strTargetid * @param string $strAttribute * * @return string */ public function getTagEntry(class_module_tags_tag $objTag, $strTargetid, $strAttribute) { if (class_carrier::getInstance()->getParam("delete") != "false") { $strTemplateID = $this->objTemplate->readTemplate("/elements.tpl", "tags_tag_delete"); } else { $strTemplateID = $this->objTemplate->readTemplate("/elements.tpl", "tags_tag"); } $strFavorite = ""; if ($objTag->rightRight1()) { $strJs = "<script type='text/javascript'>KAJONA.admin.loader.loadFile('" . class_resourceloader::getInstance()->getCorePathForModule("module_tags") . "/module_tags/admin/scripts/tags.js', function() {\r\n KAJONA.admin.tags.createFavoriteEnabledIcon = '" . addslashes(class_adminskin_helper::getAdminImage("icon_favorite", class_carrier::getInstance()->getObjLang()->getLang("tag_favorite_remove", "tags"))) . "';\r\n KAJONA.admin.tags.createFavoriteDisabledIcon = '" . addslashes(class_adminskin_helper::getAdminImage("icon_favoriteDisabled", class_carrier::getInstance()->getObjLang()->getLang("tag_favorite_add", "tags"))) . "';\r\n });</script>"; $strImage = class_module_tags_favorite::getAllFavoritesForUserAndTag(class_carrier::getInstance()->getObjSession()->getUserID(), $objTag->getSystemid()) != null ? class_adminskin_helper::getAdminImage("icon_favorite", class_carrier::getInstance()->getObjLang()->getLang("tag_favorite_remove", "tags")) : class_adminskin_helper::getAdminImage("icon_favoriteDisabled", class_carrier::getInstance()->getObjLang()->getLang("tag_favorite_add", "tags")); $strFavorite = $strJs . "<a href=\"#\" onclick=\"KAJONA.admin.tags.createFavorite('" . $objTag->getSystemid() . "', this); return false;\">" . $strImage . "</a>"; } $arrTemplate = array(); $arrTemplate["tagname"] = $objTag->getStrDisplayName(); $arrTemplate["strTagId"] = $objTag->getSystemid(); $arrTemplate["strTargetSystemid"] = $strTargetid; $arrTemplate["strAttribute"] = $strAttribute; $arrTemplate["strFavorite"] = $strFavorite; $arrTemplate["strDelete"] = class_adminskin_helper::getAdminImage("icon_delete", class_carrier::getInstance()->getObjLang()->getLang("commons_delete", "tags")); return $this->objTemplate->fillTemplate($arrTemplate, $strTemplateID); }
/** * Fetches all child-nodes (folders and pages) of the passed node. * Used by the tree-view in module-pages. * * @return string * @since 3.3.0 * @xml * @permissions view */ protected function actionGetChildNodes() { $arrReturn = array(); $arrPages = class_module_pages_folder::getPagesAndFolderList($this->getSystemid()); if (count($arrPages) > 0) { foreach ($arrPages as $objSingleEntry) { if ($objSingleEntry->rightView()) { /** @var class_module_pages_folder $objSingleEntry */ if ($objSingleEntry instanceof class_module_pages_folder) { $strLink = ""; if ($objSingleEntry->rightEdit()) { $strLink = class_link::getLinkAdminHref("pages", "list", "systemid=" . $objSingleEntry->getSystemid(), false); } $arrReturn[] = array("data" => array("title" => class_adminskin_helper::getAdminImage($objSingleEntry->getStrIcon()) . " " . $objSingleEntry->getStrDisplayName()), "state" => count(class_module_pages_folder::getPagesAndFolderList($objSingleEntry->getSystemid())) == 0 ? "" : "closed", "attr" => array("id" => $objSingleEntry->getSystemid(), "systemid" => $objSingleEntry->getSystemid(), "link" => $strLink, "isleaf" => count(class_module_pages_folder::getPagesAndFolderList($objSingleEntry->getSystemid())) == 0 ? true : false)); } /** @var class_module_pages_page $objSingleEntry */ if ($objSingleEntry instanceof class_module_pages_page) { $strTargetId = $objSingleEntry->getSystemid(); if ($objSingleEntry->getIntType() == class_module_pages_page::$INT_TYPE_ALIAS && class_module_pages_page::getPageByName($objSingleEntry->getStrAlias()) != null) { $strTargetId = class_module_pages_page::getPageByName($objSingleEntry->getStrAlias())->getSystemid(); } $strLink = ""; if ($objSingleEntry->getIntType() == class_module_pages_page::$INT_TYPE_ALIAS && class_objectfactory::getInstance()->getObject($strTargetId)->rightEdit()) { $strLink = class_link::getLinkAdminHref("pages_content", "list", "systemid=" . $strTargetId, false); } else { if ($objSingleEntry->getIntType() == class_module_pages_page::$INT_TYPE_PAGE && $objSingleEntry->rightEdit()) { $strLink = class_link::getLinkAdminHref("pages_content", "list", "systemid=" . $objSingleEntry->getSystemid(), false); } } $arrReturn[] = array("data" => array("title" => class_adminskin_helper::getAdminImage($objSingleEntry->getStrIcon()) . " " . $objSingleEntry->getStrDisplayName()), "state" => count(class_module_pages_folder::getPagesAndFolderList($objSingleEntry->getSystemid())) == 0 ? "" : "closed", "attr" => array("id" => $objSingleEntry->getSystemid(), "systemid" => $objSingleEntry->getSystemid(), "link" => $strLink, "type" => $objSingleEntry->getIntType(), "isleaf" => count(class_module_pages_folder::getPagesAndFolderList($objSingleEntry->getSystemid())) == 0 ? true : false)); } } } } class_response_object::getInstance()->setStrResponseType(class_http_responsetypes::STR_TYPE_JSON); return json_encode($arrReturn); }
/** * Returns a list of users and/or groups matching the passed query. * * @return string * @xml */ protected function actionGetUserByFilter() { $strFilter = $this->getParam("filter"); $strCheckId = $this->getParam("checkid"); $arrCheckIds = json_decode($strCheckId); $arrUsers = array(); $objSource = new class_module_user_sourcefactory(); if ($this->getParam("user") == "true") { $arrUsers = $objSource->getUserlistByUserquery($strFilter); } if ($this->getParam("group") == "true") { $arrUsers = array_merge($arrUsers, $objSource->getGrouplistByQuery($strFilter)); } usort($arrUsers, function ($objA, $objB) { if ($objA instanceof class_module_user_user) { $strA = $objA->getStrUsername(); } else { $strA = $objA->getStrName(); } if ($objB instanceof class_module_user_user) { $strB = $objB->getStrUsername(); } else { $strB = $objB->getStrName(); } return strcmp(strtolower($strA), strtolower($strB)); }); $arrReturn = array(); foreach ($arrUsers as $objOneElement) { if ($this->getParam("block") == "current" && $objOneElement->getSystemid() == $this->objSession->getUserID()) { continue; } $bitUserHasRightView = true; if (!empty($arrCheckIds) && is_array($arrCheckIds) && $objOneElement instanceof class_module_user_user) { foreach ($arrCheckIds as $strCheckId) { if (!$this->hasUserViewPermissions($strCheckId, $objOneElement)) { $bitUserHasRightView = false; break; } } } if ($bitUserHasRightView) { $arrEntry = array(); if ($objOneElement instanceof class_module_user_user) { $arrEntry["title"] = $objOneElement->getStrUsername() . " (" . $objOneElement->getStrName() . ", " . $objOneElement->getStrForename() . " )"; $arrEntry["label"] = $objOneElement->getStrUsername() . " (" . $objOneElement->getStrName() . ", " . $objOneElement->getStrForename() . " )"; $arrEntry["value"] = $objOneElement->getStrUsername() . " (" . $objOneElement->getStrName() . ", " . $objOneElement->getStrForename() . " )"; $arrEntry["systemid"] = $objOneElement->getSystemid(); $arrEntry["icon"] = class_adminskin_helper::getAdminImage("icon_user"); } else { if ($objOneElement instanceof class_module_user_group) { $arrEntry["title"] = $objOneElement->getStrName(); $arrEntry["value"] = $objOneElement->getStrName(); $arrEntry["label"] = $objOneElement->getStrName(); $arrEntry["systemid"] = $objOneElement->getSystemid(); $arrEntry["icon"] = class_adminskin_helper::getAdminImage("icon_group"); } } $arrReturn[] = $arrEntry; } } class_response_object::getInstance()->setStrResponseType(class_http_responsetypes::STR_TYPE_JSON); return json_encode($arrReturn); }
/** * @param string $strSearchterm * @param class_search_result[] $arrResults * * @return string */ private function createSearchJson($strSearchterm, $arrResults) { $arrItems = array(); foreach ($arrResults as $objOneResult) { $arrItem = array(); //create a correct link if ($objOneResult->getObjObject() == null || !$objOneResult->getObjObject()->rightView()) { continue; } $strIcon = ""; if ($objOneResult->getObjObject() instanceof interface_admin_listable) { $strIcon = $objOneResult->getObjObject()->getStrIcon(); if (is_array($strIcon)) { $strIcon = $strIcon[0]; } } $strLink = $objOneResult->getStrPagelink(); if ($strLink == "") { $strLink = class_link::getLinkAdminHref($objOneResult->getObjObject()->getArrModule("modul"), "edit", "&systemid=" . $objOneResult->getStrSystemid()); } $arrItem["module"] = class_carrier::getInstance()->getObjLang()->getLang("modul_titel", $objOneResult->getObjObject()->getArrModule("modul")); $arrItem["systemid"] = $objOneResult->getStrSystemid(); $arrItem["icon"] = class_adminskin_helper::getAdminImage($strIcon, "", true); $arrItem["score"] = $objOneResult->getStrSystemid(); $arrItem["description"] = uniStrTrim($objOneResult->getObjObject()->getStrDisplayName(), 200); $arrItem["link"] = html_entity_decode($strLink); $arrItems[] = $arrItem; } $objResult = $arrItems; class_response_object::getInstance()->setStrResponseType(class_http_responsetypes::STR_TYPE_JSON); return json_encode($objResult); }
/** * Show a logbook of all downloads * * @return string * @permissions edit * @autoTestable */ protected function actionLogbook() { $strReturn = ""; $intNrOfRecordsPerPage = 25; $strReturn .= $this->objToolkit->getTextRow(class_link::getLinkAdmin($this->getArrModule("modul"), "logbookFlush", "", $this->getLang("action_logbook_flush"), "") . "<br />"); $objLogbook = new class_module_mediamanager_logbook(); $objArraySectionIterator = new class_array_section_iterator($objLogbook->getLogbookDataCount()); $objArraySectionIterator->setIntElementsPerPage($intNrOfRecordsPerPage); $objArraySectionIterator->setPageNumber((int) ($this->getParam("pv") != "" ? $this->getParam("pv") : 1)); $objArraySectionIterator->setArraySection($objLogbook->getLogbookData($objArraySectionIterator->calculateStartPos(), $objArraySectionIterator->calculateEndPos())); $arrLogs = array(); foreach ($objArraySectionIterator as $intKey => $arrOneLog) { $arrLogs[$intKey][0] = $arrOneLog["downloads_log_id"]; $arrLogs[$intKey][1] = timeToString($arrOneLog["downloads_log_date"]); $arrLogs[$intKey][2] = $arrOneLog["downloads_log_file"]; $arrLogs[$intKey][3] = $arrOneLog["downloads_log_user"]; $arrLogs[$intKey][4] = $arrOneLog["downloads_log_ip"]; $strUtraceLinkMap = "href=\"http://www.utrace.de/ip-adresse/" . $arrOneLog["downloads_log_ip"] . "\" target=\"_blank\""; $strUtraceLinkText = "href=\"http://www.utrace.de/whois/" . $arrOneLog["downloads_log_ip"] . "\" target=\"_blank\""; if ($arrOneLog["downloads_log_ip"] != "127.0.0.1" && $arrOneLog["downloads_log_ip"] != "::1") { $arrLogs[$intKey][5] = class_link::getLinkAdminManual($strUtraceLinkMap, "", $this->getLang("login_utrace_showmap", "user"), "icon_earth") . " " . class_link::getLinkAdminManual($strUtraceLinkText, "", $this->getLang("login_utrace_showtext", "user"), "icon_text"); } else { $arrLogs[$intKey][5] = class_adminskin_helper::getAdminImage("icon_earthDisabled", $this->getLang("login_utrace_noinfo", "user")) . " " . class_adminskin_helper::getAdminImage("icon_textDisabled", $this->getLang("login_utrace_noinfo", "user")); } } //Create a data-table $arrHeader = array(); $arrHeader[0] = $this->getLang("header_id"); $arrHeader[1] = $this->getLang("commons_date"); $arrHeader[2] = $this->getLang("header_file"); $arrHeader[3] = $this->getLang("header_user"); $arrHeader[4] = $this->getLang("header_ip"); $arrHeader[5] = $this->getLang("login_utrace", "user"); $strReturn .= $this->objToolkit->dataTable($arrHeader, $arrLogs); $strReturn .= $this->objToolkit->getPageview($objArraySectionIterator, $this->getArrModule("modul"), "logbook"); return $strReturn; }
/** * @param interface_model|class_root $objListEntry * * @return string */ protected function renderDeleteAction(interface_model $objListEntry) { if ($objListEntry->rightDelete() && $this->getObjModule()->rightDelete()) { if (class_module_system_setting::getConfigValue("_packagemanager_defaulttemplate_") == $objListEntry->getStrName()) { return $this->objToolkit->listButton(class_adminskin_helper::getAdminImage("icon_deleteDisabled", $this->getLang("pack_active_no_delete"))); } else { return $this->objToolkit->listDeleteButton($objListEntry->getStrDisplayName(), $this->getLang("delete_question"), class_link::getLinkAdminHref($this->getArrModule("modul"), "deleteTemplate", "&systemid=" . $objListEntry->getSystemid() . "")); } } return ""; }
/** * Processes an admin-request * * @param string $strModule * @param string $strAction * @param string $strLanguageParam * * @throws class_exception * @return string */ private function processAdminRequest($strModule, $strAction, $strLanguageParam) { $strReturn = ""; $bitLogin = false; //validate https status if (class_module_system_setting::getConfigValue("_admin_only_https_") == "true") { //check which headers to compare $strHeaderName = class_carrier::getInstance()->getObjConfig()->getConfig("https_header"); $strHeaderValue = strtolower(class_carrier::getInstance()->getObjConfig()->getConfig("https_header_value")); //header itself given? if (!issetServer($strHeaderName)) { //reload to https if (_xmlLoader_ === true) { class_response_object::getInstance()->setStrRedirectUrl(uniStrReplace("http:", "https:", _xmlpath_) . "?" . getServer("QUERY_STRING")); } else { class_response_object::getInstance()->setStrRedirectUrl(uniStrReplace("http:", "https:", _indexpath_) . "?" . getServer("QUERY_STRING")); } class_response_object::getInstance()->sendHeaders(); die("Reloading using https..."); } else { if ($strHeaderValue != "" && $strHeaderValue != strtolower(getServer($strHeaderName))) { //reload to https if (_xmlLoader_ === true) { class_response_object::getInstance()->setStrRedirectUrl(uniStrReplace("http:", "https:", _xmlpath_) . "?" . getServer("QUERY_STRING")); } else { class_response_object::getInstance()->setStrRedirectUrl(uniStrReplace("http:", "https:", _indexpath_) . "?" . getServer("QUERY_STRING")); } class_response_object::getInstance()->sendHeaders(); die("Reloading using https..."); } } } //process language-param $objLanguage = new class_module_languages_language(); $objLanguage->setStrAdminLanguageToWorkOn($strLanguageParam); //set the current backend skin. right here to do it only once. class_adminskin_helper::defineSkinWebpath(); //validate login-status / process login-request if ($strModule != "login" && $this->objSession->isLoggedin()) { if ($this->objSession->isAdmin()) { //try to load the module $objModuleRequested = class_module_system_module::getModuleByName($strModule); if ($objModuleRequested != null) { //see if there is data from a previous, failed request if (class_carrier::getInstance()->getObjSession()->getSession(class_module_login_admin::SESSION_LOAD_FROM_PARAMS) === "true") { foreach (class_carrier::getInstance()->getObjSession()->getSession(class_module_login_admin::SESSION_PARAMS) as $strOneKey => $strOneVal) { class_carrier::getInstance()->setParam($strOneKey, $strOneVal); } class_carrier::getInstance()->getObjSession()->sessionUnset(class_module_login_admin::SESSION_LOAD_FROM_PARAMS); class_carrier::getInstance()->getObjSession()->sessionUnset(class_module_login_admin::SESSION_PARAMS); } if (_xmlLoader_) { if ($objModuleRequested->getStrXmlNameAdmin() != "") { $strClassname = str_replace(".php", "", $objModuleRequested->getStrXmlNameAdmin()); $objConcreteModule = new $strClassname(); $strReturn = $objConcreteModule->action($strAction); } else { //xml-loader not defined, try to use the regular dispatcher $objConcreteModule = $objModuleRequested->getAdminInstanceOfConcreteModule(); $strReturn = $objConcreteModule->action($strAction); } } else { //fill the history array to track actions $objHistory = new class_history(); //Writing to the history if (class_carrier::getInstance()->getParam("folderview") == "") { $objHistory->setAdminHistory(); } $objConcreteModule = $objModuleRequested->getAdminInstanceOfConcreteModule(); if (class_carrier::getInstance()->getParam("blockAction") != "1") { $objConcreteModule->action(); $strReturn = $objConcreteModule->getModuleOutput(); } //React, if admin was opened by the portaleditor if (class_carrier::getInstance()->getParam("peClose") == "1") { if (getGet("peRefreshPage") != "") { $strReturn = "<html><head></head><body onload=\"parent.location = '" . urldecode(getGet("peRefreshPage")) . "';\"></body></html>"; } else { $strReturn = "<html><head></head><body onload=\"parent.location.reload();\"></body></html>"; } } } } else { throw new class_exception("Requested module " . $strModule . " not existing", class_exception::$level_FATALERROR); } } else { throw new class_exception("Sorry, but you don't have the needed permissions to access the admin-area", class_exception::$level_FATALERROR); } } else { $bitLogin = true; if ($strModule != "login") { $strAction = ""; } } if ($bitLogin) { if (_xmlLoader_) { $objLogin = new class_module_login_admin_xml(); $strReturn = $objLogin->action($strAction); } else { if (count(class_carrier::getInstance()->getObjDB()->getTables()) == 0 && file_exists(_realpath_ . "/installer.php")) { class_response_object::getInstance()->setStrRedirectUrl(_webpath_ . "/installer.php"); return ""; } $objLogin = new class_module_login_admin(); $objLogin->action($strAction); $strReturn = $objLogin->getModuleOutput(); } } return $strReturn; }
/** * Returns an image-tag with surrounding tooltip * * @param string $strImage * @param string $strAlt * @param bool $bitNoAlt * * @return string * @deprecated replaced by class_adminskin_helper::getAdminImage() * @see class_adminskin_helper::getAdminImage() */ function getImageAdmin($strImage, $strAlt = "", $bitNoAlt = false) { return class_adminskin_helper::getAdminImage($strImage, $strAlt, $bitNoAlt); }
/** * @param string $strListIdentifier * * @return array */ protected function getBatchActionHandlers($strListIdentifier) { $arrDefault = array(); if ($this->getObjModule()->rightDelete()) { $arrDefault[] = new class_admin_batchaction(class_adminskin_helper::getAdminImage("icon_delete"), class_link::getLinkAdminXml("system", "delete", "&systemid=%systemid%"), $this->getLang("commons_batchaction_delete")); } $arrDefault[] = new class_admin_batchaction(class_adminskin_helper::getAdminImage("icon_mail"), class_link::getLinkAdminXml("messaging", "setRead", "&systemid=%systemid%"), $this->getLang("batchaction_read")); $arrDefault[] = new class_admin_batchaction(class_adminskin_helper::getAdminImage("icon_mailNew"), class_link::getLinkAdminXml("messaging", "setUnread", "&systemid=%systemid%"), $this->getLang("batchaction_unread")); return $arrDefault; }
/** * Fetches all child-nodes of the passed node. * Used by the tree-view in module-navigation admin view. * * @return string * @since 3.3.0 * @xml * @permissions view */ protected function actionGetChildNodes() { $arrNavigations = class_module_navigation_point::getNaviLayer($this->getSystemid()); $arrReturn = array(); if (count($arrNavigations) > 0) { /** @var class_module_navigation_point $objSinglePoint */ foreach ($arrNavigations as $objSinglePoint) { if ($objSinglePoint->rightView()) { $arrReturn[] = array("data" => array("title" => class_adminskin_helper::getAdminImage($objSinglePoint->getStrIcon()) . " " . $objSinglePoint->getStrDisplayName()), "state" => count(class_module_navigation_point::getNaviLayer($objSinglePoint->getSystemid())) == 0 ? "" : "closed", "attr" => array("id" => $objSinglePoint->getSystemid(), "systemid" => $objSinglePoint->getSystemid(), "link" => class_link::getLinkAdminHref("navigation", "list", "&systemid=" . $objSinglePoint->getSystemid(), false))); } } } $objCurNode = class_objectfactory::getInstance()->getObject($this->getSystemid()); if ($objCurNode instanceof class_module_navigation_tree) { $arrReturn = array("data" => array("title" => class_adminskin_helper::getAdminImage($objCurNode->getStrIcon()) . " " . $objCurNode->getStrDisplayName()), "state" => "", "attr" => array("id" => $objCurNode->getSystemid(), "systemid" => $objCurNode->getSystemid(), "link" => ""), "children" => $arrReturn); } class_response_object::getInstance()->setStrResponseType(class_http_responsetypes::STR_TYPE_JSON); return json_encode($arrReturn); }
/** * 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; }