mirror of
https://github.com/Piwigo/Piwigo.git
synced 2025-04-27 19:59:56 +03:00
git-svn-id: http://piwigo.org/svn/trunk@1604 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
parent
e5e776a263
commit
724671b669
6 changed files with 33 additions and 39 deletions
|
@ -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');
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue