public function proc() { reg::setKey(ormPages::getPrefix() . '/minitext'); function changeText($id, $obj) { if (!empty($id)) { reg::setKey($id, $obj['text'], $obj['description']); } else { if (!empty($obj['text'])) { reg::addToList(ormPages::getPrefix() . '/minitext', $obj['text'], $obj['description']); } } return true; } function delText($id) { reg::delKey($id); } $form = new uiMultiForm('change'); $form->process('changeText', 'delText'); ormPages::clearCache(); if ($_POST['parram'] == 'apply') { system::redirect('/structure/minitext'); } else { if ($_SESSION['STRUCTURE_LIST_FLAG']) { system::redirect('/structure/list'); } else { system::redirect('/structure/tree'); } } }
public function restore() { if (system::issetUrl(2) && is_numeric(system::url(2))) { // Одиночное востановление $obj = new ormObject(system::url(2)); if ($obj->isInheritor('section')) { $obj = new ormPage(system::url(2)); } $obj->restore(); echo 'delete'; } else { if (isset($_POST['objects'])) { // Множественное востановление while (list($id, $val) = each($_POST['objects'])) { if (is_numeric($id)) { $obj = new ormObject($id); if ($obj->isInheritor('section')) { $obj = new ormPage($id); } $obj->restore(); } } echo 'delete'; } } ormPages::clearCache(); system::stop(); }
public function toTrash() { if ($this->isEditable()) { ormPages::clearCache(); return parent::toTrash(); } else { $this->newError(48, 'Вы не имеете прав для удаления данной страницы!'); return false; } }
public function proc() { // ****************** Основные настройки *************************** reg::setKey(ormPages::getPrefix() . '/title_prefix', system::POST('title_prefix')); reg::setKey(ormPages::getPrefix() . '/keywords', system::POST('keywords')); reg::setKey(ormPages::getPrefix() . '/description', system::POST('description')); reg::setKey('/structure/' . domains::curId() . '/cur_date', system::POST('cur_date', isBool)); reg::setKey(ormPages::getPrefix() . '/no_view_no_edit', system::POST('no_view_no_edit', isBool)); reg::setKey(ormPages::getPrefix() . '/view_as_tree', system::POST('view_as_tree', isBool)); reg::setKey(ormPages::getPrefix('search') . '/auto_index', system::POST('auto_index', isBool)); // Сохраняем информацию о части файла Robots.txt if (isset($_POST['robots'])) { $file = ROOT_DIR . '/robots_part_' . domains::curDomain()->getName() . '.txt'; if (empty($_POST['robots']) && file_exists($file)) { unlink($file); } else { if (!empty($_POST['robots'])) { $f = fopen($file, "w"); fwrite($f, $_POST['robots']); fclose($f); } } } // Управление отображением reg::delKey(ormPages::getPrefix() . '/no_view'); if (isset($_POST['no_view_classes'])) { while (list($num, $val) = each($_POST['no_view_classes'])) { if (!empty($val)) { reg::setKey(ormPages::getPrefix() . '/no_view/' . $num, $val); } } } reg::delKey(ormPages::getPrefix() . '/no_edit'); if (isset($_POST['no_edit_classes'])) { while (list($num, $val) = each($_POST['no_edit_classes'])) { if (!empty($val)) { reg::setKey(ormPages::getPrefix() . '/no_edit/' . $num, $val); } } } // ****************** Сохранение шаблонов *************************** function changeTempl($id, $obj, $form_name) { $type = $form_name == 'page_tpl' ? 0 : 1; $templ = new template($id); $templ->setName($obj['t_name']); $templ->setFile($obj['t_file']); $templ->setDestination($type); $templ->setLangId(languages::curId()); $templ->setDomainId(domains::curId()); $templ->save(); return true; } function delTempl($id) { $templ = new template($id); $templ->delete(); } $form = new uiMultiForm('page_tpl'); $form->process('changeTempl', 'delTempl'); $form = new uiMultiForm('obj_tpl'); $form->process('changeTempl', 'delTempl'); ormPages::clearCache(); if ($_POST['parram'] == 'apply') { system::redirect('/structure/settings'); } else { if ($_SESSION['STRUCTURE_LIST_FLAG']) { system::redirect('/structure/list'); } else { system::redirect('/structure/tree'); } } }