Ignore:
Timestamp:
Mar 6, 2008, 1:25:47 AM (17 years ago)
Author:
rvelices
Message:
  • upgrade goes smarty
  • event_tracer goes smarty
  • correction in index.tpl
Location:
trunk/plugins/event_tracer
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/plugins/event_tracer/event_list.php

    r1900 r2254  
    6868$url = get_admin_plugin_menu_link(__FILE__);
    6969
    70 $template->assign_vars( array(
     70$template->assign( array(
    7171  'NB_EVENTS' => count($events),
    7272  'U_SORT0' => add_url_params($url, array('sort'=>0) ),
     
    7575  ) );
    7676
     77$template->assign('events', array());
    7778foreach ($events as $e)
    7879{
    79   $template->assign_block_vars( 'event', array(
     80  $template->append( 'events', array(
    8081    'TYPE' => $e[0],
    8182    'NAME' => $e[1],
  • trunk/plugins/event_tracer/event_list.tpl

    r2222 r2254  
    1 <!-- DEV TAG: not smarty migrated -->
    2 There are {NB_EVENTS} calls to triger_event or triger_action.
     1{* $Id$ *}
     2There are {$NB_EVENTS} calls to triger_event or triger_action.
    33
    44<table width="99%" class="table2">
    55<tr class="throw">
    6   <th><a href="{U_SORT0}">Type</a></th>
    7   <th><a href="{U_SORT1}">Name</a></th>
    8   <th><a href="{U_SORT2}">File</a></th>
     6  <th><a href="{$U_SORT0}">Type</a></th>
     7  <th><a href="{$U_SORT1}">Name</a></th>
     8  <th><a href="{$U_SORT2}">File</a></th>
    99</tr>
    10 <!-- BEGIN event -->
     10{foreach from=$events item=event}
    1111<tr>
    12   <td>{event.TYPE}</td>
    13   <td>{event.NAME}</td>
    14   <td>{event.FILE}</td>
     12  <td>{$event.TYPE}</td>
     13  <td>{$event.NAME}</td>
     14  <td>{$event.FILE}</td>
    1515</tr>
    16 <!-- END event -->
     16{/foreach}
    1717</table>
  • trunk/plugins/event_tracer/main.inc.php

    r2243 r2254  
    11<?php /*
    22Plugin Name: Event tracer
    3 Version: 1.8
     3Version: 1.8.a
    44Description: For developers. Shows all calls to trigger_event.
    55Plugin URI: http://www.phpwebgallery.net
     
    1919  }
    2020
     21  function get_config_file_dir()
     22  {
     23    global $conf;
     24    return $conf['local_data_dir'].'/plugins/';
     25  }
     26
     27  function get_config_file_name()
     28  {
     29    return basename(dirname(__FILE__)).'.dat';
     30  }
     31
    2132  function load_config()
    2233  {
    23     $x = @file_get_contents( dirname(__FILE__).'/data.dat' );
     34    $x = @file_get_contents( $this->get_config_file_dir().$this->get_config_file_name() );
    2435    if ($x!==false)
    2536    {
     
    3950  function save_config()
    4051  {
    41     $file = fopen( dirname(__FILE__).'/data.dat', 'w' );
     52    $dir = $this->get_config_file_dir();
     53    @mkdir($dir);
     54    $file = fopen( $dir.$this->get_config_file_name(), 'w' );
    4255    fwrite($file, serialize($this->my_config) );
    4356    fclose( $file );
  • trunk/plugins/event_tracer/tracer_admin.php

    r1912 r2254  
    2222  array_push($page['infos'], 'event tracer options saved');
    2323}
    24 $template->assign_var('EVENT_TRACER_FILTERS', implode("\n", $me->my_config['filters'] ) );
    25 $template->assign_var('EVENT_TRACER_SHOW_ARGS', $me->my_config['show_args'] ? 'checked="checked"' : '' );
    26 $template->assign_var('U_LIST_EVENTS', get_admin_plugin_menu_link(dirname(__FILE__).'/event_list.php'));
     24$template->assign('EVENT_TRACER_FILTERS', implode("\n", $me->my_config['filters'] ) );
     25$template->assign('EVENT_TRACER_SHOW_ARGS', $me->my_config['show_args'] ? 'checked="checked"' : '' );
     26$template->assign('U_LIST_EVENTS', get_admin_plugin_menu_link(dirname(__FILE__).'/event_list.php'));
    2727
    2828//$template->assign_var('EVENT_TRACER_F_ACTION', $my_url);
  • trunk/plugins/event_tracer/tracer_admin.tpl

    r2222 r2254  
    1 <!-- DEV TAG: not smarty migrated -->
     1{* $Id$ *}
    22<div class="titrePage">
    33  <h2>Event Tracer</h2>
     
    99<b>Note that $conf['show_queries'] must be true.</b>
    1010</p>
    11 <form method="post" action="{EVENT_TRACER_F_ACTION}" class="general">
     11<form method="post" action="{$EVENT_TRACER_F_ACTION}" class="general">
    1212<fieldset>
    1313        <legend>Event Tracer</legend>
    1414
    1515<label>Show event argument
    16         <input type="checkbox" name="eventTracer_show_args" {EVENT_TRACER_SHOW_ARGS} />
     16        <input type="checkbox" name="eventTracer_show_args" {$EVENT_TRACER_SHOW_ARGS} />
    1717</label>
    1818<br/>
    1919<label>Fill below a list of regular expressions (one per line).
    2020An event will be logged if its name matches at least one expression in the list.
    21         <textarea name="eventTracer_filters" id="eventTracer_filters"rows="10" cols="80">{EVENT_TRACER_FILTERS}</textarea>
     21        <textarea name="eventTracer_filters" id="eventTracer_filters"rows="10" cols="80">{$EVENT_TRACER_FILTERS}</textarea>
    2222</label>
    2323
     
    2626<p><input class="submit" type="submit" value="Submit" /></p>
    2727
    28 <p><a href="{U_LIST_EVENTS}">Click here to see a complete list of actions and events trigered by this PWG version</a>.</p>
     28<p><a href="{$U_LIST_EVENTS}">Click here to see a complete list of actions and events trigered by this PWG version</a>.</p>
    2929</form>
Note: See TracChangeset for help on using the changeset viewer.