$i++; $row_select = '<input type="checkbox" name="sel[book_page-' . $marker_id . ']" />'; $row_chapter = $info['type'] . ' ' . $i . ' <span class="title">' . $info['title'] . '</span>'; $row_theme = $theme->toneSelectList[$info['tone_id']]['title']; $group_list[] = array($row_select, $row_chapter, $row_theme); } } // Book archives if ($book->info) { $row_select = '<input type="checkbox" name="sel[book-' . $book->info['id'] . ']" />'; $row_book = 'Archives <span class="title">' . $book->info['title'] . '</span>'; $row_theme = $theme->toneSelectList[$book->info['tone_id']]['title']; $group_list[] = array($row_select, $row_book, $row_theme); } // Static pages $static = new GrlxStaticPage(); $page_list = $static->getPageList(); if ($page_list) { foreach ($page_list as $id => $info) { $row_select = '<input type="checkbox" name="sel[static_page-' . $id . ']" />'; $row_page = 'Static page <span class="title">' . $info['title'] . '</span>'; $row_theme = $theme->toneSelectList[$info['tone_id']]['title']; $group_list[] = array($row_select, $row_page, $row_theme); } } $sl->setCurrent(0); $tone_select = $sl->buildSelect(); $list->content($group_list); $list_output .= $list->format_content() . '<br/>'; } $form->send_to($_SERVER['SCRIPT_NAME']);
$static = new GrlxStaticPage($page_id); $static->getInfo(); $alert_output .= $message->success_dialog('Items saved. <ul><li>' . $link->paint() . '</li><li><a href="' . $static->info['url'] . '">View this page live</a></li></ul>'); } elseif ($_POST['raw_content'] && $page_id) { $xml_content = $_POST['raw_content']; $data = array('title' => $new_title, 'description' => $new_description, 'options' => $xml_content, 'date_modified' => $db->now()); $db->where('id', $page_id); $success_item = $db->update('static_page', $data); $alert_output .= $message->success_dialog('Freeform content saved. ' . $link->paint('grlx page list')); } /***** * ! Display logic */ // Get all relevant info about this page. if ($page_id) { $static = new GrlxStaticPage($page_id); $static->getInfo(); } if ($static && $static->info) { // Reality check: Does this look like XML? // No? Must be freeform content. if (substr($static->info['options'], 0, 5) != '<?xml') { $mode = 'plaintext'; } else { // ! Read current XML $args['stringXML'] = $static->info['options']; $static_xml = new GrlxXML_Static($args); // What does this page contain? $item_objects = $static_xml->getItemSets('/content'); // What is this page *allowed* to contain? $manifest = $static_xml->getClones('/options', 'option');