mirror of
https://github.com/Piwigo/Piwigo.git
synced 2025-04-27 03:39:57 +03:00
plugins last modifications + events are triggered now from picture.php
git-svn-id: http://piwigo.org/svn/trunk@1590 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
parent
525c9bc40a
commit
bce8b9f680
14 changed files with 372 additions and 220 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue