plugins/SpecialAdmin.php
changeset 1023 5a282dbf8fad
parent 1009 fa665a95e99d
child 1055 15ef8d2147c2
equal deleted inserted replaced
1021:5990ac411f34 1023:5a282dbf8fad
  2049 
  2049 
  2050 function page_Special_Administration()
  2050 function page_Special_Administration()
  2051 {
  2051 {
  2052   global $db, $session, $paths, $template, $plugins; // Common objects
  2052   global $db, $session, $paths, $template, $plugins; // Common objects
  2053   global $lang;
  2053   global $lang;
  2054   
  2054   global $output;
  2055   if($session->auth_level < USER_LEVEL_ADMIN) {
  2055   
       
  2056   if ( $session->auth_level < USER_LEVEL_ADMIN )
       
  2057   {
  2056     redirect(makeUrlNS('Special', 'Login/'.$paths->page, 'level='.USER_LEVEL_ADMIN), 'Not authorized', 'You need an authorization level of '.USER_LEVEL_ADMIN.' to use this page, your auth level is: ' . $session->auth_level, 0);
  2058     redirect(makeUrlNS('Special', 'Login/'.$paths->page, 'level='.USER_LEVEL_ADMIN), 'Not authorized', 'You need an authorization level of '.USER_LEVEL_ADMIN.' to use this page, your auth level is: ' . $session->auth_level, 0);
  2057     exit;
  2059     exit;
  2058   }
  2060   }
  2059   else
  2061   else
  2060   {
  2062   {
  2061     $template->set_theme('admin', 'default');
  2063     $template->set_theme('admin', 'default');
  2062     $template->add_header('<script type="text/javascript" src="' . cdnPath . '/includes/clientside/static/admin-menu.js"></script>');
  2064     $template->preload_js('fat');
  2063     
  2065     $template->preload_js('ajax');
  2064     if( !isset( $_GET['noheaders'] ) ) 
  2066     $template->preload_js('l10n');
  2065     {
  2067     $template->preload_js('jquery');
  2066       $template->header();
  2068     $template->preload_js('jquery-ui');
  2067     }
  2069     $template->preload_js('autofill');
       
  2070     $template->preload_js('admin-menu');
       
  2071     
       
  2072     $output->header();
       
  2073     
  2068     echo $lang->get('adm_page_tagline');
  2074     echo $lang->get('adm_page_tagline');
  2069     ?>
  2075     ?>
  2070     <script type="text/javascript">
  2076     <script type="text/javascript">
  2071     function ajaxPage(t)
  2077     function ajaxPage(t)
  2072     {
  2078     {
  2195       'icon_19' : '<?php echo cdnPath; ?>/images/icons/plus.gif',       // junction for last closed node
  2201       'icon_19' : '<?php echo cdnPath; ?>/images/icons/plus.gif',       // junction for last closed node
  2196       'icon_26' : '<?php echo cdnPath; ?>/images/icons/minusbottom.gif',// junction for opened node
  2202       'icon_26' : '<?php echo cdnPath; ?>/images/icons/minusbottom.gif',// junction for opened node
  2197       'icon_27' : '<?php echo cdnPath; ?>/images/icons/minus.gif'       // junction for last opended node
  2203       'icon_27' : '<?php echo cdnPath; ?>/images/icons/minus.gif'       // junction for last opended node
  2198     };
  2204     };
  2199     
  2205     
  2200     addOnloadHook(function()
       
  2201       {
       
  2202         load_component(['fat', 'ajax', 'l10n', 'autofill', 'jquery', 'jquery-ui']);
       
  2203         keepalive_onload();
       
  2204       });
       
  2205     
       
  2206     <?php
  2206     <?php
  2207     echo $paths->parseAdminTree(); // Make a Javascript array that defines the tree
  2207     echo $paths->parseAdminTree(); // Make a Javascript array that defines the tree
  2208     ?>
  2208     ?>
       
  2209     
       
  2210     addOnloadHook(function()
       
  2211       {
       
  2212         console.trace();
       
  2213         new tree(TREE_ITEMS, TREE_TPL, 'admin_tree');
       
  2214         keepalive_onload();
       
  2215       });
  2209     </script>
  2216     </script>
  2210     <table border="0" width="100%">
  2217     <table border="0" width="100%">
  2211       <tr>
  2218       <tr>
  2212         <td class="holder" valign="top">
  2219         <td class="holder" valign="top">
  2213           <div class="pad" style="padding-right: 20px;">
  2220           <div class="pad" style="padding-right: 20px;" id="admin_tree">
  2214             <script type="text/javascript">
       
  2215               if ( !KILL_SWITCH )
       
  2216               {
       
  2217                 new tree(TREE_ITEMS, TREE_TPL);
       
  2218               }
       
  2219             </script>
       
  2220           </div>
  2221           </div>
  2221         </td>
  2222         </td>
  2222         <td width="100%" valign="top">
  2223         <td width="100%" valign="top">
  2223           <div class="pad" id="ajaxPageContainer">
  2224           <div class="pad" id="ajaxPageContainer">
  2224           <?php
  2225           <?php
  2263         </td>
  2264         </td>
  2264       </tr>
  2265       </tr>
  2265     </table>
  2266     </table>
  2266   
  2267   
  2267     <?php
  2268     <?php
  2268   }
  2269     $output->footer();
  2269   if(!isset($_GET['noheaders']))
       
  2270   {
       
  2271     $template->footer();
       
  2272   }
  2270   }
  2273 }
  2271 }
  2274 
  2272 
  2275 function page_Special_EditSidebar()
  2273 function page_Special_EditSidebar()
  2276 {
  2274 {