/**
  * This method is called, when the widget should generate it's content.
  * Return the complete content using the methods provided by the base class.
  * Do NOT use the toolkit right here!
  *
  * @return string
  */
 public function getWidgetOutput()
 {
     $strReturn = "";
     if (!class_module_system_module::getModuleByName("packagemanager")->rightEdit()) {
         return $this->getLang("commons_error_permissions");
     }
     $objManager = new class_module_packagemanager_manager();
     $arrRemotePackages = $objManager->scanForUpdates();
     $strSystemVersion = "n.a.";
     if (isset($arrRemotePackages["system"])) {
         $strSystemVersion = $arrRemotePackages["system"];
     }
     $arrUpdates = array();
     $arrLocalPackages = $objManager->getAvailablePackages();
     foreach ($arrLocalPackages as $objOneMetadata) {
         if (isset($arrRemotePackages[$objOneMetadata->getStrTitle()])) {
             if ($arrRemotePackages[$objOneMetadata->getStrTitle()] != null && version_compare($arrRemotePackages[$objOneMetadata->getStrTitle()], $objOneMetadata->getStrVersion(), ">")) {
                 $arrUpdates[$objOneMetadata->getStrTitle()] = $arrRemotePackages[$objOneMetadata->getStrTitle()];
             }
         }
     }
     $strReturn .= $this->widgetText($this->getLang("sysinfo_kajona_version") . " " . class_module_system_module::getModuleByName("system")->getStrVersion());
     $strReturn .= $this->widgetText($this->getLang("sysinfo_kajona_versionAvail") . " " . $strSystemVersion);
     $strReturn .= $this->widgetSeparator();
     if (count($arrUpdates) > 0) {
         $strReturn .= $this->widgetText($this->getLang("updatecheck_versionAvail"));
     }
     foreach ($arrUpdates as $strPackage => $intVersion) {
         $strReturn .= $this->widgetText(class_link::getLinkAdmin("packagemanager", "list", "&packagelist_filter=" . $strPackage . "&doFilter=1", $strPackage . " (" . $intVersion . ")"));
     }
     return $strReturn;
 }
 /**
  * @return string
  * @autoTestable
  * @permissions view
  */
 protected function actionBrowserChooser()
 {
     $strReturn = "";
     if ($this->getParam("CKEditorFuncNum") != "") {
         $strReturn .= "<script type=\"text/javascript\">window.opener.KAJONA.admin.folderview.selectCallbackCKEditorFuncNum = " . (int) $this->getParam("CKEditorFuncNum") . ";</script>";
     }
     $intCounter = 1;
     $strReturn .= $this->objToolkit->listHeader();
     if (class_module_system_module::getModuleByName("pages") !== null) {
         $strAction = $this->objToolkit->listButton(class_link::getLinkAdmin("pages", "pagesFolderBrowser", "&pages=1&form_element=" . $this->getParam("form_element") . "&bit_link=1", $this->getLang("wysiwygPagesBrowser"), $this->getLang("wysiwygPagesBrowser"), "icon_folderActionOpen"));
         $strReturn .= $this->objToolkit->genericAdminList(generateSystemid(), $this->getLang("wysiwygPagesBrowser"), "", $strAction, $intCounter++);
     }
     $strRepoId = class_module_system_setting::getConfigValue("_mediamanager_default_filesrepoid_");
     if (validateSystemid($strRepoId) && class_module_system_module::getModuleByName("mediamanager") !== null && class_objectfactory::getInstance()->getObject($strRepoId) !== null) {
         $strAction = $this->objToolkit->listButton(class_link::getLinkAdmin("mediamanager", "folderContentFolderviewMode", "&systemid=" . $strRepoId . "&form_element=" . $this->getParam("form_element") . "&bit_link=1", $this->getLang("wysiwygFilesBrowser"), $this->getLang("wysiwygFilesBrowser"), "icon_folderActionOpen"));
         $strReturn .= $this->objToolkit->genericAdminList(generateSystemid(), $this->getLang("wysiwygFilesBrowser"), "", $strAction, $intCounter++);
     }
     $strRepoId = class_module_system_setting::getConfigValue("_mediamanager_default_imagesrepoid_");
     if (validateSystemid($strRepoId) && class_module_system_module::getModuleByName("mediamanager") !== null && class_objectfactory::getInstance()->getObject($strRepoId) !== null) {
         $strAction = $this->objToolkit->listButton(class_link::getLinkAdmin("mediamanager", "folderContentFolderviewMode", "&systemid=" . $strRepoId . "&form_element=" . $this->getParam("form_element") . "&bit_link=1", $this->getLang("wysiwygImagesBrowser"), $this->getLang("wysiwygImagesBrowser"), "icon_folderActionOpen"));
         $strReturn .= $this->objToolkit->genericAdminList(generateSystemid(), $this->getLang("wysiwygImagesBrowser"), "", $strAction, $intCounter++);
     }
     if (class_module_system_module::getModuleByName("mediamanager") !== null) {
         $strAction = $this->objToolkit->listButton(class_link::getLinkAdmin("mediamanager", "folderContentFolderviewMode", "&form_element=" . $this->getParam("form_element") . "&bit_link=1", $this->getLang("wysiwygRepoBrowser"), $this->getLang("wysiwygRepoBrowser"), "icon_folderActionOpen"));
         $strReturn .= $this->objToolkit->genericAdminList(generateSystemid(), $this->getLang("wysiwygRepoBrowser"), "", $strAction, $intCounter++);
     }
     $strReturn .= $this->objToolkit->listFooter();
     return $strReturn;
 }
 /**
  * This method is called, when the widget should generate it's content.
  * Return the complete content using the methods provided by the base class.
  * Do NOT use the toolkit right here!
  *
  * @return string
  */
 public function getWidgetOutput()
 {
     $strReturn = "";
     if (!class_module_system_module::getModuleByName("pages")->rightView()) {
         return $this->getLang("commons_error_permissions");
     }
     $intMax = $this->getFieldValue("nrofrows");
     if ($intMax < 0) {
         $intMax = 1;
     }
     /** @var class_module_pages_page[] $arrRecords */
     $arrRecords = class_module_system_common::getLastModifiedRecords($intMax, false, "class_module_pages_page");
     foreach ($arrRecords as $objPage) {
         if ($objPage->rightEdit()) {
             $strReturn .= $this->widgetText(class_link::getLinkAdmin("pages_content", "list", "&systemid=" . $objPage->getSystemid(), $objPage->getStrDisplayName()));
         } else {
             $strReturn .= $this->widgetText($objPage->getStrDisplayName());
         }
         $strReturn .= $this->widgetText("&nbsp; &nbsp; " . timeToString($objPage->getIntLmTime()) . "");
     }
     return $strReturn;
 }
 /**
  * @param class_model $objListEntry
  *
  * @return array
  */
 protected function renderAdditionalActions(class_model $objListEntry)
 {
     if ($objListEntry instanceof class_module_workflows_handler) {
         return array($this->objToolkit->listButton(class_link::getLinkAdmin($this->getArrModule("modul"), "instantiateHandler", "&systemid=" . $objListEntry->getSystemid(), "", $this->getLang("action_instantiate_handler"), "icon_workflowTrigger")));
     }
     if ($objListEntry instanceof class_module_workflows_workflow) {
         $arrReturn = array();
         if ($objListEntry->getIntState() == class_module_workflows_workflow::$INT_STATE_SCHEDULED && $objListEntry->getObjWorkflowHandler()->providesUserInterface()) {
             $arrReturn[] = $this->objToolkit->listButton(class_link::getLinkAdmin($this->getArrModule("modul"), "showUI", "&systemid=" . $objListEntry->getSystemid(), "", $this->getLang("workflow_ui"), "icon_workflow_ui"));
         }
         if ($objListEntry->rightEdit()) {
             $arrReturn[] = $this->objToolkit->listButton(class_link::getLinkAdmin($this->getArrModule("modul"), "showDetails", "&systemid=" . $objListEntry->getSystemid(), "", $this->getLang("action_show_details"), "icon_lens"));
         }
         return $arrReturn;
     }
     return parent::renderAdditionalActions($objListEntry);
 }
 /**
  * Helper to generate a small path-navigation
  *
  * @return array
  */
 protected function getArrOutputNaviEntries()
 {
     $arrPath = $this->getPathArray();
     $arrPathLinks = parent::getArrOutputNaviEntries();
     array_pop($arrPathLinks);
     $arrPathLinks[] = class_link::getLinkAdmin("pages", "list", "&unlockid=" . $this->getSystemid(), $this->getLang("modul_titel", "pages"));
     foreach ($arrPath as $strOneSystemid) {
         /** @var $objObject class_module_pages_folder|class_module_pages_page */
         $objObject = class_objectfactory::getInstance()->getObject($strOneSystemid);
         //Skip Elements: No sense to show in path-navigation
         if ($objObject == null || $objObject->getIntModuleNr() == _pages_content_modul_id_) {
             continue;
         }
         if ($objObject instanceof class_module_pages_folder) {
             $arrPathLinks[] = class_link::getLinkAdmin("pages", "list", "&systemid=" . $strOneSystemid . "&unlockid=" . $this->getSystemid(), $objObject->getStrName());
         }
         if ($objObject instanceof class_module_pages_page) {
             $arrPathLinks[] = class_link::getLinkAdmin("pages", "list", "&systemid=" . $strOneSystemid . "&unlockid=" . $this->getSystemid(), $objObject->getStrBrowsername());
         }
     }
     return $arrPathLinks;
 }
 /**
  * Generates a path-navigation
  *
  * @return array
  */
 protected function getArrOutputNaviEntries()
 {
     $arrEntries = class_admin_controller::getArrOutputNaviEntries();
     $arrPath = $this->getPathArray();
     array_shift($arrPath);
     foreach ($arrPath as $strOneSystemid) {
         $objPoint = class_objectfactory::getInstance()->getObject($strOneSystemid);
         $arrEntries[] = class_link::getLinkAdmin($this->getArrModule("modul"), "openFolder", "&systemid=" . $strOneSystemid, $objPoint->getStrDisplayName());
     }
     return $arrEntries;
 }
