mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-07-19 16:13:00 +02:00
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/trunk@16925 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
@@ -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');
|
||||
|
||||
@@ -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');
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user