Show
Ignore:
Timestamp:
01/12/07 23:39:27 (16 years ago)
Author:
exi
Message:

Removed unneeded admin_rental.php and maintenance.php.
Converted the first admin page to a new format, see class.options.php for details.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • dev/common/admin_menu.php

    r148 r177  
    11<?php 
    22require_once("class.box.php"); 
     3require_once('class.options.php'); 
    34 
    4 $menubox = new Box(); 
    5 $menubox->setIcon("menu-item.gif"); 
    6 $menubox->addOption("link","Generic", "?a=admin"); 
    7 $menubox->addOption("link","Contracts", "?a=admin_cc&op=view&type=contract"); 
    8 $menubox->addOption("link","Campaigns", "?a=admin_cc&op=view&type=campaign"); 
    9 $menubox->addOption("link","Standings", "?a=admin_standings"); 
    10 $menubox->addOption("link","Ship Values", "?a=admin_shp_val"); 
    11 $menubox->addOption("link","Synchronization", "?a=admin_sync"); 
    12 $menubox->addOption("link","Map Options", "?a=admin_mapoptions"); 
    13 $menubox->addOption("link","Post Permissions", "?a=admin_postperm"); 
    14 $menubox->addOption("link","Mods", "?a=admin_mods"); 
    15 if (file_exists('common/admin_feed.php')) 
     5// include all admin modules 
     6$dir = 'common/admin/'; 
     7if (is_dir($dir)) 
    168{ 
    17     $menubox->addOption("link","Feeds", "?a=admin_feed"); 
     9    if ($dh = opendir($dir)) 
     10    { 
     11        while (($file = readdir($dh)) !== false) 
     12        { 
     13            if (strstr($file, 'admin_') && substr($file, -4) == '.php') 
     14            { 
     15                require_once($dir.$file); 
     16            } 
     17        } 
     18        closedir($dh); 
     19    } 
    1820} 
    19 $menubox->addOption("link","Auditing", "?a=admin_audit"); 
    20 $menubox->addOption("link","Kill Import - files", "?a=kill_import"); 
    21 $menubox->addOption("link","Kill Import - csv", "?a=kill_import_csv"); 
    22 $menubox->addOption("link","Kill Export - files", "?a=kill_export"); 
    23 $menubox->addOption("link","Kill Export - csv", "?a=kill_export_search"); 
    24 $menubox->addOption("link","Logout", "?a=logout"); 
     21 
     22// overload the box object to force every admin page to use the new options menu 
     23class Box2 extends Box 
     24{ 
     25    function generate() 
     26    { 
     27        return options::genAdminMenu(); 
     28    } 
     29} 
     30 
     31$menubox = new Box2(); 
     32 
     33options::oldMenu('Appearance', "Contracts", "?a=admin_cc&op=view&type=contract"); 
     34options::oldMenu('Appearance', "Campaigns", "?a=admin_cc&op=view&type=campaign"); 
     35options::oldMenu('Appearance', "Standings", "?a=admin_standings"); 
     36options::oldMenu('Appearance', "Map Options", "?a=admin_mapoptions"); 
     37options::oldMenu('Advanced', "Ship Values", "?a=admin_shp_val"); 
     38options::oldMenu('Advanced', "Synchronization", "?a=admin_sync"); 
     39options::oldMenu('Advanced', "Post Permissions", "?a=admin_postperm"); 
     40options::oldMenu('Modules'," Mods", "?a=admin_mods"); 
     41options::oldMenu('Maintenance', "Auditing", "?a=admin_audit"); 
     42options::oldMenu('Maintenance', "Kill Import - files", "?a=kill_import"); 
     43options::oldMenu('Maintenance', "Kill Import - csv", "?a=kill_import_csv"); 
     44options::oldMenu('Maintenance', "Kill Export - files", "?a=kill_export"); 
     45options::oldMenu('Maintenance', "Kill Export - csv", "?a=kill_export_search"); 
     46options::oldMenu('Maintenance', "Logout", "?a=logout"); 
    2547?>