Ejemplo n.º 7
0
/**
 * Generates a link for the admin-area
 *
 * @deprecated
 *
 * @param string $strModule
 * @param string $strAction
 * @param string $strParams
 * @param string $strText
 * @param string $strAlt
 * @param string $strImage
 * @param bool $bitTooltip
 * @param string $strCss
 *
 * @return string
 */
function getLinkAdmin($strModule, $strAction, $strParams = "", $strText = "", $strAlt = "", $strImage = "", $bitTooltip = true, $strCss = "")
{
    return class_link::getLinkAdmin($strModule, $strAction, $strParams, $strText, $strAlt, $strImage, $bitTooltip, $strCss);
}
 /**
  * @param string $strListIdentifier
  * @param bool $bitDialog
  *
  * @return array
  */
 protected function getNewEntryAction($strListIdentifier, $bitDialog = false)
 {
     $arrReturn = array();
     if ($this->getObjModule()->rightEdit()) {
         $arrReturn[] = $this->objToolkit->listButton(class_link::getLinkAdminDialog($this->getArrModule("modul"), "addPackage", "&systemid=", $this->getLang("action_upload_package"), $this->getLang("action_upload_package"), "icon_upload", $this->getLang("action_upload_package")));
         $arrReturn[] = $this->objToolkit->listButton(class_link::getLinkAdmin($this->getArrModule("modul"), "new", "", $this->getLang("action_new_copy"), $this->getLang("action_new_copy"), "icon_new"));
     }
     return $arrReturn;
 }
 /**
  * @param class_model $objListEntry
  *
  * @return array
  */
 protected function renderAdditionalActions(class_model $objListEntry)
 {
     if ($objListEntry instanceof class_module_search_search) {
         return array($this->objToolkit->listButton(class_link::getLinkAdmin($this->getArrModule("modul"), "search", "&systemid=" . $objListEntry->getSystemid(), $this->getLang("action_execute_search"), $this->getLang("action_execute_search"), "icon_lens")));
     } else {
         return array();
     }
 }
 /**
  * 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"] .= "&nbsp;";
         $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"] .= "&nbsp;";
         $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("&amp;", "&", class_link::getLinkAdminHref("folderview", "browserChooser", "&form_element=ckeditor")) . "',\n                            filebrowserImageBrowseUrl : '" . uniStrReplace("&amp;", "&", 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("&amp;", "&", class_link::getLinkAdminHref("folderview", "browserChooser", "&form_element=ckeditor")) . "',\n                            filebrowserImageBrowseUrl : '" . uniStrReplace("&amp;", "&", 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;
 }
Ejemplo n.º 12
0
 /**
  * The v4 way of generating a backend-navigation.
  *
  * @param string $strCurrentModule
  *
  * @return string
  */
 public function getAdminSitemap($strCurrentModule = "")
 {
     $strWrapperID = $this->objTemplate->readTemplate("/elements.tpl", "sitemap_wrapper");
     $strModuleID = $this->objTemplate->readTemplate("/elements.tpl", "sitemap_module_wrapper");
     $strModuleActiveID = $this->objTemplate->readTemplate("/elements.tpl", "sitemap_module_wrapper_active");
     $strActionID = $this->objTemplate->readTemplate("/elements.tpl", "sitemap_action_entry");
     $strDividerID = $this->objTemplate->readTemplate("/elements.tpl", "sitemap_divider_entry");
     $strModules = "";
     if ($strCurrentModule == "elemente") {
         $strCurrentModule = "pages";
     }
     $arrModules = class_module_system_module::getModulesInNaviAsArray(class_module_system_aspect::getCurrentAspectId());
     /** @var $arrNaviInstances class_module_system_module[] */
     $arrNaviInstances = array();
     foreach ($arrModules as $arrModule) {
         $objModule = class_module_system_module::getModuleBySystemid($arrModule["module_id"]);
         if ($objModule->rightView()) {
             $arrNaviInstances[] = $objModule;
         }
     }
     foreach ($arrNaviInstances as $objOneInstance) {
         $arrActions = class_admin_helper::getModuleActionNaviHelper($objOneInstance);
         $strActions = "";
         foreach ($arrActions as $strOneAction) {
             if (trim($strOneAction) != "") {
                 $arrActionEntries = array("action" => $strOneAction);
                 $strActions .= $this->objTemplate->fillTemplate($arrActionEntries, $strActionID);
             } else {
                 $strActions .= $this->objTemplate->fillTemplate(array(), $strDividerID);
             }
         }
         $arrModuleLevel = array("module" => class_link::getLinkAdmin($objOneInstance->getStrName(), "", "", class_carrier::getInstance()->getObjLang()->getLang("modul_titel", $objOneInstance->getStrName())), "actions" => $strActions, "systemid" => $objOneInstance->getSystemid(), "moduleTitle" => $objOneInstance->getStrName(), "moduleName" => class_carrier::getInstance()->getObjLang()->getLang("modul_titel", $objOneInstance->getStrName()), "moduleHref" => class_link::getLinkAdminHref($objOneInstance->getStrName(), ""));
         if ($strCurrentModule == $objOneInstance->getStrName()) {
             $strModules .= $this->objTemplate->fillTemplate($arrModuleLevel, $strModuleActiveID);
         } else {
             $strModules .= $this->objTemplate->fillTemplate($arrModuleLevel, $strModuleID);
         }
     }
     return $this->objTemplate->fillTemplate(array("level" => $strModules), $strWrapperID);
 }
