Changeset 19736


Ignore:
Timestamp:
Jan 3, 2013, 12:35:11 AM (8 years ago)
Author:
julien1311
Message:

admin link modification

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/Media_Icon/admin.php

    r19353 r19736  
    1515check_status(ACCESS_ADMINISTRATOR);
    1616
    17 //Initialization
    18 $my_base_url = get_admin_plugin_menu_link(__FILE__);
     17//Tab management
     18if (empty($conf['Media_Icon_tabs'])) {
     19  $conf['Media_Icon_tabs'] = array('general', 'advanced', 'help');
     20}
    1921
    20 //Tab management
    21 if (!isset($_GET['tab']))
    22     $page['tab'] = 'general';
    23 else
    24     $page['tab'] = $_GET['tab'];
     22$page['tab'] = isset($_GET['tab']) ? $_GET['tab'] : $conf['Media_Icon_tabs'][0];
     23
     24if (!in_array($page['tab'], $conf['Media_Icon_tabs'])) die('Hacking attempt!');
    2525
    2626$tabsheet = new tabsheet();
    27 $tabsheet->add('general',
    28                l10n('General'),
    29                $my_base_url.'&tab=general');
    30 $tabsheet->add('advanced',
    31                l10n('Advanced options'),
    32                $my_base_url.'&tab=advanced');
    33 $tabsheet->add('help',
    34                l10n('Help'),
    35                $my_base_url.'&tab=help');
     27foreach ($conf['Media_Icon_tabs'] as $tab) {
     28  $tabsheet->add($tab, l10n(ucfirst($tab)), MEDIA_ICON_ADMIN.'-'.$tab);
     29}
    3630$tabsheet->select($page['tab']);
    3731$tabsheet->assign();
    3832
    39 switch ($page['tab']) {
    40         case 'advanced':
    41                 include_once(dirname(__FILE__).'/admin/admin_advanced.php');
    42                 break;
    43         case 'help':
    44                 include_once(dirname(__FILE__).'/admin/admin_help.php');
    45                 break;
    46         default:
    47                 include_once(dirname(__FILE__).'/admin/admin_general.php');
    48                 break;
    49 }
     33include_once(MEDIA_ICON_PATH.'/admin/admin_'.$page['tab'].'.php');
    5034?>
Note: See TracChangeset for help on using the changeset viewer.