/**
  * Renders the field itself.
  * In most cases, based on the current toolkit.
  *
  * @return string
  */
 public function renderField()
 {
     $objToolkit = class_carrier::getInstance()->getObjToolkit("admin");
     $strReturn = "";
     if ($this->getStrHint() != null) {
         $strReturn .= $objToolkit->formTextRow($this->getStrHint());
     }
     $strOpener = "";
     if ($this->bitRenderReset) {
         $strOpener = " " . class_link::getLinkAdminManual("href=\"#\" onclick=\"\$('#" . $this->getStrEntryName() . "').val('');return false;\"", "", class_carrier::getInstance()->getObjLang()->getLang("commons_reset", "prozessverwaltung"), "icon_delete");
     }
     $strReturn .= $objToolkit->formInputDropdown($this->getStrEntryName(), $this->arrKeyValues, $this->getStrLabel(), $this->getStrValue(), "", !$this->getBitReadonly(), $this->getStrAddons(), $this->getStrDataPlaceholder(), $strOpener);
     return $strReturn;
 }
 /**
  * Returns a form to modify the rights
  *
  * @return string
  * @permissions right
  */
 protected function actionChange()
 {
     $strReturn = "";
     $strSystemID = $this->getParam("systemid");
     $objTargetRecord = null;
     if ($strSystemID == "") {
         $strSystemID = "0";
     }
     //Determine the systemid
     if ($strSystemID != "") {
         $objTargetRecord = class_objectfactory::getInstance()->getObject($strSystemID);
     }
     //Edit a module?
     if ($this->getParam("changemodule") != "") {
         $objTargetRecord = class_module_system_module::getModuleByName($this->getParam("changemodule"));
         $strSystemID = $objTargetRecord->getSystemid();
     }
     if ($objTargetRecord == null) {
         return $this->getLang("commons_error_permissions");
     }
     $objRights = class_carrier::getInstance()->getObjRights();
     if ($objTargetRecord->rightRight()) {
         //Get Rights
         $arrRights = $objRights->getArrayRights($objTargetRecord->getSystemid());
         //Get groups
         $arrGroups = class_module_user_group::getObjectList();
         //Determine name of the record
         if ($objTargetRecord instanceof class_module_system_module) {
             $strTitle = class_carrier::getInstance()->getObjLang()->getLang("modul_titel", $objTargetRecord->getStrName()) . " (" . $objTargetRecord->getStrDisplayName() . ")";
         } else {
             if ($objTargetRecord->getStrDisplayName() == "") {
                 $strTitle = $this->getLang("titel_leer");
             } else {
                 $strTitle = $objTargetRecord->getStrDisplayName() . " ";
             }
         }
         //Load the rights header-row
         if ($objTargetRecord->getIntModuleNr() == 0) {
             $strModule = "system";
         } else {
             if ($objTargetRecord instanceof class_module_system_module) {
                 $strModule = $objTargetRecord->getStrName();
             } else {
                 if (defined("_pages_folder_id_") && $objTargetRecord->getIntModuleNr() == _pages_folder_id_) {
                     $strModule = "pages";
                 } else {
                     $strModule = $objTargetRecord->getArrModule("modul");
                 }
             }
         }
         $arrHeaderRow = $this->getLang("permissions_header", $strModule);
         $arrDefaultHeader = $this->getLang("permissions_default_header", "system");
         if ($arrHeaderRow == "!permissions_header!") {
             $arrHeaderRow = $arrDefaultHeader;
         }
         if ($strSystemID == "0") {
             $arrHeaderRow = $this->getLang("permissions_root_header", "system");
         }
         $arrTitles = $arrHeaderRow;
         $arrTemplateTotal = array();
         $arrTemplateTotal["title0"] = $arrTitles[0];
         $arrTemplateTotal["title1"] = $arrTitles[1];
         $arrTemplateTotal["title2"] = $arrTitles[2];
         $arrTemplateTotal["title3"] = $arrTitles[3];
         $arrTemplateTotal["title4"] = $arrTitles[4];
         $arrTemplateTotal["title5"] = $arrTitles[5];
         $arrTemplateTotal["title6"] = $arrTitles[6];
         $arrTemplateTotal["title7"] = $arrTitles[7];
         $arrTemplateTotal["title8"] = $arrTitles[8];
         if (class_module_system_setting::getConfigValue("_system_changehistory_enabled_") == "true") {
             if (!isset($arrTitles[9])) {
                 //fallback for pre 4.3.2 systems
                 $arrTitles[9] = $arrDefaultHeader[9];
             }
             $arrTemplateTotal["title9"] = $arrTitles[9];
         }
         //Read the template
         $strTemplateRowID = $this->objTemplate->readTemplate("/elements.tpl", "rights_form_row");
         $arrTemplateTotal["rows"] = "";
         //Inserting Rows
         foreach ($arrGroups as $objSingleGroup) {
             $arrTemplateRow = array();
             $arrSingleGroup = array();
             $arrTemplateRow["group"] = $objSingleGroup->getStrName();
             $arrSingleGroup["group_id"] = $objSingleGroup->getSystemid();
             //hide the superglobal admin-row from non-members
             if ($objSingleGroup->getSystemid() == class_module_system_setting::getConfigValue("_admins_group_id_") && !in_array(class_module_system_setting::getConfigValue("_admins_group_id_"), $this->objSession->getGroupIdsAsArray())) {
                 continue;
             }
             //Building Checkboxes
             $arrTemplateRow["box0"] = "<input title=\"" . $arrTitles[0] . "\" rel=\"tooltip\" type=\"checkbox\" name=\"1," . $arrSingleGroup["group_id"] . "\" id=\"1," . $arrSingleGroup["group_id"] . "\" value=\"1\" " . (in_array($arrSingleGroup["group_id"], $arrRights["view"]) ? " checked=\"checked\" " : "") . " />";
             $arrTemplateRow["box1"] = "<input title=\"" . $arrTitles[1] . "\" rel=\"tooltip\" type=\"checkbox\" name=\"2," . $arrSingleGroup["group_id"] . "\" id=\"2," . $arrSingleGroup["group_id"] . "\" value=\"1\" " . (in_array($arrSingleGroup["group_id"], $arrRights["edit"]) ? " checked=\"checked\" " : "") . " />";
             $arrTemplateRow["box2"] = "<input title=\"" . $arrTitles[2] . "\" rel=\"tooltip\" type=\"checkbox\" name=\"3," . $arrSingleGroup["group_id"] . "\" id=\"3," . $arrSingleGroup["group_id"] . "\" value=\"1\" " . (in_array($arrSingleGroup["group_id"], $arrRights["delete"]) ? " checked=\"checked\" " : "") . " />";
             $arrTemplateRow["box3"] = "<input title=\"" . $arrTitles[3] . "\" rel=\"tooltip\" type=\"checkbox\" name=\"4," . $arrSingleGroup["group_id"] . "\" id=\"4," . $arrSingleGroup["group_id"] . "\" value=\"1\" " . (in_array($arrSingleGroup["group_id"], $arrRights["right"]) ? " checked=\"checked\" " : "") . " />";
             //loop the module specific permissions
             for ($intI = 1; $intI <= 5; $intI++) {
                 if ($arrTemplateTotal["title" . ($intI + 3)] != "") {
                     $arrTemplateRow["box" . ($intI + 3)] = "<input title=\"" . $arrTitles[$intI + 3] . "\" rel=\"tooltip\" type=\"checkbox\" name=\"" . ($intI + 4) . "," . $arrSingleGroup["group_id"] . "\" id=\"" . ($intI + 4) . "," . $arrSingleGroup["group_id"] . "\" value=\"1\" " . (in_array($arrSingleGroup["group_id"], $arrRights["right" . $intI]) ? " checked=\"checked\" " : "") . " />";
                 } else {
                     $arrTemplateRow["box" . ($intI + 3)] = "<input type=\"hidden\" name=\"" . ($intI + 4) . "," . $arrSingleGroup["group_id"] . "\" id=\"" . ($intI + 4) . "," . $arrSingleGroup["group_id"] . "\" value=\"1\" />";
                 }
             }
             if (class_module_system_setting::getConfigValue("_system_changehistory_enabled_") == "true") {
                 $arrTemplateRow["box9"] = "<input title=\"" . $arrTitles[9] . "\" rel=\"tooltip\" type=\"checkbox\" name=\"10," . $arrSingleGroup["group_id"] . "\" id=\"10," . $arrSingleGroup["group_id"] . "\" value=\"1\" " . (in_array($arrSingleGroup["group_id"], $arrRights["changelog"]) ? " checked=\"checked\" " : "") . " />";
             }
             //And Print it to template
             $arrTemplateTotal["rows"] .= $this->objTemplate->fillTemplate($arrTemplateRow, $strTemplateRowID);
         }
         //Build the inherit-box
         $strTemplateInheritID = $this->objTemplate->readTemplate("/elements.tpl", "rights_form_inherit");
         $arrTemplateInherit = array();
         $arrTemplateInherit["title"] = $this->getLang("titel_erben");
         $arrTemplateInherit["name"] = "inherit";
         if (isset($arrRights["inherit"]) && $arrRights["inherit"] == 1) {
             $arrTemplateInherit["checked"] = "checked=\"checked\"";
         } else {
             $arrTemplateInherit["checked"] = "";
         }
         $arrTemplateTotal["inherit"] = $this->objTemplate->fillTemplate($arrTemplateInherit, $strTemplateInheritID);
         //Creating the output, starting with the header
         $strTemplateID = $this->objTemplate->readTemplate("/elements.tpl", "rights_form_header");
         $arrTemplate = array();
         $arrTemplate["record"] = $strTitle;
         //Backlink
         $strUrlHistory = $this->getHistory(0);
         //Buliding the right-matrix
         $arrHistory = explode("&", $strUrlHistory);
         if (isset($arrHistory[0]) && isset($arrHistory[1])) {
             $arrTemplate["backlink"] = class_link::getLinkAdminManual("href=\"" . $arrHistory[0] . "&" . $arrHistory[1] . "\"", $this->getLang("commons_back"));
         }
         $arrTemplate["desc"] = $this->getLang("desc");
         $strReturn .= $this->objTemplate->fillTemplate($arrTemplate, $strTemplateID);
         //Followed by the form
         $strReturn .= $this->objToolkit->formHeader(class_link::getLinkAdminHref($this->getArrModule("modul"), "saverights"), "rightsForm", "", "KAJONA.admin.permissions.submitForm(); return false;");
         $strTemplateID = $this->objTemplate->readTemplate("/elements.tpl", "rights_form_form");
         $strReturn .= $this->objTemplate->fillTemplate($arrTemplateTotal, $strTemplateID);
         $strReturn .= $this->objToolkit->formInputHidden("systemid", $strSystemID);
         //place all inheritance-rights as hidden-fields to support the change-js script
         $strPrevId = $objTargetRecord->getPrevId();
         $arrRightsInherited = $objRights->getArrayRights($strPrevId);
         foreach ($arrRightsInherited as $strRightName => $arrRightsPerAction) {
             if ($strRightName != "inherit") {
                 $intRightCounter = 0;
                 if ($strRightName == "view") {
                     $intRightCounter = 1;
                 }
                 if ($strRightName == "edit") {
                     $intRightCounter = 2;
                 }
                 if ($strRightName == "delete") {
                     $intRightCounter = 3;
                 }
                 if ($strRightName == "right") {
                     $intRightCounter = 4;
                 }
                 if ($strRightName == "right1") {
                     $intRightCounter = 5;
                 }
                 if ($strRightName == "right2") {
                     $intRightCounter = 6;
                 }
                 if ($strRightName == "right3") {
                     $intRightCounter = 7;
                 }
                 if ($strRightName == "right4") {
                     $intRightCounter = 8;
                 }
                 if ($strRightName == "right5") {
                     $intRightCounter = 9;
                 }
                 if ($strRightName == "changelog") {
                     $intRightCounter = 10;
                 }
                 foreach ($arrRightsPerAction as $strOneGroupId) {
                     //place hidden field
                     $strReturn .= $this->objToolkit->formInputHidden("inherit," . $intRightCounter . "," . $strOneGroupId, "1");
                 }
             }
         }
         //Close the form
         $strReturn .= $this->objToolkit->formInputSubmit($this->getLang("commons_save"));
         $strReturn .= $this->objToolkit->formClose();
         $strReturn .= "<script type=\"text/javascript\">\n                KAJONA.admin.permissions.checkRightMatrix();\n                KAJONA.admin.permissions.toggleEmtpyRows('" . $this->getLang("permissions_toggle_visible") . "', '" . $this->getLang("permissions_toggle_hidden") . "', '#rightsForm tr');\n                </script>";
     } else {
         $strReturn .= $this->getLang("commons_error_permissions");
     }
     return $strReturn;
 }