Ejemplo n.º 13
0
 /**
  * Returns a list of folders in the pages-database
  *
  * @return String
  * @permissions view
  * @autoTestable
  */
 protected function actionPagesFolderBrowser()
 {
     $strReturn = "";
     $intCounter = 1;
     $this->setArrModuleEntry("template", "/folderview.tpl");
     if ($this->getParam("CKEditorFuncNum") != "") {
         $strReturn .= "<script type=\"text/javascript\">window.opener.KAJONA.admin.folderview.selectCallbackCKEditorFuncNum = " . (int) $this->getParam("CKEditorFuncNum") . ";</script>";
     }
     //param init
     $bitPages = $this->getParam("pages") != "" ? true : false;
     $bitPageAliases = $this->getParam("pagealiases") != "" ? true : false;
     $bitPageelements = $this->getParam("elements") == "false" ? false : true;
     $bitFolder = $this->getParam("folder") != "" ? true : false;
     $strSystemid = $this->getSystemid() != "" ? $this->getSystemid() : class_module_system_module::getModuleByName("pages")->getSystemid();
     $strElement = $this->getParam("form_element") != "" ? $this->getParam("form_element") : "ordner_name";
     $strPageid = $this->getParam("pageid") != "" ? $this->getParam("pageid") : "0";
     $strLinkAddon = "" . ($bitPages ? "&pages=1" : "") . ($bitFolder ? "&folder=1" : "") . ($this->getParam("bit_link") != "" ? "&bit_link=1" : "") . (!$bitPageelements ? "&elements=false" : "") . ($bitPageAliases ? "&pagealiases=1" : "");
     $arrFolder = class_module_pages_folder::getFolderList($strSystemid);
     $objFolder = new class_module_pages_folder($strSystemid);
     $strLevelUp = "";
     if (validateSystemid($strSystemid) && $strSystemid != $this->getObjModule()->getSystemid()) {
         $strLevelUp = $objFolder->getPrevId();
     }
     //but: when browsing pages the current level should be kept
     if ($strPageid != "0") {
         $strLevelUp = $strSystemid;
     }
     $strReturn .= $this->objToolkit->formHeader("");
     $strAction = $this->objToolkit->listButton("<a href=\"#\" title=\"" . $this->getLang("select_page") . "\" rel=\"tooltip\" onclick=\"KAJONA.admin.folderview.selectCallback([['" . $strElement . "', '" . _indexpath_ . "?page='+\$('#quickselect').val()]]);\">" . class_adminskin_helper::getAdminImage("icon_accept") . "</a>");
     $strReturn .= $this->objToolkit->formInputPageSelector("quickselect", $this->getLang("folderview_quickselect"), "", "", false, false, $strAction);
     $strReturn .= $this->objToolkit->formClose(false);
     $strReturn .= $this->objToolkit->listHeader();
     //Folder to jump one level up
     if (!$bitPages || $strLevelUp != "" || $bitFolder) {
         $strAction = $this->objToolkit->listButton($strSystemid != "0" && $strLevelUp != "" || $strPageid != "0" ? class_link::getLinkAdmin($this->getArrModule("modul"), "pagesFolderBrowser", "&systemid=" . $strLevelUp . $strLinkAddon . "&form_element=" . $strElement . ($this->getParam("bit_link") != "" ? "&bit_link=1" : ""), $this->getLang("commons_one_level_up"), $this->getLang("commons_one_level_up"), "icon_folderActionLevelup") : " ");
         if ($strSystemid == $this->getObjModule()->getSystemid() && (!$bitPages || $bitFolder)) {
             $strAction .= $this->objToolkit->listButton("<a href=\"#\" title=\"" . $this->getLang("commons_accept") . "\" rel=\"tooltip\" onclick=\"KAJONA.admin.folderview.selectCallback([['" . $strElement . "_id', '" . $this->getObjModule()->getSystemid() . "'], ['" . $strElement . "', '']]);\">" . class_adminskin_helper::getAdminImage("icon_accept"));
         }
         $strReturn .= $this->objToolkit->genericAdminList(generateSystemid(), "..", getImageAdmin("icon_folderOpen"), $strAction, $intCounter++);
     }
     if (count($arrFolder) > 0 && $strPageid == "0") {
         foreach ($arrFolder as $objSingleFolder) {
             if ($bitPages && !$bitFolder) {
                 $strAction = $this->objToolkit->listButton(class_link::getLinkAdmin($this->getArrModule("modul"), "pagesFolderBrowser", "&systemid=" . $objSingleFolder->getSystemid() . "&form_element=" . $strElement . $strLinkAddon, $this->getLang("pages_ordner_oeffnen"), $this->getLang("pages_ordner_oeffnen"), "icon_folderActionOpen"));
                 $strReturn .= $this->objToolkit->simpleAdminList($objSingleFolder, $strAction, $intCounter++);
             } else {
                 $strAction = $this->objToolkit->listButton(class_link::getLinkAdmin($this->getArrModule("modul"), "pagesFolderBrowser", "&systemid=" . $objSingleFolder->getSystemid() . "&form_element=" . $strElement . $strLinkAddon, $this->getLang("pages_ordner_oeffnen"), $this->getLang("pages_ordner_oeffnen"), "icon_folderActionOpen"));
                 $strAction .= $this->objToolkit->listButton("<a href=\"#\" title=\"" . $this->getLang("commons_accept") . "\" rel=\"tooltip\" onclick=\"KAJONA.admin.folderview.selectCallback([['" . $strElement . "_id', '" . $objSingleFolder->getSystemid() . "'], ['" . $strElement . "', '" . $objSingleFolder->getStrName() . "']]); \">" . class_adminskin_helper::getAdminImage("icon_accept"));
                 $strReturn .= $this->objToolkit->simpleAdminList($objSingleFolder, $strAction, $intCounter++);
             }
         }
     }
     $strReturn .= $this->objToolkit->listFooter();
     //Pages could be sent too
     if ($bitPages && $strPageid == "0") {
         $arrPages = class_module_pages_folder::getPagesInFolder($strSystemid);
         if (count($arrPages) > 0) {
             $strReturn .= $this->objToolkit->listHeader();
             /** @var $objSinglePage class_module_pages_page */
             foreach ($arrPages as $objSinglePage) {
                 $arrSinglePage = array();
                 //Should we generate a link ?
                 if ($this->getParam("bit_link") != "") {
                     $arrSinglePage["name2"] = class_link::getLinkPortalHref($objSinglePage->getStrName(), "", "", "", "", $this->getLanguageToWorkOn());
                 } else {
                     $arrSinglePage["name2"] = $objSinglePage->getStrName();
                 }
                 if ($objSinglePage->getIntType() == class_module_pages_page::$INT_TYPE_ALIAS) {
                     if (count(class_module_pages_folder::getPagesInFolder($objSinglePage->getSystemid())) == 0) {
                         $strAction = getImageAdmin("icon_treeBranchOpenDisabled");
                     } else {
                         $strAction = $this->objToolkit->listButton(class_link::getLinkAdmin($this->getArrModule("modul"), "pagesFolderBrowser", "&systemid=" . $objSinglePage->getSystemid() . "&form_element=" . $strElement . $strLinkAddon, $this->getLang("page_sublist"), $this->getLang("page_sublist"), "icon_treeBranchOpen"));
                     }
                     if ($bitPageAliases) {
                         $strAction .= $this->objToolkit->listButton("<a href=\"#\" title=\"" . $this->getLang("select_page") . "\" rel=\"tooltip\" onclick=\"KAJONA.admin.folderview.selectCallback([['" . $strElement . "_id', '" . $objSinglePage->getSystemid() . "'],['" . $strElement . "', '" . $arrSinglePage["name2"] . "']]);\">" . class_adminskin_helper::getAdminImage("icon_accept") . "</a>");
                     }
                     $strReturn .= $this->objToolkit->simpleAdminList($objSinglePage, $strAction, $intCounter++);
                 } else {
                     if (count(class_module_pages_folder::getPagesInFolder($objSinglePage->getSystemid())) == 0) {
                         $strAction = getImageAdmin("icon_treeBranchOpenDisabled");
                     } else {
                         $strAction = $this->objToolkit->listButton(class_link::getLinkAdmin($this->getArrModule("modul"), "pagesFolderBrowser", "&systemid=" . $objSinglePage->getSystemid() . "&form_element=" . $strElement . $strLinkAddon, $this->getLang("page_sublist"), $this->getLang("page_sublist"), "icon_treeBranchOpen"));
                     }
                     if ($bitPageelements) {
                         $strAction .= $this->objToolkit->listButton(class_link::getLinkAdmin($this->getArrModule("modul"), "pagesFolderBrowser", "&systemid=" . $strSystemid . "&form_element=" . $strElement . "&pageid=" . $objSinglePage->getSystemid() . ($this->getParam("bit_link") != "" ? "&bit_link=1" : "") . ($bitPages ? "&pages=1" : "") . ($bitPageAliases ? "&pagealiases=1" : ""), $this->getLang("seite_oeffnen"), $this->getLang("seite_oeffnen"), "icon_folderActionOpen"));
                     }
                     $strAction .= $this->objToolkit->listButton("<a href=\"#\" title=\"" . $this->getLang("select_page") . "\" rel=\"tooltip\" onclick=\"KAJONA.admin.folderview.selectCallback([['" . $strElement . "_id', '" . $objSinglePage->getSystemid() . "'],['" . $strElement . "', '" . $arrSinglePage["name2"] . "']]);\">" . class_adminskin_helper::getAdminImage("icon_accept") . "</a>");
                     $strReturn .= $this->objToolkit->simpleAdminList($objSinglePage, $strAction, $intCounter++);
                 }
             }
             $strReturn .= $this->objToolkit->listFooter();
         }
     }
     //Load the list of pagelements available on the page
     if ($strPageid != "0") {
         $strReturn .= $this->objToolkit->divider();
         $arrPageelements = class_module_pages_pageelement::getElementsOnPage($strPageid, true, $this->getLanguageToWorkOn());
         $objPage = new class_module_pages_page($strPageid);
         if (count($arrPageelements) > 0) {
             $strReturn .= $this->objToolkit->listHeader();
             /** @var class_module_pages_pageelement $objOnePageelement */
             foreach ($arrPageelements as $objOnePageelement) {
                 $arrSinglePage = array();
                 //Should we generate a link ?
                 if ($this->getParam("bit_link") != "") {
                     $arrSinglePage["name2"] = class_link::getLinkPortalHref($objPage->getStrName(), "", "", "", "", $this->getLanguageToWorkOn()) . "#" . $objOnePageelement->getSystemid();
                 } else {
                     $arrSinglePage["name2"] = $objPage->getStrName() . "#" . $objOnePageelement->getSystemid();
                 }
                 $strAction = $this->objToolkit->listButton("<a href=\"#\" title=\"" . $this->getLang("seite_uebernehmen") . "\" rel=\"tooltip\" onclick=\"KAJONA.admin.folderview.selectCallback([['" . $strElement . "', '" . $arrSinglePage["name2"] . "']]);\">" . class_adminskin_helper::getAdminImage("icon_accept") . "</a>");
                 $strReturn .= $this->objToolkit->simpleAdminList($objOnePageelement, $strAction, $intCounter++);
             }
             $strReturn .= $this->objToolkit->listFooter();
         }
     }
     return $strReturn;
 }
