Exemple #1
0
 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');
         }
     }
 }
Exemple #2
0
 private function changeDomainInfo($TEMPLATE)
 {
     if (system::issetUrl(2) && system::url(2) == 'edit') {
         if (isset($_POST['error_msg']) && isset($_POST['offline_msg'])) {
             // Обработчик изменения свойств домена
             $domain = new domain(system::url(3));
             $domain->setErrorMsg($_POST['error_msg']);
             $domain->setOfflineMsg($_POST['offline_msg']);
             $domain->save();
             $form = new uiMultiForm('mirrors');
             function changeMirror($id, $data, $form_name, $domain)
             {
                 return $domain->changeMirror($data['d_name'], $id);
             }
             function delMirror($id, $form_name, $domain)
             {
                 $domain->delMirror($id);
             }
             $form->process('changeMirror', 'delMirror', $domain);
         } else {
             // Форма редактирования домена
             $domain = new domain(system::url(3));
             page::assign('error_msg', $domain->getErrorMsg());
             page::assign('offline_msg', $domain->getOfflineMsg());
             $form = new uiMultiForm('mirrors');
             $form->insideForm();
             $form->setData($domain->getMirrors());
             $form->addColumn('d_name', lang::get('CONFIG_FORM_FIELD', 31), 260);
             page::assign('mirrors_list', $form->getHTML());
             echo page::parse($TEMPLATE['domain_frame']);
         }
         die;
     }
 }
Exemple #3
0
 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');
         }
     }
 }