Changeset 17604


Ignore:
Timestamp:
Aug 21, 2012, 12:07:18 AM (12 years ago)
Author:
grum
Message:

bug:2726

Location:
extensions/lmt
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • extensions/lmt/lmt_aip.class.inc.php

    r16014 r17604  
    215215    foreach($filter_list_values as $key=>$val)
    216216    {
    217       $filter_list_labels[] = "[".l10n("lmt_lbl_cc_s-".strtolower($val))."] ".l10n("lmt_lbl_cc-".strtolower($val));
     217      $filter_list_labels[] = "[".$this->translateCopyright("lmt_lbl_cc_s-".strtolower($val))."] ".$this->translateCopyright("lmt_lbl_cc-".strtolower($val));
    218218      if($val==$_REQUEST['filter'])
    219219      {
     
    224224    $filter_list_values = array_merge(array(''), $filter_list_values);
    225225    $filter_list_labels = array_merge(array(l10n('lmt_nofilter')), $filter_list_labels);
    226     $default_licence = l10n("lmt_lbl_cc-".strtolower($this->config['lmt_licence_default']));
     226    $default_licence = $this->translateCopyright("lmt_lbl_cc-".strtolower($this->config['lmt_licence_default']));
    227227    $default_licence_img =LMT_PATH."img/".strtolower($this->config['lmt_licence_default'])."_80x15.png";
    228228
     
    373373    foreach($licences_list_values as $key=>$val)
    374374    {
    375       $licences_list_labels[] = "[".l10n("lmt_lbl_cc_s-".strtolower($val))."] ".l10n("lmt_lbl_cc-".strtolower($val));
     375      $licences_list_labels[] = "[".$this->translateCopyright("lmt_lbl_cc_s-".strtolower($val))."] ".$this->translateCopyright("lmt_lbl_cc-".strtolower($val));
    376376    }
    377377
     
    439439    foreach($lmt_licence_default_values as $key=>$val)
    440440    {
    441       $lmt_licence_default_labels[] = "[".l10n("lmt_lbl_cc_s-".strtolower($val))."] ".l10n("lmt_lbl_cc-".strtolower($val));
     441      $lmt_licence_default_labels[] = "[".$this->translateCopyright("lmt_lbl_cc_s-".strtolower($val))."] ".$this->translateCopyright("lmt_lbl_cc-".strtolower($val));
    442442
    443443      $tmp[]="'".str2url("ilmt_redirect_url-".strToLower($val))."'";
    444444      $datas['lmt_redirect_urls'][str2url('lmt_redirect_url-'.strToLower($val))]=array(
    445         'text' => l10n("lmt_lbl_cc_s-".strToLower($val)),
     445        'text' => $this->translateCopyright("lmt_lbl_cc_s-".strToLower($val)),
    446446        'langs' => array()
    447447      );
     
    660660      "author_list" => array(),
    661661      "img_directory" => LMT_PATH."img/",
    662       "default_licencepublished" => l10n("lmt_lbl_under-".strToLower($this->config['lmt_licence_default'])),
     662      "default_licencepublished" => $this->translateCopyright("lmt_lbl_under-".strToLower($this->config['lmt_licence_default'])),
    663663      "default_licenceL" => strToLower($this->config['lmt_licence_default']),
    664       "default_licenceU" => l10n("lmt_lbl_cc_s-".strToLower($this->config['lmt_licence_default'])),
     664      "default_licenceU" => $this->translateCopyright("lmt_lbl_cc_s-".strToLower($this->config['lmt_licence_default'])),
    665665      "lmt_licence_logo" => $this->config['lmt_licence_logo'],
    666666      "nbauthor" => 0,
     
    770770    {
    771771      $datas['shortlicencetext'][$val] = array(
    772         "txt" => l10n("lmt_lbl_cc_s-".strtolower($val)),
    773         "published" => l10n("lmt_lbl_under-".strtolower($val))
     772        "txt" => $this->translateCopyright("lmt_lbl_cc_s-".strtolower($val)),
     773        "published" => $this->translateCopyright("lmt_lbl_under-".strtolower($val))
    774774      );
    775775    }
  • extensions/lmt/lmt_pip.class.inc.php

    r16014 r17604  
    1717//include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCPublicIntegration.class.inc.php');
    1818
    19 load_language('plugin.lang', LMT_PATH);
     19global $user;
     20
    2021
    2122class LMT_PIP extends LMT_root
     
    4647    if($this->config['lmt_licence_activated']=='y')
    4748    {
     49      add_event_handler('user_init', array(&$this, 'loadLang'));
    4850      add_event_handler('loc_end_picture', array(&$this, 'manageLicenceElement'));
    4951
     
    6163  }
    6264
     65  public function loadLang()
     66  {
     67    load_language('plugin.lang', LMT_PATH);
     68  }
     69
    6370  /* -------------------------------------------------------------------------
    6471    FUNCTIONS TO MANAGE LMT DISPLAY
     
    6673  public function manageLicenceElement()
    6774  {
    68     global $template, $page, $user;
     75    global $template, $page, $user, $lang;
    6976
    7077    $licence=$this->getImageLicence($page['image_id']);
     
    8794    }
    8895
    89     $alternateText=" alt='".htmlspecialchars(l10n('lmt_lbl_cc_s-'.strtolower($licence['licence'])), ENT_QUOTES)."'
     96    $alternateText=" alt='".htmlspecialchars($this->translateCopyright('lmt_lbl_cc_s-'.strToLower($licence['licence'])), ENT_QUOTES)."'
    9097      title='".htmlspecialchars(
    91         l10n('lmt_lbl_under-'.strtolower($licence['licence'])).' '.
    92         l10n('lmt_lbl_cc_s-'.strtolower($licence['licence'])).' : '.
    93         l10n('lmt_lbl_cc-'.strtolower($licence['licence'])),ENT_QUOTES
     98        $this->translateCopyright('lmt_lbl_under-'.strtolower($licence['licence'])).' '.
     99        $this->translateCopyright('lmt_lbl_cc_s-'.strtolower($licence['licence'])).' : '.
     100        $this->translateCopyright('lmt_lbl_cc-'.strtolower($licence['licence'])),ENT_QUOTES
    94101    )."' ";
    95102
     
    123130        if($url!="")
    124131        {
    125           $text ="<br/>".l10n("lmt_lbl_under-".strToLower($licence['licence']))." <a href='".$url."'".$target.">".l10n("lmt_lbl_cc_s-".strToLower($licence['licence']))."</a> ".$licence['aut_text1']." ".$licence['aut_text2'];
     132          $text ="<br/>".$this->translateCopyright("lmt_lbl_under-".strToLower($licence['licence']))." <a href='".$url."'".$target.">".$this->translateCopyright("lmt_lbl_cc_s-".strToLower($licence['licence']))."</a> ".$licence['aut_text1']." ".$licence['aut_text2'];
    126133        }
    127134        else
    128135        {
    129           $text ="<br/>".l10n("lmt_lbl_under-".strToLower($licence['licence']))." ".l10n("lmt_lbl_cc_s-".strToLower($licence['licence']))." ".$licence['aut_text1']." ".$licence['aut_text2'];
     136          $text ="<br/>".$this->translateCopyright("lmt_lbl_under-".strToLower($licence['licence']))." ".$this->translateCopyright("lmt_lbl_cc_s-".strToLower($licence['licence']))." ".$licence['aut_text1']." ".$licence['aut_text2'];
    130137        }
    131138        break;
     
    137144  public function manageWarningText()
    138145  {
    139     global $template, $user;
     146    global $template, $user, $lang;
    140147
    141148
     
    149156    }
    150157
    151     $alternateText=" alt='".htmlspecialchars(l10n('lmt_lbl_cc_s-'.strtolower($this->config['lmt_licence_default'])), ENT_QUOTES)."'
     158    $alternateText=" alt='".htmlspecialchars($this->translateCopyright('lmt_lbl_cc_s-'.strtolower($this->config['lmt_licence_default'])), ENT_QUOTES)."'
    152159      title='".htmlspecialchars(
    153         l10n('lmt_lbl_under-'.strtolower($this->config['lmt_licence_default'])).' '.
    154         l10n('lmt_lbl_cc_s-'.strtolower($this->config['lmt_licence_default'])).' : '.
    155         l10n('lmt_lbl_cc-'.strtolower($this->config['lmt_licence_default'])),ENT_QUOTES
     160        $this->translateCopyright('lmt_lbl_under-'.strtolower($this->config['lmt_licence_default'])).' '.
     161        $this->translateCopyright('lmt_lbl_cc_s-'.strtolower($this->config['lmt_licence_default'])).' : '.
     162        $this->translateCopyright('lmt_lbl_cc-'.strtolower($this->config['lmt_licence_default'])),ENT_QUOTES
    156163    )."' ";
    157164
    158165    $patterns = array('/\[logo=80x15\]/i', '/\[logo=88x31\]/i', '/\[logo=text\]/i');
    159166    $replacements = array(
    160       "<img $alternateText class='logo80x15' src='". LMT_PATH."img/".strToLower($this->config['lmt_licence_default'])."_80x15.png'>",
    161       "<img $alternateText class='logo88x31' src='". LMT_PATH."img/".strToLower($this->config['lmt_licence_default'])."_88x31.png'>",
    162       l10n("lmt_lbl_cc_s-".strToLower($this->config['lmt_licence_default']))
     167      "<img $alternateText class='logo80x15' src='". LMT_PATH."img/".strtolower($this->config['lmt_licence_default'])."_80x15.png'>",
     168      "<img $alternateText class='logo88x31' src='". LMT_PATH."img/".strtolower($this->config['lmt_licence_default'])."_88x31.png'>",
     169      $this->translateCopyright("lmt_lbl_cc_s-".strtolower($this->config['lmt_licence_default']))
    163170    );
    164171
  • extensions/lmt/lmt_root.class.inc.php

    r16014 r17604  
    243243  }
    244244
     245  public function translateCopyright($key)
     246  {
     247    global $lang;
     248    if(isset($lang[$key]) and $lang[$key]=='') return('');
     249    return(l10n($key));
     250  }
     251
    245252} //class
    246253
  • extensions/lmt/lmt_version.inc.php

    r15341 r17604  
    1515  if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
    1616
    17   define('LMT_VERSION',  '1.4.0');
    18   define('LMT_VERSION2', '01.04.00');
     17  define('LMT_VERSION',  '1.4.1');
     18  define('LMT_VERSION2', '01.04.01');
    1919  define('LMT_GPC_NEEDED', '3.5.2');
    2020?>
  • extensions/lmt/main.inc.php

    r16461 r17604  
    22/*
    33Plugin Name: LMT
    4 Version: 1.4.0
     4Version: 1.4.1
    55Description: Appliquer une licence sur ses photos / Apply a licence on photos
    66Plugin URI: http://piwigo.org/ext/extension_view.php?eid=282
     
    7373|         |            |   . compatibility with piwigo 2.4
    7474|         |            |
     75| 1.4.1   | 2012/08/20 | * mantis bug:2726
     76|         |            |   .  Copyright display is not correct
     77|         |            |     => use $this->translateCopyright() insted of l10n()
     78|         |            |     => load langage file when user_init() is done
     79|         |            |
     80|         |            |
     81|         |            |
     82|         |            |
    7583|         |            |
    7684
Note: See TracChangeset for help on using the changeset viewer.