Ejemplo n.º 14
0
 /**
  * @see interface_calendarsource_admin::getArrCalendarEntries()
  */
 public function getArrCalendarEntries(class_date $objStartDate, class_date $objEndDate)
 {
     $arrEntries = array();
     if ($this->objSession->getSession(self::STR_CALENDAR_FILTER_NEWS) != "disabled") {
         $arrNews = class_module_news_news::getObjectList("", null, null, $objStartDate, $objEndDate);
         foreach ($arrNews as $objOneNews) {
             $objEntry = new class_calendarentry();
             $objEntry->setStrClass("calendarEvent calendarNews");
             $strAlt = $this->getLang("calendar_type_news");
             $strTitle = $objOneNews->getStrTitle();
             if (uniStrlen($strTitle) > 15) {
                 $strAlt = $strTitle . "<br />" . $strAlt;
                 $strTitle = uniStrTrim($strTitle, 14);
             }
             $strName = class_link::getLinkAdmin($this->getArrModule("modul"), "edit", "&systemid=" . $objOneNews->getSystemid(), $strTitle, $strAlt);
             $objEntry->setStrName($strName);
             $arrEntries[] = $objEntry;
         }
     }
     return $arrEntries;
 }
Ejemplo n.º 15
0
 /**
  * Creates a browser-like view of the users available
  *
  * @return string
  */
 protected function actionUserBrowser()
 {
     $this->setArrModuleEntry("template", "/folderview.tpl");
     $strReturn = "";
     $strFormElement = $this->getParam("form_element");
     if ($this->getSystemid() == "") {
         //show groups
         $arrUsers = class_module_user_group::getObjectList();
         $strReturn .= $this->objToolkit->listHeader();
         $intI = 0;
         foreach ($arrUsers as $objSingleGroup) {
             $strAction = "";
             $strAction .= $this->objToolkit->listButton(class_link::getLinkAdmin("user", "userBrowser", "&form_element=" . $this->getParam("form_element") . "&systemid=" . $objSingleGroup->getSystemid() . "&filter=" . $this->getParam("filter") . "&checkid=" . $this->getParam("checkid"), $this->getLang("user_browser_show"), $this->getLang("user_browser_show"), "icon_folderActionOpen"));
             if ($this->getParam("allowGroup") == "1") {
                 $strAction .= $this->objToolkit->listButton("<a href=\"#\" title=\"" . $this->getLang("group_accept") . "\" rel=\"tooltip\" onclick=\"KAJONA.admin.folderview.selectCallback([['" . strFormElement . "', '" . addslashes($objSingleGroup->getStrName()) . "'], ['" . $strFormElement . "_id', '" . $objSingleGroup->getSystemid() . "']]);\">" . getImageAdmin("icon_accept"));
             }
             $strReturn .= $this->objToolkit->simpleAdminList($objSingleGroup, $strAction, $intI++);
         }
     } else {
         //show members of group
         $objGroup = new class_module_user_group($this->getSystemid());
         $arrUsers = $objGroup->getObjSourceGroup()->getUserIdsForGroup();
         $strReturn .= $this->objToolkit->listHeader();
         $intI = 0;
         $strReturn .= $this->objToolkit->genericAdminList(generateSystemid(), "", "", $this->objToolkit->listButton(class_link::getLinkAdmin($this->getArrModule("modul"), "userBrowser", "&form_element=" . $this->getParam("form_element") . "&filter=" . $this->getParam("filter") . "&allowGroup=" . $this->getParam("allowGroup") . "&checkid=" . $this->getParam("checkid"), $this->getLang("user_list_parent"), $this->getLang("user_list_parent"), "icon_folderActionLevelup")), $intI++);
         $strCheckId = $this->getParam("checkid");
         $arrCheckIds = json_decode($strCheckId);
         foreach ($arrUsers as $strSingleUser) {
             $objSingleUser = new class_module_user_user($strSingleUser);
             $bitRenderAcceptLink = true;
             if (!empty($arrCheckIds) && is_array($arrCheckIds)) {
                 foreach ($arrCheckIds as $strCheckId) {
                     if (!$this->hasUserViewPermissions($strCheckId, $objSingleUser)) {
                         $bitRenderAcceptLink = false;
                         break;
                     }
                 }
             }
             $strAction = "";
             if (!$bitRenderAcceptLink || $objSingleUser->getIntActive() == 0 || $this->getParam("filter") == "current" && $objSingleUser->getSystemid() == $this->objSession->getUserID()) {
                 $strAction .= $this->objToolkit->listButton(getImageAdmin("icon_acceptDisabled"));
             } else {
                 $strAction .= $this->objToolkit->listButton("<a href=\"#\" title=\"" . $this->getLang("user_accept") . "\" rel=\"tooltip\" onclick=\"KAJONA.admin.folderview.selectCallback([['" . $strFormElement . "', '" . addslashes($objSingleUser->getStrUsername()) . "'], ['" . $strFormElement . "_id', '" . $objSingleUser->getSystemid() . "']]);\">" . getImageAdmin("icon_accept"));
             }
             $strReturn .= $this->objToolkit->simpleAdminList($objSingleUser, $strAction, $intI++);
         }
     }
     return $strReturn;
 }
 public function getValueAsText()
 {
     $objSourceObject = $this->getObjSourceObject();
     if ($objSourceObject == null) {
         return "";
     }
     if (!empty($this->arrKeyValues)) {
         $strHtml = "";
         foreach ($this->arrKeyValues as $objObject) {
             if ($objObject instanceof interface_model && $objObject->rightView()) {
                 $strTitle = self::getDisplayName($objObject);
                 //see, if the matching target-module provides a showSummary method
                 $objModule = class_module_system_module::getModuleByName($objObject->getArrModule("modul"));
                 if ($objModule != null) {
                     $objAdmin = $objModule->getAdminInstanceOfConcreteModule($objObject->getSystemid());
                     if ($objAdmin !== null && method_exists($objAdmin, "actionShowSummary")) {
                         $strTitle = class_link::getLinkAdmin($objObject->getArrModule("modul"), "showSummary", "&systemid=" . $objObject->getSystemid(), $strTitle);
                     }
                 }
                 $strHtml .= $strTitle . "<br/>\n";
             } else {
                 throw new class_exception("Array must contain objects", class_exception::$level_ERROR);
             }
         }
         $strHtml .= "";
         return $strHtml;
     }
     return "-";
 }
