- plugins admin menu appear now in the admin page menubar
- plugins are loaded immediately after loading the config (allow them to hack more of pwg like user init, template init etc...) - trigger event format_exif_data (for picture display only) git-svn-id: http://piwigo.org/svn/trunk@1655 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
parent
51e56e9c1f
commit
f7960e7e72
10 changed files with 53 additions and 65 deletions
32
admin.php
32
admin.php
|
|
@ -31,6 +31,7 @@ define('IN_ADMIN', true);
|
|||
include_once( PHPWG_ROOT_PATH.'include/common.inc.php' );
|
||||
|
||||
include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
|
||||
include_once(PHPWG_ROOT_PATH.'admin/include/functions_plugins.inc.php');
|
||||
|
||||
// +-----------------------------------------------------------------------+
|
||||
// | Check Access and exit when user status is not ok |
|
||||
|
|
@ -58,6 +59,9 @@ else
|
|||
$page['page'] = 'intro';
|
||||
}
|
||||
|
||||
$page['errors'] = array();
|
||||
$page['infos'] = array();
|
||||
|
||||
$link_start = PHPWG_ROOT_PATH.'admin.php?page=';
|
||||
$conf_link = $link_start.'configuration&section=';
|
||||
$opt_link = $link_start.'cat_options&section=';
|
||||
|
|
@ -114,19 +118,38 @@ if ($conf['allow_random_representative'])
|
|||
);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------- content display
|
||||
$page['errors'] = array();
|
||||
$page['infos'] = array();
|
||||
// required before plugin page inclusion
|
||||
trigger_action('plugin_admin_menu');
|
||||
|
||||
include(PHPWG_ROOT_PATH.'admin/'.$page['page'].'.php');
|
||||
|
||||
//------------------------------------------------------------- content display
|
||||
$template->assign_block_vars('plugin_menu.menu_item',
|
||||
array(
|
||||
'NAME' => l10n('admin'),
|
||||
'URL' => $link_start.'plugins'
|
||||
)
|
||||
);
|
||||
if ( isset($page['plugin_admin_menu']) )
|
||||
{
|
||||
$plug_base_url = $link_start.'plugin&section=';
|
||||
foreach ($page['plugin_admin_menu'] as $menu)
|
||||
{
|
||||
$template->assign_block_vars('plugin_menu.menu_item',
|
||||
array(
|
||||
'NAME' => $menu['title'],
|
||||
'URL' => $plug_base_url.$menu['uid']
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// +-----------------------------------------------------------------------+
|
||||
// | errors & infos |
|
||||
// +-----------------------------------------------------------------------+
|
||||
|
||||
if (count($page['errors']) != 0)
|
||||
{
|
||||
$template->assign_block_vars('errors',array());
|
||||
foreach ($page['errors'] as $error)
|
||||
{
|
||||
$template->assign_block_vars('errors.error',array('ERROR'=>$error));
|
||||
|
|
@ -135,7 +158,6 @@ if (count($page['errors']) != 0)
|
|||
|
||||
if (count($page['infos']) != 0)
|
||||
{
|
||||
$template->assign_block_vars('infos',array());
|
||||
foreach ($page['infos'] as $info)
|
||||
{
|
||||
$template->assign_block_vars('infos.info',array('INFO'=>$info));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue