From c55dbbc995e152af3f2c88662101b0643d2e171a Mon Sep 17 00:00:00 2001 From: vdigital Date: Fri, 23 May 2008 22:38:14 +0000 Subject: Removed file/folder git-svn-id: http://piwigo.org/svn/trunk@2358 68402e56-0260-453c-a942-63ccdbb3a9ee --- BSF/plugins/event_tracer/event_list.php | 90 -------------------- BSF/plugins/event_tracer/event_list.tpl | 17 ---- BSF/plugins/event_tracer/index.php | 30 ------- BSF/plugins/event_tracer/main.inc.php | 137 ------------------------------ BSF/plugins/event_tracer/maintain.inc.php | 9 -- BSF/plugins/event_tracer/tracer_admin.php | 31 ------- BSF/plugins/event_tracer/tracer_admin.tpl | 29 ------- 7 files changed, 343 deletions(-) delete mode 100644 BSF/plugins/event_tracer/event_list.php delete mode 100644 BSF/plugins/event_tracer/event_list.tpl delete mode 100644 BSF/plugins/event_tracer/index.php delete mode 100644 BSF/plugins/event_tracer/main.inc.php delete mode 100644 BSF/plugins/event_tracer/maintain.inc.php delete mode 100644 BSF/plugins/event_tracer/tracer_admin.php delete mode 100644 BSF/plugins/event_tracer/tracer_admin.tpl (limited to 'BSF/plugins/event_tracer') diff --git a/BSF/plugins/event_tracer/event_list.php b/BSF/plugins/event_tracer/event_list.php deleted file mode 100644 index ae617fe87..000000000 --- a/BSF/plugins/event_tracer/event_list.php +++ /dev/null @@ -1,90 +0,0 @@ -.*<\?php#m', '', $code); - $code = preg_replace( '#\/\*.*\*\/#m', '', $code); - $code = preg_replace( '#\/\/.*#', '', $code); - - $count = preg_match_all( - '#[^a-zA-Z_$-]trigger_(action|event)\s*\(\s*([^,)]+)#m', - $code, $matches - ); - - for ($i=0; $i<$count; $i++) - { - $type = $matches[1][$i]; - $name = preg_replace( '#^[\'"]?([^\'"]*)[\'"]?$#', '$1', $matches[2][$i]); - array_push($events, array($type,$name,$file) ); - } -} - -$sort= isset($_GET['sort']) ? $_GET['sort'] : 1; -usort( - $events, - create_function( '$a,$b', 'return $a['.$sort.']>$b['.$sort.'];' ) - ); - -global $template; - -$url = get_admin_plugin_menu_link(__FILE__); - -$template->assign( array( - 'NB_EVENTS' => count($events), - 'U_SORT0' => add_url_params($url, array('sort'=>0) ), - 'U_SORT1' => add_url_params($url, array('sort'=>1) ), - 'U_SORT2' => add_url_params($url, array('sort'=>2) ), - ) ); - -$template->assign('events', array()); -foreach ($events as $e) -{ - $template->append( 'events', array( - 'TYPE' => $e[0], - 'NAME' => $e[1], - 'FILE' => $e[2], - ) - ); -} - -$template->set_filenames( array('event_list' => dirname(__FILE__).'/event_list.tpl' ) ); -$template->assign_var_from_handle( 'ADMIN_CONTENT', 'event_list'); -?> diff --git a/BSF/plugins/event_tracer/event_list.tpl b/BSF/plugins/event_tracer/event_list.tpl deleted file mode 100644 index accc27278..000000000 --- a/BSF/plugins/event_tracer/event_list.tpl +++ /dev/null @@ -1,17 +0,0 @@ -{* $Id$ *} -There are {$NB_EVENTS} calls to triger_event or triger_action. - - - - - - - -{foreach from=$events item=event} - - - - - -{/foreach} -
TypeNameFile
{$event.TYPE}{$event.NAME}{$event.FILE}
diff --git a/BSF/plugins/event_tracer/index.php b/BSF/plugins/event_tracer/index.php deleted file mode 100644 index c15b15795..000000000 --- a/BSF/plugins/event_tracer/index.php +++ /dev/null @@ -1,30 +0,0 @@ - diff --git a/BSF/plugins/event_tracer/main.inc.php b/BSF/plugins/event_tracer/main.inc.php deleted file mode 100644 index dcf282146..000000000 --- a/BSF/plugins/event_tracer/main.inc.php +++ /dev/null @@ -1,137 +0,0 @@ -me_working=0; - } - - function get_config_file_dir() - { - global $conf; - return $conf['local_data_dir'].'/plugins/'; - } - - function get_config_file_name() - { - return basename(dirname(__FILE__)).'.dat'; - } - - function load_config() - { - $x = @file_get_contents( $this->get_config_file_dir().$this->get_config_file_name() ); - if ($x!==false) - { - $c = unserialize($x); - // do some more tests here - $this->my_config = $c; - } - if ( !isset($this->my_config) - or empty($this->my_config['filters']) ) - { - $this->my_config['filters'] = array( '.*' ); - $this->my_config['show_args'] = false; - $this->save_config(); - } - } - - function save_config() - { - $dir = $this->get_config_file_dir(); - @mkdir($dir); - $file = fopen( $dir.$this->get_config_file_name(), 'w' ); - fwrite($file, serialize($this->my_config) ); - fclose( $file ); - } - - function on_pre_trigger_event($event_info) - { - $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) - { - if ( preg_match( '/'.$filter.'/', $event_info['event'] ) ) - { - if ($this->my_config['show_args']) - { - $s = '
';
-          $s .= htmlspecialchars( var_export( $event_info['data'], true ) );
-          $s .= '
'; - } - else - $s = ''; - pwg_debug($event.' "'.$event_info['event'].'" '.($s) ); - break; - } - } - } - - function plugin_admin_menu($menu) - { - array_push($menu, - array( - 'NAME' => 'Event Tracer', - 'URL' => get_admin_plugin_menu_link(dirname(__FILE__).'/tracer_admin.php') - ) - ); - return $menu; - } -} - -$obj = new EventTracer(); -$obj->load_config(); - -add_event_handler('get_admin_plugin_menu_links', array(&$obj, 'plugin_admin_menu') ); -add_event_handler('pre_trigger_event', array(&$obj, 'on_pre_trigger_event') ); -add_event_handler('post_trigger_event', array(&$obj, 'on_post_trigger_event') ); -add_event_handler('trigger_action', array(&$obj, 'on_trigger_action') ); -set_plugin_data($plugin['id'], $obj); -?> diff --git a/BSF/plugins/event_tracer/maintain.inc.php b/BSF/plugins/event_tracer/maintain.inc.php deleted file mode 100644 index f7d0131c5..000000000 --- a/BSF/plugins/event_tracer/maintain.inc.php +++ /dev/null @@ -1,9 +0,0 @@ - diff --git a/BSF/plugins/event_tracer/tracer_admin.php b/BSF/plugins/event_tracer/tracer_admin.php deleted file mode 100644 index b17f2a301..000000000 --- a/BSF/plugins/event_tracer/tracer_admin.php +++ /dev/null @@ -1,31 +0,0 @@ -set_filenames( array('plugin_admin_content' => dirname(__FILE__).'/tracer_admin.tpl') ); - -if ( isset($_POST['eventTracer_filters']) ) -{ - $v = $_POST['eventTracer_filters']; - $v = str_replace( "\r\n", "\n", $v ); - $v = str_replace( "\n\n", "\n", $v ); - $v = stripslashes($v); - if (!empty($v)) - $me->my_config['filters'] = explode("\n", $v); - else - $me->my_config['filters'] = array(); - $me->my_config['show_args'] = isset($_POST['eventTracer_show_args']); - $me->save_config(); - global $page; - array_push($page['infos'], 'event tracer options saved'); -} -$template->assign('EVENT_TRACER_FILTERS', implode("\n", $me->my_config['filters'] ) ); -$template->assign('EVENT_TRACER_SHOW_ARGS', $me->my_config['show_args'] ? 'checked="checked"' : '' ); -$template->assign('U_LIST_EVENTS', get_admin_plugin_menu_link(dirname(__FILE__).'/event_list.php')); - -//$template->assign_var('EVENT_TRACER_F_ACTION', $my_url); - -$template->assign_var_from_handle( 'ADMIN_CONTENT', 'plugin_admin_content'); -?> diff --git a/BSF/plugins/event_tracer/tracer_admin.tpl b/BSF/plugins/event_tracer/tracer_admin.tpl deleted file mode 100644 index 17d7e2b01..000000000 --- a/BSF/plugins/event_tracer/tracer_admin.tpl +++ /dev/null @@ -1,29 +0,0 @@ -{* $Id$ *} -
-

Event Tracer

-
- -

-The event tracer is a developer tool that logs in the footer of the window all calls to trigger_event method. -You can use this plugin to see what events is Piwigo calling. -Note that $conf['show_queries'] must be true. -

-
-
- Event Tracer - - -
- - -
- -

- -

Click here to see a complete list of actions and events trigered by this PWG version.

-
-- cgit v1.2.3