root/dev/common/admin/admin_menu.php @ 190

Revision 190, 2.1 KB (checked in by exi, 15 years ago)

This is a big update...
Moved all admin scripts to common/admin.
Moved all includes and classes to common/includes.
Edited all include-paths to reflect the movement.
Fixed a bug with the session system allowing every registered user to access admin pages.
Replaced calls to date() to use a wrapper so gmdate can be used.
Replaced some calls to $config with calls to the static object.
Fixed a big which caused the portrait_grab to not download a new picute.
Added a classified-state to kills.
Removed the sync_server server script in this tree.
Added code to help modules find the includes to index.php.

Line 
1<?php
2require_once('common/includes/class.options.php');
3
4// include all admin modules
5// this doesnt need to check for itself because its already loaded
6$dir = 'common/admin/';
7if (is_dir($dir))
8{
9    if ($dh = opendir($dir))
10    {
11        while (($file = readdir($dh)) !== false)
12        {
13            // only load auto-option files
14            if (strstr($file, 'option_') && substr($file, -4) == '.php')
15            {
16                require_once($dir.$file);
17            }
18        }
19        closedir($dh);
20    }
21}
22
23// load all auto-options from mods
24$mods_active = explode(',', config::get('mods_active'));
25$modOverrides = false;
26foreach ($mods_active as $mod)
27{
28    if (file_exists('mods/'.$mod.'/auto_settings.php'))
29    {
30        include('mods/'.$mod.'/auto_settings.php');
31    }
32}
33
34// overload the box object to force every admin page to use the new options menu
35class Box2 extends Box
36{
37    function generate()
38    {
39        return options::genAdminMenu();
40    }
41}
42
43$menubox = new Box2();
44
45options::oldMenu('Appearance', "Contracts", "?a=admin_cc&op=view&type=contract");
46options::oldMenu('Appearance', "Campaigns", "?a=admin_cc&op=view&type=campaign");
47options::oldMenu('Appearance', "Standings", "?a=admin_standings");
48options::oldMenu('Appearance', "Map Options", "?a=admin_mapoptions");
49
50options::oldMenu('Advanced', "Ship Values", "?a=admin_shp_val");
51options::oldMenu('Advanced', "Synchronization", "?a=admin_sync");
52options::oldMenu('Advanced', "Post Permissions", "?a=admin_postperm");
53
54options::oldMenu('Modules', "Mods", "?a=admin_mods");
55
56options::oldMenu('Maintenance', "Auditing", "?a=admin_audit");
57options::oldMenu('Maintenance', "Kill Import - files", "?a=admin_kill_import");
58options::oldMenu('Maintenance', "Kill Import - csv", "?a=admin_kill_import_csv");
59options::oldMenu('Maintenance', "Kill Export - files", "?a=admin_kill_export");
60options::oldMenu('Maintenance', "Kill Export - csv", "?a=admin_kill_export_search");
61options::oldMenu('Maintenance', "Logout", "?a=logout");
62
63options::oldMenu('User', 'Roles', '?a=admin_roles');
64#options::oldMenu('User', 'Titles', '?a=admin_titles');
65?>
Note: See TracBrowser for help on using the browser.