aboutsummaryrefslogtreecommitdiffstats
path: root/admin
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2006-11-01 05:54:35 +0000
committerrvelices <rv-github@modusoptimus.com>2006-11-01 05:54:35 +0000
commitbce8b9f680af4eb5481441e52e1d82b11da722be (patch)
tree45b30f55abb3257bbc3a8592f8ab872468e41636 /admin
parent525c9bc40ab6a99c44292388ce4385574057da86 (diff)
plugins last modifications + events are triggered now from picture.php
git-svn-id: http://piwigo.org/svn/trunk@1590 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--admin/include/functions_plugins.inc.php26
-rw-r--r--admin/plugin.php2
-rw-r--r--admin/plugins.php2
3 files changed, 24 insertions, 6 deletions
diff --git a/admin/include/functions_plugins.inc.php b/admin/include/functions_plugins.inc.php
index d938f7b23..652aa7e19 100644
--- a/admin/include/functions_plugins.inc.php
+++ b/admin/include/functions_plugins.inc.php
@@ -38,11 +38,11 @@ function get_fs_plugins()
$path = PHPWG_PLUGINS_PATH.$file;
if (is_dir($path) and !is_link($path)
and preg_match('/^[a-zA-Z0-9-_]+$/', $file )
- and file_exists($path.'/index.php')
+ and file_exists($path.'/main.inc.php')
)
{
$plugin = array('name'=>'?', 'version'=>'0', 'uri'=>'', 'description'=>'');
- $plg_data = implode( '', file($path.'/index.php') );
+ $plg_data = implode( '', file($path.'/main.inc.php') );
if ( preg_match("|Plugin Name: (.*)|i", $plg_data, $val) )
{
@@ -72,8 +72,26 @@ function get_fs_plugins()
function add_plugin_admin_menu($title, $func)
{
global $page;
-
- $uid = md5( var_export($func, true) );
+ if ( is_array( $func) )
+ {
+ $s = '';
+ foreach( $func as $e)
+ {
+ if (is_object($e))
+ {
+ $s.=get_class($e)."\n";
+ }
+ else
+ {
+ $s.=$e;
+ }
+ }
+ $uid = md5( $s );
+ }
+ else
+ {
+ $uid = md5( $func );
+ }
$page['plugin_admin_menu'][] =
array(
'title' => $title,
diff --git a/admin/plugin.php b/admin/plugin.php
index 08afccc61..e3d5e4e4e 100644
--- a/admin/plugin.php
+++ b/admin/plugin.php
@@ -36,7 +36,7 @@ check_status(ACCESS_ADMINISTRATOR);
$template->set_filenames(array('plugin' => 'admin/plugin.tpl'));
-trigger_event('plugin_admin_menu');
+trigger_action('plugin_admin_menu');
if ( isset($page['plugin_admin_menu']) )
diff --git a/admin/plugins.php b/admin/plugins.php
index 27bc5600d..6b5bf4505 100644
--- a/admin/plugins.php
+++ b/admin/plugins.php
@@ -162,7 +162,7 @@ foreach ($db_plugins as $db_plugin)
$template->set_filenames(array('plugins' => 'admin/plugins.tpl'));
-trigger_event('plugin_admin_menu');
+trigger_action('plugin_admin_menu');
$template->assign_block_vars('plugin_menu.menu_item',
array(