From f90014943d7344608f519b556bc5086b41f3b14f Mon Sep 17 00:00:00 2001 From: patdenice Date: Thu, 7 Jul 2011 09:15:57 +0000 Subject: LocalFiles Editor tabs can be selected in configuration file. git-svn-id: http://piwigo.org/svn/trunk@11655 68402e56-0260-453c-a942-63ccdbb3a9ee --- plugins/LocalFilesEditor/admin.php | 32 +++++++++++++------------------- 1 file changed, 13 insertions(+), 19 deletions(-) (limited to 'plugins') diff --git a/plugins/LocalFilesEditor/admin.php b/plugins/LocalFilesEditor/admin.php index a0e679378..cdb452950 100644 --- a/plugins/LocalFilesEditor/admin.php +++ b/plugins/LocalFilesEditor/admin.php @@ -30,27 +30,21 @@ $my_base_url = get_root_url().'admin.php?page=plugin-'.basename(dirname(__FILE__ // +-----------------------------------------------------------------------+ // | Tabssheet // +-----------------------------------------------------------------------+ -if (!isset($_GET['tab'])) - $page['tab'] = 'localconf'; -else - $page['tab'] = $_GET['tab']; + +if (empty($conf['LocalFilesEditor_tabs'])) +{ + $conf['LocalFilesEditor_tabs'] = array('localconf', 'css', 'tpl', 'lang', 'plug'); +} + +$page['tab'] = isset($_GET['tab']) ? $_GET['tab'] : $conf['LocalFilesEditor_tabs'][0]; + +if (!in_array($page['tab'], $conf['LocalFilesEditor_tabs'])) die('Hacking attempt!'); $tabsheet = new tabsheet(); -$tabsheet->add('localconf', - l10n('locfiledit_onglet_localconf'), - $my_base_url.'-localconf'); -$tabsheet->add('css', - l10n('locfiledit_onglet_css'), - $my_base_url.'-css'); -$tabsheet->add('tpl', - l10n('locfiledit_onglet_tpl'), - $my_base_url.'-tpl'); -$tabsheet->add('lang', - l10n('locfiledit_onglet_lang'), - $my_base_url.'-lang'); -$tabsheet->add('plug', - l10n('locfiledit_onglet_plug'), - $my_base_url.'-plug'); +foreach ($conf['LocalFilesEditor_tabs'] as $tab) +{ + $tabsheet->add($tab, l10n('locfiledit_onglet_'.$tab), $my_base_url.'-'.$tab); +} $tabsheet->select($page['tab']); $tabsheet->assign(); -- cgit v1.2.3