plugins/SpecialAdmin.php
changeset 590 03a60844c7c5
parent 582 a38876c0793c
child 593 4f9bec0d65c1
equal deleted inserted replaced
589:88d4ed0a2898 590:03a60844c7c5
    22  * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for details.
    22  * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for details.
    23  */
    23  */
    24  
    24  
    25 global $db, $session, $paths, $template, $plugins; // Common objects
    25 global $db, $session, $paths, $template, $plugins; // Common objects
    26 
    26 
    27 $plugins->attachHook('session_started', '
    27 $plugins->attachHook('session_started', 'SpecialAdmin_paths_init();');
       
    28 
       
    29 function SpecialAdmin_paths_init()
       
    30 {
    28   global $paths;
    31   global $paths;
    29     $paths->add_page(Array(
    32   $paths->add_page(Array(
    30       \'name\'=>\'specialpage_administration\',
    33     'name'=>'specialpage_administration',
    31       \'urlname\'=>\'Administration\',
    34     'urlname'=>'Administration',
    32       \'namespace\'=>\'Special\',
    35     'namespace'=>'Special',
    33       \'special\'=>0,\'visible\'=>1,\'comments_on\'=>0,\'protected\'=>1,\'delvotes\'=>0,\'delvote_ips\'=>\'\',
    36     'special'=>0,'visible'=>1,'comments_on'=>0,'protected'=>1,'delvotes'=>0,'delvote_ips'=>'',
    34       ));
    37     ));
    35     
    38   
    36     $paths->add_page(Array(
    39   $paths->add_page(Array(
    37       \'name\'=>\'specialpage_manage_sidebar\',
    40     'name'=>'specialpage_manage_sidebar',
    38       \'urlname\'=>\'EditSidebar\',
    41     'urlname'=>'EditSidebar',
    39       \'namespace\'=>\'Special\',
    42     'namespace'=>'Special',
    40       \'special\'=>0,\'visible\'=>1,\'comments_on\'=>0,\'protected\'=>1,\'delvotes\'=>0,\'delvote_ips\'=>\'\',
    43     'special'=>0,'visible'=>1,'comments_on'=>0,'protected'=>1,'delvotes'=>0,'delvote_ips'=>'',
    41       ));
    44     ));
    42   ');
    45 }
    43 
    46 
    44 // Admin pages that were too enormous to be in this file were split off into the plugins/admin/ directory in 1.0.1
    47 $plugins->attachHook('common_post', 'SpecialAdmin_include();');
    45 require(ENANO_ROOT . '/plugins/admin/PageManager.php');
    48 
    46 require(ENANO_ROOT . '/plugins/admin/PageEditor.php');
    49 function SpecialAdmin_include()
    47 require(ENANO_ROOT . '/plugins/admin/PageGroups.php');
    50 {
    48 require(ENANO_ROOT . '/plugins/admin/GroupManager.php');
    51   global $paths;
    49 require(ENANO_ROOT . '/plugins/admin/SecurityLog.php');
    52   
    50 require(ENANO_ROOT . '/plugins/admin/UserManager.php');
    53   // Admin pages that were too enormous to be in this file were split off into the plugins/admin/ directory in 1.0.1.
    51 require(ENANO_ROOT . '/plugins/admin/UserRanks.php');
    54   // Only load these files if we're looking to load the admin panel
    52 require(ENANO_ROOT . '/plugins/admin/LangManager.php');
    55   list($pid, $ns) = RenderMan::strToPageID($paths->get_pageid_from_url());
    53 require(ENANO_ROOT . '/plugins/admin/ThemeManager.php');
    56   if ( $ns == 'Admin' )
    54 require(ENANO_ROOT . '/plugins/admin/PluginManager.php');
    57   {
       
    58     require(ENANO_ROOT . '/plugins/admin/PageManager.php');
       
    59     require(ENANO_ROOT . '/plugins/admin/PageEditor.php');
       
    60     require(ENANO_ROOT . '/plugins/admin/PageGroups.php');
       
    61     require(ENANO_ROOT . '/plugins/admin/GroupManager.php');
       
    62     require(ENANO_ROOT . '/plugins/admin/SecurityLog.php');
       
    63     require(ENANO_ROOT . '/plugins/admin/UserManager.php');
       
    64     require(ENANO_ROOT . '/plugins/admin/UserRanks.php');
       
    65     require(ENANO_ROOT . '/plugins/admin/LangManager.php');
       
    66     require(ENANO_ROOT . '/plugins/admin/ThemeManager.php');
       
    67     require(ENANO_ROOT . '/plugins/admin/PluginManager.php');
       
    68   }
       
    69 }
    55 
    70 
    56 // For convenience and nothing more.
    71 // For convenience and nothing more.
    57 function acp_start_form()
    72 function acp_start_form()
    58 {
    73 {
    59   global $db, $session, $paths, $template, $plugins; // Common objects
    74   global $db, $session, $paths, $template, $plugins; // Common objects