diff options
Diffstat (limited to '')
-rw-r--r-- | admin.php | 32 | ||||
-rw-r--r-- | admin/plugin.php | 21 | ||||
-rw-r--r-- | admin/plugins.php | 24 |
3 files changed, 30 insertions, 47 deletions
@@ -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)); diff --git a/admin/plugin.php b/admin/plugin.php index e3d5e4e4e..c880cdca7 100644 --- a/admin/plugin.php +++ b/admin/plugin.php @@ -31,40 +31,25 @@ if( !defined("PHPWG_ROOT_PATH") ) } include_once(PHPWG_ROOT_PATH.'admin/include/functions.php'); -include_once(PHPWG_ROOT_PATH.'admin/include/functions_plugins.inc.php'); check_status(ACCESS_ADMINISTRATOR); $template->set_filenames(array('plugin' => 'admin/plugin.tpl')); -trigger_action('plugin_admin_menu'); - - if ( isset($page['plugin_admin_menu']) ) { - $template->assign_block_vars('plugin_menu.menu_item', - array( - 'NAME' => l10n('Plugins'), - 'URL' => PHPWG_ROOT_PATH.'admin.php?page=plugins' - ) - ); - - $plug_base_url = PHPWG_ROOT_PATH.'admin.php?page=plugin&section='; foreach ($page['plugin_admin_menu'] as $menu) { if (isset($_GET['section']) and $menu['uid']==$_GET['section']) { $found_menu=$menu; + break; } - $template->assign_block_vars('plugin_menu.menu_item', - array( - 'NAME' => $menu['title'], - 'URL' => $plug_base_url.$menu['uid'] - ) - ); } } + if ( isset($found_menu) ) { + $template->assign_var('PLUGIN_TITLE', $found_menu['title'] ); call_user_func( $found_menu['function'], PHPWG_ROOT_PATH.'admin.php?page=plugin&section='.$found_menu['uid'] ); diff --git a/admin/plugins.php b/admin/plugins.php index 6b5bf4505..e8f2c2a5a 100644 --- a/admin/plugins.php +++ b/admin/plugins.php @@ -31,7 +31,6 @@ if( !defined("PHPWG_ROOT_PATH") ) } include_once(PHPWG_ROOT_PATH.'admin/include/functions.php'); -include_once(PHPWG_ROOT_PATH.'admin/include/functions_plugins.inc.php'); check_status(ACCESS_ADMINISTRATOR); $my_base_url = PHPWG_ROOT_PATH.'admin.php?page=plugins'; @@ -162,29 +161,6 @@ foreach ($db_plugins as $db_plugin) $template->set_filenames(array('plugins' => 'admin/plugins.tpl')); -trigger_action('plugin_admin_menu'); - -$template->assign_block_vars('plugin_menu.menu_item', - array( - 'NAME' => l10n('Plugins'), - 'URL' => PHPWG_ROOT_PATH.'admin.php?page=plugins' - ) - ); - -if ( isset($page['plugin_admin_menu']) ) -{ - $plug_base_url = PHPWG_ROOT_PATH.'admin.php?page=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'] - ) - ); - } -} - $num=0; foreach( $fs_plugins as $plugin_id => $fs_plugin ) { |