/** * Display the dialog for inserting pages into a menu * */ function InsertDialog($cmd) { global $langmessage, $page; includeFile('admin/admin_trash.php'); echo '<div class="inline_box">'; echo '<div class="layout_links">'; echo ' <a href="#gp_Insert_New" name="tabs" class="selected">' . $langmessage['new_file'] . '</a>'; echo ' <a href="#gp_Insert_Hidden" name="tabs">' . $langmessage['Available Pages'] . '</a>'; echo ' <a href="#gp_Insert_Deleted" name="tabs">' . $langmessage['restore_from_trash'] . '</a>'; echo ' <a href="#gp_Insert_External" name="tabs">' . $langmessage['External Link'] . '</a>'; echo '</div>'; // Insert New echo '<div id="gp_Insert_New">'; echo '<form action="' . $this->GetUrl('Admin_Menu') . '" method="post">'; echo '<table class="bordered full_width">'; echo '<tr><th> </th><th> </th></tr>'; echo '<tr>'; echo '<td>' . $langmessage['label'] . '</td>'; echo '<td><input type="text" name="title" maxlength="100" value="" size="50" class="gpinput" /></td>'; echo '</tr>'; echo '<tr>'; echo '<td>' . $langmessage['Content Type'] . '</td>'; echo '<td>'; includeFile('tool/editing_page.php'); editing_page::SectionTypes(); echo '</td>'; echo '</tr>'; echo '</table>'; echo '<p>'; echo '<input type="hidden" name="insert_how" value="' . htmlspecialchars($cmd) . '" />'; echo '<input type="hidden" name="insert_where" value="' . htmlspecialchars($_GET['insert_where']) . '" />'; echo '<input type="hidden" name="cmd" value="new_file" />'; echo '<input type="submit" name="aaa" value="' . $langmessage['create_new_file'] . '" class="menupost gpsubmit"/> '; echo '<input type="submit" value="' . $langmessage['cancel'] . '" class="admin_box_close gpcancel" /> '; echo '</p>'; echo '</form>'; echo '</div>'; // Insert Hidden echo '<div id="gp_Insert_Hidden" class="nodisplay">'; if ($this->is_main_menu) { $avail = $this->GetAvailable(); } else { $avail = $this->GetAvail_Current(); } if (count($avail) == 0) { echo '<p>'; echo $langmessage['Empty']; echo '</p>'; } else { echo '<form action="' . common::GetUrl('Admin_Menu') . '" method="post">'; echo '<table class="bordered full_width">'; echo '<thead><tr><th>'; echo $langmessage['title']; echo ' <input type="text" name="search" value="" class="gpinput gpsearch" />'; echo '</th><th class="right">'; echo $langmessage['insert_into_menu']; echo '</th></tr></thead>'; echo '</table>'; echo '<ul class="gpui-scrolllist ui-menu ui-widget ui-widget-content ui-corner-all">'; //sort by label $sort_avail = array(); foreach ($avail as $index => $title) { $sort_avail[$index] = common::GetLabel($title); } natcasesort($sort_avail); foreach ($sort_avail as $index => $label) { echo '<li class="ui-menu-item">'; echo '<label class="ui-corner-all">'; echo '<input type="checkbox" name="keys[]" value="' . htmlspecialchars($index) . '" />'; echo common::LabelSpecialChars($label); echo '<span class="slug">'; echo '/' . $avail[$index]; echo '</span>'; echo '</label>'; echo '</li>'; } echo '</ul>'; echo '<p>'; echo '<input type="hidden" name="insert_how" value="' . htmlspecialchars($cmd) . '" />'; echo '<input type="hidden" name="insert_where" value="' . htmlspecialchars($_GET['insert_where']) . '" />'; echo '<input type="hidden" name="cmd" value="insert_from_hidden" />'; echo '<input type="submit" name="" value="' . $langmessage['insert_into_menu'] . '" class="menupost gpsubmit" />'; echo ' <input type="submit" value="' . $langmessage['cancel'] . '" class="admin_box_close gpcancel" /> '; echo '</p>'; echo '</form>'; } echo '</div>'; // Insert Deleted / Restore from trash echo '<div id="gp_Insert_Deleted" class="nodisplay">'; $trashtitles = admin_trash::TrashFiles(); if (count($trashtitles) == 0) { echo '<p>' . $langmessage['TRASH_IS_EMPTY'] . '</p>'; } else { echo '<form action="' . common::GetUrl('Admin_Menu') . '" method="post">'; echo '<table class="bordered full_width"><thead>'; echo '<tr><th>' . $langmessage['title']; echo ' <input type="text" name="search" value="" class="gpinput gpsearch" />'; echo '</th><th class="right">'; echo $langmessage['restore']; echo '</th></tr>'; echo '</thead></table>'; echo '<ul class="gpui-scrolllist ui-menu ui-widget ui-widget-content ui-corner-all">'; foreach ($trashtitles as $title => $info) { echo '<li class="ui-menu-item">'; echo '<label class="ui-corner-all">'; echo '<input type="checkbox" name="titles[]" value="' . htmlspecialchars($title) . '" />'; echo $info['label']; echo '<span class="slug">'; echo '/' . $title; echo '</span>'; echo '</label></li>'; } echo '</ul>'; echo '<p>'; echo '<input type="hidden" name="insert_how" value="' . htmlspecialchars($cmd) . '" />'; echo '<input type="hidden" name="insert_where" value="' . htmlspecialchars($_GET['insert_where']) . '" />'; echo '<input type="hidden" name="cmd" value="restore" />'; echo '<input type="submit" name="" value="' . $langmessage['restore'] . '" class="menupost gpsubmit" />'; echo ' <input type="submit" value="' . $langmessage['cancel'] . '" class="admin_box_close gpcancel" /> '; echo '</p>'; echo '</form>'; } echo '</div>'; //Insert External echo '<div id="gp_Insert_External" class="nodisplay">'; $args['insert_how'] = $cmd; $args['insert_where'] = $_GET['insert_where']; $this->ExternalForm('new_external', $langmessage['insert_into_menu'], $args); echo '</div>'; echo '</div>'; }
/** * Display a form for adding a new section to the page * */ function NewSectionPrompt() { global $langmessage; ob_start(); echo '<div class="inline_box">'; echo '<form method="post" action="' . common::GetUrl($this->title) . '">'; echo '<h2>' . $langmessage['new_section_about'] . '</h2>'; echo '<table class="bordered full_width">'; echo '<tr><th colspan="2">' . $langmessage['New Section'] . '</th></tr>'; echo '<tr><td>'; echo $langmessage['Content Type']; echo '</td><td>'; editing_page::SectionTypes(); echo '</td></tr>'; echo '<tr><td>'; echo $langmessage['Insert Location']; echo '</td><td>'; echo '<label><input type="radio" name="insert" value="before" /> '; echo $langmessage['insert_before']; echo '</label>'; echo '<label><input type="radio" name="insert" value="after" checked="checked" /> '; echo $langmessage['insert_after']; echo '</label>'; echo '</td></tr>'; echo '</table>'; echo '<p>'; echo '<input type="hidden" name="last_mod" value="' . $this->fileModTime . '" />'; echo '<input type="hidden" name="section" value="' . $_GET['section'] . '" />'; echo '<input type="hidden" name="cmd" value="add_section" />'; echo '<input type="submit" name="" value="' . $langmessage['save'] . '" class="gpsubmit"/>'; echo ' <input type="button" name="" value="' . $langmessage['cancel'] . '" class="admin_box_close gpcancel" />'; echo '</p>'; echo '</form>'; echo '</div>'; $this->contentBuffer = ob_get_clean(); }