From bce8b9f680af4eb5481441e52e1d82b11da722be Mon Sep 17 00:00:00 2001 From: rvelices Date: Wed, 1 Nov 2006 05:54:35 +0000 Subject: [PATCH] plugins last modifications + events are triggered now from picture.php git-svn-id: http://piwigo.org/svn/trunk@1590 68402e56-0260-453c-a942-63ccdbb3a9ee --- admin/include/functions_plugins.inc.php | 26 +- admin/plugin.php | 2 +- admin/plugins.php | 2 +- include/functions_plugins.inc.php | 125 +++++++-- include/page_header.php | 9 +- include/picture_metadata.inc.php | 4 +- picture.php | 261 ++++++++++-------- .../event_tracer/{index.php => main.inc.php} | 52 ++-- plugins/event_tracer/tracer_admin.tpl | 2 +- plugins/hello_world/index.php | 18 -- plugins/hello_world/main.inc.php | 30 ++ template/yoga/header.tpl | 6 +- template/yoga/picture.tpl | 47 ++-- template/yoga/picture_content.tpl | 8 + 14 files changed, 372 insertions(+), 220 deletions(-) rename plugins/event_tracer/{index.php => main.inc.php} (52%) delete mode 100644 plugins/hello_world/index.php create mode 100644 plugins/hello_world/main.inc.php create mode 100644 template/yoga/picture_content.tpl 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( diff --git a/include/functions_plugins.inc.php b/include/functions_plugins.inc.php index f381b0a89..e83f76df7 100644 --- a/include/functions_plugins.inc.php +++ b/include/functions_plugins.inc.php @@ -35,17 +35,22 @@ string. define('PHPWG_PLUGINS_PATH',PHPWG_ROOT_PATH.'plugins/'); +define('EVENT_HANDLER_PRIORITY_NEUTRAL', 50); + /* Register a event handler. * @param string $event the name of the event to listen to * @param mixed $func the function that will handle the event + * @param int $priority optional priority (greater priority will + * be executed at last) */ -function add_event_handler($event, $func, $priority=50, $accepted_args=1) +function add_event_handler($event, $func, + $priority=EVENT_HANDLER_PRIORITY_NEUTRAL, $accepted_args=1) { global $pwg_event_handlers; - if ( isset($pwg_event_handlers[$event]["$priority"]) ) + if ( isset($pwg_event_handlers[$event][$priority]) ) { - foreach($pwg_event_handlers[$event]["$priority"] as $handler) + foreach($pwg_event_handlers[$event][$priority] as $handler) { if ( $handler['function'] == $func ) { @@ -54,18 +59,50 @@ function add_event_handler($event, $func, $priority=50, $accepted_args=1) } } - trigger_event('add_event_handler', - array('event'=>$event, 'function'=>$func) - ); - - $pwg_event_handlers[$event]["$priority"][] = + $pwg_event_handlers[$event][$priority][] = array( 'function'=>$func, 'accepted_args'=>$accepted_args); - + ksort( $pwg_event_handlers[$event] ); return true; } +/* Register a event handler. + * @param string $event the name of the event to listen to + * @param mixed $func the function that needs removal + * @param int $priority optional priority (greater priority will + * be executed at last) +*/ +function remove_event_handler($event, $func, + $priority=EVENT_HANDLER_PRIORITY_NEUTRAL) +{ + global $pwg_event_handlers; + + if (!isset( $pwg_event_handlers[$event][$priority] ) ) + { + return false; + } + for ($i=0; $i$event, 'data'=>$data) ); - if ( !isset($pwg_event_handlers[$event]) ) - { - trigger_event('post_trigger_event', - array('event'=>$event, 'data'=>$data) ); - } - } if ( !isset($pwg_event_handlers[$event]) ) { + trigger_action('post_trigger_event', + array('event'=>$event, 'data'=>$data) ); return $data; } $args = array_slice(func_get_args(), 2); @@ -114,17 +147,53 @@ function trigger_event($event, $data=null) } } } - - if ($event!='pre_trigger_event' and $event!='post_trigger_event') - { - trigger_event('post_trigger_event', + trigger_action('post_trigger_event', array('event'=>$event, 'data'=>$data) ); - } - return $data; } +function trigger_action($event, $data=null) +{ + global $pwg_event_handlers; + if ($event!='pre_trigger_event' + and $event!='post_trigger_event' + and $event!='trigger_action') + {// special case for debugging - avoid recursive calls + trigger_action('trigger_action', + array('event'=>$event, 'data'=>$data) ); + } + + if ( !isset($pwg_event_handlers[$event]) ) + { + return; + } + $args = array_slice(func_get_args(), 2); + + foreach ($pwg_event_handlers[$event] as $priority => $handlers) + { + if ( !is_null($handlers) ) + { + foreach($handlers as $handler) + { + $all_args = array_merge( array($data), $args); + $function_name = $handler['function']; + $accepted_args = $handler['accepted_args']; + + if ( $accepted_args == 1 ) + $the_args = array($data); + elseif ( $accepted_args > 1 ) + $the_args = array_slice($all_args, 0, $accepted_args); + elseif ( $accepted_args == 0 ) + $the_args = NULL; + else + $the_args = $all_args; + + call_user_func_array($function_name, $the_args); + } + } + } +} /* Returns an array of plugins defined in the database @@ -173,8 +242,12 @@ function load_plugins() $plugins = get_db_plugins('active'); foreach( $plugins as $plugin) { - @include_once( PHPWG_PLUGINS_PATH.$plugin['id'].'/index.php' ); + $file_name = PHPWG_PLUGINS_PATH.$plugin['id'].'/main.inc.php'; + if ( file_exists($file_name) ) + { + include_once( $file_name ); + } } - trigger_event('plugins_loaded'); + trigger_action('plugins_loaded'); } ?> \ No newline at end of file diff --git a/include/page_header.php b/include/page_header.php index af571ab19..1535eb896 100644 --- a/include/page_header.php +++ b/include/page_header.php @@ -30,6 +30,8 @@ // $template->set_filenames(array('header'=>'header.tpl')); +trigger_action('loc_begin_page_header'); + $template->assign_vars( array( 'GALLERY_TITLE' => @@ -37,9 +39,8 @@ $template->assign_vars( $page['gallery_title'] : $conf['gallery_title'], 'PAGE_BANNER' => - trigger_event('page_banner', - isset($page['page_banner']) ? - $page['page_banner'] : $conf['page_banner'] ), + isset($page['page_banner']) ? + $page['page_banner'] : $conf['page_banner'], 'BODY_ID' => isset($page['body_id']) ? @@ -67,6 +68,8 @@ if ( isset( $refresh ) and intval($refresh) >= 0 $template->assign_block_vars('refresh', array()); } +trigger_action('loc_end_page_header'); + header('Content-Type: text/html; charset='.$lang_info['charset']); $template->parse('header'); ?> diff --git a/include/picture_metadata.inc.php b/include/picture_metadata.inc.php index 777cbd822..038737eb7 100644 --- a/include/picture_metadata.inc.php +++ b/include/picture_metadata.inc.php @@ -39,7 +39,7 @@ if ($conf['show_exif']) die('Exif extension not available, admin should disable exif display'); } - if ($exif = @read_exif_data($picture['current']['src_file_system'])) + if ($exif = @read_exif_data($picture['current']['image_path'])) { $template->assign_block_vars( 'metadata.headline', @@ -92,7 +92,7 @@ if ($conf['show_exif']) } if ($conf['show_iptc']) { - $iptc = get_iptc_data($picture['current']['src_file_system'], + $iptc = get_iptc_data($picture['current']['image_path'], $conf['show_iptc_mapping']); if (count($iptc) > 0) diff --git a/picture.php b/picture.php index 6ebce15dd..69b28a7cc 100644 --- a/picture.php +++ b/picture.php @@ -46,6 +46,50 @@ if (!in_array($page['image_id'], $page['items'])) duplicate_index_url() ); } +// add default event handler for rendering element content +add_event_handler('render_element_content', 'default_picture_content', + EVENT_HANDLER_PRIORITY_NEUTRAL, 2); +trigger_action('loc_begin_picture'); + +// this is the default handler that generates the display for the element +function default_picture_content($content, $element_info) +{ + if ( !empty($content) ) + {// someone hooked us - so we skip; + return $content; + } + if (!isset($element_info['image_url'])) + { // nothing to do + return $content; + } + global $user; + $my_template = new Template(PHPWG_ROOT_PATH.'template/'.$user['template'], + $user['theme'] ); + $my_template->set_filenames( array('default_content'=>'picture_content.tpl') ); + + if (isset($element_info['high_url'])) + { + $uuid = uniqid(rand()); + $my_template->assign_block_vars( + 'high', + array( + 'U_HIGH' => $element_info['high_url'], + 'UUID' => $uuid, + ) + ); + } + $my_template->assign_vars( array( + 'SRC_IMG' => $element_info['image_url'], + 'ALT_IMG' => $element_info['file'], + 'WIDTH_IMG' => $element_info['scaled_width'], + 'HEIGHT_IMG' => $element_info['scaled_height'], + ) + ); + return $my_template->parse( 'default_content', true); +} + + + // +-----------------------------------------------------------------------+ // | initialization | // +-----------------------------------------------------------------------+ @@ -99,7 +143,7 @@ $url_self = duplicate_picture_url(); * Actions finish by a redirection */ -if (isset($_GET['action']) and !is_adviser()) +if (isset($_GET['action'])) { switch ($_GET['action']) { @@ -139,7 +183,7 @@ DELETE FROM '.FAVORITES_TABLE.' } case 'set_as_representative' : { - if (is_admin() and isset($page['category'])) + if (is_admin() and !is_adviser() and isset($page['category'])) { $query = ' UPDATE '.CATEGORIES_TABLE.' @@ -174,7 +218,7 @@ UPDATE '.CATEGORIES_TABLE.' { if (isset($_GET['comment_to_delete']) and is_numeric($_GET['comment_to_delete']) - and is_admin()) + and is_admin() and !is_adviser() ) { $query = ' DELETE FROM '.COMMENTS_TABLE.' @@ -275,22 +319,17 @@ while ($row = mysql_fetch_array($result)) $cat_directory = dirname($row['path']); $file_wo_ext = get_filename_wo_extension($row['file']); - if (isset($row['representative_ext']) and $row['representative_ext'] != '') + // ------ build element_path and element_url + $picture[$i]['element_url'] = $row['path']; + if ( ! url_is_remote($row['path']) ) { - $picture[$i]['src'] = - $cat_directory.'/pwg_representative/' - .$file_wo_ext.'.'.$row['representative_ext']; + $picture[$i]['element_url'] = get_root_url().$row['path']; } - else - { - $icon = get_themeconf('mime_icon_dir'); - $icon.= strtolower(get_extension($row['file'])).'.png'; - $picture[$i]['src'] = $icon; - } - // special case for picture files + + // ------ build image_path and image_url if ($picture[$i]['is_picture']) { - $picture[$i]['src'] = $row['path']; + $picture[$i]['image_path'] = $row['path']; // if we are working on the "current" element, we search if there is a // high quality picture if ($i == 'current') @@ -298,25 +337,47 @@ while ($row = mysql_fetch_array($result)) if (($row['has_high'] == 'true') and ($user['enabled_high'] == 'true')) { $url_high=$cat_directory.'/pwg_high/'.$row['file']; - $picture[$i]['high_file_system'] = $picture[$i]['high'] = $url_high; - if ( ! url_is_remote($picture[$i]['high']) ) + $picture[$i]['high_url'] = $picture[$i]['high_path'] = $url_high; + if ( ! url_is_remote($picture[$i]['high_path']) ) { - $picture[$i]['high'] = get_root_url().$picture[$i]['high']; + $picture[$i]['high_url'] = get_root_url().$picture[$i]['high_path']; } } } } - $picture[$i]['src_file_system'] = $picture[$i]['src']; - if ( ! url_is_remote($picture[$i]['src']) ) - { - $picture[$i]['src'] = get_root_url(). $picture[$i]['src']; + else + {// not a picture + if (isset($row['representative_ext']) and $row['representative_ext']!='') + { + $picture[$i]['image_path'] = + $cat_directory.'/pwg_representative/' + .$file_wo_ext.'.'.$row['representative_ext']; + } + else + { + $picture[$i]['image_path'] = + get_themeconf('mime_icon_dir') + .strtolower(get_extension($row['file'])).'.png'; + } } - // if picture is not a file, we need the download link - if (!$picture[$i]['is_picture']) + $picture[$i]['image_url'] = $picture[$i]['image_path']; + if ( ! url_is_remote($picture[$i]['image_path']) ) { - $picture[$i]['download'] = url_is_remote($row['path']) ? '' : get_root_url(); - $picture[$i]['download'].= $row['path']; + $picture[$i]['image_url'] = get_root_url().$picture[$i]['image_path']; + } + + if (!$picture[$i]['is_picture']) + {// if picture is not a file, we need the download link + $picture[$i]['download_url'] = $picture[$i]['element_url']; + } + else + {// if picture is a file with high, we put the download link + if ( isset($picture[$i]['high_path']) ) + { + $picture[$i]['download_url'] = get_root_url().'action.php?dwn=' + .$picture[$i]['high_path']; + } } $picture[$i]['thumbnail'] = get_thumbnail_src($row['path'], @$row['tn_ext']); @@ -350,6 +411,32 @@ while ($row = mysql_fetch_array($result)) } } +// calculation of width and height for the current picture +if (empty($picture['current']['width'])) +{ + $taille_image = @getimagesize($picture['current']['image_path']); + if ($taille_image!==false) + { + $picture['current']['width'] = $taille_image[0]; + $picture['current']['height']= $taille_image[1]; + } +} + +if (!empty($picture['current']['width'])) +{ + list($picture['current']['scaled_width'],$picture['current']['scaled_height']) = + get_picture_size( + $picture['current']['width'], + $picture['current']['height'], + @$user['maxwidth'], + @$user['maxheight'] + ); +} + +// now give an opportunity to the filters to alter element_url, +// image_url, high_url and download_url +$picture = trigger_event('picture_navigation', $picture); + $url_admin = get_root_url().'admin.php?page=picture_modify' .'&cat_id='.(isset($page['category']) ? $page['category'] : '') @@ -377,42 +464,43 @@ if ( isset( $_GET['slideshow'] ) and isset($page['next_item']) ) $title_nb = ($page['current_rank'] + 1).'/'.$page['cat_nb_images']; -// calculation of width and height -if (empty($picture['current']['width'])) -{ - $taille_image = @getimagesize($picture['current']['src_file_system']); - $original_width = $taille_image[0]; - $original_height = $taille_image[1]; -} -else -{ - $original_width = $picture['current']['width']; - $original_height = $picture['current']['height']; -} - -$picture_size = get_picture_size( - $original_width, - $original_height, - @$user['maxwidth'], - @$user['maxheight'] - ); - // metadata $url_metadata = duplicate_picture_url(); -if ($conf['show_exif'] or $conf['show_iptc']) + +// do we have a plugin that can show metadata for something else than images? +$metadata_showable = trigger_event('get_element_metadata_available', + ( + ($conf['show_exif'] or $conf['show_iptc']) + and isset($picture['current']['image_path']) + ), + $picture['current']['path'] ); +if ($metadata_showable) { - $metadata_showable = true; if ( !isset($_GET['metadata']) ) { $url_metadata = add_url_params( $url_metadata, array('metadata'=>null) ); } } -else -{ - $metadata_showable = false; -} $page['body_id'] = 'thePicturePage'; + +// maybe someone wants a special display (call it before page_header so that they +// can add stylesheets) +$element_content = trigger_event('render_element_content', + '', $picture['current'] ); + +if ( isset($picture['next']['image_url']) + and isset($picture['next']['is_picture']) ) +{ + $template->assign_block_vars( 'prefetch', + array ( + 'URL' => $picture['next']['image_url'] + ) + ); +} +include(PHPWG_ROOT_PATH.'include/page_header.php'); +$template->set_filenames(array('picture'=>'picture.tpl')); + //------------------------------------------------------- navigation management foreach ( array('first','previous','next','last') as $which_image ) { @@ -424,48 +512,21 @@ foreach ( array('first','previous','next','last') as $which_image ) 'TITLE_IMG' => $picture[$which_image]['name'], 'IMG' => $picture[$which_image]['thumbnail'], 'U_IMG' => $picture[$which_image]['url'], - 'U_IMG_SRC' => $picture[$which_image]['src'] ) ); } } -include(PHPWG_ROOT_PATH.'include/page_header.php'); -$template->set_filenames(array('picture'=>'picture.tpl')); - $template->assign_vars( array( 'SECTION_TITLE' => $page['title'], 'PICTURE_TITLE' => $picture['current']['name'], 'PHOTO' => $title_nb, 'TITLE' => $picture['current']['name'], - 'SRC_IMG' => $picture['current']['src'], - 'ALT_IMG' => $picture['current']['file'], - 'WIDTH_IMG' => $picture_size[0], - 'HEIGHT_IMG' => $picture_size[1], + 'ELEMENT_CONTENT' => $element_content, 'LEVEL_SEPARATOR' => $conf['level_separator'], - 'L_HOME' => $lang['home'], - 'L_SLIDESHOW' => $lang['slideshow'], - 'L_STOP_SLIDESHOW' => $lang['slideshow_stop'], - 'L_PREV_IMG' =>$lang['previous_page'].' : ', - 'L_NEXT_IMG' =>$lang['next_page'].' : ', - 'L_ADMIN' =>$lang['link_info_image'], - 'L_COMMENT_TITLE' =>$lang['comments_title'], - 'L_ADD_COMMENT' =>$lang['comments_add'], - 'L_DELETE_COMMENT' =>$lang['comments_del'], - 'L_DELETE' =>$lang['delete'], - 'L_SUBMIT' =>$lang['submit'], - 'L_AUTHOR' => $lang['upload_author'], - 'L_COMMENT' =>$lang['comment'], - 'L_DOWNLOAD' => $lang['download'], - 'L_DOWNLOAD_HINT' => $lang['download_hint'], - 'L_PICTURE_METADATA' => $lang['picture_show_metadata'], - 'L_PICTURE_HIGH' => $lang['picture_high'], - 'L_UP_HINT' => $lang['home_hint'], - 'L_UP_ALT' => $lang['home'], - 'U_HOME' => make_index_url(), 'U_UP' => $url_up, 'U_METADATA' => $url_metadata, @@ -482,35 +543,13 @@ if ($conf['show_picture_name_on_title']) //------------------------------------------------------- upper menu management -// download link if file is not a picture -if (!$picture['current']['is_picture']) +// download link +if ( isset($picture['current']['download_url']) ) { $template->assign_block_vars( 'download', array( - 'U_DOWNLOAD' => $picture['current']['download'] - ) - ); -} - -// display a high quality link if present -if (isset($picture['current']['high'])) -{ - $uuid = uniqid(rand()); - - $template->assign_block_vars( - 'high', - array( - 'U_HIGH' => $picture['current']['high'], - 'UUID' => $uuid, - ) - ); - - $template->assign_block_vars( - 'download', - array( - 'U_DOWNLOAD' => get_root_url().'action.php?dwn=' - .$picture['current']['high_file_system'] + 'U_DOWNLOAD' => $picture['current']['download_url'] ) ); } @@ -655,19 +694,19 @@ $url = make_index_url( $infos['INFO_POSTED_DATE'] = ''.$val.''; // size in pixels -if ($picture['current']['is_picture']) +if ($picture['current']['is_picture'] and isset($picture['current']['width']) ) { - if ($original_width != $picture_size[0] - or $original_height != $picture_size[1]) + if ($picture['current']['scaled_width'] !== $picture['current']['width'] ) { $infos['INFO_DIMENSIONS'] = - ''. - $original_width.'*'.$original_height.''; + $picture['current']['width'].'*'.$picture['current']['height'].''; } else { - $infos['INFO_DIMENSIONS'] = $original_width.'*'.$original_height; + $infos['INFO_DIMENSIONS'] = + $picture['current']['width'].'*'.$picture['current']['height']; } } else diff --git a/plugins/event_tracer/index.php b/plugins/event_tracer/main.inc.php similarity index 52% rename from plugins/event_tracer/index.php rename to plugins/event_tracer/main.inc.php index cc9130b67..fef23296a 100644 --- a/plugins/event_tracer/index.php +++ b/plugins/event_tracer/main.inc.php @@ -19,7 +19,7 @@ class EventTracer function load_config() { - $x = @file_get_contents( dirname(__FILE__).'/tracer.dat' ); + $x = @file_get_contents( dirname(__FILE__).'/data.dat' ); if ($x!==false) { $c = unserialize($x); @@ -37,39 +37,45 @@ class EventTracer function save_config() { - $file = fopen( dirname(__FILE__).'/tracer.dat', 'w' ); + $file = fopen( dirname(__FILE__).'/data.dat', 'w' ); fwrite($file, serialize($this->my_config) ); fclose( $file ); } - function pre_trigger_event($event_info) + function on_pre_trigger_event($event_info) { - if (!$this->me_working) + $this->dump('pre_trigger_event', $event_info); + } + function on_post_trigger_event($event_info) + { + $this->dump('post_trigger_event', $event_info); + } + + function on_trigger_action($event_info) + { + $this->dump('trigger_action', $event_info); + } + + function dump($event, $event_info) + { + foreach( $this->my_config['filters'] as $filter) { - foreach( $this->my_config['filters'] as $filter) + if ( preg_match( '/'.$filter.'/', $event_info['event'] ) ) { - if ( preg_match( '/'.$filter.'/', $event_info['event'] ) ) + if ($this->my_config['show_args']) { - if ($this->my_config['show_args']) - $s = var_export( $event_info['data'], true ); - else - $s = ''; - pwg_debug('begin trigger_event "'.$event_info['event'].'" '.htmlspecialchars($s) ); - break; + $s = '
';
+          $s .= htmlspecialchars( var_export( $event_info['data'], true ) );
+          $s .= '
'; } + else + $s = ''; + pwg_debug($event.' "'.$event_info['event'].'" '.($s) ); + break; } } } - /*function post_trigger_event($filter_info) - { - if (!$this->me_working) - { - $s = var_export( $filter_info['data'], true ); - pwg_debug('end trigger_event '.$filter_info['event'].' '.$s ); - } - }*/ - function plugin_admin_menu() { add_plugin_admin_menu( "Event Tracer", array(&$this, 'do_admin') ); @@ -86,5 +92,7 @@ $eventTracer = new EventTracer(); $eventTracer->load_config(); add_event_handler('plugin_admin_menu', array(&$eventTracer, 'plugin_admin_menu') ); -add_event_handler('pre_trigger_event', array(&$eventTracer, 'pre_trigger_event') ); +add_event_handler('pre_trigger_event', array(&$eventTracer, 'on_pre_trigger_event') ); +add_event_handler('post_trigger_event', array(&$eventTracer, 'on_post_trigger_event') ); +add_event_handler('trigger_action', array(&$eventTracer, 'on_trigger_action') ); ?> \ No newline at end of file diff --git a/plugins/event_tracer/tracer_admin.tpl b/plugins/event_tracer/tracer_admin.tpl index 38fbd2796..95ee65907 100644 --- a/plugins/event_tracer/tracer_admin.tpl +++ b/plugins/event_tracer/tracer_admin.tpl @@ -8,7 +8,7 @@ You can use this plugin to see what events is PhpWebGallery calling. Event Tracer