/**
  * @inheritDoc
  */
 public function generateFieldsFromObject()
 {
     parent::generateFieldsFromObject();
     $this->getField("path")->setStrOpener(class_link::getLinkAdminDialog("mediamanager", "folderListFolderview", "&form_element=" . $this->getField("path")->getStrEntryName(), $this->getLang("commons_open_browser"), $this->getLang("commons_open_browser"), "icon_externalBrowser", $this->getLang("commons_open_browser")))->setStrHint($this->getLang("mediamanager_path_h"));
     $this->getField("uploadfilter")->setStrHint($this->getLang("mediamanager_upload_filter_h"));
     $this->getField("viewfilter")->setStrHint($this->getLang("mediamanager_view_filter_h"));
 }
 /**
  * @param class_model $objListEntry
  *
  * @return array
  */
 protected function renderAdditionalActions(class_model $objListEntry)
 {
     if ($objListEntry instanceof class_module_news_category) {
         return array($this->objToolkit->listButton(class_link::getLinkAdmin($this->getArrModule("modul"), "listNewsAndCategories", "&filterId=" . $objListEntry->getSystemid(), "", $this->getLang("kat_anzeigen"), "icon_lens")));
     }
     if ($objListEntry instanceof class_module_news_news && $objListEntry->rightEdit()) {
         if (class_module_languages_language::getNumberOfLanguagesAvailable() > 1) {
             return array($this->objToolkit->listButton(class_link::getLinkAdminDialog($this->getArrModule("modul"), "editLanguageset", "&systemid=" . $objListEntry->getSystemid(), "", $this->getLang("news_languageset"), "icon_language")));
         }
     }
     return array();
 }
 private function getNaviAdminForm(class_module_navigation_tree $objTree)
 {
     $strFolderBrowser = class_link::getLinkAdminDialog("pages", "pagesFolderBrowser", "&form_element=navi_folder_i&folder=1", $this->getLang("commons_open_browser"), $this->getLang("commons_open_browser"), "icon_externalBrowser", $this->getLang("commons_open_browser"));
     $objForm = new class_admin_formgenerator("navi", $objTree);
     $objFolder = new class_module_pages_folder($objTree->getStrFolderId());
     $objForm->addDynamicField("strName");
     $objForm->addField(new class_formentry_text("navi", "folder_i", null))->setStrValue($objFolder->getStrName())->setBitReadonly(true)->setStrOpener($strFolderBrowser)->setStrLabel($this->getLang("navigation_folder_i"));
     $objForm->addField(new class_formentry_hidden("navi", "folder_i_id"))->setStrValue($objFolder->getSystemid());
     return $objForm;
 }
Example #4
0
/**
 * Generates a link opening in a dialog in admin-area
 *
 * @deprecated
 *
 * @param string $strModule
 * @param string $strAction
 * @param string $strParams
 * @param string $strText
 * @param string $strAlt
 * @param string $strImage
 * @param string $strTitle
 * @param bool $bitTooltip
 * @param bool $bitPortalEditor
 * @param bool|string $strOnClick
 * @param null|int $intWidth
 * @param null|int $intHeight
 *
 * @return string
 */
