/** * Validates a news start/end/archive date for a correct logical order. * * * @param class_model $objObject - the model object to the given form * @return bool */ public function validateObject(class_model $objObject) { $objLang = class_carrier::getInstance()->getObjLang(); $strModuleName = $objObject->getArrModule("modul"); if ($objObject instanceof class_module_news_news) { //validate: $objStartDate < $objSpecialDate < $objEndDate $objStartDate = $objObject->getObjStartDate(); $objEndDate = $objObject->getObjEndDate(); $objSpecialDate = $objObject->getObjSpecialDate(); $strLabelStartDate = $objLang->getLang("form_" . $objObject->getArrModule("modul") . "_datestart", $strModuleName); $strLabelEndDate = $objLang->getLang("form_" . $objObject->getArrModule("modul") . "_dateend", $strModuleName); $strLabelSpecialDate = $objLang->getLang("form_" . $objObject->getArrModule("modul") . "_datespecial", $strModuleName); if ($objStartDate != null && $objEndDate != null) { if (class_objectvalidator_helper::compareDates($objStartDate, $objEndDate) === 1) { $this->addValidationError("startdate", $objLang->getLang("commons_object_validator_datecompare_validationmessage_before", $strModuleName, array($strLabelStartDate, $strLabelEndDate))); } } if ($objSpecialDate != null && $objEndDate != null) { if (class_objectvalidator_helper::compareDates($objSpecialDate, $objEndDate) === 1) { $this->addValidationError("startdate", $objLang->getLang("commons_object_validator_datecompare_validationmessage_before", $strModuleName, array($strLabelSpecialDate, $strLabelEndDate))); } } if ($objStartDate != null && $objSpecialDate != null) { if (class_objectvalidator_helper::compareDates($objStartDate, $objSpecialDate) === 1) { $this->addValidationError("startdate", $objLang->getLang("commons_object_validator_datecompare_validationmessage_before", $strModuleName, array($strLabelStartDate, $strLabelSpecialDate))); } } } else { return false; } return count($this->getArrValidationMessages()) == 0; }
/** * Loads the fields label-text, based on a combination of form-name and property-name. * The generated label may be overwritten if necessary. */ public function updateLabel($strKey = "") { //check, if label is set as a property if ($strKey != "") { $this->strLabel = class_carrier::getInstance()->getObjLang()->getLang($strKey, $this->objSourceObject->getArrModule("modul")); } else { $this->strLabel = class_carrier::getInstance()->getObjLang()->getLang("form_" . $this->strFormName . "_" . $this->strSourceProperty, $this->objSourceObject->getArrModule("modul")); $strKey = "form_" . $this->strFormName . "_" . $this->strSourceProperty; } $strHint = $strKey . "_hint"; if (class_carrier::getInstance()->getObjLang()->getLang($strHint, $this->objSourceObject->getArrModule("modul")) != "!" . $strHint . "!") { $this->setStrHint(class_carrier::getInstance()->getObjLang()->getLang($strHint, $this->objSourceObject->getArrModule("modul"))); } }
/** * 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|interface_admin_listable|interface_model $objOneIterable * @param string $strListIdentifier * * @return string */ public function getActionIcons($objOneIterable, $strListIdentifier = "") { if ($strListIdentifier == "searchResultList") { //call the original module to render the action-icons $objAdminInstance = class_module_system_module::getModuleByName($objOneIterable->getArrModule("modul"))->getAdminInstanceOfConcreteModule(); if ($objAdminInstance != null && $objAdminInstance instanceof class_admin_simple) { return $objAdminInstance->getActionIcons($objOneIterable); } } return parent::getActionIcons($objOneIterable, $strListIdentifier); }
/** * @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 $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); } }