Changeset 11655


Ignore:
Timestamp:
07/07/11 11:15:57 (9 years ago)
Author:
patdenice
Message:

LocalFiles Editor tabs can be selected in configuration file.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/plugins/LocalFilesEditor/admin.php

    r10348 r11655  
    3131// |                            Tabssheet 
    3232// +-----------------------------------------------------------------------+ 
    33 if (!isset($_GET['tab'])) 
    34     $page['tab'] = 'localconf'; 
    35 else 
    36     $page['tab'] = $_GET['tab']; 
     33 
     34if (empty($conf['LocalFilesEditor_tabs'])) 
     35{ 
     36  $conf['LocalFilesEditor_tabs'] = array('localconf', 'css', 'tpl', 'lang', 'plug'); 
     37} 
     38 
     39$page['tab'] = isset($_GET['tab']) ? $_GET['tab'] : $conf['LocalFilesEditor_tabs'][0]; 
     40 
     41if (!in_array($page['tab'], $conf['LocalFilesEditor_tabs'])) die('Hacking attempt!'); 
    3742 
    3843$tabsheet = new tabsheet(); 
    39 $tabsheet->add('localconf', 
    40                l10n('locfiledit_onglet_localconf'), 
    41                $my_base_url.'-localconf'); 
    42 $tabsheet->add('css', 
    43                l10n('locfiledit_onglet_css'), 
    44                $my_base_url.'-css'); 
    45 $tabsheet->add('tpl', 
    46                l10n('locfiledit_onglet_tpl'), 
    47                $my_base_url.'-tpl'); 
    48 $tabsheet->add('lang', 
    49                l10n('locfiledit_onglet_lang'), 
    50                $my_base_url.'-lang'); 
    51 $tabsheet->add('plug', 
    52                l10n('locfiledit_onglet_plug'), 
    53                $my_base_url.'-plug'); 
     44foreach ($conf['LocalFilesEditor_tabs'] as $tab) 
     45{ 
     46  $tabsheet->add($tab, l10n('locfiledit_onglet_'.$tab), $my_base_url.'-'.$tab); 
     47} 
    5448$tabsheet->select($page['tab']); 
    5549$tabsheet->assign(); 
Note: See TracChangeset for help on using the changeset viewer.