Ejemplo n.º 17
0
 /**
  * Renders the "always present" module permissions entry for each module (takes the currents' user permissions into
  * account).
  * If you don't want this default behaviour, overwrite this method.
  * @return array
  */
 public function getModuleRightNaviEntry()
 {
     $arrLinks = array();
     $arrLinks[] = array("", "");
     $arrLinks[] = array("right", class_link::getLinkAdmin("right", "change", "&changemodule=" . $this->getArrModule("modul"), $this->getLang("commons_module_permissions")));
     return $arrLinks;
 }
 /**
  * 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;
 }
 public function getOutputModuleNavi()
 {
     $arrReturn = array();
     $arrReturn[] = array("view", class_link::getLinkAdmin($this->getArrModule("modul"), "list", "", $this->getLang("commons_list"), "", "", true, "adminnavi"));
     return $arrReturn;
 }
Ejemplo n.º 20
0
 /**
  * Renders the action to add a new record to the end of the list.
  * Make sure you have the lang-key "module_action_new" in the modules' lang-file.
  * If you overwrite this method, you can either return a string containing the new-link or an array if you want to
  * provide multiple new-action.
  *
  * @param string $strListIdentifier an internal identifier to check the current parent-list
  * @param bool $bitDialog opens the linked pages in a dialog
  *
  * @return string|array
  */
 protected function getNewEntryAction($strListIdentifier, $bitDialog = false)
 {
     $objObject = null;
     if (validateSystemid($this->getSystemid())) {
         $objObject = class_objectfactory::getInstance()->getObject($this->getSystemid());
     }
     if ($objObject == null) {
         $objObject = $this->getObjModule();
     }
     if ($objObject->rightEdit()) {
         if ($bitDialog) {
             return $this->objToolkit->listButton(class_link::getLinkAdminDialog($this->getArrModule("modul"), $this->getActionNameForClass("new", null), "&folderview=1&systemid=" . $this->getSystemid() . $this->strPeAddon, $this->getLang("commons_list_new"), $this->getLang("commons_list_new"), "icon_new"));
         } else {
             return $this->objToolkit->listButton(class_link::getLinkAdmin($this->getArrModule("modul"), $this->getActionNameForClass("new", null), "&systemid=" . $this->getSystemid() . $this->strPeAddon, $this->getLang("commons_list_new"), $this->getLang("commons_list_new"), "icon_new"));
         }
     }
     return "";
 }
 /**
  * @param class_model $objListEntry
  * @param bool $bitDialog
  *
  * @return string
  */
 protected function renderEditAction(class_model $objListEntry, $bitDialog = false)
 {
     if ($objListEntry->rightView()) {
         return $this->objToolkit->listButton(class_link::getLinkAdmin($objListEntry->getArrModule("modul"), "edit", "&systemid=" . $objListEntry->getSystemid(), $this->getLang("action_edit"), $this->getLang("action_edit"), "icon_lens"));
     }
     return "";
 }
