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();
 }
 /**
  * @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();
 }
 /**
  * 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;
 }
 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 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 onInsertToDb()
 {
     //fix the initial sort-id
     $strQuery = "SELECT COUNT(*)\n                       FROM " . _dbprefix_ . "system\n                      WHERE system_prev_id = ?\n                        AND (system_module_nr = ? OR system_module_nr = ?)";
     $arrRow = $this->objDB->getPRow($strQuery, array($this->getPrevId(), _pages_modul_id_, _pages_folder_id_));
     $this->setIntSort($arrRow["COUNT(*)"]);
     return parent::onInsertToDb();
 }
예제 #8
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")));
     }
 }
 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);
 }
 /**
  * Updates the record
  *
  * @return bool
  */
 protected function updateStateToDb()
 {
     $bitReturn = parent::updateStateToDb();
     if ($this->bitOnReadTrigger && $this->getStrMessageProvider() != "") {
         $this->bitOnReadTrigger = false;
         $strHandler = $this->getStrMessageProvider();
         /** @var $objHandler interface_messageprovider */
         $objHandler = new $strHandler();
         $objHandler->onSetRead($this);
     }
     return $bitReturn;
 }
 /**
  * @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 "";
 }
 /**
  * @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();
     }
 }
예제 #13
0
 /**
  * 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;
 }
예제 #14
0
 /**
  * @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);
 }
예제 #15
0
 /**
  * @param string $strNewPrevid
  * @param bool $bitChangeTitle
  *
  * @return bool
  */
 public function copyObject($strNewPrevid = "", $bitChangeTitle = true, $bitCopyChilds = true)
 {
     $strPrefix = $this->getStrName() . "_";
     $intCount = 1;
     $strQuery = "SELECT COUNT(*) FROM " . _dbprefix_ . "tags_tag WHERE tags_tag_name = ?";
     $arrRow = $this->objDB->getPRow($strQuery, array($strPrefix . $intCount));
     while ($arrRow["COUNT(*)"] > 0) {
         $arrRow = $this->objDB->getPRow($strQuery, array($strPrefix . ++$intCount));
     }
     $this->setStrName($strPrefix . $intCount);
     //save assigned records
     $arrRecords = $this->getListOfAssignments();
     parent::copyObject($strNewPrevid, $bitChangeTitle, $bitCopyChilds);
     //copy the tag assignments
     foreach ($arrRecords as $arrOneRecord) {
         $this->assignToSystemrecord($arrOneRecord["tags_systemid"]);
     }
     return true;
 }
 protected function updateStateToDb()
 {
     //check if its a valid package
     if (uniSubstr($this->getStrFilename(), -4) == ".zip") {
         $this->updatePackageInformation();
     }
     return parent::updateStateToDb();
 }
 /**
  * saves the current object with all its params back to the database
  *
  * @return bool
  */
 protected function updateStateToDb()
 {
     //if no other aspect exists, we have a new default aspect
     if (class_module_system_aspect::getObjectCount() == 0) {
         $this->setBitDefault(1);
     }
     if ($this->getBitDefault() == 1) {
         self::resetDefaultAspect();
     }
     return parent::updateStateToDb();
 }
 /**
  * @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);
 }
 public function actionChangeCover()
 {
     $this->retVal = new stdClass();
     $relativePath = '/images/class_cover/' . Yii::app()->request->getPost('class_id_cover') . '/';
     $dir = "images/class_cover/" . Yii::app()->request->getPost('class_id_cover');
     @mkdir(Yii::getPathOfAlias('webroot') . '/' . $dir, 0777, true);
     $image = "";
     if (isset($_FILES["file_upload_cover"]["name"])) {
         if ($_FILES["file_upload_cover"]["type"] == "image/jpeg" || $_FILES["file_upload_cover"]["type"] == "image/jpg" || $_FILES["file_upload_cover"]["type"] == "image/pjpeg" || $_FILES["file_upload_cover"]["type"] == "image/x-png" || $_FILES["file_upload_cover"]["type"] == "image/png") {
             if ($_FILES["file_upload_cover"]["error"] > 0) {
                 $arr->message = "Return Code: " . $_FILES["file_upload_cover"]["error"];
             }
             $tempFile = $_FILES["file_upload_cover"]["tmp_name"];
             //3
             $targetPath = Yii::getPathOfAlias('webroot') . '/' . $dir . "/";
             //4
             $targetFile = $targetPath . $_FILES["file_upload_cover"]["name"];
             //5
             move_uploaded_file($tempFile, $targetFile);
             //6
             $image = $relativePath . $_FILES["file_upload_cover"]["name"];
         }
     }
     $image_resize = $relativePath . 'coverresize' . $_FILES["file_upload_cover"]["name"];
     imageresize::resize_image(Yii::getPathOfAlias('webroot') . $image, null, 1000, 315, false, Yii::getPathOfAlias('webroot') . $image_resize, false, false, 100);
     $this->retVal->message = Yii::app()->createUrl($image_resize);
     $class_cover = class_model::model()->findByAttributes(array('class_id' => Yii::app()->request->getPost('class_id_cover')));
     $class_cover->class_cover = $image_resize;
     $class_cover->save(FALSE);
     echo CJSON::encode($this->retVal);
     Yii::app()->end();
 }
 /**
  * @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 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;
 }
 /**
  * Deletes the element from the system-tables, also from the foreign-element-tables.
  * This takes care of reordering the internal sort-ids.
  *
  * @return bool
  */
 public function deleteObjectFromDatabase()
 {
     //fix the internal sorting
     $arrElements = $this->getSortedElementsAtPlaceholder();
     $arrIds = array();
     $bitHit = false;
     foreach ($arrElements as $arrOneSibling) {
         if ($bitHit) {
             $arrIds[] = $arrOneSibling["system_id"];
         }
         if ($arrOneSibling["system_id"] == $this->getSystemid()) {
             $bitHit = true;
         }
     }
     if (count($arrIds) > 0) {
         $strQuery = "UPDATE " . _dbprefix_ . "system SET system_sort = system_sort-1 where system_id IN (" . implode(",", array_map(function ($strVal) {
             return "?";
         }, $arrIds)) . ")";
         $this->objDB->_pQuery($strQuery, $arrIds);
     }
     //Load the Element-Data
     $objElement = $this->getConcreteAdminInstance();
     if ($objElement != null) {
         //Fetch the table
         $strElementTable = $objElement->getTable();
         //Delete the entry in the Element-Table
         if ($strElementTable != "") {
             $strQuery = "DELETE FROM " . $strElementTable . " WHERE content_id= ?";
             if (!$this->objDB->_pQuery($strQuery, array($this->getSystemid()))) {
                 return false;
             }
         }
     }
     //Delete from page_element table
     parent::deleteObjectFromDatabase();
     //Loading the data of the corresponding site
     $objPage = new class_module_pages_page($this->getPrevId());
     class_cache::flushCache("class_element_portal", $objPage->getStrName());
     return true;
 }
