/** * Обработка отправки формы при редактировании страницы * * @param unknown_type $oPageEdit */ protected function EventPagesEditSubmit($oPageEdit) { $this->Security_ValidateSendForm(); // * Проверяем корректность полей if (!$this->EventPagesCheckFields()) { return; } if ($oPageEdit->getId() == getRequest('page_pid')) { $this->_messageError($this->Lang_Get('system_error'), 'page:edit'); return; } // * Обновляем свойства страницы $oPageEdit->setAutoBr(getRequest('page_auto_br') ? 1 : 0); $oPageEdit->setActive(getRequest('page_active') ? 1 : 0); $oPageEdit->setMain(getRequest('page_main') ? 1 : 0); $oPageEdit->setDateEdit(date("Y-m-d H:i:s")); if (getRequest('page_pid') == 0) { $oPageEdit->setUrlFull(getRequest('page_url')); $oPageEdit->setPid(null); } else { $oPageEdit->setPid(getRequest('page_pid')); $oPageParent = $this->PluginPage_Page_GetPageById(getRequest('page_pid')); $oPageEdit->setUrlFull($oPageParent->getUrlFull() . '/' . getRequest('page_url')); } $oPageEdit->setSeoDescription(getRequest('page_seo_description')); $oPageEdit->setSeoKeywords(getRequest('page_seo_keywords')); $oPageEdit->setText(getRequest('page_text')); $oPageEdit->setTitle(getRequest('page_title')); $oPageEdit->setUrl(getRequest('page_url')); $oPageEdit->setSort(intval(getRequest('page_sort'))); $oPageEdit->setOtherUrl(getRequest('page_other_url')); // * Обновляем страницу if ($this->PluginPage_Page_UpdatePage($oPageEdit)) { $this->PluginPage_Page_RebuildUrlFull($oPageEdit); $this->_messageNotice($this->Lang_Get('page_edit_submit_save_ok'), 'page:edit'); $this->SetParam(0, null); $this->SetParam(1, null); } else { $this->_messageError($this->Lang_Get('system_error'), 'page:edit'); } }
/** * Обработка отправки формы при редактировании страницы * * @param unknown_type $oPageEdit */ protected function SubmitEditPage($oPageEdit) { /** * Проверяем корректность полей */ if (!$this->CheckPageFields()) { return; } if ($oPageEdit->getId() == getRequest('page_pid')) { $this->Message_AddError($this->Lang_Get('system_error')); return; } /** * Обновляем свойства страницы */ $oPageEdit->setActive(getRequest('page_active') ? 1 : 0); $oPageEdit->setAutoBr(getRequest('page_auto_br') ? 1 : 0); $oPageEdit->setMain(getRequest('page_main') ? 1 : 0); $oPageEdit->setDateEdit(date("Y-m-d H:i:s")); if (getRequest('page_pid') == 0) { $oPageEdit->setUrlFull(getRequest('page_url')); $oPageEdit->setPid(null); } else { $oPageEdit->setPid(getRequest('page_pid')); $oPageParent = $this->PluginPage_Page_GetPageById(getRequest('page_pid')); $oPageEdit->setUrlFull($oPageParent->getUrlFull() . '/' . getRequest('page_url')); } $oPageEdit->setSeoDescription(getRequest('page_seo_description')); $oPageEdit->setSeoKeywords(getRequest('page_seo_keywords')); $oPageEdit->setText(getRequest('page_text')); $oPageEdit->setTitle(getRequest('page_title')); $oPageEdit->setUrl(getRequest('page_url')); $oPageEdit->setSort(getRequest('page_sort')); /** * Обновляем страницу */ if ($this->PluginPage_Page_UpdatePage($oPageEdit)) { $this->PluginPage_Page_RebuildUrlFull($oPageEdit); $this->Message_AddNotice($this->Lang_Get('plugin.page.edit_submit_save_ok')); $this->SetParam(0, null); $this->SetParam(1, null); } else { $this->Message_AddError($this->Lang_Get('system_error')); } }