function getLinkAdminDialog($strModule, $strAction, $strParams = "", $strText = "", $strAlt = "", $strImage = "", $strTitle = "", $bitTooltip = true, $bitPortalEditor = false, $strOnClick = "", $intWidth = null, $intHeight = null)
{
    return class_link::getLinkAdminDialog($strModule, $strAction, $strParams, $strText, $strAlt, $strImage, $strTitle, $bitTooltip, $bitPortalEditor, $strOnClick, $intWidth, $intHeight);
}
 /**
  * Renders the button to open the records' change history. In most cases, this is done in a overlay.
  * To open the change-history, the permission "right3" on the system-module is required.
  *
  * @param class_model|interface_model $objListEntry
  *
  * @return string
  */
 protected function renderChangeHistoryAction(class_model $objListEntry)
 {
     if (class_module_system_setting::getConfigValue("_system_changehistory_enabled_") == "true" && $objListEntry instanceof interface_versionable && $objListEntry->rightChangelog()) {
         return $this->objToolkit->listButton(class_link::getLinkAdminDialog("system", "genericChangelog", "&systemid=" . $objListEntry->getSystemid() . "&folderview=1", $this->getLang("commons_edit_history"), $this->getLang("commons_edit_history"), "icon_history", $objListEntry->getStrDisplayName()));
     }
     return "";
 }
 /**
  * @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
  * @param bool $bitDialog
  *
  * @return string
  */
 protected function renderEditAction(class_model $objListEntry, $bitDialog = false)
 {
     if ($objListEntry instanceof class_module_user_group) {
         if ($objListEntry->getSystemid() != class_module_system_setting::getConfigValue("_guests_group_id_") && $objListEntry->getSystemid() != class_module_system_setting::getConfigValue("_admins_group_id_") && $this->isGroupEditable($objListEntry)) {
             if ($objListEntry->rightEdit()) {
                 return $this->objToolkit->listButton(class_link::getLinkAdminDialog("user", "groupEdit", "&systemid=" . $objListEntry->getSystemid(), "", $this->getLang("action_group_edit"), "icon_edit"));
             }
         } else {
             return $this->objToolkit->listButton(class_adminskin_helper::getAdminImage("icon_editDisabled", $this->getLang("gruppe_bearbeiten_x")));
         }
     }
     return parent::renderEditAction($objListEntry);
 }
 /**
  * @param class_model|interface_admin_listable|interface_model|class_module_pages_pageelement $objOneIterable
  * @param string $strListIdentifier
  *
  * @return string
  */
 public function getActionIcons($objOneIterable, $strListIdentifier = "")
 {
     $strActions = "";
     if ($objOneIterable instanceof class_module_pages_pageelement) {
         $objLockmanager = $objOneIterable->getLockManager();
         //Create a row to handle the element, check all necessary stuff such as locking etc
         $strActions = "";
         //First step - Record locked? Offer button to unlock? But just as admin! For the user, who locked the record, the unlock-button
         //won't be visible
         if (!$objLockmanager->isAccessibleForCurrentUser()) {
             //So, return a button, if we have an admin in front of us
             if ($objLockmanager->isUnlockableForCurrentUser()) {
                 $strActions .= $this->objToolkit->listButton(class_link::getLinkAdmin("pages_content", "list", "&systemid=" . $this->getSystemid() . "&adminunlockid=" . $objOneIterable->getSystemid(), "", $this->getLang("ds_entsperren"), "icon_lockerOpen"));
             }
             //If the Element is locked, then its not allowed to edit or delete the record, so disable the icons
             if ($objOneIterable->rightEdit()) {
                 $strActions .= $this->objToolkit->listButton(class_adminskin_helper::getAdminImage("icon_editLocked", $this->getLang("ds_gesperrt")));
             }
             if ($objOneIterable->rightDelete()) {
                 $strActions .= $this->objToolkit->listButton(class_adminskin_helper::getAdminImage("icon_deleteLocked", $this->getLang("ds_gesperrt")));
             }
         } else {
             if ($objOneIterable->rightEdit()) {
                 $strActions .= $this->objToolkit->listButton(class_link::getLinkAdmin("pages_content", "edit", "&systemid=" . $objOneIterable->getSystemid(), "", $this->getLang("element_bearbeiten"), "icon_edit"));
             }
             if ($objOneIterable->rightDelete()) {
                 $strActions .= $this->objToolkit->listDeleteButton($objOneIterable->getStrName() . ($objOneIterable->getConcreteAdminInstance()->getContentTitle() != "" ? " - " . $objOneIterable->getConcreteAdminInstance()->getContentTitle() : "") . ($objOneIterable->getStrTitle() != "" ? " - " . $objOneIterable->getStrTitle() : ""), $this->getLang("element_loeschen_frage"), class_link::getLinkAdminHref("pages_content", "deleteElementFinal", "&systemid=" . $objOneIterable->getSystemid() . ($this->getParam("pe") == "" ? "" : "&peClose=" . $this->getParam("pe"))));
             }
         }
         //The Icons to sort the list and to copy the element
         $strActions .= $this->objToolkit->listButton(class_link::getLinkAdminDialog("pages_content", "copyElement", "&systemid=" . $objOneIterable->getSystemid(), "", $this->getLang("element_copy"), "icon_copy"));
         //The status-icons
         $strActions .= $this->objToolkit->listStatusButton($objOneIterable->getSystemid());
     } else {
         if ($objOneIterable instanceof class_module_pages_element) {
             $objAdminInstance = class_module_system_module::getModuleByName("pages")->getAdminInstanceOfConcreteModule();
             if ($objAdminInstance != null && $objAdminInstance instanceof class_admin_simple) {
                 return $objAdminInstance->getActionIcons($objOneIterable);
             }
         }
     }
     return $strActions;
 }
 /**
  * @param class_model $objListEntry
  *
  * @return array
  */
 protected function renderAdditionalActions(class_model $objListEntry)
 {
     if ($objListEntry instanceof class_module_messaging_message) {
         return array(class_link::getLinkAdminDialog($this->getArrModule("modul"), "new", "&messaging_user_id=" . $objListEntry->getStrSenderId() . "&messaging_messagerefid=" . $objListEntry->getSystemid() . "&messaging_title=RE: " . $objListEntry->getStrTitle(), $this->getLang("message_reply"), $this->getLang("message_reply"), "icon_reply"));
     }
     return array();
 }
 /**
  * @param class_model $objListEntry
  * @param bool $bitDialog
  *
  * @return string
  */
 protected function renderEditAction(class_model $objListEntry, $bitDialog = false)
 {
     if ($objListEntry instanceof class_module_mediamanager_file) {
         if ($objListEntry->rightEdit()) {
             if ($this->getStrPeAddon() != "") {
                 return $this->objToolkit->listButton(class_link::getLinkAdmin($objListEntry->getArrModule("modul"), "editFile", "&systemid=" . $objListEntry->getSystemid() . $this->getStrPeAddon(), $this->getLang("commons_list_edit"), $this->getLang("commons_list_edit"), "icon_edit"));
             } else {
                 return $this->objToolkit->listButton(class_link::getLinkAdminDialog($objListEntry->getArrModule("modul"), "editFile", "&systemid=" . $objListEntry->getSystemid() . $this->getStrPeAddon(), $this->getLang("commons_list_edit"), $this->getLang("commons_list_edit"), "icon_edit"));
             }
         }
         return "";
     } else {
         return parent::renderEditAction($objListEntry, $bitDialog);
     }
 }
 /**
  * @param class_model $objListEntry
  *
  * @return array
  */
 protected function renderAdditionalActions(class_model $objListEntry)
 {
     if ($objListEntry instanceof class_module_system_module) {
         $arrReturn = array();
         $arrReturn[] = $this->objToolkit->listButton(class_link::getLinkAdminDialog("system", "moduleAspect", "&systemid=" . $objListEntry->getSystemid(), "", $this->getLang("modul_aspectedit"), "icon_aspect", $this->getLang("modul_aspectedit")));
         if ($objListEntry->rightEdit() && class_carrier::getInstance()->getObjSession()->isSuperAdmin()) {
             if ($objListEntry->getStrName() == "system") {
                 $arrReturn[] = $this->objToolkit->listButton(class_link::getLinkAdmin("system", "moduleList", "", "", $this->getLang("modul_status_system"), "icon_enabled"));
             } else {
                 if ($objListEntry->getIntRecordStatus() == 0) {
                     $arrReturn[] = $this->objToolkit->listButton(class_link::getLinkAdmin("system", "moduleStatus", "&systemid=" . $objListEntry->getSystemid(), "", $this->getLang("modul_status_disabled"), "icon_disabled"));
                 } else {
                     $arrReturn[] = $this->objToolkit->listButton(class_link::getLinkAdmin("system", "moduleStatus", "&systemid=" . $objListEntry->getSystemid(), "", $this->getLang("modul_status_enabled"), "icon_enabled"));
                 }
             }
         }
         return $arrReturn;
     }
     return parent::renderAdditionalActions($objListEntry);
 }
 /**
  * General form entry which displays an list of objects which can be deleted. It is possible to provide an addlink
  * where entries can be appended to the list. To add an entry you can use the javascript function
  * KAJONA.v4skin.setObjectListItems
  *
  * @param $strName
  * @param string $strTitle
  * @param array $arrObjects
  * @param string $strAddLink
  *
  * @return string
  * @throws class_exception
  */
 public function formInputObjectList($strName, $strTitle = "", array $arrObjects, $strAddLink, $bitReadOnly = false)
 {
     $strTemplateID = $this->objTemplate->readTemplate("/elements.tpl", "input_objectlist");
     $strTemplateRowID = $this->objTemplate->readTemplate("/elements.tpl", "input_objectlist_row");
     $arrTemplate = array();
     $arrTemplate["name"] = $strName;
     $arrTemplate["title"] = $strTitle;
     $arrTemplate["addLink"] = $bitReadOnly ? "" : $strAddLink;
     $strTable = '';
     foreach ($arrObjects as $objObject) {
         /** @var $objObject class_model */
         if ($objObject instanceof interface_model && $objObject->rightView()) {
             $strRemoveLink = "";
             if (!$bitReadOnly) {
                 $strDelete = class_carrier::getInstance()->getObjLang()->getLang("commons_remove_assignment", "system");
                 $strRemoveLink = class_link::getLinkAdminDialog(null, "", "", $strDelete, $strDelete, "icon_delete", $strDelete, true, false, "KAJONA.v4skin.removeObjectListItem(this);return false;");
             }
             $strIcon = is_array($objObject->getStrIcon()) ? $objObject->getStrIcon()[0] : $objObject->getStrIcon();
             $arrTemplateRow = array('name' => $strName, 'displayName' => class_formentry_objectlist::getDisplayName($objObject), 'path' => class_formentry_objectlist::getPathName($objObject), 'icon' => class_adminskin_helper::getAdminImage($strIcon), 'value' => $objObject->getSystemid(), 'removeLink' => $strRemoveLink);
             $strTable .= $this->objTemplate->fillTemplate($arrTemplateRow, $strTemplateRowID, true);
         }
     }
     $arrTemplate["table"] = $strTable;
     return $this->objTemplate->fillTemplate($arrTemplate, $strTemplateID, true);
 }
 /**
  * @param $bitAlias
  * @param class_module_pages_page $objPage
  * @param $strMode
  *
  * @return class_admin_formgenerator
  */
 private function getPageForm($bitAlias, class_module_pages_page $objPage, $strMode)
 {
     //Load all the Templates available
     $arrTemplates = class_resourceloader::getInstance()->getTemplatesInFolder("/module_pages");
     $arrTemplatesDD = array();
     if (count($arrTemplates) > 0) {
         foreach ($arrTemplates as $strTemplate) {
             $arrTemplatesDD[$strTemplate] = $strTemplate;
         }
     }
     //remove template of master-page when editing a regular page
     $objMasterPage = class_module_pages_page::getPageByName("master");
     if ($objMasterPage != null && ($objPage->getSystemid() == "" || $objMasterPage->getSystemid() != $objPage->getSystemid())) {
         unset($arrTemplatesDD[$objMasterPage->getStrTemplate()]);
     }
     $strPagesBrowser = class_link::getLinkAdminDialog("pages", "pagesFolderBrowser", "&form_element=page_folder_name&pages=1&elements=false&folder=1&pagealiases=1", $this->getLang("commons_open_browser"), $this->getLang("commons_open_browser"), "icon_externalBrowser", $this->getLang("commons_open_browser"));
     $objForm = new class_admin_formgenerator("page", $objPage);
     if ($bitAlias) {
         $objForm->addField(new class_formentry_hidden("page", "name"))->setStrValue(generateSystemid())->setStrLabel($this->getLang("name"));
     } else {
         $objForm->addDynamicField("strName")->setStrLabel($this->getLang("name"));
     }
     $objForm->addDynamicField("browsername")->setStrLabel($this->getLang("browsername"));
     if (!$bitAlias) {
         $objForm->addDynamicField("strSeostring")->setStrLabel($this->getLang("seostring"));
         $objForm->addDynamicField("strDescription")->setStrLabel($this->getLang("commons_description"));
         $objForm->addDynamicField("strKeywords")->setStrLabel($this->getLang("keywords"));
     }
     $strParentId = $objPage->getPrevId();
     if (!validateSystemid($strParentId) && $strMode == "new") {
         $strParentId = $this->getSystemid();
     }
     $strFolderId = $this->getParam("page_folder_name_id");
     $strFolderName = $this->getParam("page_folder_name");
     if (!validateSystemid($strFolderId) && validateSystemid($strParentId)) {
         $objParent = class_objectfactory::getInstance()->getObject($strParentId);
         $strFolderId = $objParent->getSystemid();
         if ($objParent->getSystemid() != $this->getObjModule()->getSystemid()) {
             $strFolderName = $objParent->getStrDisplayName();
         }
     }
     $objForm->addField(new class_formentry_text("page", "folder_name"))->setStrValue($strFolderName)->setBitReadonly(true)->setStrOpener($strPagesBrowser)->setStrLabel($this->getLang("page_folder_name"));
     $objForm->addField(new class_formentry_hidden("page", "folder_name_id"))->setStrValue($strFolderId);
     if (!$bitAlias) {
         /** @var $objField class_formentry_base */
         $objField = $objForm->addDynamicField("strTemplate")->setArrKeyValues($arrTemplatesDD)->setStrLabel($this->getLang("template"));
         if ($strMode == "edit" && $objPage->getStrTemplate() == "") {
             $objField->setStrHint($this->getLang("templateNotSelectedBefore"));
         }
         $bitReadonly = false;
         if (class_module_system_setting::getConfigValue("_pages_templatechange_") == "false") {
             if ($this->getAction() == "newPage" || $this->getParam("mode") == "new") {
                 $bitReadonly = false;
             } else {
                 if ($objPage->getNumberOfElementsOnPage() != 0) {
                     $bitReadonly = true;
                 }
             }
         }
         $objField->setBitReadonly($bitReadonly);
         if ($strMode == "new" && $this->getParam("page_template") == "") {
             $objField->setStrValue(class_module_system_setting::getConfigValue("_pages_defaulttemplate_"));
         }
     } else {
         $objForm->addDynamicField("strAlias")->setStrHint($this->getLang("page_alias_hint"))->setBitMandatory(true)->setStrLabel($this->getLang("page_alias"));
         $objForm->addDynamicField("strTarget")->setStrLabel($this->getLang("page_target"));
     }
     $objForm->addField(new class_formentry_hidden("", "mode"))->setStrValue($strMode);
     return $objForm;
 }
 /**
  * @param class_model $objListEntry
  *
  * @return array
  */
 protected function renderAdditionalActions(class_model $objListEntry)
 {
     if ($objListEntry instanceof class_module_mediamanager_file && $objListEntry->getIntType() == class_module_mediamanager_file::$INT_TYPE_FOLDER) {
         return array($this->objToolkit->listButton(class_link::getLinkAdmin($this->getArrModule("modul"), "openFolder", "&systemid=" . $objListEntry->getSystemid(), "", $this->getLang("action_open_folder", "mediamanager"), "icon_folderActionOpen")));
     } else {
         if ($objListEntry instanceof class_module_mediamanager_file && $objListEntry->getIntType() == class_module_mediamanager_file::$INT_TYPE_FILE) {
             return array($this->objToolkit->listButton(class_link::getLinkAdminDialog($this->getArrModule("modul"), "showInfo", "&systemid=" . $objListEntry->getSystemid(), $this->getLang("package_info"), $this->getLang("package_info"), "icon_lens", $objListEntry->getStrDisplayName())));
         }
     }
     return array();
 }
 /**
  * Creates the layout of a dashboard-entry. loads the widget to fetch the contents of the concrete widget.
  *
  * @param class_module_dashboard_widget $objDashboardWidget
  *
  * @return string
  */
 protected function layoutAdminWidget($objDashboardWidget)
 {
     $strWidgetContent = "";
     $objConcreteWidget = $objDashboardWidget->getConcreteAdminwidget();
     $strWidgetId = $objConcreteWidget->getSystemid();
     $strWidgetName = $objConcreteWidget->getWidgetName();
     $strWidgetNameAdditionalContent = $objConcreteWidget->getWidgetNameAdditionalContent();
     $strWidgetContent .= $this->objToolkit->getDashboardWidgetEncloser($objDashboardWidget->getSystemid(), $this->objToolkit->getAdminwidget($strWidgetId, $strWidgetName, $strWidgetNameAdditionalContent, $objDashboardWidget->rightEdit() ? class_link::getLinkAdminDialog("dashboard", "editWidget", "&systemid=" . $objDashboardWidget->getSystemid(), "", $this->getLang("editWidget"), "icon_edit", $objDashboardWidget->getConcreteAdminwidget()->getWidgetName()) : "", $objDashboardWidget->rightDelete() ? $this->objToolkit->listDeleteButton($objDashboardWidget->getConcreteAdminwidget()->getWidgetName(), $this->getLang("widgetDeleteQuestion"), "javascript:KAJONA.admin.dashboard.removeWidget(\\'" . $objDashboardWidget->getSystemid() . "\\');") : "", $objDashboardWidget->getConcreteAdminwidget()->getLayoutSection()));
     return $strWidgetContent;
 }