Changeset 2254


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

Legend:

Unmodified
Added
Removed
  • trunk/include/template.class.php

    r2239 r2254  
    8585    $this->smarty->register_modifier( 'translate', array('Template', 'mod_translate') );
    8686
    87     include($root.'/theme/'.$theme.'/themeconf.inc.php');
    88     $this->smarty->assign('themeconf', $themeconf);
     87    if ( !empty($theme) )
     88    {
     89      include($root.'/theme/'.$theme.'/themeconf.inc.php');
     90      $this->smarty->assign('themeconf', $themeconf);
     91    }
    8992
    9093    $this->_old = & new TemplateOld($root, $theme);
  • 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>
  • trunk/template/yoga/index.tpl

    r2231 r2254  
    5757    <select onchange="document.location = this.options[this.selectedIndex].value;">
    5858      {foreach from=$chronology_views item=view}
    59       <option value="{$view.VALUE}"{if $view.SELECTED} selected="selected"{/if}}>{$view.CONTENT}</option>
     59      <option value="{$view.VALUE}"{if $view.SELECTED} selected="selected"{/if}>{$view.CONTENT}</option>
    6060      {/foreach}
    6161    </select>
  • trunk/template/yoga/upgrade.tpl

    r2222 r2254  
    1 <!-- DEV TAG: not smarty migrated -->
     1{* $Id$ *}
    22<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    33<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
     
    55  <head>
    66    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"  />
    7     <title>PhpWebGallery : Upgrade to {RELEASE}</title>
     7    <title>PhpWebGallery : Upgrade to {$RELEASE}</title>
    88  </head>
    99
    1010  <body>
    11     <!-- BEGIN introduction -->
     11    {if isset($introduction)}
    1212    <h1>Welcome to PhpWebGallery upgrade page.</h1>
    1313
     
    1515version of PhpWebGallery to the current version. The upgrade assistant
    1616thinks you are currently running a
    17 <strong>release {introduction.CURRENT_RELEASE}</strong> (or equivalent).</p>
     17<strong>release {$introduction.CURRENT_RELEASE}</strong> (or equivalent).</p>
    1818
    19     <p><a href="{introduction.RUN_UPGRADE_URL}">Upgrade from release
    20 {introduction.CURRENT_RELEASE} to {RELEASE}</a></p>
    21     <!-- END introduction -->
     19    <p><a href="{$introduction.RUN_UPGRADE_URL}">Upgrade from release
     20{$introduction.CURRENT_RELEASE} to {$RELEASE}</a></p>
     21    {/if}
    2222
    23     <!-- BEGIN upgrade -->
    24     <h1>Upgrade from version {upgrade.VERSION} to {RELEASE}</h1>
     23    {if isset($upgrade)}
     24    <h1>Upgrade from version {$upgrade.VERSION} to {$RELEASE}</h1>
    2525
    2626    <p>Statistics</p>
    2727    <ul>
    28       <li>total upgrade time : {upgrade.TOTAL_TIME}</li>
    29       <li>total SQL time : {upgrade.SQL_TIME}</li>
    30       <li>SQL queries : {upgrade.NB_QUERIES}</li>
     28      <li>total upgrade time : {$upgrade.TOTAL_TIME}</li>
     29      <li>total SQL time : {$upgrade.SQL_TIME}</li>
     30      <li>SQL queries : {$upgrade.NB_QUERIES}</li>
    3131    </ul>
    3232
    33     <!-- BEGIN infos -->
    3433    <p>Upgrade informations</p>
    3534
    3635    <ul>
    37       <!-- BEGIN info -->
    38       <li>{upgrade.infos.info.CONTENT}</li>
    39       <!-- END info -->
     36      {foreach from=$infos item=info}
     37      <li>{$info}</li>
     38      {/foreach}
    4039    </ul>
    41     <!-- END infos -->
    42     <!-- END upgrade -->
     40
     41    {/if}
    4342  </body>
    4443
  • trunk/upgrade.php

    r2102 r2254  
    33// | PhpWebGallery - a PHP based picture gallery                           |
    44// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
    5 // | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
     5// | Copyright (C) 2003-2008 PhpWebGallery Team - http://phpwebgallery.net |
    66// +-----------------------------------------------------------------------+
    77// | file          : $Id$
     
    148148$template = new Template(PHPWG_ROOT_PATH.'template/yoga');
    149149$template->set_filenames(array('upgrade'=>'upgrade.tpl'));
    150 $template->assign_vars(array('RELEASE'=>PHPWG_VERSION));
     150$template->assign('RELEASE', PHPWG_VERSION);
    151151
    152152// +-----------------------------------------------------------------------+
     
    180180    $current_release = '1.5.0';
    181181  }
    182   else if (!in_array(PREFIX_TABLE.'history_summary', $tables))
     182  else if ( !in_array(PREFIX_TABLE.'history_summary', $tables) )
    183183  {
    184184    if (!in_array('auto_login_key', $columns_of[PREFIX_TABLE.'user_infos']))
     
    196196  }
    197197 
    198   $template->assign_block_vars(
     198  $template->assign(
    199199    'introduction',
    200200    array(
     
    216216    die('No database upgrade required, do not refresh the page');
    217217  }
    218    
     218
    219219  $upgrade_file = PHPWG_ROOT_PATH.'install/upgrade_'.$_GET['version'].'.php';
    220220  if (is_file($upgrade_file))
     
    250250    // Create empty local files to avoid log errors
    251251    create_empty_local_files();
    252    
     252
    253253    $page['upgrade_end'] = get_moment();
    254254
    255     $template->assign_block_vars(
     255    $template->assign(
    256256      'upgrade',
    257257      array(
     
    291291      );
    292292   
    293     $template->assign_block_vars('upgrade.infos', array());
     293    $template->assign('infos', $page['infos']);
    294294   
    295     foreach ($page['infos'] as $info)
    296     {
    297       $template->assign_block_vars(
    298         'upgrade.infos.info',
    299         array(
    300           'CONTENT' => $info,
    301           )
    302         );
    303     }
    304 
    305295    $query = '
    306296UPDATE '.USER_CACHE_TABLE.'
Note: See TracChangeset for help on using the changeset viewer.