diff options
author | mistic100 <mistic@piwigo.org> | 2012-07-23 10:06:27 +0000 |
---|---|---|
committer | mistic100 <mistic@piwigo.org> | 2012-07-23 10:06:27 +0000 |
commit | 798de81516100c4037949c7e73c4c5af1915a088 (patch) | |
tree | 9f65e12568632152e24ac9e09ef0ea52257655c2 | |
parent | 3f51676bfefae98cddb26d5fa7b2992cc5aa6823 (diff) |
Merged revision(s) 16925 from trunk:
feature 2703: make it easy for plugins to add tabs in admin screens
add a trigger a give an id to each core tabsheets
git-svn-id: http://piwigo.org/svn/branches/2.4@16926 68402e56-0260-453c-a942-63ccdbb3a9ee
-rw-r--r-- | admin/album.php | 1 | ||||
-rw-r--r-- | admin/batch_manager.php | 1 | ||||
-rw-r--r-- | admin/cat_options.php | 1 | ||||
-rw-r--r-- | admin/comments.php | 1 | ||||
-rw-r--r-- | admin/configuration.php | 1 | ||||
-rw-r--r-- | admin/help.php | 1 | ||||
-rw-r--r-- | admin/include/albums_tab.inc.php | 1 | ||||
-rw-r--r-- | admin/include/functions_history.inc.php | 1 | ||||
-rw-r--r-- | admin/include/tabsheet.class.php | 8 | ||||
-rw-r--r-- | admin/languages.php | 1 | ||||
-rw-r--r-- | admin/notification_by_mail.php | 1 | ||||
-rw-r--r-- | admin/photo.php | 1 | ||||
-rw-r--r-- | admin/photos_add.php | 1 | ||||
-rw-r--r-- | admin/plugins.php | 1 | ||||
-rw-r--r-- | admin/rating.php | 1 | ||||
-rw-r--r-- | admin/rating_user.php | 1 | ||||
-rw-r--r-- | admin/themes.php | 1 | ||||
-rw-r--r-- | admin/updates.php | 3 |
18 files changed, 26 insertions, 1 deletions
diff --git a/admin/album.php b/admin/album.php index 8609da9f5..289be09ee 100644 --- a/admin/album.php +++ b/admin/album.php @@ -62,6 +62,7 @@ if (isset($_GET['tab'])) } $tabsheet = new tabsheet(); +$tabsheet->set_id('album'); $tabsheet->add('properties', l10n('Properties'), $admin_album_base_url.'-properties'); $tabsheet->add('sort_order', l10n('Manage photo ranks'), $admin_album_base_url.'-sort_order'); $tabsheet->add('permissions', l10n('Permissions'), $admin_album_base_url.'-permissions'); diff --git a/admin/batch_manager.php b/admin/batch_manager.php index 20508d576..ddca63ed0 100644 --- a/admin/batch_manager.php +++ b/admin/batch_manager.php @@ -379,6 +379,7 @@ else if (in_array($page['tab'], $tab_codes)) { $tabsheet = new tabsheet(); + $tabsheet->set_id('batch_manager'); foreach ($tabs as $tab) { $tabsheet->add( diff --git a/admin/cat_options.php b/admin/cat_options.php index cc757180c..aa871c309 100644 --- a/admin/cat_options.php +++ b/admin/cat_options.php @@ -138,6 +138,7 @@ $template->assign( // TabSheet $tabsheet = new tabsheet(); +$tabsheet->set_id('cat_options'); // TabSheet initialization $opt_link = $link_start.'cat_options&section='; $tabsheet->add('status', l10n('Public / Private'), $opt_link.'status'); diff --git a/admin/comments.php b/admin/comments.php index 5e8a6c4d2..9b330ac8b 100644 --- a/admin/comments.php +++ b/admin/comments.php @@ -98,6 +98,7 @@ $template->assign( include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php'); $tabsheet = new tabsheet(); +$tabsheet->set_id('comments'); $tabsheet->add('', l10n('User comments validation'), ''); $tabsheet->select(''); $tabsheet->assign(); diff --git a/admin/configuration.php b/admin/configuration.php index 5ea0da672..aa27cc5f3 100644 --- a/admin/configuration.php +++ b/admin/configuration.php @@ -286,6 +286,7 @@ $template->set_filename('config', 'configuration.tpl'); // TabSheet $tabsheet = new tabsheet(); +$tabsheet->set_id('configuration'); // TabSheet initialization $tabsheet->add('main', l10n('Main'), $conf_link.'main'); $tabsheet->add('sizes', l10n('Photo sizes'), $conf_link.'sizes'); diff --git a/admin/help.php b/admin/help.php index 22e223971..ec4a1fc45 100644 --- a/admin/help.php +++ b/admin/help.php @@ -65,6 +65,7 @@ else } $tabsheet = new tabsheet(); +$tabsheet->set_id('help'); foreach ($tabs as $tab) { if ($tab['code'] == $section) diff --git a/admin/include/albums_tab.inc.php b/admin/include/albums_tab.inc.php index 3db2d98a3..22457efd3 100644 --- a/admin/include/albums_tab.inc.php +++ b/admin/include/albums_tab.inc.php @@ -26,6 +26,7 @@ include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php'); $my_base_url = get_root_url().'admin.php?page='; $tabsheet = new tabsheet(); +$tabsheet->set_id('cat_list'); $tabsheet->add('list', l10n('List'), $my_base_url.'cat_list'); $tabsheet->add('move', l10n('Move'), $my_base_url.'cat_move'); $tabsheet->add('permalinks', l10n('Permalinks'), $my_base_url.'permalinks'); diff --git a/admin/include/functions_history.inc.php b/admin/include/functions_history.inc.php index 911546125..301ae6b7d 100644 --- a/admin/include/functions_history.inc.php +++ b/admin/include/functions_history.inc.php @@ -29,6 +29,7 @@ function history_tabsheet() // TabSheet $tabsheet = new tabsheet(); + $tabsheet->set_id('history'); // TabSheet initialization $tabsheet->add('stats', l10n('Statistics'), $link_start.'stats'); $tabsheet->add('history', l10n('Search'), $link_start.'history'); diff --git a/admin/include/tabsheet.class.php b/admin/include/tabsheet.class.php index e046c7f8d..02ee9a3d1 100644 --- a/admin/include/tabsheet.class.php +++ b/admin/include/tabsheet.class.php @@ -24,6 +24,7 @@ class tabsheet { var $sheets; + var $uniqid; var $name; var $titlename; var $selected; @@ -35,10 +36,16 @@ class tabsheet function tabsheet($name = 'TABSHEET', $titlename = 'TABSHEET_TITLE') { $this->sheets = array(); + $this->uniqid = null; $this->name = $name; $this->titlename = $titlename; $this->selected = ""; } + + function set_id($id) + { + $this->uniqid = $id; + } /* add a tab @@ -81,6 +88,7 @@ class tabsheet */ function select($name) { + $this->sheets = trigger_event('tabsheet_before_select', $this->sheets, $this->uniqid); $this->selected = $name; } diff --git a/admin/languages.php b/admin/languages.php index 748a91796..fd282d556 100644 --- a/admin/languages.php +++ b/admin/languages.php @@ -36,6 +36,7 @@ else $page['tab'] = 'installed'; $tabsheet = new tabsheet(); +$tabsheet->set_id('languages'); $tabsheet->add('installed', l10n('Installed Languages'), $my_base_url.'&tab=installed'); $tabsheet->add('update', l10n('Check for updates'), $my_base_url.'&tab=update'); $tabsheet->add('new', l10n('Add New Language'), $my_base_url.'&tab=new'); diff --git a/admin/notification_by_mail.php b/admin/notification_by_mail.php index 786dc7935..1db2bae32 100644 --- a/admin/notification_by_mail.php +++ b/admin/notification_by_mail.php @@ -588,6 +588,7 @@ if (is_autorize_status(ACCESS_WEBMASTER)) { // TabSheet $tabsheet = new tabsheet(); + $tabsheet->set_id('nbm'); // TabSheet initialization $tabsheet->add('param', l10n('Parameter'), add_url_params($base_url.get_query_string_diff(array('mode', 'select')), diff --git a/admin/photo.php b/admin/photo.php index 30d86624c..b016b4bcb 100644 --- a/admin/photo.php +++ b/admin/photo.php @@ -61,6 +61,7 @@ if (isset($_GET['tab'])) } $tabsheet = new tabsheet(); +$tabsheet->set_id('photo'); $tabsheet->add('properties', l10n('Properties'), $admin_photo_base_url.'-properties'); $tabsheet->add('coi', l10n('Center of interest'), $admin_photo_base_url.'-coi'); diff --git a/admin/photos_add.php b/admin/photos_add.php index d969cf099..92fd6b0bb 100644 --- a/admin/photos_add.php +++ b/admin/photos_add.php @@ -87,6 +87,7 @@ else } $tabsheet = new tabsheet(); +$tabsheet->set_id('photos_add'); foreach ($tabs as $tab) { $tabsheet->add( diff --git a/admin/plugins.php b/admin/plugins.php index 693ecb7a3..9c4e1d239 100644 --- a/admin/plugins.php +++ b/admin/plugins.php @@ -36,6 +36,7 @@ else $page['tab'] = 'installed'; $tabsheet = new tabsheet(); +$tabsheet->set_id('plugins'); $tabsheet->add('installed', l10n('Plugin list'), $my_base_url.'&tab=installed'); $tabsheet->add('update', l10n('Check for updates'), $my_base_url.'&tab=update'); $tabsheet->add('new', l10n('Other plugins'), $my_base_url.'&tab=new'); diff --git a/admin/rating.php b/admin/rating.php index 2073ca64c..0f495c876 100644 --- a/admin/rating.php +++ b/admin/rating.php @@ -36,6 +36,7 @@ check_status(ACCESS_ADMINISTRATOR); include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php'); $tabsheet = new tabsheet(); +$tabsheet->set_id('rating'); $tabsheet->add('rating', l10n('Photos'), get_root_url().'admin.php?page=rating'); $tabsheet->add('rating_user', l10n('Users'), get_root_url().'admin.php?page=rating_user'); $tabsheet->select('rating'); diff --git a/admin/rating_user.php b/admin/rating_user.php index 03cf2653e..480ec41c4 100644 --- a/admin/rating_user.php +++ b/admin/rating_user.php @@ -25,6 +25,7 @@ defined('PHPWG_ROOT_PATH') or die ("Hacking attempt!"); include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php'); $tabsheet = new tabsheet(); +$tabsheet->set_id('rating'); $tabsheet->add('rating', l10n('Photos'), get_root_url().'admin.php?page=rating'); $tabsheet->add('rating_user', l10n('Users'), get_root_url().'admin.php?page=rating_user'); $tabsheet->select('rating_user'); diff --git a/admin/themes.php b/admin/themes.php index eab002bc2..93d159dc2 100644 --- a/admin/themes.php +++ b/admin/themes.php @@ -36,6 +36,7 @@ else $page['tab'] = 'installed'; $tabsheet = new tabsheet(); +$tabsheet->set_id('themes'); $tabsheet->add('installed', l10n('Installed Themes'), $my_base_url.'&tab=installed'); $tabsheet->add('update', l10n('Check for updates'), $my_base_url.'&tab=update'); $tabsheet->add('new', l10n('Add New Theme'), $my_base_url.'&tab=new'); diff --git a/admin/updates.php b/admin/updates.php index 97c56a2cd..3a2c3609d 100644 --- a/admin/updates.php +++ b/admin/updates.php @@ -33,7 +33,8 @@ if (isset($_GET['tab'])) else
$page['tab'] = 'pwg';
-$tabsheet = new tabsheet();
+$tabsheet = new tabsheet(); +$tabsheet->set_id('updates');
$tabsheet->add('pwg', l10n('Piwigo Update'), $my_base_url);
$tabsheet->add('ext', l10n('Extensions Update'), $my_base_url.'&tab=ext');
$tabsheet->select($page['tab']);
|