Changeset 2478


Ignore:
Timestamp:
Aug 20, 2008, 1:58:35 AM (16 years ago)
Author:
rvelices
Message:
  • ws can include php file before invoking web call method
  • remove "Pierrick ..." from some languages
  • tags - small change to avoid increasing number of urls
  • added a missing closedir
  • remove some unnecessary class names and inexisting rel attributes
Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/include/functions.php

    r2472 r2478  
    357357        }
    358358      }
     359      closedir($contents);
    359360    }
    360361  }
     
    14971498{
    14981499  global $page;
    1499  
     1500
    15001501  $tag_name = trim($tag_name);
    15011502  if (isset($page['tag_id_from_tag_name_cache'][$tag_name]))
     
    16181619  $query = 'OPTIMIZE TABLE '.implode(', ', $all_tables).';';
    16191620  $mysql_rc = $mysql_rc && pwg_query($query);
    1620   if ($mysql_rc) 
     1621  if ($mysql_rc)
    16211622  {
    16221623    array_push(
  • trunk/include/ws_core.inc.php

    r2299 r2478  
    345345  var $_responseFormat;
    346346
    347   var $_methods;
    348   var $_methodSignatures;
     347  var $_methods = array();
    349348
    350349  function PwgServer()
    351350  {
    352     $methods = array();
    353351  }
    354352
     
    436434  function addMethod($methodName, $callback, $params=array(), $description, $include_file='')
    437435  {
    438     $this->_methods[$methodName] = $callback;
    439     $this->_methodDescriptions[$methodName] = $description;
    440 
    441436    if (!is_array($params))
    442437    {
     
    470465      }
    471466    }
    472     $this->_methodSignatures[$methodName] = $params;
     467
     468    $this->_methods[$methodName] = array(
     469      'callback'    => $callback,
     470      'description' => $description,
     471      'signature'   => $params,
     472      'include'     => $include_file,
     473      );
    473474  }
    474475
     
    480481  function getMethodDescription($methodName)
    481482  {
    482     $desc = @$this->_methodDescriptions[$methodName];
     483    $desc = @$this->_methods[$methodName]['description'];
    483484    return isset($desc) ? $desc : '';
    484485  }
     
    486487  function getMethodSignature($methodName)
    487488  {
    488     $signature = @$this->_methodSignatures[$methodName];
     489    $signature = @$this->_methods[$methodName]['signature'];
    489490    return isset($signature) ? $signature : array();
    490491  }
     
    518519  function invoke($methodName, $params)
    519520  {
    520     $callback = @$this->_methods[$methodName];
    521 
    522     if ( $callback==null )
     521    $method = @$this->_methods[$methodName];
     522
     523    if ( $method==null )
    523524    {
    524525      return new PwgError(WS_ERR_INVALID_METHOD, 'Method name "'.$methodName.'" is not valid');
     
    526527
    527528    // parameter check and data coercion !
    528     $signature = @$this->_methodSignatures[$methodName];
     529    $signature = $method['signature'];
    529530    $missing_params = array();
    530531    foreach($signature as $name=>$options)
     
    571572    if ( strtolower( get_class($result) )!='pwgerror')
    572573    {
    573       $result = call_user_func_array($callback, array($params, &$this) );
     574      if ( !empty($method['include']) )
     575      {
     576        include_once( $method['include'] );
     577      }
     578      $result = call_user_func_array($method['callback'], array($params, &$this) );
    574579    }
    575580    return $result;
  • trunk/language/en_UK/common.lang.php

    r2476 r2478  
    311311$lang['upload_advise_thumbnail'] = 'Optional, but recommended : choose a thumbnail to associate to ';
    312312$lang['upload_advise_width'] = 'the width of the picture must not exceed : ';
    313 $lang['upload_author'] = 'Author (eg "Pierrick LE GALL")';
     313$lang['upload_author'] = 'Author';
    314314$lang['upload_cannot_upload'] = 'can\'t upload the picture on the server';
    315315$lang['upload_err_username'] = 'the username must be given';
  • trunk/language/nl_NL/common.lang.php

    r2342 r2478  
    311311$lang['upload_advise_thumbnail'] = 'Optioneel, maar aanbevolen : kies een thumbnail voor associatie';
    312312$lang['upload_advise_width'] = 'de breedte van de afbeelding mag niet te groot zijn : ';
    313 $lang['upload_author'] = 'Auteur (eg "Pierrick LE GALL")';
     313$lang['upload_author'] = 'Auteur';
    314314$lang['upload_cannot_upload'] = 'kan de afbeelding niet op de server plaatsen';
    315315$lang['upload_err_username'] = 'de gebruikersnaam moet ingevuld zijn';
  • trunk/tags.php

    r2409 r2478  
    6868}
    6969
    70 $template->assign(
    71   array(
    72     'U_CLOUD' => get_root_url().'tags.php?display_mode=cloud',
    73     'U_LETTERS' => get_root_url().'tags.php?display_mode=letters',
    74     'display_mode' => $page['display_mode'],
    75     )
    76   );
     70foreach (array('cloud', 'letters') as $mode)
     71{
     72  $template->assign(
     73    'U_'.strtoupper($mode),
     74    get_root_url().'tags.php'. ($conf['tags_default_display_mode']==$mode ? '' : '?display_mode='.$mode)
     75    );
     76}
     77
     78$template->assign( 'display_mode', $page['display_mode'] );
    7779
    7880// find all tags available for the current user
  • trunk/template/yoga/picture_nav_buttons.tpl

    r2270 r2478  
    33 
    44{if isset($last)}
    5   <a class="navButton prev" href="{$last.U_IMG}" title="{'last_page'|@translate} : {$last.TITLE}" rel="last"><img src="{$ROOT_URL}{$themeconf.icon_dir}/last.png" class="button" alt="{'last_page'|@translate}"></a>
     5  <a class="navButton" href="{$last.U_IMG}" title="{'last_page'|@translate} : {$last.TITLE}" rel="last"><img src="{$ROOT_URL}{$themeconf.icon_dir}/last.png" class="button" alt="{'last_page'|@translate}"></a>
    66{else}
    7   <a class="navButton prev"><img src="{$ROOT_URL}{$themeconf.icon_dir}/last_unactive.png" class="button" alt=""></a>
     7  <a class="navButton"><img src="{$ROOT_URL}{$themeconf.icon_dir}/last_unactive.png" class="button" alt=""></a>
    88{/if}
    99 
    1010{if isset($next)}
    11   <a class="navButton next" href="{$next.U_IMG}" title="{'next_page'|@translate} : {$next.TITLE}" rel="next"><img src="{$ROOT_URL}{$themeconf.icon_dir}/right.png" class="button" alt="{'next_page'|@translate}"></a>
     11  <a class="navButton" href="{$next.U_IMG}" title="{'next_page'|@translate} : {$next.TITLE}" rel="next"><img src="{$ROOT_URL}{$themeconf.icon_dir}/right.png" class="button" alt="{'next_page'|@translate}"></a>
    1212{else}
    13   <a class="navButton next"><img src="{$ROOT_URL}{$themeconf.icon_dir}/right_unactive.png" class="button" alt=""></a>
     13  <a class="navButton"><img src="{$ROOT_URL}{$themeconf.icon_dir}/right_unactive.png" class="button" alt=""></a>
    1414{/if}
    1515
    1616{if isset($slideshow.U_START_PLAY)}
    17   <a class="navButton play" href="{$slideshow.U_START_PLAY}" title="{'start_play'|@translate}" rel="play"><img src="{$ROOT_URL}{$themeconf.icon_dir}/play.png" class="button" alt="{'start_play'|@translate}"></a>
     17  <a class="navButton" href="{$slideshow.U_START_PLAY}" title="{'start_play'|@translate}"><img src="{$ROOT_URL}{$themeconf.icon_dir}/play.png" class="button" alt="{'start_play'|@translate}"></a>
    1818{/if}
    1919
    2020{if isset($slideshow.U_STOP_PLAY)}
    21   <a class="navButton play" href="{$slideshow.U_STOP_PLAY}" title="{'stop_play'|@translate}" rel="play"><img src="{$ROOT_URL}{$themeconf.icon_dir}/pause.png" class="button" alt="{'stop_play'|@translate}"></a>
     21  <a class="navButton" href="{$slideshow.U_STOP_PLAY}" title="{'stop_play'|@translate}"><img src="{$ROOT_URL}{$themeconf.icon_dir}/pause.png" class="button" alt="{'stop_play'|@translate}"></a>
    2222{/if}
    2323
    2424{if isset($U_UP) and !isset($slideshow)}
    25   <a class="navButton up" href="{$U_UP}" title="{'thumbnails'|@translate}" rel="up"><img src="{$ROOT_URL}{$themeconf.icon_dir}/up.png" class="button" alt="{'thumbnails'|@translate}"></a>
     25  <a class="navButton" href="{$U_UP}" title="{'thumbnails'|@translate}" rel="up"><img src="{$ROOT_URL}{$themeconf.icon_dir}/up.png" class="button" alt="{'thumbnails'|@translate}"></a>
    2626{/if}
    2727 
    2828{if isset($previous)}
    29   <a class="navButton prev" href="{$previous.U_IMG}" title="{'previous_page'|@translate} : {$previous.TITLE}" rel="prev"><img src="{$ROOT_URL}{$themeconf.icon_dir}/left.png" class="button" alt="{'previous_page'|@translate}"></a>
     29  <a class="navButton" href="{$previous.U_IMG}" title="{'previous_page'|@translate} : {$previous.TITLE}" rel="prev"><img src="{$ROOT_URL}{$themeconf.icon_dir}/left.png" class="button" alt="{'previous_page'|@translate}"></a>
    3030{else}
    31   <a class="navButton prev"><img src="{$ROOT_URL}{$themeconf.icon_dir}/left_unactive.png" class="button" alt=""></a>
     31  <a class="navButton"><img src="{$ROOT_URL}{$themeconf.icon_dir}/left_unactive.png" class="button" alt=""></a>
    3232{/if}
    3333 
    3434{if isset($first)}
    35   <a class="navButton prev" href="{$first.U_IMG}" title="{'first_page'|@translate} : {$first.TITLE}" rel="first"><img src="{$ROOT_URL}{$themeconf.icon_dir}/first.png" class="button" alt="{'first_page'|@translate}"></a>
     35  <a class="navButton" href="{$first.U_IMG}" title="{'first_page'|@translate} : {$first.TITLE}" rel="first"><img src="{$ROOT_URL}{$themeconf.icon_dir}/first.png" class="button" alt="{'first_page'|@translate}"></a>
    3636{else}
    37   <a class="navButton prev"><img src="{$ROOT_URL}{$themeconf.icon_dir}/first_unactive.png" class="button" alt=""></a>
     37  <a class="navButton"><img src="{$ROOT_URL}{$themeconf.icon_dir}/first_unactive.png" class="button" alt=""></a>
    3838{/if}
    3939
    4040
    4141{if isset($slideshow.U_START_REPEAT)}
    42   <a class="navButton repeat" href="{$slideshow.U_START_REPEAT}" title="{'start_repeat'|@translate}" rel="repeat"><img src="{$ROOT_URL}{$themeconf.icon_dir}/start_repeat.png" class="button" alt="{'start_repeat'|@translate}"></a>
     42  <a class="navButton" href="{$slideshow.U_START_REPEAT}" title="{'start_repeat'|@translate}"><img src="{$ROOT_URL}{$themeconf.icon_dir}/start_repeat.png" class="button" alt="{'start_repeat'|@translate}"></a>
    4343{/if}
    4444
    4545{if isset($slideshow.U_STOP_REPEAT)}
    46   <a class="navButton repeat" href="{$slideshow.U_STOP_REPEAT}" title="{'stop_repeat'|@translate}" rel="repeat"><img src="{$ROOT_URL}{$themeconf.icon_dir}/stop_repeat.png" class="button" alt="{'stop_repeat'|@translate}"></a>
     46  <a class="navButton" href="{$slideshow.U_STOP_REPEAT}" title="{'stop_repeat'|@translate}"><img src="{$ROOT_URL}{$themeconf.icon_dir}/stop_repeat.png" class="button" alt="{'stop_repeat'|@translate}"></a>
    4747{/if}
    4848
    4949{if isset($slideshow)}
    5050  {if isset($slideshow.U_DEC_PERIOD)}
    51     <a class="navButton dec_period" href="{$slideshow.U_DEC_PERIOD}" title="{'dec_period'|@translate}" rel="repeat"><img src="{$ROOT_URL}{$themeconf.icon_dir}/dec_period.png" class="button" alt="{'dec_period'|@translate}"></a>
     51    <a class="navButton" href="{$slideshow.U_DEC_PERIOD}" title="{'dec_period'|@translate}"><img src="{$ROOT_URL}{$themeconf.icon_dir}/dec_period.png" class="button" alt="{'dec_period'|@translate}"></a>
    5252  {else}
    53     <a class="navButton dec_period"> <img src="{$ROOT_URL}{$themeconf.icon_dir}/dec_period_unactive.png" class="button" alt=""></a>
     53    <a class="navButton"> <img src="{$ROOT_URL}{$themeconf.icon_dir}/dec_period_unactive.png" class="button" alt=""></a>
    5454  {/if}
    5555
    5656  {if isset($slideshow.U_INC_PERIOD)}
    57     <a class="navButton inc_period" href="{$slideshow.U_INC_PERIOD}" title="{'inc_period'|@translate}" rel="repeat"><img src="{$ROOT_URL}{$themeconf.icon_dir}/inc_period.png" class="button" alt="{'inc_period'|@translate}"></a>
     57    <a class="navButton" href="{$slideshow.U_INC_PERIOD}" title="{'inc_period'|@translate}"><img src="{$ROOT_URL}{$themeconf.icon_dir}/inc_period.png" class="button" alt="{'inc_period'|@translate}"></a>
    5858  {else}
    59     <a class="navButton inc_period"> <img src="{$ROOT_URL}{$themeconf.icon_dir}/inc_period_unactive.png" class="button" alt=""></a>
     59    <a class="navButton"> <img src="{$ROOT_URL}{$themeconf.icon_dir}/inc_period_unactive.png" class="button" alt=""></a>
    6060  {/if}
    6161{/if}
Note: See TracChangeset for help on using the changeset viewer.