<?php session_start(); require_once '../controllers/SectionController.php'; require_once '../controllers/noticeController.php'; require_once '../functions/functions.inc'; if (!$_SESSION['userId']) { header("Location:index.php"); } $obj_section_controller = new SectionController(); $obj_section_controller->getAllSections(); function getComboSections($obj_section) { $result = ""; foreach ($obj_section->obj_section_service->list_sections as $section) { foreach ($section as $key => $value) { if ($key == 'id') { $id = $value; } if ($key == 'section') { $result = $result . '<option value="' . $id . '">' . $value . '</option>'; } } } return $result; } function getComboSectionsSelect($obj_section, $sectionId) { $result = ""; foreach ($obj_section->obj_section_service->list_sections as $section) { foreach ($section as $key => $value) {
function row($row) { if (!$this->controller) { return; } extract($this->controller->context); extract($row); $event = $this->controller->event; $tr = array(); $tr[] = $id; $tr[] = fInput('text', 'name', $name, '', '', '', 20); $tr[] = fInput('text', 'title', $title, '', '', '', 20); $tr[] = selectInput('page', $this->pages, $page); //.sp.popHelp('section_uses_page'); $tr[] = selectInput('css', $this->styles, $css); //.sp.popHelp('section_uses_css'); $tr[] = SectionController::adopters_dropdown($id, $parent); //.sp.popHelp('section_parent_section'); $tr[] = yesnoradio('is_default', $is_default, '', $name); //.sp.popHelp('section_is_default'); $tr[] = yesnoradio('on_frontpage', $on_frontpage, '', $name); //.sp.popHelp('section_on_frontpage'); $tr[] = yesnoradio('in_rss', $in_rss, '', $name); //.sp.popHelp('section_syndicate'); $tr[] = yesnoradio('searchable', $searchable, '', $name); //.sp.popHelp('section_searchable'); $tr[] = fInput('submit', '', gTxt('save_button'), 'smallerbox') . eInput('section') . sInput('save') . hInput('old_name', $name); $tr = doWrap($tr, 'tr', 'td', 'row-' . (++$this->count % 2 ? 'odd' : 'even')); #echo "<pre>".htmlspecialchars($tr)."</pre><br />===<br />"; $tr = preg_replace('/<tr.*>/', '\\0' . start_form(), $tr); $tr = preg_replace('/<\\/tr>/', end_form() . '</tr>', $tr); return $tr; }