Example #3
0
/**
 * Generates a link using the content passed.
 * The param $strLinkContent should contain all contents of the a-tag.
 * The system renders <a $strLinkContent title... class...>($strText|$strImage)</a>
 *
 * @deprecated
 *
 * @param string $strLinkContent
 * @param string $strText
 * @param string $strAlt
 * @param string $strImage
 * @param string $strImageId
 * @param string $strLinkId
 * @param bool $bitTooltip
 * @param string $strCss
 *
 * @return string
 */
function getLinkAdminManual($strLinkContent, $strText, $strAlt = "", $strImage = "", $strImageId = "", $strLinkId = "", $bitTooltip = true, $strCss = "")
{
    return class_link::getLinkAdminManual($strLinkContent, $strText, $strAlt, $strImage, $strImageId, $strLinkId, $bitTooltip, $strCss);
}
 /**
  * Renders the permissions action button for the current record.
  * @param class_model|interface_model $objListEntry
  * @return string
  */
 protected function renderCopyAction(class_model $objListEntry)
 {
     if ($objListEntry->getIntRecordDeleted() == 1) {
         return "";
     }
     if ($objListEntry->rightEdit() && $this->strPeAddon == "") {
         $strHref = class_link::getLinkAdminHref($objListEntry->getArrModule("modul"), $this->getActionNameForClass("copyObject", $objListEntry), "&systemid=" . $objListEntry->getSystemid() . $this->strPeAddon);
         return $this->objToolkit->listButton(class_link::getLinkAdminManual(" onclick='jsDialog_3.init();' href='" . $strHref . "'", "", $this->getLang("commons_edit_copy"), "icon_copy"));
     }
     return "";
 }
 /**
  * @param string $strLangName
  * @param null $strLangModule
  *
  * @return string
  */
 protected function renderError($strLangName, $strLangModule = null)
 {
     $strError = $this->getLang($strLangName, $strLangModule);
     $objHistory = new class_history();
     $arrHistory = explode("&", $objHistory->getAdminHistory(0));
     if ($this->getArrModule("template") == "/folderview.tpl") {
         $strError .= ' ' . class_link::getLinkAdminManual('href="javascript:window.parent.location.reload();"', $this->getLang('commons_back'));
     } else {
         $strError .= ' ' . class_link::getLinkAdminManual("href=\"" . $arrHistory[0] . "&" . $arrHistory[1] . "\"", $this->getLang("commons_back"));
     }
     return $this->objToolkit->warningBox($strError);
 }
 /**
  * returns a list of the last logins
  *
  * @return string
  * @autoTestable
  * @permissions right1
  */
 protected function actionLoginLog()
 {
     $strReturn = "";
     //fetch log-rows
     $objLogbook = new class_module_user_log();
     $objIterator = new class_array_section_iterator($objLogbook->getLoginLogsCount());
     $objIterator->setPageNumber((int) ($this->getParam("pv") != "" ? $this->getParam("pv") : 1));
     $objIterator->setArraySection(class_module_user_log::getLoginLogs($objIterator->calculateStartPos(), $objIterator->calculateEndPos()));
     $arrRows = array();
     foreach ($objIterator as $arrLogRow) {
         $arrSingleRow = array();
         $arrSingleRow[] = $arrLogRow["user_log_sessid"];
         $arrSingleRow[] = $arrLogRow["user_username"] != "" ? $arrLogRow["user_username"] : $arrLogRow["user_log_userid"];
         $arrSingleRow[] = dateToString(new class_date($arrLogRow["user_log_date"]));
         $arrSingleRow[] = $arrLogRow["user_log_enddate"] != "" ? dateToString(new class_date($arrLogRow["user_log_enddate"])) : "";
         $arrSingleRow[] = $arrLogRow["user_log_status"] == 0 ? $this->getLang("login_status_0") : $this->getLang("login_status_1");
         $arrSingleRow[] = $arrLogRow["user_log_ip"];
         $strUtraceLinkMap = "href=\"http://www.utrace.de/ip-adresse/" . $arrLogRow["user_log_ip"] . "\" target=\"_blank\"";
         $strUtraceLinkText = "href=\"http://www.utrace.de/whois/" . $arrLogRow["user_log_ip"] . "\" target=\"_blank\"";
         if ($arrLogRow["user_log_ip"] != "127.0.0.1" && $arrLogRow["user_log_ip"] != "::1") {
             $arrSingleRow[] = $this->objToolkit->listButton(class_link::getLinkAdminManual($strUtraceLinkMap, "", $this->getLang("login_utrace_showmap"), "icon_earth")) . " " . $this->objToolkit->listButton(class_link::getLinkAdminManual($strUtraceLinkText, "", $this->getLang("login_utrace_showtext"), "icon_text"));
         } else {
             $arrSingleRow[] = $this->objToolkit->listButton(class_adminskin_helper::getAdminImage("icon_earthDisabled", $this->getLang("login_utrace_noinfo"))) . " " . $this->objToolkit->listButton(class_adminskin_helper::getAdminImage("icon_textDisabled", $this->getLang("login_utrace_noinfo")));
         }
         $arrRows[] = $arrSingleRow;
     }
     //Building the surrounding table
     $arrHeader = array();
     $arrHeader[] = $this->getLang("login_sessid");
     $arrHeader[] = $this->getLang("login_user");
     $arrHeader[] = $this->getLang("login_logindate");
     $arrHeader[] = $this->getLang("login_logoutdate");
     $arrHeader[] = $this->getLang("login_status");
     $arrHeader[] = $this->getLang("login_ip");
     $arrHeader[] = $this->getLang("login_utrace");
     //and fetch the table
     $strReturn .= $this->objToolkit->dataTable($arrHeader, $arrRows);
     $strReturn .= $this->objToolkit->getPageview($objIterator, "user", "loginlog");
     return $strReturn;
 }
 /**
  * @return string
  */
 public function getReport()
 {
     $strReturn = "";
     //Create Data-table
     $arrHeader = array();
     $arrValues = array();
     //Fetch data
     $arrStats = $this->getTopVisitors();
     //calc a few values
     $intSum = 0;
     foreach ($arrStats as $arrOneStat) {
         $intSum += $arrOneStat["anzahl"];
     }
     $intI = 0;
     $objUser = new class_module_user_user(class_session::getInstance()->getUserID());
     foreach ($arrStats as $arrOneStat) {
         //Escape?
         if ($intI >= $objUser->getIntItemsPerPage()) {
             break;
         }
         $arrValues[$intI] = array();
         $arrValues[$intI][] = $intI + 1;
         if ($arrOneStat["stats_hostname"] != "" and $arrOneStat["stats_hostname"] != "na") {
             $arrValues[$intI][] = $arrOneStat["stats_hostname"];
         } else {
             $arrValues[$intI][] = $arrOneStat["stats_ip"];
         }
         $arrValues[$intI][] = $arrOneStat["anzahl"];
         $arrValues[$intI][] = $this->objToolkit->percentBeam($arrOneStat["anzahl"] / $intSum * 100);
         $strUtraceLinkMap = "href=\"http://www.utrace.de/ip-adresse/" . $arrOneStat["stats_ip"] . "\" target=\"_blank\"";
         $strUtraceLinkText = "href=\"http://www.utrace.de/whois/" . $arrOneStat["stats_ip"] . "\" target=\"_blank\"";
         if ($arrOneStat["stats_ip"] != "127.0.0.1" && $arrOneStat["stats_ip"] != "::1") {
             $arrValues[$intI][] = class_link::getLinkAdminManual($strUtraceLinkMap, "", $this->objLang->getLang("login_utrace_showmap", "user"), "icon_earth") . " " . class_link::getLinkAdminManual($strUtraceLinkText, "", $this->objLang->getLang("login_utrace_showtext", "user"), "icon_text");
         } else {
             $arrValues[$intI][] = getImageAdmin("icon_earthDisabled", $this->objLang->getLang("login_utrace_noinfo", "user")) . " " . getImageAdmin("icon_textDisabled", $this->objLang->getLang("login_utrace_noinfo", "user"));
         }
         $intI++;
     }
     //HeaderRow
     $arrHeader[] = "#";
     $arrHeader[] = $this->objLang->getLang("top_visitor_titel", "stats");
     $arrHeader[] = $this->objLang->getLang("commons_hits_header", "stats");
     $arrHeader[] = $this->objLang->getLang("anteil", "stats");
     $arrHeader[] = $this->objLang->getLang("login_utrace", "user");
     $strReturn .= $this->objToolkit->dataTable($arrHeader, $arrValues);
     $strReturn .= $this->objToolkit->getTextRow($this->objLang->getLang("stats_hint_task", "stats"));
     return $strReturn;
 }
 /**
  * Returns a skin based info-box about the current users' login-status.
  *
  * @return string
  */
 public function getLoginStatus()
 {
     $arrTemplate = array();
     $arrTemplate["name"] = $this->objSession->getUsername();
     $arrTemplate["profile"] = class_link::getLinkAdminHref("user", "edit", "userid=" . $this->objSession->getUserID());
     $arrTemplate["logout"] = class_link::getLinkAdminHref($this->getArrModule("modul"), "adminLogout");
     $arrTemplate["dashboard"] = class_link::getLinkAdminHref("dashboard");
     $arrTemplate["sitemap"] = class_link::getLinkAdminHref("dashboard", "sitemap");
     $arrTemplate["statusTitle"] = $this->getLang("login_statusTitle", "user");
     $arrTemplate["profileTitle"] = $this->getLang("login_profileTitle", "user");
     $arrTemplate["logoutTitle"] = $this->getLang("login_logoutTitle", "user");
     $arrTemplate["dashboardTitle"] = $this->getLang("login_dashboard", "user");
     $arrTemplate["sitemapTitle"] = $this->getLang("login_sitemap", "user");
     $arrTemplate["printLink"] = class_link::getLinkAdminManual("href=\"#\" onclick=\"window.print();\"", $this->getLang("login_printview", "user"));
     $arrTemplate["printTitle"] = $this->getLang("login_print", "user");
     return $this->objToolkit->getLoginStatus($arrTemplate);
 }
 /**
  * Creates the code surrounding the element.
  * Creates the "entry" to the portal-editor
  *
  * @param string $strContent elements' output
  * @param string $strSystemid elements' systemid
  * @param array $arrConfig : pe_module, pe_action, [pe_action_new, pe_action_new_params]
  * @param string $strElement
  *
  * @return string
  * @static
  */
 public static function addPortalEditorCode($strContent, $strSystemid, $arrConfig, $strElement = "")
 {
     $strReturn = "";
     if (!validateSystemid($strSystemid)) {
         return $strContent;
     }
     $objInstance = class_objectfactory::getInstance()->getObject($strSystemid);
     if ($objInstance == null || class_module_system_setting::getConfigValue("_pages_portaleditor_") != "true") {
         return $strContent;
     }
     if (!class_carrier::getInstance()->getObjSession()->isAdmin() || !$objInstance->rightEdit($strSystemid) || class_carrier::getInstance()->getObjSession()->getSession("pe_disable") == "true") {
         return $strContent;
     }
     //switch the text-language temporary
     $strPortalLanguage = class_carrier::getInstance()->getObjLang()->getStrTextLanguage();
     class_carrier::getInstance()->getObjLang()->setStrTextLanguage(class_carrier::getInstance()->getObjSession()->getAdminLanguage());
     //fetch the language to set the correct admin-lang
     $objLanguages = new class_module_languages_language();
     $strAdminLangParam = "&language=" . $objLanguages->getPortalLanguage();
     $strModule = "pages_content";
     $strAction = "edit";
     //param-inits ---------------------------------------
     //Generate url to the admin-area
     if ($arrConfig["pe_module"] != "") {
         $strModule = $arrConfig["pe_module"];
     }
     //---------------------------------------------------
     //---------------------------------------------------
     //Link to create a new entry - only for modules, so not the page-content directly!
     $strNewLink = "";
     if ($strModule != "pages_content") {
         //Use Module-config to generate link
         if (isset($arrConfig["pe_action_new"]) && $arrConfig["pe_action_new"] != "") {
             $strNewUrl = class_link::getLinkAdminHref($strModule, $arrConfig["pe_action_new"], $arrConfig["pe_action_new_params"] . $strAdminLangParam . "&pe=1");
             $strNewLink = "<a href=\"#\" onclick=\"KAJONA.admin.portaleditor.openDialog('" . $strNewUrl . "'); return false;\">" . class_carrier::getInstance()->getObjLang()->getLang("pe_new_old", "pages") . "</a>";
         }
     }
     //---------------------------------------------------
     //Link to edit current element
     $strEditLink = "";
     //standard: pages_content.
     if ($strModule == "pages_content") {
         $arrConfig["pe_action_edit"] = $strAction;
         $arrConfig["pe_action_edit_params"] = "&systemid=" . $strSystemid;
     }
     //Use Module-config to generate link
     if (isset($arrConfig["pe_action_edit"]) && $arrConfig["pe_action_edit"] != "") {
         $strEditUrl = class_link::getLinkAdminHref($strModule, $arrConfig["pe_action_edit"], $arrConfig["pe_action_edit_params"] . $strAdminLangParam . "&pe=1");
         $strEditLink = "<a href=\"#\" onclick=\"KAJONA.admin.portaleditor.openDialog('" . $strEditUrl . "'); return false;\">" . class_carrier::getInstance()->getObjLang()->getLang("pe_edit", "pages") . "</a>";
     }
     //---------------------------------------------------
     //link to copy an element to the same or another placeholder
     $strCopyLink = "";
     //standard: pages_content.
     if ($strModule == "pages_content") {
         $arrConfig["pe_action_copy"] = "copyElement";
         $arrConfig["pe_action_copy_params"] = "&systemid=" . $strSystemid;
     }
     //Use Module-config to generate link
     if (isset($arrConfig["pe_action_copy"]) && $arrConfig["pe_action_copy"] != "") {
         $strCopyUrl = class_link::getLinkAdminHref($strModule, $arrConfig["pe_action_copy"], $arrConfig["pe_action_copy_params"] . $strAdminLangParam . "&pe=1");
         $strCopyLink = "<a href=\"#\" onclick=\"KAJONA.admin.portaleditor.openDialog('" . $strCopyUrl . "'); return false;\">" . class_carrier::getInstance()->getObjLang()->getLang("pe_copy", "pages") . "</a>";
     }
     //---------------------------------------------------
     //link to delete the current element
     $strDeleteLink = "";
     if ($objInstance->rightDelete()) {
         //standard: pages_content.
         if ($strModule == "pages_content") {
             $arrConfig["pe_action_delete"] = "deleteElementFinal";
             $arrConfig["pe_action_edit_params"] = "&systemid=" . $strSystemid;
             $strCallback = " function() { delDialog.hide(); KAJONA.admin.portaleditor.deleteElementData('{$strSystemid}'); return false; } ";
         } else {
             if (isset($arrConfig["pe_action_delete"]) && $arrConfig["pe_action_delete"] != "") {
                 $strDeleteUrl = class_link::getLinkAdminHref($strModule, $arrConfig["pe_action_delete"], $arrConfig["pe_action_edit_params"] . $strAdminLangParam . "&pe=1");
                 $strCallback = " function() { delDialog.hide(); KAJONA.admin.portaleditor.openDialog('{$strDeleteUrl}'); return false; } ";
             }
         }
         if (isset($arrConfig["pe_action_delete"]) && $arrConfig["pe_action_delete"] != "") {
             $strElementName = uniStrReplace(array('\''), array('\\\''), $objInstance->getStrDisplayName());
             $strQuestion = uniStrReplace("%%element_name%%", htmlToString($strElementName, true), class_carrier::getInstance()->getObjLang()->getLang("commons_delete_record_question", "system"));
             $strDeleteLink = class_link::getLinkAdminManual("href=\"#\" onclick=\"javascript:delDialog.setTitle('" . class_carrier::getInstance()->getObjLang()->getLang("dialog_deleteHeader", "system") . "'); delDialog.setContent('" . $strQuestion . "', '" . class_carrier::getInstance()->getObjLang()->getLang("dialog_deleteButton", "system") . "',  " . $strCallback . "); delDialog.init(); return false;\"", class_carrier::getInstance()->getObjLang()->getLang("commons_delete", "system"), class_carrier::getInstance()->getObjLang()->getLang("commons_delete", "system"));
         }
     }
     //---------------------------------------------------
     //link to drag n drop element
     //TODO: check if there are more than one elements in current placeholder before showing shift buttons
     $strMoveHandle = "";
     if ($strModule == "pages_content") {
         $strMoveHandle = "<i href=\"#\" class=\"moveHandle fa fa-arrows\" title=\"" . class_carrier::getInstance()->getObjLang()->getLang("pe_move", "pages") . "\" rel=\"tooltip\"></i>";
     }
     //---------------------------------------------------
     //link to set element inactive
     $strSetInactiveLink = "";
     //standard: pages_content.
     if ($strModule == "pages_content") {
         $arrConfig["pe_action_setStatus"] = "elementStatus";
         $arrConfig["pe_action_setStatus_params"] = "&systemid=" . $strSystemid;
     }
     //Use Module-config to generate link
     if (isset($arrConfig["pe_action_setStatus"]) && $arrConfig["pe_action_setStatus"] != "") {
         $strSetInactiveUrl = class_link::getLinkAdminHref($strModule, $arrConfig["pe_action_setStatus"], $arrConfig["pe_action_setStatus_params"] . $strAdminLangParam . "&pe=1");
         $strSetInactiveLink = "<a href=\"#\" onclick=\"KAJONA.admin.portaleditor.openDialog('" . $strSetInactiveUrl . "'); return false;\">" . class_carrier::getInstance()->getObjLang()->getLang("pe_setinactive", "pages") . "</a>";
     }
     //---------------------------------------------------
     // layout generation
     $strReturn .= class_carrier::getInstance()->getObjToolkit("portal")->getPeActionToolbar($strSystemid, array($strMoveHandle, $strNewLink, $strEditLink, $strCopyLink, $strDeleteLink, $strSetInactiveLink), $strContent, $strElement);
     //reset the portal texts language
     class_carrier::getInstance()->getObjLang()->setStrTextLanguage($strPortalLanguage);
     return $strReturn;
 }
 /**
  * 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;
 }
 /**
  * Generates a delete-button. The passed element name and question is shown as a modal dialog
  * when the icon was clicked. So set the link-href-param for the final deletion, otherwise the
  * user has no more chance to delete the record!
  *
  * @param string $strElementName
  * @param string $strQuestion
  * @param string $strLinkHref
  *
  * @return string
  */
 public function listDeleteButton($strElementName, $strQuestion, $strLinkHref)
 {
     $strElementName = uniStrReplace(array('\''), array('\\\''), $strElementName);
     $strQuestion = uniStrReplace("%%element_name%%", htmlToString($strElementName, true), $strQuestion);
     //get the reload-url
     $objHistory = new class_history();
     $strParam = "";
     if (uniStrpos($strLinkHref, "javascript:") === false) {
         $strParam = "reloadUrl=" . urlencode($objHistory->getAdminHistory());
         if (uniSubstr($strLinkHref, -4) == ".php" || uniSubstr($strLinkHref, -5) == ".html") {
             $strParam = "?" . $strParam;
         } else {
             $strParam = "&" . $strParam;
         }
     }
     //create the list-button and the js code to show the dialog
     $strButton = class_link::getLinkAdminManual("href=\"#\" onclick=\"javascript:jsDialog_1.setTitle('" . class_carrier::getInstance()->getObjLang()->getLang("dialog_deleteHeader", "system") . "'); jsDialog_1.setContent('" . $strQuestion . "', '" . class_carrier::getInstance()->getObjLang()->getLang("dialog_deleteButton", "system") . "',  '" . $strLinkHref . $strParam . "'); jsDialog_1.init(); return false;\"", "", class_carrier::getInstance()->getObjLang()->getLang("commons_delete", "system"), "icon_delete");
     return $this->listButton($strButton);
 }