예제 #1
0
 function __construct($args)
 {
     global $langmessage;
     $this->page = $args['page'];
     $this->Init();
     \gp\tool\Editing::PrepAutoComplete();
     $cmd = \gp\tool::GetCommand();
     $show = true;
     switch ($cmd) {
         case 'save404':
             $show = $this->Save404();
             break;
         case 'edit404':
             $this->Edit404();
             return;
         case 'editredir':
             $this->EditRedir();
             return;
         case 'saveredir':
             $this->SaveRedir();
             break;
         case 'updateredir':
             $this->UpdateRedir();
             break;
         case 'rmredir':
             $this->RmRedir();
             break;
         case 'newform':
             $this->RedirForm();
             return;
     }
     if ($show) {
         $this->Show();
     }
 }
예제 #2
0
 /**
  * Primary Display
  *
  *
  */
 public function ShowForm()
 {
     global $langmessage, $config;
     $menu_output = false;
     ob_start();
     if (isset($this->list_displays[$this->curr_menu_id])) {
         $this->SearchDisplay();
         $replace_id = '#gp_menu_available';
     } else {
         $menu_output = true;
         $this->OutputMenu();
         $replace_id = '#admin_menu';
     }
     $content = ob_get_clean();
     // json response
     if (isset($_REQUEST['gpreq']) && $_REQUEST['gpreq'] == 'json') {
         $this->MenuJsonResponse($replace_id, $content);
         return;
     }
     // search form
     echo '<form action="' . \gp\tool::GetUrl('Admin/Menu') . '" method="post" id="page_search">';
     $_REQUEST += array('q' => '');
     echo '<input type="text" name="q" size="15" value="' . htmlspecialchars($_REQUEST['q']) . '" class="gptext gpinput title-autocomplete" /> ';
     echo '<input type="submit" name="cmd" value="' . $langmessage['search pages'] . '" class="gpbutton" />';
     echo '<input type="hidden" name="menu" value="search" />';
     echo '</form>';
     $menus = $this->GetAvailMenus('menu');
     $lists = $this->GetAvailMenus('display');
     //heading
     echo '<form action="' . \gp\tool::GetUrl('Admin/Menu') . '" method="post" id="gp_menu_select_form">';
     echo '<input type="hidden" name="curr_menu" id="gp_curr_menu" value="' . $this->curr_menu_id . '" />';
     echo '<h2 class="first-child">';
     echo $langmessage['file_manager'] . ' &#187;  ';
     echo '<select id="gp_menu_select" name="gp_menu_select" class="gpselect">';
     echo '<optgroup label="' . $langmessage['Menus'] . '">';
     foreach ($menus as $menu_id => $menu_label) {
         if ($menu_id == $this->curr_menu_id) {
             echo '<option value="' . $menu_id . '" selected="selected">';
         } else {
             echo '<option value="' . $menu_id . '">';
         }
         echo $menu_label . '</option>';
     }
     echo '</optgroup>';
     echo '<optgroup label="' . $langmessage['Lists'] . '">';
     foreach ($lists as $menu_id => $menu_label) {
         if ($menu_id == $this->curr_menu_id) {
             echo '<option value="' . $menu_id . '" selected="selected">';
         } elseif ($menu_id == 'search') {
             continue;
         } else {
             echo '<option value="' . $menu_id . '">';
         }
         echo $menu_label . '</option>';
     }
     echo '</optgroup>';
     echo '</select>';
     echo '</h2>';
     echo '</form>';
     //homepage
     echo '<div class="homepage_setting">';
     $this->HomepageDisplay();
     echo '</div>';
     \gp\tool\Editing::PrepAutoComplete();
     echo '<div id="admin_menu_div">';
     if ($menu_output) {
         echo '<ul id="admin_menu" class="sortable_menu">';
         echo $content;
         echo '</ul><div id="admin_menu_tools" ></div>';
         echo '<div id="menu_info" style="display:none">';
         $this->MenuSkeleton();
         echo '</div>';
         echo '<div id="menu_info_extern" style="display:none">';
         $this->MenuSkeletonExtern();
         echo '</div>';
     } else {
         echo '<div id="gp_menu_available">';
         echo $content;
         echo '</div>';
     }
     echo '</div>';
     echo '<div class="admin_footnote">';
     echo '<div>';
     echo '<b>' . $langmessage['Menus'] . '</b>';
     $this->MenuList($menus);
     echo '<span>' . \gp\tool::Link('Admin/Menu/Menus', '+ ' . $langmessage['Add New Menu'], 'cmd=NewMenuPrompt', 'data-cmd="gpabox"') . '</span>';
     echo '</div>';
     echo '<div>';
     echo '<b>' . $langmessage['Lists'] . '</b>';
     $this->MenuList($lists);
     echo '</div>';
     //options for alternate menu
     if ($this->is_alt_menu) {
         echo '<div>';
         $label = $menus[$this->curr_menu_id];
         echo '<b>' . $label . '</b>';
         echo '<span>' . \gp\tool::Link('Admin/Menu/Menus', $langmessage['rename'], 'cmd=RenameMenuPrompt&id=' . $this->curr_menu_id, 'data-cmd="gpabox"') . '</span>';
         $title_attr = sprintf($langmessage['generic_delete_confirm'], '&quot;' . $label . '&quot;');
         echo '<span>' . \gp\tool::Link('Admin/Menu/Menus', $langmessage['delete'], 'cmd=MenuRemove&id=' . $this->curr_menu_id, array('data-cmd' => 'cnreq', 'class' => 'gpconfirm', 'title' => $title_attr)) . '</span>';
         echo '</div>';
     }
     echo '</div>';
     echo '<div class="gpclear"></div>';
 }