Ignore:
Timestamp:
11/01/06 06:54:35 (13 years ago)
Author:
rvelices
Message:

plugins last modifications + events are triggered now from picture.php

Location:
trunk/plugins/event_tracer
Files:
1 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/plugins/event_tracer/main.inc.php

    r1586 r1590  
    2020  function load_config() 
    2121  { 
    22     $x = @file_get_contents( dirname(__FILE__).'/tracer.dat' ); 
     22    $x = @file_get_contents( dirname(__FILE__).'/data.dat' ); 
    2323    if ($x!==false) 
    2424    { 
     
    3838  function save_config() 
    3939  { 
    40     $file = fopen( dirname(__FILE__).'/tracer.dat', 'w' ); 
     40    $file = fopen( dirname(__FILE__).'/data.dat', 'w' ); 
    4141    fwrite($file, serialize($this->my_config) ); 
    4242    fclose( $file ); 
    4343  } 
    4444 
    45   function pre_trigger_event($event_info) 
     45  function on_pre_trigger_event($event_info) 
    4646  { 
    47     if (!$this->me_working) 
     47    $this->dump('pre_trigger_event', $event_info); 
     48  } 
     49  function on_post_trigger_event($event_info) 
     50  { 
     51    $this->dump('post_trigger_event', $event_info); 
     52  } 
     53 
     54  function on_trigger_action($event_info) 
     55  { 
     56    $this->dump('trigger_action', $event_info); 
     57  } 
     58 
     59  function dump($event, $event_info) 
     60  { 
     61    foreach( $this->my_config['filters'] as $filter) 
    4862    { 
    49       foreach( $this->my_config['filters'] as $filter) 
     63      if ( preg_match( '/'.$filter.'/', $event_info['event'] ) ) 
    5064      { 
    51         if ( preg_match( '/'.$filter.'/', $event_info['event'] ) ) 
     65        if ($this->my_config['show_args']) 
    5266        { 
    53           if ($this->my_config['show_args']) 
    54             $s = var_export( $event_info['data'], true ); 
    55           else 
    56             $s = ''; 
    57           pwg_debug('begin trigger_event "'.$event_info['event'].'" '.htmlspecialchars($s) ); 
    58           break; 
     67          $s = '<pre>'; 
     68          $s .= htmlspecialchars( var_export( $event_info['data'], true ) ); 
     69          $s .= '</pre>'; 
    5970        } 
     71        else 
     72          $s = ''; 
     73        pwg_debug($event.' "'.$event_info['event'].'" '.($s) ); 
     74        break; 
    6075      } 
    6176    } 
    6277  } 
    63  
    64   /*function post_trigger_event($filter_info) 
    65   { 
    66     if (!$this->me_working) 
    67     { 
    68       $s = var_export( $filter_info['data'], true ); 
    69       pwg_debug('end trigger_event '.$filter_info['event'].' '.$s ); 
    70     } 
    71   }*/ 
    7278 
    7379  function plugin_admin_menu() 
     
    8793 
    8894add_event_handler('plugin_admin_menu', array(&$eventTracer, 'plugin_admin_menu') ); 
    89 add_event_handler('pre_trigger_event', array(&$eventTracer, 'pre_trigger_event') ); 
     95add_event_handler('pre_trigger_event', array(&$eventTracer, 'on_pre_trigger_event') ); 
     96add_event_handler('post_trigger_event', array(&$eventTracer, 'on_post_trigger_event') ); 
     97add_event_handler('trigger_action', array(&$eventTracer, 'on_trigger_action') ); 
    9098?> 
  • trunk/plugins/event_tracer/tracer_admin.tpl

    r1580 r1590  
    99 
    1010<label>Show event argument 
    11         <input type="checkbox" name="eventTracer_show_args" value="{EVENT_TRACER_SHOW_ARGS}" /> 
     11        <input type="checkbox" name="eventTracer_show_args" {EVENT_TRACER_SHOW_ARGS} /> 
    1212</label> 
    1313<br/> 
Note: See TracChangeset for help on using the changeset viewer.