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(); } }
/** * 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); }
/** * @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; }
/** * @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 ""; }
/** * 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; }
/** * @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); }
/** * 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); }
/** * 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); }
/** * @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; }
/** * @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; }
/** * 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; }
/** * 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); }
/** * @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); }
/** * 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); }
/** * @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; }