aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2006-11-10 01:10:42 +0000
committerrvelices <rv-github@modusoptimus.com>2006-11-10 01:10:42 +0000
commit724671b669d5a0e5a2ffb684ffd4534584c52113 (patch)
tree0bbe2f62f2a325ee0060627e032c8b99b0b98341 /include
parente5e776a263ba63407893a28df379f2ac8152680c (diff)
git-svn-id: http://piwigo.org/svn/trunk@1604 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include')
-rw-r--r--include/functions_plugins.inc.php19
-rw-r--r--include/section_init.inc.php2
2 files changed, 14 insertions, 7 deletions
diff --git a/include/functions_plugins.inc.php b/include/functions_plugins.inc.php
index e83f76df7..92adb22e9 100644
--- a/include/functions_plugins.inc.php
+++ b/include/functions_plugins.inc.php
@@ -54,7 +54,7 @@ function add_event_handler($event, $func,
{
if ( $handler['function'] == $func )
{
- return true;
+ return false;
}
}
}
@@ -230,6 +230,15 @@ WHERE 1=1';
}
+function load_plugin($plugin)
+{
+ $file_name = PHPWG_PLUGINS_PATH.$plugin['id'].'/main.inc.php';
+ if ( file_exists($file_name) )
+ {
+ include_once( $file_name );
+ }
+}
+
/*loads all the plugins on startup*/
function load_plugins()
{
@@ -241,12 +250,8 @@ function load_plugins()
$plugins = get_db_plugins('active');
foreach( $plugins as $plugin)
- {
- $file_name = PHPWG_PLUGINS_PATH.$plugin['id'].'/main.inc.php';
- if ( file_exists($file_name) )
- {
- include_once( $file_name );
- }
+ {// include main from a function to avoid using same function context
+ load_plugin($plugin);
}
trigger_action('plugins_loaded');
}
diff --git a/include/section_init.inc.php b/include/section_init.inc.php
index 8d0525422..9db071714 100644
--- a/include/section_init.inc.php
+++ b/include/section_init.inc.php
@@ -652,4 +652,6 @@ SELECT id,file
$page['image_id'] = -1; // will fail in picture.php
}
}
+
+trigger_action('loc_end_section_init');
?> \ No newline at end of file