Пример #1
0
 function __construct()
 {
     global $langmessage;
     $this->Init();
     gp_edit::PrepAutoComplete();
     $cmd = common::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
 function ShowForm()
 {
     global $langmessage, $page, $config;
     $replace_id = '';
     $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') {
         if (isset($_REQUEST['menus'])) {
             $this->GetMenus();
         }
         $page->ajaxReplace[] = array('gp_menu_prep', '', '');
         $page->ajaxReplace[] = array('inner', $replace_id, $content);
         $page->ajaxReplace[] = array('gp_menu_refresh', '', '');
         return;
     }
     // search form
     echo '<form action="' . common::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="' . common::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">';
         } 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_edit::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>';
     foreach ($menus as $menu_id => $menu_label) {
         if ($menu_id == $this->curr_menu_id) {
             echo '<span>' . $menu_label . '</span>';
         } else {
             echo '<span>' . common::Link('Admin_Menu', $menu_label, 'menu=' . $menu_id, array('data-cmd' => 'cnreq')) . '</span>';
         }
     }
     echo '<span>' . common::Link('Admin_Menu', '+ ' . $langmessage['Add New Menu'], 'cmd=newmenu', 'data-cmd="gpabox"') . '</span>';
     echo '</div>';
     echo '<div>';
     echo '<b>' . $langmessage['Lists'] . '</b>';
     foreach ($lists as $menu_id => $menu_label) {
         if ($menu_id == $this->curr_menu_id) {
         } else {
         }
         echo '<span>' . common::Link('Admin_Menu', $menu_label, 'menu=' . $menu_id, array('data-cmd' => 'creq')) . '</span>';
     }
     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>' . common::Link('Admin_Menu', $langmessage['rename'], 'cmd=rename_menu_prompt&id=' . $this->curr_menu_id, 'data-cmd="gpabox"') . '</span>';
         $title_attr = sprintf($langmessage['generic_delete_confirm'], '&quot;' . $label . '&quot;');
         echo '<span>' . common::Link('Admin_Menu', $langmessage['delete'], 'cmd=rm_menu&id=' . $this->curr_menu_id, array('data-cmd' => 'creq', 'class' => 'gpconfirm', 'title' => $title_attr)) . '</span>';
         echo '</div>';
     }
     echo '</div>';
     echo '<div class="gpclear"></div>';
 }
Пример #3
0
 /**
  * @deprecated
  * Use gp_edit::PrepAutoComplete();
  */
 function PrepAutoComplete($autocomplete_js = true, $GetUrl = true)
 {
     includeFile('tool/editing.php');
     gp_edit::PrepAutoComplete($autocomplete_js, $GetUrl);
 }
Пример #4
0
 /**
  * Use ckeditor for to edit content
  *
  *	configuration options
  * 	- http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html
  */
 static function UseCK($contents, $name = 'gpcontent', $options = array())
 {
     global $page;
     $options += array('rows' => '20', 'cols' => '50');
     echo "\n\n";
     echo '<textarea name="' . $name . '" style="width:90%" rows="' . $options['rows'] . '" cols="' . $options['cols'] . '" class="CKEDITAREA">';
     echo htmlspecialchars($contents);
     echo '</textarea><br/>';
     //$page->head_js[] = '/include/thirdparty/ckeditor_34/ckeditor.js'; //wasn't working quite right, and it's called seperately for inline editing
     $page->head .= "\n" . '<script type="text/javascript" src="' . common::GetDir('/include/thirdparty/ckeditor_34/ckeditor.js') . '?3.6.2"></script>';
     gp_edit::PrepAutoComplete(false, true);
     ob_start();
     echo 'CKEDITOR.replaceAll( function(tarea,config){';
     echo 'if( tarea.className.indexOf("CKEDITAREA") == -1 ) return false;';
     echo gp_edit::CKConfig($options);
     echo 'return true;';
     echo '});';
     echo "\n\n";
     $page->jQueryCode .= ob_get_clean();
 }
Пример #5
0
 function RedirForm()
 {
     global $langmessage, $page;
     gp_edit::PrepAutoComplete(true, false);
     echo '<div class="inline_box" id="gp_redir">';
     echo '<h2>' . $langmessage['New Redirection'] . '</h2>';
     echo '<form method="post" action="' . common::GetUrl('Admin_Missing') . '">';
     echo '<input type="hidden" name="cmd" value=""/>';
     echo '<input type="hidden" name="orig_source" value=""/>';
     echo '<table class="bordered">';
     echo '<tr><th colspan="2">' . $langmessage['options'] . '</th>';
     echo '</tr>';
     echo '<tr><td>';
     echo $langmessage['Source URL'];
     echo '</td><td>';
     echo common::GetUrl('');
     echo '<input type="text" name="source" value="" size="20" class="gpinput"/>';
     echo '</td></tr>';
     echo '<tr><td>';
     echo $langmessage['Target URL'];
     echo '</td><td>';
     echo '<input type="text" name="target" value="" class="autocomplete gpinput" size="40" />';
     echo '</td></tr>';
     echo '<tr><td>';
     echo $langmessage['Method'];
     echo '</td><td>';
     echo '<select name="code" class="gpselect">';
     echo '<option value="301">' . $langmessage['301 Moved Permanently'] . '</option>';
     echo '<option value="302">' . $langmessage['302 Moved Temporarily'] . '</option>';
     echo '</select>';
     echo '</td></tr>';
     echo '</table>';
     echo '<p>';
     echo '<input type="submit" name="" value="' . $langmessage['save_changes'] . '" class="gpsubmit" />';
     //not using gppost because of autocomplete
     echo ' <input type="button" name="" value="' . $langmessage['cancel'] . '" class="admin_box_close gpcancel" />';
     echo '</p>';
     echo '</form>';
     echo '</div>';
 }