Ejemplo n.º 22
0
 protected function getOutputNaviEntry(interface_model $objInstance)
 {
     if ($objInstance instanceof class_module_tags_tag) {
         return class_link::getLinkAdmin($this->getArrModule("modul"), "showAssignedRecords", "&systemid=" . $objInstance->getSystemid(), $objInstance->getStrName());
     }
     return null;
 }
Ejemplo n.º 23
0
 protected function getOutputNaviEntry(interface_model $objInstance)
 {
     return class_link::getLinkAdmin($this->getArrModule("modul"), "edit", "&systemid=" . $objInstance->getSystemid(), $objInstance->getStrDisplayName());
 }
 /**
  * Helper to generate a small path-navigation
  *
  * @return array
  */
 protected function getArrOutputNaviEntries()
 {
     $arrEntries = parent::getArrOutputNaviEntries();
     $arrPath = $this->getPathArray();
     foreach ($arrPath as $strOneSystemid) {
         $objPoint = new class_module_navigation_point($strOneSystemid);
         $arrEntries[] = class_link::getLinkAdmin("navigation", "list", "&systemid=" . $strOneSystemid, $objPoint->getStrName(), $objPoint->getStrName());
     }
     return $arrEntries;
 }
    /**
     * Creates a calendar-based view of the current month.
     * Single objects may register themselves to be rendered within the calendar.
     * The calendar-view consists of a view single elements:
     * +---------------------------+
     * | control-elements (pager)  |
     * +---------------------------+
     * | wrapper                   |
     * +---------------------------+
     * | the column headers        |
     * +---------------------------+
     * | a row for each week (4x)  |
     * +---------------------------+
     * | wrapper                   |
     * +---------------------------+
     * | legend                    |
     * +---------------------------+
     *
     * The calendar internally is loaded via ajax since fetching all events
     * may take some time.
     *
     * @return string
     * @since 3.4
     * @autoTestable
     * @permissions view
     */
    protected function actionCalendar()
    {
        $strReturn = "";
        //save dates to session
        if ($this->getParam("month") != "") {
            $this->objSession->setSession($this->strStartMonthKey, $this->getParam("month"));
        }
        if ($this->getParam("year") != "") {
            $this->objSession->setSession($this->strStartYearKey, $this->getParam("year"));
        }
        $strContainerId = generateSystemid();
        $strContent = "<script type=\"text/javascript\">";
        $strContent .= <<<JS
            \$(document).ready(function() {
                  KAJONA.admin.ajax.genericAjaxCall("dashboard", "renderCalendar", "{$strContainerId}", function(data, status, jqXHR) {
                    if(status == 'success') {
                        var intStart = data.indexOf("[CDATA[")+7;
                        \$("#{$strContainerId}").html(data.substr(
                          intStart, data.indexOf("]]")-intStart
                        ));
                        if(data.indexOf("[CDATA[") < 0) {
                            var intStart = data.indexOf("<error>")+7;
                            \$("#{$strContainerId}").html(o.responseText.substr(
                              intStart, data.indexOf("</error>")-intStart
                            ));
                        }
                        KAJONA.util.evalScript(data);
                        KAJONA.admin.tooltip.initTooltip();
                    }
                    else {
                        KAJONA.admin.statusDisplay.messageError("<b>Request failed!</b><br />" + data);
                    }
                  })
            });
JS;
        $strContent .= "</script>";
        //fetch modules relevant for processing
        $arrLegendEntries = array();
        $arrFilterEntries = array();
        $arrModules = class_module_system_module::getAllModules();
        foreach ($arrModules as $objSingleModule) {
            /** @var $objAdminInstance interface_calendarsource_admin|class_module_system_module */
            $objAdminInstance = $objSingleModule->getAdminInstanceOfConcreteModule();
            if ($objSingleModule->getIntRecordStatus() == 1 && $objAdminInstance instanceof interface_calendarsource_admin) {
                //TODO: switch to plugin manager
                $arrLegendEntries = array_merge($arrLegendEntries, $objAdminInstance->getArrLegendEntries());
                $arrFilterEntries = array_merge($arrFilterEntries, $objAdminInstance->getArrFilterEntries());
            }
        }
        if ($this->getParam("doCalendarFilter") != "") {
            //update filter-criteria
            foreach (array_keys($arrFilterEntries) as $strOneId) {
                if ($this->getParam($strOneId) != "") {
                    $this->objSession->sessionUnset($strOneId);
                } else {
                    $this->objSession->setSession($strOneId, "disabled");
                }
            }
        }
        //render the single rows. calculate the first day of the row
        $objDate = new class_date();
        $objDate->setIntDay(1);
        if ($this->objSession->getSession($this->strStartMonthKey) != "") {
            $objDate->setIntMonth($this->objSession->getSession($this->strStartMonthKey));
        }
        if ($this->objSession->getSession($this->strStartYearKey) != "") {
            $objDate->setIntYear($this->objSession->getSession($this->strStartYearKey));
        }
        //pager-setup
        $objEndDate = clone $objDate;
        $objEndDate->setNextMonth();
        $objEndDate->setPreviousDay();
        $strCenter = dateToString($objDate, false) . " - " . dateToString($objEndDate, false);
        $objEndDate->setNextDay();
        $objPrevDate = clone $objDate;
        $objPrevDate->setPreviousDay();
        $strPrev = class_link::getLinkAdmin($this->getArrModule("modul"), "calendar", "&month=" . $objPrevDate->getIntMonth() . "&year=" . $objPrevDate->getIntYear(), $this->getLang("calendar_prev"));
        $strNext = class_link::getLinkAdmin($this->getArrModule("modul"), "calendar", "&month=" . $objEndDate->getIntMonth() . "&year=" . $objEndDate->getIntYear(), $this->getLang("calendar_next"));
        $strReturn .= $this->objToolkit->getCalendarPager($strPrev, $strCenter, $strNext);
        $strReturn .= $strContent;
        $strReturn .= $this->objToolkit->getCalendarContainer($strContainerId);
        $strReturn .= $this->objToolkit->getCalendarLegend($arrLegendEntries);
        $strReturn .= $this->objToolkit->getCalendarFilter($arrFilterEntries);
        return $strReturn;
    }