예제 #23
0
 /**
  * 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 "";
 }
 /**
  * @return bool
  */
 public function deleteObjectFromDatabase()
 {
     //delete elements in the database
     $arrElements = $this->objDB->getPArray("SELECT page_element_id FROM " . _dbprefix_ . "page_element WHERE page_element_ph_element = ?", array($this->getStrName()));
     foreach ($arrElements as $arrOneRow) {
         $objElement = new class_module_pages_pageelement($arrOneRow["page_element_id"]);
         $objElement->deleteObjectFromDatabase();
     }
     parent::deleteObjectFromDatabase();
 }
예제 #25
0
 /**
  * Loads all faqs from the database
  * if passed, the filter is used to load the faqs of the given category
  *
  * @param string $strFilter
  *
  * @return mixed
  * @static
  */
 public static function getObjectCount($strFilter = "")
 {
     if ($strFilter != "") {
         $objORM = new class_orm_objectlist();
         $strQuery = "SELECT COUNT(*)\n\t\t\t\t\t\t\tFROM " . _dbprefix_ . "faqs,\n\t\t\t\t\t\t\t     " . _dbprefix_ . "system,\n\t\t\t\t\t\t\t     " . _dbprefix_ . "faqs_member\n\t\t\t\t\t\t\tWHERE system_id = faqs_id\n\t\t\t\t\t\t\t  AND faqs_id = faqsmem_faq\n\t\t\t\t\t\t\t  " . $objORM->getDeletedWhereRestriction() . "\n\t\t\t\t\t\t\t  AND faqsmem_category = ?";
         $arrRow = class_carrier::getInstance()->getObjDB()->getPRow($strQuery, array($strFilter));
         return $arrRow["COUNT(*)"];
     } else {
         return parent::getObjectCount();
     }
 }
 /**
  * Deletes the tag with the given systemid from the system
  *
  * @return bool
  */
 public function deleteObjectFromDatabase()
 {
     //delete all files from the filesystem
     $objFilesystem = new class_filesystem();
     $objFilesystem->folderDeleteRecursive(_templatepath_ . "/" . $this->getStrName());
     return parent::deleteObjectFromDatabase();
 }
 public function deleteObjectFromDatabase()
 {
     $this->setParam("deleteMediamanagerRepo", true);
     return parent::deleteObjectFromDatabase();
 }
예제 #28
0
 /**
  * Adds a single object to the cache
  * @param class_model $objObject
  */
 public function addObjectToCache(class_model $objObject)
 {
     $this->arrObjectCache[$objObject->getSystemid()] = $objObject;
 }
예제 #29
0
 /**
  * @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
  * @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 "";
 }