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->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); }
/** * @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(); }
/** * Renders the permissions action button for the current record. * @param class_model|interface_model $objListEntry * @return string */ protected function renderCopyAction(class_model $objListEntry) { if ($objListEntry->getIntRecordDeleted() == 1) { return ""; } if ($objListEntry->rightEdit() && $this->strPeAddon == "") { $strHref = class_link::getLinkAdminHref($objListEntry->getArrModule("modul"), $this->getActionNameForClass("copyObject", $objListEntry), "&systemid=" . $objListEntry->getSystemid() . $this->strPeAddon); return $this->objToolkit->listButton(class_link::getLinkAdminManual(" onclick='jsDialog_3.init();' href='" . $strHref . "'", "", $this->getLang("commons_edit_copy"), "icon_copy")); } return ""; }
/** * @param class_model * @param string $strAltActive tooltip text for the icon if record is active * @param string $strAltInactive tooltip text for the icon if record is inactive * * @return string */ protected function renderStatusAction(class_model $objListEntry, $strAltActive = "", $strAltInactive = "") { if ($objListEntry->rightEdit()) { if (class_module_system_setting::getConfigValue("_packagemanager_defaulttemplate_") == $objListEntry->getStrName()) { return $this->objToolkit->listButton(class_adminskin_helper::getAdminImage("icon_enabled", $this->getLang("pack_active_no_status"))); } else { return $this->objToolkit->listStatusButton($objListEntry, true); } } return ""; }
/** * Validates a set of permissions for a single object. * The string of permissions is a comma-separated list, whereas the entries may be one of * view, edit, delete, right, right1, right2, right3, right4, right5 * If at least a single permission is given, true is returned, otherwise false. * * @param string $strPermissions * @param class_model $objObject * * @return bool * @throws class_exception * @since 4.0 */ public function validatePermissionString($strPermissions, class_model $objObject) { if (!$objObject instanceof class_model) { throw new class_exception("automated permission-check only for instances of class_model", class_exception::$level_ERROR); } if (trim($strPermissions) == "") { return false; } $arrPermissions = explode(",", $strPermissions); foreach ($arrPermissions as $strOnePermissions) { $strOnePermissions = trim($strOnePermissions); switch (trim($strOnePermissions)) { case self::$STR_RIGHT_VIEW: if ($objObject->rightView()) { return true; } break; case self::$STR_RIGHT_EDIT: if ($objObject->rightEdit()) { return true; } break; case self::$STR_RIGHT_DELETE: if ($objObject->rightDelete()) { return true; } break; case self::$STR_RIGHT_RIGHT: if ($objObject->rightRight()) { return true; } break; case self::$STR_RIGHT_RIGHT1: if ($objObject->rightRight1()) { return true; } break; case self::$STR_RIGHT_RIGHT2: if ($objObject->rightRight2()) { return true; } break; case self::$STR_RIGHT_RIGHT3: if ($objObject->rightRight3()) { return true; } break; case self::$STR_RIGHT_RIGHT4: if ($objObject->rightRight4()) { return true; } break; case self::$STR_RIGHT_RIGHT5: if ($objObject->rightRight5()) { return true; } break; case self::$STR_RIGHT_CHANGELOG: if ($objObject->rightChangelog()) { return true; } break; default: break; } } return false; }
/** * @param class_model|class_module_user_user $objListEntry * * @return array */ protected function renderAdditionalActions(class_model $objListEntry) { $objUsersources = new class_module_user_sourcefactory(); $arrReturn = array(); if ($objListEntry instanceof class_module_user_user && $objListEntry->rightEdit() && $objUsersources->getUsersource($objListEntry->getStrSubsystem())->getMembersEditable()) { $arrReturn[] = $this->objToolkit->listButton(class_link::getLinkAdminDialog("user", "editMemberships", "&systemid=" . $objListEntry->getSystemid() . "&folderview=1", "", $this->getLang("user_zugehoerigkeit"), "icon_group", $objListEntry->getStrUsername())); } $objValidator = new class_email_validator(); if ($objListEntry instanceof class_module_user_user && $objListEntry->getObjSourceUser()->isEditable() && $objListEntry->getIntActive() == 1 && $objListEntry->getObjSourceUser()->isPasswordResettable() && $objListEntry->rightEdit() && $objValidator->validate($objListEntry->getStrEmail())) { $arrReturn[] = $this->objToolkit->listButton(class_link::getLinkAdmin("user", "sendPassword", "&systemid=" . $objListEntry->getSystemid(), "", $this->getLang("user_password_resend"), "icon_mailNew")); } if ($objListEntry instanceof class_module_user_user && $objListEntry->getIntActive() == 1) { $arrReturn[] = $this->objToolkit->listButton(class_link::getLinkAdminDialog("messaging", "new", "&messaging_user_id=" . $objListEntry->getSystemid(), "", $this->getLang("user_send_message"), "icon_mail", $this->getLang("user_send_message"))); } if ($objListEntry instanceof class_module_user_user && $objListEntry->getIntActive() == 1 && class_carrier::getInstance()->getObjSession()->isSuperAdmin()) { $arrReturn[] = $this->objToolkit->listButton(class_link::getLinkAdmin("user", "switchToUser", "&systemid=" . $objListEntry->getSystemid(), "", $this->getLang("user_switch_to"), "icon_userswitch")); } if ($objListEntry instanceof class_module_user_group && $objListEntry->rightEdit()) { $arrReturn[] = $this->objToolkit->listButton(class_link::getLinkAdmin("user", "groupMember", "&systemid=" . $objListEntry->getSystemid(), "", $this->getLang("action_group_member"), "icon_group")); } return $arrReturn; }
/** * @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 $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); }
/** * @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); } } }