mirror of
https://github.com/Piwigo/Piwigo.git
synced 2025-04-28 04:09:56 +03: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:
parent
2e2ac819ec
commit
283e9010eb
18 changed files with 26 additions and 1 deletions
|
@ -62,6 +62,7 @@ if (isset($_GET['tab']))
|
||||||
}
|
}
|
||||||
|
|
||||||
$tabsheet = new tabsheet();
|
$tabsheet = new tabsheet();
|
||||||
|
$tabsheet->set_id('album');
|
||||||
$tabsheet->add('properties', l10n('Properties'), $admin_album_base_url.'-properties');
|
$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('sort_order', l10n('Manage photo ranks'), $admin_album_base_url.'-sort_order');
|
||||||
$tabsheet->add('permissions', l10n('Permissions'), $admin_album_base_url.'-permissions');
|
$tabsheet->add('permissions', l10n('Permissions'), $admin_album_base_url.'-permissions');
|
||||||
|
|
|
@ -379,6 +379,7 @@ else
|
||||||
if (in_array($page['tab'], $tab_codes))
|
if (in_array($page['tab'], $tab_codes))
|
||||||
{
|
{
|
||||||
$tabsheet = new tabsheet();
|
$tabsheet = new tabsheet();
|
||||||
|
$tabsheet->set_id('batch_manager');
|
||||||
foreach ($tabs as $tab)
|
foreach ($tabs as $tab)
|
||||||
{
|
{
|
||||||
$tabsheet->add(
|
$tabsheet->add(
|
||||||
|
|
|
@ -138,6 +138,7 @@ $template->assign(
|
||||||
|
|
||||||
// TabSheet
|
// TabSheet
|
||||||
$tabsheet = new tabsheet();
|
$tabsheet = new tabsheet();
|
||||||
|
$tabsheet->set_id('cat_options');
|
||||||
// TabSheet initialization
|
// TabSheet initialization
|
||||||
$opt_link = $link_start.'cat_options&section=';
|
$opt_link = $link_start.'cat_options&section=';
|
||||||
$tabsheet->add('status', l10n('Public / Private'), $opt_link.'status');
|
$tabsheet->add('status', l10n('Public / Private'), $opt_link.'status');
|
||||||
|
|
|
@ -98,6 +98,7 @@ $template->assign(
|
||||||
include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php');
|
include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php');
|
||||||
|
|
||||||
$tabsheet = new tabsheet();
|
$tabsheet = new tabsheet();
|
||||||
|
$tabsheet->set_id('comments');
|
||||||
$tabsheet->add('', l10n('User comments validation'), '');
|
$tabsheet->add('', l10n('User comments validation'), '');
|
||||||
$tabsheet->select('');
|
$tabsheet->select('');
|
||||||
$tabsheet->assign();
|
$tabsheet->assign();
|
||||||
|
|
|
@ -286,6 +286,7 @@ $template->set_filename('config', 'configuration.tpl');
|
||||||
|
|
||||||
// TabSheet
|
// TabSheet
|
||||||
$tabsheet = new tabsheet();
|
$tabsheet = new tabsheet();
|
||||||
|
$tabsheet->set_id('configuration');
|
||||||
// TabSheet initialization
|
// TabSheet initialization
|
||||||
$tabsheet->add('main', l10n('Main'), $conf_link.'main');
|
$tabsheet->add('main', l10n('Main'), $conf_link.'main');
|
||||||
$tabsheet->add('sizes', l10n('Photo sizes'), $conf_link.'sizes');
|
$tabsheet->add('sizes', l10n('Photo sizes'), $conf_link.'sizes');
|
||||||
|
|
|
@ -65,6 +65,7 @@ else
|
||||||
}
|
}
|
||||||
|
|
||||||
$tabsheet = new tabsheet();
|
$tabsheet = new tabsheet();
|
||||||
|
$tabsheet->set_id('help');
|
||||||
foreach ($tabs as $tab)
|
foreach ($tabs as $tab)
|
||||||
{
|
{
|
||||||
if ($tab['code'] == $section)
|
if ($tab['code'] == $section)
|
||||||
|
|
|
@ -26,6 +26,7 @@ include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php');
|
||||||
$my_base_url = get_root_url().'admin.php?page=';
|
$my_base_url = get_root_url().'admin.php?page=';
|
||||||
|
|
||||||
$tabsheet = new tabsheet();
|
$tabsheet = new tabsheet();
|
||||||
|
$tabsheet->set_id('cat_list');
|
||||||
$tabsheet->add('list', l10n('List'), $my_base_url.'cat_list');
|
$tabsheet->add('list', l10n('List'), $my_base_url.'cat_list');
|
||||||
$tabsheet->add('move', l10n('Move'), $my_base_url.'cat_move');
|
$tabsheet->add('move', l10n('Move'), $my_base_url.'cat_move');
|
||||||
$tabsheet->add('permalinks', l10n('Permalinks'), $my_base_url.'permalinks');
|
$tabsheet->add('permalinks', l10n('Permalinks'), $my_base_url.'permalinks');
|
||||||
|
|
|
@ -29,6 +29,7 @@ function history_tabsheet()
|
||||||
|
|
||||||
// TabSheet
|
// TabSheet
|
||||||
$tabsheet = new tabsheet();
|
$tabsheet = new tabsheet();
|
||||||
|
$tabsheet->set_id('history');
|
||||||
// TabSheet initialization
|
// TabSheet initialization
|
||||||
$tabsheet->add('stats', l10n('Statistics'), $link_start.'stats');
|
$tabsheet->add('stats', l10n('Statistics'), $link_start.'stats');
|
||||||
$tabsheet->add('history', l10n('Search'), $link_start.'history');
|
$tabsheet->add('history', l10n('Search'), $link_start.'history');
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
class tabsheet
|
class tabsheet
|
||||||
{
|
{
|
||||||
var $sheets;
|
var $sheets;
|
||||||
|
var $uniqid;
|
||||||
var $name;
|
var $name;
|
||||||
var $titlename;
|
var $titlename;
|
||||||
var $selected;
|
var $selected;
|
||||||
|
@ -35,10 +36,16 @@ class tabsheet
|
||||||
function tabsheet($name = 'TABSHEET', $titlename = 'TABSHEET_TITLE')
|
function tabsheet($name = 'TABSHEET', $titlename = 'TABSHEET_TITLE')
|
||||||
{
|
{
|
||||||
$this->sheets = array();
|
$this->sheets = array();
|
||||||
|
$this->uniqid = null;
|
||||||
$this->name = $name;
|
$this->name = $name;
|
||||||
$this->titlename = $titlename;
|
$this->titlename = $titlename;
|
||||||
$this->selected = "";
|
$this->selected = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function set_id($id)
|
||||||
|
{
|
||||||
|
$this->uniqid = $id;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
add a tab
|
add a tab
|
||||||
|
@ -81,6 +88,7 @@ class tabsheet
|
||||||
*/
|
*/
|
||||||
function select($name)
|
function select($name)
|
||||||
{
|
{
|
||||||
|
$this->sheets = trigger_event('tabsheet_before_select', $this->sheets, $this->uniqid);
|
||||||
$this->selected = $name;
|
$this->selected = $name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -36,6 +36,7 @@ else
|
||||||
$page['tab'] = 'installed';
|
$page['tab'] = 'installed';
|
||||||
|
|
||||||
$tabsheet = new tabsheet();
|
$tabsheet = new tabsheet();
|
||||||
|
$tabsheet->set_id('languages');
|
||||||
$tabsheet->add('installed', l10n('Installed Languages'), $my_base_url.'&tab=installed');
|
$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('update', l10n('Check for updates'), $my_base_url.'&tab=update');
|
||||||
$tabsheet->add('new', l10n('Add New Language'), $my_base_url.'&tab=new');
|
$tabsheet->add('new', l10n('Add New Language'), $my_base_url.'&tab=new');
|
||||||
|
|
|
@ -588,6 +588,7 @@ if (is_autorize_status(ACCESS_WEBMASTER))
|
||||||
{
|
{
|
||||||
// TabSheet
|
// TabSheet
|
||||||
$tabsheet = new tabsheet();
|
$tabsheet = new tabsheet();
|
||||||
|
$tabsheet->set_id('nbm');
|
||||||
// TabSheet initialization
|
// TabSheet initialization
|
||||||
$tabsheet->add('param', l10n('Parameter'),
|
$tabsheet->add('param', l10n('Parameter'),
|
||||||
add_url_params($base_url.get_query_string_diff(array('mode', 'select')),
|
add_url_params($base_url.get_query_string_diff(array('mode', 'select')),
|
||||||
|
|
|
@ -61,6 +61,7 @@ if (isset($_GET['tab']))
|
||||||
}
|
}
|
||||||
|
|
||||||
$tabsheet = new tabsheet();
|
$tabsheet = new tabsheet();
|
||||||
|
$tabsheet->set_id('photo');
|
||||||
$tabsheet->add('properties', l10n('Properties'), $admin_photo_base_url.'-properties');
|
$tabsheet->add('properties', l10n('Properties'), $admin_photo_base_url.'-properties');
|
||||||
$tabsheet->add('coi', l10n('Center of interest'), $admin_photo_base_url.'-coi');
|
$tabsheet->add('coi', l10n('Center of interest'), $admin_photo_base_url.'-coi');
|
||||||
|
|
||||||
|
|
|
@ -87,6 +87,7 @@ else
|
||||||
}
|
}
|
||||||
|
|
||||||
$tabsheet = new tabsheet();
|
$tabsheet = new tabsheet();
|
||||||
|
$tabsheet->set_id('photos_add');
|
||||||
foreach ($tabs as $tab)
|
foreach ($tabs as $tab)
|
||||||
{
|
{
|
||||||
$tabsheet->add(
|
$tabsheet->add(
|
||||||
|
|
|
@ -36,6 +36,7 @@ else
|
||||||
$page['tab'] = 'installed';
|
$page['tab'] = 'installed';
|
||||||
|
|
||||||
$tabsheet = new tabsheet();
|
$tabsheet = new tabsheet();
|
||||||
|
$tabsheet->set_id('plugins');
|
||||||
$tabsheet->add('installed', l10n('Plugin list'), $my_base_url.'&tab=installed');
|
$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('update', l10n('Check for updates'), $my_base_url.'&tab=update');
|
||||||
$tabsheet->add('new', l10n('Other plugins'), $my_base_url.'&tab=new');
|
$tabsheet->add('new', l10n('Other plugins'), $my_base_url.'&tab=new');
|
||||||
|
|
|
@ -36,6 +36,7 @@ check_status(ACCESS_ADMINISTRATOR);
|
||||||
|
|
||||||
include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php');
|
include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php');
|
||||||
$tabsheet = new tabsheet();
|
$tabsheet = new tabsheet();
|
||||||
|
$tabsheet->set_id('rating');
|
||||||
$tabsheet->add('rating', l10n('Photos'), get_root_url().'admin.php?page=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->add('rating_user', l10n('Users'), get_root_url().'admin.php?page=rating_user');
|
||||||
$tabsheet->select('rating');
|
$tabsheet->select('rating');
|
||||||
|
|
|
@ -25,6 +25,7 @@ defined('PHPWG_ROOT_PATH') or die ("Hacking attempt!");
|
||||||
|
|
||||||
include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php');
|
include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php');
|
||||||
$tabsheet = new tabsheet();
|
$tabsheet = new tabsheet();
|
||||||
|
$tabsheet->set_id('rating');
|
||||||
$tabsheet->add('rating', l10n('Photos'), get_root_url().'admin.php?page=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->add('rating_user', l10n('Users'), get_root_url().'admin.php?page=rating_user');
|
||||||
$tabsheet->select('rating_user');
|
$tabsheet->select('rating_user');
|
||||||
|
|
|
@ -36,6 +36,7 @@ else
|
||||||
$page['tab'] = 'installed';
|
$page['tab'] = 'installed';
|
||||||
|
|
||||||
$tabsheet = new tabsheet();
|
$tabsheet = new tabsheet();
|
||||||
|
$tabsheet->set_id('themes');
|
||||||
$tabsheet->add('installed', l10n('Installed Themes'), $my_base_url.'&tab=installed');
|
$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('update', l10n('Check for updates'), $my_base_url.'&tab=update');
|
||||||
$tabsheet->add('new', l10n('Add New Theme'), $my_base_url.'&tab=new');
|
$tabsheet->add('new', l10n('Add New Theme'), $my_base_url.'&tab=new');
|
||||||
|
|
|
@ -33,7 +33,8 @@ if (isset($_GET['tab']))
|
||||||
else
|
else
|
||||||
$page['tab'] = 'pwg';
|
$page['tab'] = 'pwg';
|
||||||
|
|
||||||
$tabsheet = new tabsheet();
|
$tabsheet = new tabsheet();
|
||||||
|
$tabsheet->set_id('updates');
|
||||||
$tabsheet->add('pwg', l10n('Piwigo Update'), $my_base_url);
|
$tabsheet->add('pwg', l10n('Piwigo Update'), $my_base_url);
|
||||||
$tabsheet->add('ext', l10n('Extensions Update'), $my_base_url.'&tab=ext');
|
$tabsheet->add('ext', l10n('Extensions Update'), $my_base_url.'&tab=ext');
|
||||||
$tabsheet->select($page['tab']);
|
$tabsheet->select($page['tab']);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue