/** * @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(); }
protected function renderAdditionalActions(class_model $objListEntry) { if ($objListEntry instanceof class_module_tags_tag) { $arrButtons = array(); $arrButtons[] = $this->objToolkit->listButton(class_link::getLinkAdmin($this->getArrModule("modul"), "showAssignedRecords", "&systemid=" . $objListEntry->getSystemid(), $this->getLang("action_show_assigned_records"), $this->getLang("action_show_assigned_records"), "icon_folderActionOpen")); if ($objListEntry->rightRight1()) { $strJs = "<script type='text/javascript'>KAJONA.admin.loader.loadFile('" . class_resourceloader::getInstance()->getCorePathForModule("module_tags") . "/module_tags/admin/scripts/tags.js', function() {\n KAJONA.admin.tags.createFavoriteEnabledIcon = '" . addslashes(class_adminskin_helper::getAdminImage("icon_favorite", $this->getLang("tag_favorite_remove"))) . "';\n KAJONA.admin.tags.createFavoriteDisabledIcon = '" . addslashes(class_adminskin_helper::getAdminImage("icon_favoriteDisabled", $this->getLang("tag_favorite_add"))) . "';\n });</script>"; $strImage = class_module_tags_favorite::getAllFavoritesForUserAndTag($this->objSession->getUserID(), $objListEntry->getSystemid()) != null ? class_adminskin_helper::getAdminImage("icon_favorite", $this->getLang("tag_favorite_remove")) : class_adminskin_helper::getAdminImage("icon_favoriteDisabled", $this->getLang("tag_favorite_add")); $arrButtons[] = $strJs . $this->objToolkit->listButton("<a href=\"#\" onclick=\"KAJONA.admin.tags.createFavorite('" . $objListEntry->getSystemid() . "', this); return false;\">" . $strImage . "</a>"); } return $arrButtons; } else { return array(); } }
protected function renderAdditionalActions(class_model $objListEntry) { if ($objListEntry->rightEdit() && $objListEntry instanceof class_module_votings_voting) { return array($this->objToolkit->listButton(getLinkAdmin($this->getArrModule("modul"), "listAnswers", "&systemid=" . $objListEntry->getSystemid(), "", $this->getLang("action_list_answers"), "icon_folderActionOpen"))); } return parent::renderAdditionalActions($objListEntry); }
protected function renderAdditionalActions(class_model $objListEntry) { if ($objListEntry instanceof class_module_faqs_category) { return array($this->objToolkit->listButton(class_link::getLinkAdmin($this->getArrModule("modul"), "list", "&filterId=" . $objListEntry->getSystemid(), "", $this->getLang("kat_anzeigen"), "icon_lens"))); } return array(); }
protected function renderAdditionalActions(class_model $objListEntry) { $arrReturn = array(); if ($objListEntry instanceof class_module_navigation_tree) { if (validateSystemid($objListEntry->getStrFolderId())) { $arrReturn[] = $this->objToolkit->listButton(getImageAdmin("icon_treeBranchOpenDisabled", $this->getLang("navigation_show_disabled"))); } else { $arrReturn[] = $this->objToolkit->listButton(class_link::getLinkAdmin($this->getArrModule("modul"), "list", "&systemid=" . $objListEntry->getSystemid() . $this->strPeAddon, "", $this->getLang("navigation_anzeigen"), "icon_treeBranchOpen")); } } if ($objListEntry instanceof class_module_navigation_point) { $arrReturn[] = $this->objToolkit->listButton(class_link::getLinkAdmin("navigation", "list", "&systemid=" . $objListEntry->getSystemid() . $this->strPeAddon, "", $this->getLang("navigationp_anzeigen"), "icon_treeBranchOpen")); } return $arrReturn; }
protected function renderAdditionalActions(class_model $objListEntry) { if ($objListEntry->rightEdit() && $objListEntry instanceof class_module_eventmanager_event) { return array($this->objToolkit->listButton(getLinkAdmin($this->getArrModule("modul"), "listParticipant", "&systemid=" . $objListEntry->getSystemid(), "", $this->getLang("action_list_participant"), "icon_group"))); } if ($objListEntry instanceof class_module_eventmanager_participant) { if ($objListEntry->rightEdit()) { $objValidator = new class_email_validator(); $objEvent = new class_module_eventmanager_event($objListEntry->getPrevId()); if ($objValidator->validate($objListEntry->getStrEmail())) { $strPreset = "&mail_recipient=" . $objListEntry->getStrEmail(); $strPreset .= "&mail_subject=" . $this->getLang("participant_mail_subject"); $strPreset .= "&mail_body=" . $this->getLang("participant_mail_intro") . "\n" . $this->getLang("event_title") . " " . $objEvent->getStrTitle() . "\n" . $this->getLang("event_location") . " " . $objEvent->getStrLocation() . "\n" . $this->getLang("event_start") . " " . dateToString($objEvent->getObjStartDate()); return array($this->objToolkit->listButton(getLinkAdminDialog("system", "mailForm", $strPreset, "", $this->getLang("participant_mail"), "icon_mail"))); } } } return parent::renderAdditionalActions($objListEntry); }
/** * 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 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(); } }
/** * @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); }
/** * Adds a single object to the cache * @param class_model $objObject */ public function addObjectToCache(class_model $objObject) { $this->arrObjectCache[$objObject->getSystemid()] = $objObject; }
/** * @param class_model $objObject * @return void */ public function setObjObject($objObject) { $this->objObject = $objObject; if ($objObject instanceof class_model) { if ($this->strSystemid == "") { $this->strSystemid = $objObject->getSystemid(); } if ($this->strResultId == "") { $this->strResultId = $objObject->getSystemid(); } } }
/** * @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); }
/** * @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|class_module_pages_page $objListEntry * * @return array */ protected function renderAdditionalActions(class_model $objListEntry) { $bitPeMode = $this->getParam("pe") != ""; if ($objListEntry instanceof class_module_pages_page) { $arrReturn = array(); if ($objListEntry->getIntType() == class_module_pages_page::$INT_TYPE_ALIAS) { $objTargetPage = class_module_pages_page::getPageByName($objListEntry->getStrAlias()); if (!$bitPeMode && $objTargetPage != null && $objTargetPage->rightEdit()) { $arrReturn[] = $this->objToolkit->listButton(class_link::getLinkAdmin("pages_content", "list", "&systemid=" . $objTargetPage->getStrSystemid() . "&pe=" . $this->getParam("pe"), "", $this->getLang("seite_inhalte_alias"), "icon_page_alias")); } $arrReturn[] = $this->objToolkit->listButton(class_link::getLinkAdmin($this->getArrModule("modul"), "list", "&systemid=" . $objListEntry->getSystemid() . "&pe=" . $this->getParam("pe"), "", $this->getLang("page_sublist"), "icon_folderActionOpen")); } else { if ($objListEntry->rightView()) { if (!$bitPeMode && $objListEntry->rightEdit()) { $arrReturn[] = $this->objToolkit->listButton(class_link::getLinkAdmin("pages_content", "list", "&systemid=" . $objListEntry->getSystemid() . "&pe=" . $this->getParam("pe"), "", $this->getLang("seite_inhalte"), "icon_page")); } $arrReturn[] = $this->objToolkit->listButton(class_link::getLinkAdmin($this->getArrModule("modul"), "list", "&systemid=" . $objListEntry->getSystemid() . "&pe=" . $this->getParam("pe"), "", $this->getLang("page_sublist"), "icon_folderActionOpen")); } } return $arrReturn; } else { if ($objListEntry instanceof class_module_pages_folder) { $arrReturn[] = $this->objToolkit->listButton(class_link::getLinkAdmin("pages", "list", "&systemid=" . $objListEntry->getSystemid() . "&pe=" . $this->getParam("pe"), $this->getLang("pages_ordner_oeffnen"), $this->getLang("pages_ordner_oeffnen"), "icon_folderActionOpen")); return $arrReturn; } else { return parent::renderAdditionalActions($objListEntry); } } }
protected function renderAdditionalActions(class_model $objListEntry) { if ($objListEntry instanceof class_module_guestbook_guestbook) { return array($this->objToolkit->listButton(getLinkAdmin($this->arrModule["modul"], "listPost", "&systemid=" . $objListEntry->getSystemid(), "", $this->getLang("action_view_guestbook"), "icon_bookLens"))); } }
/** * @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 ""; }
/** * @param class_model|interface_admin_listable|interface_model $objOneIterable * @param string $strListIdentifier * * @return string */ public function getActionIcons($objOneIterable, $strListIdentifier = "") { if ($strListIdentifier == self::INT_LISTTYPE_FOLDERVIEW) { $strTargetfield = $this->getParam("form_element"); if ($objOneIterable instanceof class_module_mediamanager_file && $objOneIterable->rightView()) { if ($objOneIterable->getIntType() == class_module_mediamanager_file::$INT_TYPE_FOLDER) { return $this->objToolkit->listButton(class_link::getLinkAdmin($this->getArrModule("modul"), "folderContentFolderviewMode", "&form_element=" . $strTargetfield . "&systemid=" . $objOneIterable->getSystemid(), "", $this->getLang("action_open_folder"), "icon_folderActionOpen")); } else { if ($objOneIterable->getIntType() == class_module_mediamanager_file::$INT_TYPE_FILE) { return $this->objToolkit->listButton("<a href=\"#\" title=\"" . $this->getLang("commons_accept") . "\" rel=\"tooltip\" onclick=\"KAJONA.admin.folderview.selectCallback([['" . $strTargetfield . "', '" . $objOneIterable->getStrFilename() . "']]);\">" . class_adminskin_helper::getAdminImage("icon_accept") . "</a>"); } } } return ""; } return parent::getActionIcons($objOneIterable, $strListIdentifier); }
/** * @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); }
/** * @param string $strTargetURI If you pass null, no form-tags will be rendered. * @param int $intButtonConfig a list of buttons to attach to the end of the form. if you need more then the obligatory save-button, * pass them combined by a bitwise or, e.g. class_admin_formgenerator::BIT_BUTTON_SAVE | class_admin_formgenerator::$BIT_BUTTON_CANCEL * * @throws class_exception * @return string */ public function renderForm($strTargetURI, $intButtonConfig = 2) { $strReturn = ""; //add a hidden systemid-field if ($this->objSourceobject != null) { $objField = new class_formentry_hidden($this->strFormname, "systemid"); $objField->setStrEntryName("systemid")->setStrValue($this->objSourceobject->getSystemid())->setObjValidator(new class_systemid_validator()); $this->addField($objField); } $objToolkit = class_carrier::getInstance()->getObjToolkit("admin"); if ($strTargetURI !== null) { $strReturn .= $objToolkit->formHeader($strTargetURI, "", $this->strFormEncoding, $this->strOnSubmit); } $strReturn .= $objToolkit->getValidationErrors($this); $strHidden = ""; foreach ($this->arrFields as $objOneField) { if (in_array($objOneField->getStrEntryName(), $this->arrHiddenElements)) { $strHidden .= $objOneField->renderField(); } else { $strReturn .= $objOneField->renderField(); } } if ($strHidden != "") { $strReturn .= $objToolkit->formOptionalElementsWrapper($strHidden, $this->strHiddenGroupTitle, $this->bitHiddenElementsVisible); } if ($intButtonConfig & self::BIT_BUTTON_SUBMIT) { $strReturn .= $objToolkit->formInputSubmit(class_lang::getInstance()->getLang("commons_submit", "system"), "submitbtn"); } if ($intButtonConfig & self::BIT_BUTTON_SAVE) { $strReturn .= $objToolkit->formInputSubmit(class_lang::getInstance()->getLang("commons_save", "system"), "submitbtn"); } if ($intButtonConfig & self::BIT_BUTTON_CANCEL) { $strReturn .= $objToolkit->formInputSubmit(class_lang::getInstance()->getLang("commons_cancel", "system"), "cancelbtn"); } if ($intButtonConfig & self::BIT_BUTTON_CLOSE) { $strReturn .= $objToolkit->formInputSubmit(class_lang::getInstance()->getLang("commons_close", "system"), "closebtn"); } if ($intButtonConfig & self::BIT_BUTTON_DELETE) { $strReturn .= $objToolkit->formInputSubmit(class_lang::getInstance()->getLang("commons_delete", "system"), "deletebtn"); } if ($intButtonConfig & self::BIT_BUTTON_RESET) { $strReturn .= $objToolkit->formInputSubmit(class_lang::getInstance()->getLang("commons_reset", "system"), "reset", "", "cancelbutton"); } if ($intButtonConfig & self::BIT_BUTTON_CONTINUE) { $strReturn .= $objToolkit->formInputSubmit(class_lang::getInstance()->getLang("commons_continue", "system"), "continuebtn"); } if ($intButtonConfig & self::BIT_BUTTON_BACK) { $strReturn .= $objToolkit->formInputSubmit(class_lang::getInstance()->getLang("commons_back", "system"), "backbtn"); } if ($strTargetURI !== null) { $strReturn .= $objToolkit->formClose(); } if (count($this->arrFields) > 0) { reset($this->arrFields); do { $objField = current($this->arrFields); if (!$objField instanceof class_formentry_hidden && !$objField instanceof class_formentry_plaintext && !$objField instanceof class_formentry_headline && !$objField instanceof class_formentry_divider) { $strReturn .= $objToolkit->setBrowserFocus($objField->getStrEntryName()); break; } } while (next($this->arrFields) !== false); } //lock the record to avoid multiple edit-sessions - if in edit mode if ($this->objSourceobject != null && method_exists($this->objSourceobject, "getLockManager")) { $bitSkip = false; if ($this->getField("mode") != null && $this->getField("mode")->getStrValue() == "new") { $bitSkip = true; } if (!$bitSkip && !validateSystemid($this->objSourceobject->getSystemid())) { $bitSkip = true; } if (!$bitSkip) { if ($this->objSourceobject->getLockManager()->isAccessibleForCurrentUser()) { $this->objSourceobject->getLockManager()->lockRecord(); } else { $objUser = new class_module_user_user($this->objSourceobject->getLockManager()->getLockId()); throw new class_exception("Current record is already locked by user '" . $objUser->getStrDisplayName() . "'.\nCannot be locked for the current user", class_exception::$level_ERROR); } } } return $strReturn; }
/** * @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(); }