Index: /extensions/lmt/admin/index.php
===================================================================
--- /extensions/lmt/admin/index.php	(revision 3396)
+++ /extensions/lmt/admin/index.php	(revision 3396)
@@ -0,0 +1,33 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | PhpWebGallery - a PHP based picture gallery                           |
+// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
+// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
+// +-----------------------------------------------------------------------+
+// | file          : $Id: index.php 1912 2007-03-16 06:30:07Z rub $
+// | last update   : $Date: 2007-03-16 07:30:07 +0100 (ven, 16 mar 2007) $
+// | last modifier : $Author: rub $
+// | revision      : $Revision: 1912 $
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/lmt/admin/lmt_admin.tpl
===================================================================
--- /extensions/lmt/admin/lmt_admin.tpl	(revision 3396)
+++ /extensions/lmt/admin/lmt_admin.tpl	(revision 3396)
@@ -0,0 +1,12 @@
+
+<div class="titrePage">
+  <h2 style="position:absolute;right:0px;top:32px;height:auto;font-size:12px;font-weight:normal;">:: {$plugin.LMT_VERSION} ::</h2>
+  <h2>{'lmt_title'|@translate} <span style="font-size:-1;font-weight:normal;">{$TABSHEET_TITLE}</span></h2>
+
+  {*{$tabsheet}*}
+</div>
+
+{*<h3>{$plugin.LMT_TITLE}</h3>*}
+
+{$LMT_BODY_PAGE}
+
Index: /extensions/lmt/admin/lmt_js.tpl
===================================================================
--- /extensions/lmt/admin/lmt_js.tpl	(revision 3396)
+++ /extensions/lmt/admin/lmt_js.tpl	(revision 3396)
@@ -0,0 +1,19 @@
+{literal}
+function get_licence_text(txt, published)
+{
+  returned='';
+  switch(txt)
+  {
+    {/literal}
+    {foreach from=$datas.shortlicencetext key=name item=nfo}
+    case '{$name}':
+      returned='{$nfo.txt}';
+      if(published)  returned = "{$nfo.published} "+returned;
+      break;
+    {/foreach}
+    {literal}
+  }
+
+  return(returned);
+}
+{/literal}
Index: /extensions/lmt/admin/plugin_admin.php
===================================================================
--- /extensions/lmt/admin/plugin_admin.php	(revision 3396)
+++ /extensions/lmt/admin/plugin_admin.php	(revision 3396)
@@ -0,0 +1,26 @@
+<?php
+/* -----------------------------------------------------------------------------
+  Plugin     : LMT
+  Author     : Grum
+    email    : grum@piwigo.org
+    website  : http://photos.grum.fr
+
+    << May the Little SpaceFrog be with you ! >>
+  ------------------------------------------------------------------------------
+  See main.inc.php for release information
+
+  --------------------------------------------------------------------------- */
+
+if (!defined('PHPWG_ROOT_PATH')) { die('Hacking attempt!'); }
+
+include(LMT_PATH."lmt_aip.class.inc.php");
+
+global $prefixeTable;
+
+load_language('plugin.lang', LMT_PATH);
+
+$main_plugin_object = get_plugin_data($plugin_id);
+
+$plugin_aip = new LMT_AIP($prefixeTable, $main_plugin_object->get_filelocation());
+$plugin_aip->manage();
+?>
Index: /extensions/lmt/admin/plugin_admin_config.tpl
===================================================================
--- /extensions/lmt/admin/plugin_admin_config.tpl	(revision 3396)
+++ /extensions/lmt/admin/plugin_admin_config.tpl	(revision 3396)
@@ -0,0 +1,332 @@
+{literal}
+<script type="text/javascript">
+
+    //global var ; need to not have to initialize them every time a value is changed
+    var objlang; 
+    var objlang2; 
+    var objnames = new Array('itext');
+    var objnames2 = new Array({/literal}{$datas.objnames2}{literal});
+    var objinput = new Array();   //input text from form => objinput[name]
+    var objhidden = new Array();  //input hidden from form => objhidden[name][lang]
+    var objinput2 = new Array();   //input text from form => objinput[name]
+    var objhidden2 = new Array();  //input hidden from form => objhidden[name][lang]
+
+  {/literal}
+  {$extended_code}
+  {literal}
+
+  function change_logodefault()
+  {
+    if($("#ilicence_logo").val()=="text")
+    {
+      $("#logodefault").get(0).innerHTML=get_licence_text($("#ilicence_default").val(), true);
+    }
+    else
+    {
+      $("#logodefault").get(0).innerHTML="<img src='{/literal}{$datas.img_directory}{literal}"+
+            $("#ilicence_default").val().toLowerCase()+"_"+
+            $("#ilicence_logo").val()+".png'>";
+    }
+    change_example();
+  }
+
+  function init()
+  {
+    // initialize translations
+    objlang = document.getElementById('islang');
+    objlang2 = document.getElementById('iurlslang');
+
+    for(i=0;i<objnames.length;i++)
+    {
+      objinput[i] = document.getElementById(objnames[i]);
+      objhidden[i] = new Array();
+      for(j=0;j<objlang.options.length;j++)
+      {
+        objhidden[i][j] = document.getElementById(objnames[i]+'_'+objlang.options[j].value);
+      }
+    }
+    for(i=0;i<objnames2.length;i++)
+    {
+      objinput2[i] = document.getElementById(objnames2[i]);
+      objhidden2[i] = new Array();
+      for(j=0;j<objlang.options.length;j++)
+      {
+        objhidden2[i][j] = document.getElementById(objnames2[i]+'_'+objlang.options[j].value);
+      }
+    }
+
+    //initialize help event
+    $("sup").filter('.icnhelp').bind("mouseenter", 
+      function(event){ 
+        $("#hinthlp").attr("innerHTML", get_hint(this))
+          .css("left", event.clientX+1+window.pageXOffset)
+          .css("top", event.clientY+1+window.pageYOffset);
+      } 
+    );
+
+    $("sup").filter('.icnhelp').bind("mouseleave", 
+      function(event){ 
+        $("#hinthlp")
+          .css("left", -450);
+      } 
+    );
+
+  }
+
+  function change_lang()
+  {
+    for(i=0;i<objnames.length;i++)
+    {
+      objinput[i].value = objhidden[i][objlang.options.selectedIndex].value;
+    }
+    change_example();
+  }
+
+  function change_urllang()
+  {
+    for(i=0;i<objnames2.length;i++)
+    {
+      objinput2[i].value = objhidden2[i][objlang2.options.selectedIndex].value;
+    }
+  }
+
+
+  function apply_changes(input_id)
+  {
+    var obj=document.getElementById(input_id);
+    objhidden[objnames.indexOf(input_id)][objlang.options.selectedIndex].value = obj.value;
+
+    change_example();
+  }
+
+  function apply_changes2(input_id)
+  {
+    var obj=document.getElementById(input_id);
+    objhidden2[objnames2.indexOf(input_id)][objlang2.options.selectedIndex].value = obj.value;
+  }
+
+  function get_hint(obj)
+  {
+    switch(obj.id)
+    {
+      {/literal}
+      {foreach from=$datas.help key=name item=txt}
+      case '{$name}':return('{$txt}');
+        break;
+      {/foreach}
+      {literal}      
+    }
+  }
+
+  function change_example()
+  {
+    var str = $("#itext").val();
+
+    //var re = new RegExp('\\[logo=80x15\\]|\\[logo=88x31\\]|\\[logo=text\\]', "i");
+    var re = new RegExp('\\[logo=80x15\\]', "i");
+    img = "<img class='logo80x15' src='{/literal}{$datas.img_directory}{literal}"+$("#ilicence_default").val().toLowerCase()+"_80x15.png'>";
+    str = str.replace(re, img);
+
+    var re = new RegExp('\\[logo=88x31\\]', "i");
+    img = "<img class='logo88x31' src='{/literal}{$datas.img_directory}{literal}"+$("#ilicence_default").val().toLowerCase()+"_88x31.png'>";
+    str = str.replace(re, img);
+
+    var re = new RegExp('\\[logo=text\\]', "i");
+    txt = get_licence_text($("#ilicence_default").val(), false);
+    str = str.replace(re, txt);
+
+    $("#textexample").attr("innerHTML",str);
+  }
+
+</script>
+{/literal}
+
+<div id="hinthlp" class="hinthlp"></div>
+
+<form method="post" action="" class="general">
+
+  <fieldset >
+    <legend>{'lmt_general_config'|@translate}</legend>
+    
+    <table class="formtable"  >
+      <tr>
+        <td>{'lmt_cfg_licence_activated'|@translate}<sup id="hlp2" class="icnhelp">?</sup></td>
+        <td>
+          {html_options name="f_lmt_licence_activated" values=$lmt_yesno_values output=$lmt_yesno_labels selected=$datas.lmt_licence_activated}
+        </td>
+      </tr>
+
+    </table>
+  </fieldset >
+
+  <fieldset >
+    <legend>{'lmt_display_config'|@translate}</legend>
+    <table class="formtable"  >
+
+      <tr>
+        <td>{'lmt_cfg_list_maxheight'|@translate}<sup id="hlp1" class="icnhelp">?</sup></td>
+        <td>
+          <input type="text" name="f_lmt_list_maxheight" size="4"
+                 value="{$datas.lmt_list_maxheight}" maxlength="4" />&nbsp;px
+        </td>
+      </tr>
+
+      <tr>
+        <td>{'lmt_cfg_list_maxitems'|@translate}<sup id="hlp9" class="icnhelp">?</sup></td>
+        <td>
+          <input type="text" name="f_lmt_list_maxitems" value="{$datas.lmt_list_maxitems}"
+                 maxlength="4" size="4" />
+        </td>
+      </tr>
+
+    </table>
+  </fieldset>
+
+  <fieldset >
+    <legend>{'lmt_licence_config'|@translate}</legend>
+    <table class="formtable"  >
+
+      <tr>
+        <td>{'lmt_cfg_licence_visible'|@translate}<sup id="hlp3" class="icnhelp">?</sup></td>
+        <td>
+          {html_options name="f_lmt_licence_visible" values=$lmt_yesno_values output=$lmt_yesno_labels selected=$datas.lmt_licence_visible}
+        </td>
+      </tr>
+
+      <tr>
+        <td>{'lmt_cfg_licence_logo'|@translate}</td>
+        <td>
+          <select name="f_lmt_licence_logo"  id="ilicence_logo" onchange="change_logodefault();">
+            {html_options values=$lmt_licence_logo_values output=$lmt_licence_logo_labels selected=$datas.lmt_licence_logo}
+          </select>
+        </td>
+      </tr>
+
+      <tr>
+        <td>{'lmt_cfg_licence_default'|@translate}<sup id="hlp4" class="icnhelp">?</sup></td>
+        <td>
+          <select name="f_lmt_licence_default" id="ilicence_default" onchange="change_logodefault();">
+            {html_options values=$lmt_licence_default_values output=$lmt_licence_default_labels selected=$datas.lmt_licence_default}
+          </select>
+        </td>
+      </tr>
+
+      <tr>
+        <td>{'lmt_cfg_licence_default_author'|@translate}<sup id="hlp8" class="icnhelp">?</sup></td>
+        <td>
+          <select name="f_lmt_licence_default_author" id="ilicence_default_author">
+            {html_options values=$lmt_licence_default_author_values output=$lmt_licence_default_author_labels selected=$datas.lmt_licence_default_author}
+          </select>
+        </td>
+      </tr>
+
+      <tr>
+        <td colspan=2 style="border-top:1px dotted;"></td>
+      </tr>
+
+      <tr>
+        <td>{'example'|@translate}</td>
+        <td><span id="logodefault"></span></td>
+      </tr>
+
+
+    </table>
+  </fieldset>
+
+
+  <fieldset >
+    <legend>{'lmt_warning_config'|@translate}</legend>
+    <table class="formtable"  >
+      <tr>
+        <td>{'lmt_cfg_warning_visible'|@translate}<sup id="hlp5" class="icnhelp">?</sup></td>
+        <td>
+          {html_options name="f_lmt_warning_visible" values=$lmt_yesno_values output=$lmt_yesno_labels selected=$datas.lmt_warning_visible}
+        </td>
+      </tr>
+  
+      <tr>
+        <td>
+          {'lmt_cfg_warning_texts'|@translate}<sup id="hlp7" class="icnhelp">?</sup><br/>
+          <select onchange="change_lang();" id="islang">
+            {html_options values=$lmt_language_list_values output=$lmt_language_list_labels selected=$lmt_language_selected}
+          </select>
+        </td>
+        <td>
+        {if isset($datas.lmt_warning_texts) and count($datas.lmt_warning_texts)}
+          {foreach from=$datas.lmt_warning_texts key=name item=lang}
+            <input type="hidden" name="f_lmt_warning_texts_{$lang.lang}"
+                    id="itext_{$lang.lang}" value="{$lang.text}">
+          {/foreach}
+        {/if}        
+        <textarea id="itext" rows="4" cols="60" onkeyup="apply_changes('itext');" /></textarea>
+        </td>
+      </tr>
+
+      <tr>
+        <td>&nbsp;</td>
+        <td style="font-size:90%;">{'lmt_warning_texts_help'|@translate}</td>
+      </tr>
+
+      <tr>
+        <td colspan=2 style="border-top:1px dotted;"></td>
+      </tr>
+
+      <tr>
+        <td>{'example'|@translate}</td>
+        <td><span id="textexample"></span></td>
+      </tr>
+
+
+
+    </table>
+  </fieldset>
+
+  <fieldset >
+    <legend>{'lmt_redirect_config'|@translate}</legend>
+    
+    <table class="formtable"  >
+
+      <tr>
+        <td>{'lmt_cfg_warning_link'|@translate}<sup id="hlp6" class="icnhelp">?</sup></td>
+        <td>
+          {html_options name="f_lmt_redirect_activated" values=$lmt_yesno_values output=$lmt_yesno_labels selected=$datas.lmt_redirect_activated}
+        </td>
+      </tr>
+
+      <tr>
+        <td colspan=2 style="padding-top:5px;border-top:1px dotted;">
+          {'lmt_redirect_urls'|@translate}<br/>
+          <select onchange="change_urllang();" id="iurlslang">
+            {html_options values=$lmt_language_list_values output=$lmt_language_list_labels selected=$lmt_language_selected}
+          </select>
+        </td>
+      </tr>
+
+
+      {foreach from=$datas.lmt_redirect_urls key=name item=data}
+      <tr>
+        <td>{$data.text}</td>
+        <td>
+          <input type="text" value="" maxlength="250" size="50" id="i{$name}" onkeyup="apply_changes2('i{$name}')"/>
+          {foreach from=$data.langs key=lname item=lang}
+            <input type="hidden" name="f_{$name}_{$lname}" value="{$lang}" id="i{$name}_{$lname}"/>
+          {/foreach}
+        </td>
+      </tr>
+      {/foreach}
+
+    </table>
+  </fieldset >
+
+
+  <p>
+    <input type="submit" value="{'lmt_do_save'|@translate}" name="submit_save_config"/>
+  </p>
+</form>
+
+<script type="text/javascript">
+  change_logodefault();
+  init();
+  change_lang();
+  change_urllang();
+</script>
Index: /extensions/lmt/admin/plugin_admin_help.tpl
===================================================================
--- /extensions/lmt/admin/plugin_admin_help.tpl	(revision 3396)
+++ /extensions/lmt/admin/plugin_admin_help.tpl	(revision 3396)
@@ -0,0 +1,27 @@
+<div id="lmt_help">
+<h3 class="lmt">{'lmt_whatisit'|@translate}</h3>
+<p class="lmt_page">{'lmt_whatisit_def1'|@translate}</p>
+<p class="lmt_page">{'lmt_whatisit_def2'|@translate}</p>
+<p class="lmt_page"><a href="{'lmt_cc_url'|@translate}">{'lmt_official_website'|@translate}</a></p>
+
+
+<h3 class="lmt">{'lmt_four_way'|@translate}</h3>
+<table class="formtable" width="100%">
+<tr><td>{'lmt_way_--'|@translate}</td><td rowspan=4 width="20px">&nbsp;</td><td>{'lmt_def_--'|@translate}</td></tr>
+<tr><td>{'lmt_way_nd'|@translate}</td><td>{'lmt_def_nd'|@translate}</td></tr>
+<tr><td>{'lmt_way_nc'|@translate}</td><td>{'lmt_def_nc'|@translate}</td></tr>
+<tr><td>{'lmt_way_sa'|@translate}</td><td>{'lmt_def_sa'|@translate}</td></tr>
+</table>
+
+<h3 class="lmt">{'lmt_six_licences'|@translate}</h3>
+<table class="formtable" width="100%">
+<tr><td><img src="{$imgdir}by_88x31.png" style="float:left;"/>&nbsp;{'lmt_lbl_cc-by'|@translate}</td><td></td></tr>
+<tr><td><img src="{$imgdir}by-nd_88x31.png" style="float:left;"/>&nbsp;{'lmt_lbl_cc-by-nd'|@translate}</td><td></td></tr>
+<tr><td><img src="{$imgdir}by-nc_88x31.png" style="float:left;"/>&nbsp;{'lmt_lbl_cc-by-nc'|@translate}</td><td></td></tr>
+<tr><td><img src="{$imgdir}by-nc-nd_88x31.png" style="float:left;"/>&nbsp;{'lmt_lbl_cc-by-nc-nd'|@translate}</td><td></td></tr>
+<tr><td><img src="{$imgdir}by-nc-sa_88x31.png" style="float:left;"/>&nbsp;{'lmt_lbl_cc-by-nc-sa'|@translate}</td><td></td></tr>
+<tr><td><img src="{$imgdir}by-sa_88x31.png" style="float:left;"/>&nbsp;{'lmt_lbl_cc-by-sa'|@translate}</td><td></td></tr>
+</table>
+
+
+</div>
Index: /extensions/lmt/admin/plugin_admin_list.tpl
===================================================================
--- /extensions/lmt/admin/plugin_admin_list.tpl	(revision 3396)
+++ /extensions/lmt/admin/plugin_admin_list.tpl	(revision 3396)
@@ -0,0 +1,47 @@
+<script type="text/javascript">
+{literal}
+  function loadpage(pagenum)
+  {
+    http_request=create_httpobject('get', '', '{/literal}{$datas.LMT_AJAX_URL_LIST}{literal}'+pagenum+"&filter="+$("#filter").val(), false);
+    http_request.send(null);
+
+    tmp=http_request.responseText;
+    
+    $("#nbphotos").attr("innerHTML", tmp.substr(0,tmp.indexOf("#")));
+    $("#list").attr("innerHTML", tmp.substr(tmp.indexOf("#")+1));
+  }
+{/literal}
+</script>
+
+<fieldset style="text-align:left;">
+  <legend>{'lmt_lst_default_licence'|@translate}</legend>
+  {if $default_licence_img!=""}
+    <img style="position:relative;top:3px;" src="{$default_licence_img}"/>
+  {/if}&nbsp;<i>{$default_licence}</i>
+</fieldset>
+
+
+<fieldset>
+  <legend>{'lmt_lst_special_licence'|@translate}</legend>
+  <div id="list">
+  </div>
+  
+    <p class="lmt_page" style="border-top:1px dotted;padding-top:10px;">
+      <span id="nbphotos" style="float:right;"></span>
+      <span id="navigate" style="float:right;">{$datas.navigate}</span>
+      <span>{'lmt_lst_apply_filter'|@translate}&nbsp;
+        <select id="filter" name="filter" onchange="loadpage(1);">
+          {html_options values=$filter_list_values output=$filter_list_labels selected=$filter_list_selected}
+        </select>
+      </span>
+    </p>
+
+  <form method="POST">
+    <input type="submit" name="submit_add_to_caddie" value="{'lmt_add_to_caddie'|@translate}">&nbsp;
+    <input type="submit" name="submit_replace_caddie" value="{'lmt_replace_caddie'|@translate}">
+  </form>
+</fieldset>
+
+<script type="text/javascript">
+  loadpage(1);
+</script>
Index: /extensions/lmt/admin/plugin_admin_listitems.tpl
===================================================================
--- /extensions/lmt/admin/plugin_admin_listitems.tpl	(revision 3396)
+++ /extensions/lmt/admin/plugin_admin_listitems.tpl	(revision 3396)
@@ -0,0 +1,24 @@
+<ul id="ullist" class="thumbnails">
+  {foreach from=$imgliste key=name item=data}
+    <li>
+      <table><tr>
+      <td width="140px;">
+        <span class="wrap1 extendwrap1">
+          <span class="wrap2">
+              <img class="thumbnail" src="{$data.thumb}"/>
+          </span>
+        </span>
+      </td>
+      <td>
+        <span>
+          [ <a href="{$data.catlink}">{$data.catname}</a> ]<br/>
+          [ <a href="{$data.imglink}">{$data.file}</a> ]<br/>
+          <img src="{$data.licencei}"/> <br/>
+          <i>{$data.aut_text1}<br/>
+          {$data.aut_text2}</i>
+        </span>
+      </td>
+      </tr></table>
+    </li>
+  {/foreach}
+</ul>
Index: /extensions/lmt/admin/plugin_admin_manage.tpl
===================================================================
--- /extensions/lmt/admin/plugin_admin_manage.tpl	(revision 3396)
+++ /extensions/lmt/admin/plugin_admin_manage.tpl	(revision 3396)
@@ -0,0 +1,166 @@
+
+{if $nbphotos==0}
+  <p>{'lmt_caddie_is_empty_please_fill_it'|@translate}</p>
+{else}
+
+{literal}
+<script type="text/javascript">
+$(document).data("nbsel", {/literal}{$nbphotos}{literal});
+
+  function loadpage(pagenum)
+  {
+    http_request=create_httpobject('get', '', '{/literal}{$datas.LMT_AJAX_URL_LIST}{literal}'+pagenum, false);
+    http_request.send(null);
+
+    tmp=http_request.responseText;
+    
+    $("#nbphotos").attr("innerHTML", tmp.substr(0,tmp.indexOf("#")));
+    $("#list").attr("innerHTML", tmp.substr(tmp.indexOf("#")+1));
+  }
+
+  function swap_state(id)
+  {
+    if($("#"+id).val()=="1")
+    {
+      $("#"+id).val("0");
+      $("#img"+id).attr("className", "is_off");
+      $(document).data("nbsel", $(document).data("nbsel")-1);
+    }
+    else
+    {
+      $("#"+id).val("1");
+      $("#img"+id).attr("className", "is_on");
+      $(document).data("nbsel", $(document).data("nbsel")+1);
+    }    
+    $("#btsubmit").get(0).disabled=($(document).data("nbsel")==0);
+  }
+
+  function change_select()
+  {
+    act=$("#selectlist").val();
+    switch(act)
+    {
+      case '-':
+        break;
+      case 'all': 
+        $(document).data("nbsel", {/literal}{$nbphotos}{literal});
+        $("input").filter(".none").each(
+          function(i) 
+          { 
+            this.value="1"; 
+            $("#img"+this.id).attr("className", "is_on");
+          } 
+        );        
+        break;
+      case 'none':
+        $(document).data("nbsel", 0);
+        $("input").filter(".none").each(
+          function(i) 
+          { 
+            this.value="0"; 
+            $("#img"+this.id).attr("className", "is_off");
+          } 
+        );        
+        break;
+      case 'invert':
+        $("input").filter(".none").each(
+          function(i) 
+          { 
+            if(this.value=="1")
+            {
+              this.value="0";
+              $("#img"+this.id).attr("className", "is_off");
+              $(document).data("nbsel", $(document).data("nbsel")-1);
+            }
+            else
+            {
+              this.value="1";
+              $("#img"+this.id).attr("className", "is_on");
+              $(document).data("nbsel", $(document).data("nbsel")+1);
+            }
+          } 
+        );        
+        break;
+      default:
+        $(document).data("nbsel", 0);
+        $("input").filter(".none").each(
+          function(i) 
+          { 
+            if(this.alt==act)
+            {
+              this.value="1";
+              $("#img"+this.id).attr("className", "is_on");
+              $(document).data("nbsel", $(document).data("nbsel")+1);
+            }
+          } 
+        );        
+        break;
+    } 
+    $("#selectlist").get(0).options[0].selected=true;
+    $("#btsubmit").get(0).disabled=($(document).data("nbsel")==0);
+  }
+
+</script>
+{/literal}
+
+
+<form method="POST">
+
+  <fieldset>
+    <legend>{'lmt_caddie_items'|@translate}</legend>
+
+    <div id="list">
+    </div>
+
+    <p class="lmt_page" style="border-top:1px dotted;padding-top:10px;">
+      <span id="nbphotos" style="float:right;"></span>
+      <span>
+          <select id="selectlist" onchange="change_select();">
+            {html_options values=$selectlist_list_values output=$selectlist_list_labels selected=$selectlist_list_selected}
+          </select>
+      </span>
+    </p>
+  </fieldset>
+
+  <fieldset>
+    <legend>{'lmt_licence_to_apply'|@translate}</legend>
+
+    <p class="lmt_page">
+      <table class="formtable">
+        <tr>
+          <td>{'lmt_licence'|@translate}</td>
+          <td>
+            <select name="licence">
+              {html_options values=$licences_list_values output=$licences_list_labels selected=$licences_list_selected}
+            </select>
+          </td>
+        </tr>
+        <tr>
+          <td>{'lmt_author'|@translate}</td>
+          <td>
+            <select name="author">
+              {html_options values=$author_list_values output=$author_list_labels}
+            </select>
+          </td>
+        </tr>
+      </table>
+    </p>
+  </fieldset>
+
+  <fieldset>
+    <legend>{'Caddie management'|@translate}</legend>
+    <label><input type="radio" name="manage_caddie" value="app_nothing" checked>&nbsp;{'lmt_apply_do_nothing'|@translate}</label><br/>
+    <label><input type="radio" name="manage_caddie" value="app_clear">&nbsp;{'lmt_apply_do_clear'|@translate}</label><br/>
+    <label><input type="radio" name="manage_caddie" value="app_clear_selected">&nbsp;{'lmt_apply_do_clear_selected'|@translate}</label><br/>
+    <label><input type="radio" name="manage_caddie" value="napp_clear_selected">&nbsp;{'lmt_dontapply_do_clear_selected'|@translate}</label><br/>
+</fieldset>
+
+  <p><input type="submit" id="btsubmit" name="submit_apply_licence" value="{'lmt_apply'|@translate}"></p>
+
+</form>
+
+<script type="text/javascript">
+  loadpage(1);
+</script>
+
+{/if}
Index: /extensions/lmt/admin/plugin_admin_manageaut.tpl
===================================================================
--- /extensions/lmt/admin/plugin_admin_manageaut.tpl	(revision 3396)
+++ /extensions/lmt/admin/plugin_admin_manageaut.tpl	(revision 3396)
@@ -0,0 +1,75 @@
+{literal}
+<script type="text/javascript">
+
+
+  function init() {
+    $("tr").filter(".TableRow").bind("mouseover", 
+      function (event) {
+        {/literal}
+        {if $datas.lmt_licence_logo=="80x15"}
+          txt="<img class='logo80x15' src='{$datas.img_directory}{$datas.default_licenceL}_80x15.png'>"+this.cells[1].innerHTML+"&nbsp;"+this.cells[2].innerHTML;
+        {elseif $datas.lmt_licence_logo=="88x31"}
+          txt="<table style='margin:0px;'><tr><td><img class='logo88x31' src='{$datas.img_directory}{$datas.default_licenceL}_88x31.png'></td><td>"+this.cells[1].innerHTML+"<br/>"+this.cells[2].innerHTML+"</td></tr></table>";
+        {else}
+          txt="{$datas.default_licencepublished} {$datas.default_licenceU}&nbsp;"+this.cells[1].innerHTML+"&nbsp;"+this.cells[2].innerHTML;
+        {/if}
+        {literal}
+        $("#iexample").attr("innerHTML", txt);
+      }      
+    );
+
+    $("tr").filter(".TableRow").bind("mouseout", 
+      function (event) {
+       // $("#iexample").attr("innerHTML", "");
+      }      
+    );
+  }
+
+</script>
+{/literal}
+
+<p class="lmt">{'lmt_author_nfo'|@translate}</p>
+
+<fieldset >
+  <legend>{'lmt_author_title'|@translate}</legend>
+
+  <div style="float:left;">
+    {if $datas.nbauthor==0}
+    [{'lmt_nb_author_zero'|@translate}]
+    {elseif $datas.nbauthor==1}
+    [{'lmt_nb_author_one'|@translate}]
+    {else}
+    [{$datas.nbauthor}&nbsp;{'lmt_nb_authors'|@translate}]
+    {/if}
+    <br/>
+    <a href="{$datas.add_link}">{'lmt_add_author'|@translate}</a>
+    <table id="author_list" class="table2 littlefont">
+    <tr class="throw">
+      <th>#id</th>
+      <th>{'lmt_author_txt1'|@translate}</th>
+      <th>{'lmt_author_txt2'|@translate}</th>
+      <th>{'lmt_action'|@translate}</th>
+    </tr>
+    {foreach from=$datas.author_list key=name item=data}
+      <tr class="TableRow">
+        <td>{$data.id}</td>
+        <td>{$data.text1}</td>
+        <td>{$data.text2}</td>
+        <td>
+        {if $data.lnk_delete!=""}
+          <a href="{$data.lnk_delete}"><img src="{$themeconf.admin_icon_dir}/category_delete.png" class="button" alt="{'lmt_delete'|@translate}"/></a>
+          <a href="{$data.lnk_edit}"><img src="{$themeconf.admin_icon_dir}/category_edit.png" class="button" alt="{'lmt_edit'|@translate}"/></a>
+        {/if}
+        </td>
+      </tr>
+    {/foreach}
+    </table>
+  </div>
+  <div id="iexample" style="float:left;margin:20px;text-align:left;width:50%;">
+  </div>
+</fieldset >
+
+
+<script type="text/javascript">
+  init();
+</script>
Index: /extensions/lmt/admin/plugin_admin_manageaut_edit.tpl
===================================================================
--- /extensions/lmt/admin/plugin_admin_manageaut_edit.tpl	(revision 3396)
+++ /extensions/lmt/admin/plugin_admin_manageaut_edit.tpl	(revision 3396)
@@ -0,0 +1,64 @@
+{literal}
+<script type="text/javascript">
+
+
+  function init() {
+    $("#i_text1").keyup(
+      function (event) { 
+        $("#isubmit").attr("disabled", ($("#i_text1").val()==""));
+      }
+    );
+  }
+
+  function goback()
+  {
+    {/literal}
+    document.location= "{$datas.urllist}";
+    {literal}
+  }
+
+</script>
+{/literal}
+
+
+<fieldset >
+  {if $datas.action=="add"}
+  <legend>{'lmt_authoradd_title'|@translate}</legend>
+  {elseif $datas.action=="modify"}
+  <legend>{'lmt_authormodify_title'|@translate}</legend>
+  {/if}
+
+  <form method="post" action="" class="general">
+    <table class="formtable"  >
+      <tr>
+        <td>{'lmt_author_txt1'|@translate}</td>
+        <td>
+          <input type="text" id="i_text1" name="text1" size="25" value="{$datas.text1}" maxlength="25"/>
+        </td>
+      </tr>
+
+      <tr>
+        <td>{'lmt_author_txt2'|@translate}</td>
+        <td>
+          <input type="text" id="i_text2" name="text2" size="25" value="{$datas.text2}" maxlength="25"/>
+        </td>
+      </tr>
+    </table>
+
+    <p class="lmt_page">
+      {if $datas.action=="add"}
+      <input type="submit" value="{'lmt_add'|@translate}" id="isubmit" name="submit_add_author" disabled/>
+      {elseif $datas.action=="modify"}
+      <input type="submit" value="{'lmt_modify'|@translate}" id="isubmit" name="submit_modify_author"/>
+      <input type="hidden" value="{$datas.id}" id="iid" name="id"/>
+      {/if}
+      &nbsp;
+      <input type="button" value="{'lmt_cancel'|@translate}" onclick="goback();"/>
+    </p>
+
+  </form>
+</fieldset >
+
+<script type="text/javascript">
+  init();
+</script>
Index: /extensions/lmt/admin/plugin_admin_manageitems.tpl
===================================================================
--- /extensions/lmt/admin/plugin_admin_manageitems.tpl	(revision 3396)
+++ /extensions/lmt/admin/plugin_admin_manageitems.tpl	(revision 3396)
@@ -0,0 +1,30 @@
+<ul id="ullist" class="thumbnails">
+  {foreach from=$imgliste key=name item=data}
+    <li>
+      <input class="none" type="hidden" name="fn{$data.id}" id="fi{$data.id}" value="1" alt="{$data.licence}"/>
+
+      <table><tr>
+      <td width="140px;">
+        <span class="wrap1 extendwrap1" onclick="swap_state('fi{$data.id}');">
+          <span class="wrap2">
+              <img class="thumbnail" src="{$data.thumb}"/>
+          </span>
+        </span>
+      </td>
+      <td>
+        <span>
+          <br/><div class="is_on" id="imgfi{$data.id}" onclick="swap_state('fi{$data.id}');">&nbsp;</div>
+          [ <a href="{$data.catlink}">{$data.catname}</a> ]<br/>
+          [ <a href="{$data.imglink}">{$data.file}</a> ]<br/>
+          {if $data.licencei!=""}
+          <img src="{$data.licencei}"/><br/>
+          <i>{$data.aut_text1}<br/>
+          {$data.aut_text2}</i>
+          {/if}
+        </span>
+      </td>
+      </tr></table>
+
+    </li>
+  {/foreach}
+</ul>
Index: /extensions/lmt/img/index.php
===================================================================
--- /extensions/lmt/img/index.php	(revision 3396)
+++ /extensions/lmt/img/index.php	(revision 3396)
@@ -0,0 +1,33 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | PhpWebGallery - a PHP based picture gallery                           |
+// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
+// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
+// +-----------------------------------------------------------------------+
+// | file          : $Id: index.php 1912 2007-03-16 06:30:07Z rub $
+// | last update   : $Date: 2007-03-16 07:30:07 +0100 (ven, 16 mar 2007) $
+// | last modifier : $Author: rub $
+// | revision      : $Revision: 1912 $
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/lmt/index.php
===================================================================
--- /extensions/lmt/index.php	(revision 3396)
+++ /extensions/lmt/index.php	(revision 3396)
@@ -0,0 +1,33 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | PhpWebGallery - a PHP based picture gallery                           |
+// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
+// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
+// +-----------------------------------------------------------------------+
+// | file          : $Id: index.php 1912 2007-03-16 06:30:07Z rub $
+// | last update   : $Date: 2007-03-16 07:30:07 +0100 (ven, 16 mar 2007) $
+// | last modifier : $Author: rub $
+// | revision      : $Revision: 1912 $
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/lmt/language/en_UK/index.php
===================================================================
--- /extensions/lmt/language/en_UK/index.php	(revision 3396)
+++ /extensions/lmt/language/en_UK/index.php	(revision 3396)
@@ -0,0 +1,33 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | PhpWebGallery - a PHP based picture gallery                           |
+// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
+// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
+// +-----------------------------------------------------------------------+
+// | file          : $Id: index.php 1912 2007-03-16 06:30:07Z rub $
+// | last update   : $Date: 2007-03-16 07:30:07 +0100 (ven, 16 mar 2007) $
+// | last modifier : $Author: rub $
+// | revision      : $Revision: 1912 $
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/lmt/language/en_UK/plugin.lang.php
===================================================================
--- /extensions/lmt/language/en_UK/plugin.lang.php	(revision 3396)
+++ /extensions/lmt/language/en_UK/plugin.lang.php	(revision 3396)
@@ -0,0 +1,175 @@
+<?php
+
+/* -----------------------------------------------------------------------------
+  This file was created by 'Translator r2.0.0-beta' plugin
+
+  **** Export informations
+  Export date       : 2009-04-30 22:59:49
+  Number of items   : 149
+    Number exported : 149
+  Exported by       : grum
+
+  **** File informations
+  Language          : English [ISO en_UK]
+  Charset           : utf-8
+  Type              : plugin
+  Name (Release)    : lmt (2.0.0-beta)
+
+  **** Export options
+  Items exported    : "ok"
+  Translator export : NO
+----------------------------------------------------------------------------- */
+
+
+$lang['example'] = 'Display sample';
+$lang['lmt_action'] = 'Actions';
+$lang['lmt_add'] = 'Add';
+$lang['lmt_add_author'] = 'Add author';
+$lang['lmt_add_licence_ko'] = 'The license count not be applied to the selected items';
+$lang['lmt_add_licence_ok'] = 'The license has been applied to the selected items';
+$lang['lmt_add_to_caddie'] = 'Add the items in the caddie';
+$lang['lmt_apply'] = 'Apply';
+$lang['lmt_apply_do_clear'] = 'Apply the licence and empty the caddie';
+$lang['lmt_apply_do_clear_selected'] = 'Apply the licence and clear the selected items in the caddie';
+$lang['lmt_apply_do_nothing'] = 'Apply the licence and don\'t modify the caddie';
+$lang['lmt_author'] = 'Author';
+$lang['lmt_author_added'] = 'The author was added';
+$lang['lmt_author_deleted'] = 'The author was deleted';
+$lang['lmt_author_modified'] = 'The author was modified';
+$lang['lmt_author_nb_images_updated'] = 'images attached to this author have been updated';
+$lang['lmt_author_nfo'] = 'When the logo of a licence is placed on a viewed page, it\'s possible to specify the author who holds the rights.';
+$lang['lmt_author_one_image_updated'] = 'A picture attached to this author has been updated';
+$lang['lmt_author_title'] = 'List of authors';
+$lang['lmt_author_txt1'] = 'Text 1';
+$lang['lmt_author_txt2'] = 'Text 2';
+$lang['lmt_authoradd_title'] = 'Add author';
+$lang['lmt_authormodify_title'] = 'Edit author';
+$lang['lmt_bydefault'] = 'Apply the default licence';
+$lang['lmt_caddie_is_empty_please_fill_it'] = 'The application of a licence is made with the contents of the caddie. Unfortunately, it is empty ...';
+$lang['lmt_caddie_items'] = 'Items in caddie';
+$lang['lmt_caddie_not_updated'] = 'The basket could not be updated';
+$lang['lmt_caddie_updated'] = 'The caddie has been updated';
+$lang['lmt_cancel'] = 'Cancel';
+$lang['lmt_cannot_add_author'] = 'The author could not be added';
+$lang['lmt_cannot_delete_author'] = 'The author could not be deleted';
+$lang['lmt_cannot_modify_author'] = 'The author could not be changed';
+$lang['lmt_category'] = 'Category';
+$lang['lmt_cc-all'] = 'All licences';
+$lang['lmt_cc_url'] = 'http://creativecommons.org/international/';
+$lang['lmt_cfg_licence_activated'] = 'Activate the licence management';
+$lang['lmt_cfg_licence_default'] = 'Choice of the licence applied by default';
+$lang['lmt_cfg_licence_default_author'] = 'Choice of author for the licence by default';
+$lang['lmt_cfg_licence_logo'] = 'Type of logo displayed';
+$lang['lmt_cfg_licence_visible'] = 'The licence is always displayed, even if it\'s a default licence';
+$lang['lmt_cfg_list_maxheight'] = 'Maximum height of lists';
+$lang['lmt_cfg_list_maxitems'] = 'Maximum number of items displayed';
+$lang['lmt_cfg_warning_link'] = 'Enable redirect';
+$lang['lmt_cfg_warning_texts'] = 'Footer text';
+$lang['lmt_cfg_warning_visible'] = 'View the license applied by default in the bottom of the page';
+$lang['lmt_choose_select'] = '&lt;Select&gt;';
+$lang['lmt_clear_caddie_ko'] = 'Caddie could not be purged';
+$lang['lmt_clear_caddie_ok'] = 'Caddie has been purged';
+$lang['lmt_clear_si_caddie_ko'] = 'Selected items could not be purged from the caddie';
+$lang['lmt_clear_si_caddie_ok'] = 'Selected items have been purged from the caddie';
+$lang['lmt_config'] = 'Settings';
+$lang['lmt_def_--'] = 'The work may be freely used, provided the award to its author by quoting his name';
+$lang['lmt_def_nc'] = 'The right holder may allow all types of use or to restrict the non-commercial use (commercial uses remain subject to permission).';
+$lang['lmt_def_nd'] = 'The right holder may continue to reserve the right to make such derivative works or to authorize in advance the changes, translations ...';
+$lang['lmt_def_sa'] = 'On the possibility of authorizing in advance the changes can superimpose the requirement for so-called derivative works to be offered to the public with the same freedoms (the same options under Creative Commons) that the work originates.';
+$lang['lmt_delete'] = 'Delete';
+$lang['lmt_display_config'] = 'Display options';
+$lang['lmt_do_save'] = 'Save settings';
+$lang['lmt_dontapply_do_clear_selected'] = 'Clear selected items from the caddie without applying the licence';
+$lang['lmt_error_on_image_author'] = 'A problem occurs when updating elements attached to the deleted author';
+$lang['lmt_four_way'] = 'The 4 principles';
+$lang['lmt_general_config'] = 'General options';
+$lang['lmt_general_text'] = '[logo=80x15]The media of this website are subject to copyright and, unless otherwise indicated, distributed under Creative Commons Licence [text=logo]';
+$lang['lmt_help'] = 'Help';
+$lang['lmt_help_config'][1] = 'Depending on the number of elements with a licence number or the number of items in your caddie, size of the display area will change. A display area too bogger can reduce the comfort of reading the page. <br> This parameter is used to force the maximum height of the display area.';
+$lang['lmt_help_config'][2] = 'Selects whether or not the management of licenses. Compared to completely disable the plugin, this option allows to disable the license management on the public part of the site while retaining the administration of the plugin actived.';
+$lang['lmt_help_config'][3] = 'This option will always display the licence of the element, even if the licence by default it is assigned. <br> If this option is not activated, the licence will be displayed only for elements with a particular licence.';
+$lang['lmt_help_config'][4] = 'This option allows you to select the licence will be applied by default to the elements for which no licence has been affected.';
+$lang['lmt_help_config'][5] = 'This option allows you to choose whether to display or not the licence by default on all pages (will be shown on the footer).';
+$lang['lmt_help_config'][6] = 'If enabled, the logo indicating the licence is a hyperlink redirecting the user to a page explaining in more detail the operating conditions of the item.';
+$lang['lmt_help_config'][7] = 'The license text displayed at the bottom of the page is changed according to your needs. <br> It is possible to view items in automatically: <br> <b>[logo=80x15]</b> insert the 80x15 logo of the default licence <br> <b>[logo=88x31]</b> insert the 88x31 logo of the default licence<br> <b>[logo=text]</b>insert the text of the default licence';
+$lang['lmt_help_config'][8] = 'This option allows you to select the author who will be assigned to the licence used by default.';
+$lang['lmt_help_config'][9] = 'This option allows you to choose the number of items displayed per page.';
+$lang['lmt_icon_80x15'] = '80x15 icon';
+$lang['lmt_icon_88x31'] = '88x31 icon';
+$lang['lmt_icon_text'] = 'Text';
+$lang['lmt_image'] = 'Image';
+$lang['lmt_lbl_cc-by'] = 'Attribution';
+$lang['lmt_lbl_cc-by-nc'] = 'Attribution, Non commercial';
+$lang['lmt_lbl_cc-by-nc-nd'] = 'Attribution, Non Commercial, No Derivative Works';
+$lang['lmt_lbl_cc-by-nc-sa'] = 'Attribution, Non Commercial, Share Alike';
+$lang['lmt_lbl_cc-by-nd'] = 'Attribution, No Derivative Works';
+$lang['lmt_lbl_cc-by-sa'] = 'Attribution, Share Alike';
+$lang['lmt_lbl_cc-cleft'] = 'Copyleft';
+$lang['lmt_lbl_cc-cright'] = 'Copyright';
+$lang['lmt_lbl_cc-default'] = 'Licence by default';
+$lang['lmt_lbl_cc_s-by'] = 'Creative Commons BY';
+$lang['lmt_lbl_cc_s-by-nc'] = 'Creative Commons BY-NC';
+$lang['lmt_lbl_cc_s-by-nc-nd'] = 'Creative Commons BY-NC-ND';
+$lang['lmt_lbl_cc_s-by-nc-sa'] = 'Creative Commons BY-NC-SA';
+$lang['lmt_lbl_cc_s-by-nd'] = 'Creative Commons BY-ND';
+$lang['lmt_lbl_cc_s-by-sa'] = 'Creative Commons BY-SA';
+$lang['lmt_lbl_cc_s-cleft'] = 'Copyleft';
+$lang['lmt_lbl_cc_s-cright'] = '© Copyright';
+$lang['lmt_lbl_cc_s-default'] = ' - ';
+$lang['lmt_lbl_under-by'] = 'Published under license';
+$lang['lmt_lbl_under-by-nc'] = 'Published under license';
+$lang['lmt_lbl_under-by-nc-nd'] = 'Published under license';
+$lang['lmt_lbl_under-by-nc-sa'] = 'Published under license';
+$lang['lmt_lbl_under-by-nd'] = 'Published under license';
+$lang['lmt_lbl_under-by-sa'] = 'Published under license';
+$lang['lmt_lbl_under-cleft'] = 'Published under license';
+$lang['lmt_lbl_under-cright'] = '';
+$lang['lmt_lbl_under-default'] = '';
+$lang['lmt_licence'] = 'Licence';
+$lang['lmt_licence_config'] = 'Licences management';
+$lang['lmt_licence_to_apply'] = 'Choice of licence';
+$lang['lmt_list'] = 'Photos licensed';
+$lang['lmt_lst_apply_filter'] = 'Filter';
+$lang['lmt_lst_default_licence'] = 'The photos are by default published under the following licence';
+$lang['lmt_lst_nb_photos'] = 'photos';
+$lang['lmt_lst_special_licence'] = 'The following photos are published with a licence';
+$lang['lmt_manage'] = 'Managing assignments';
+$lang['lmt_manageaut'] = 'Manage authors';
+$lang['lmt_modify'] = 'Edit';
+$lang['lmt_name'] = 'Name';
+$lang['lmt_nav_first'] = 'First';
+$lang['lmt_nav_last'] = 'Last';
+$lang['lmt_nav_next'] = 'Next';
+$lang['lmt_nav_prev'] = 'Previous';
+$lang['lmt_nb_author_one'] = '1 author set';
+$lang['lmt_nb_author_zero'] = 'There is no author set';
+$lang['lmt_nb_authors'] = 'authors set';
+$lang['lmt_no_author'] = '&lt;No author&gt;';
+$lang['lmt_no_element_selected'] = 'There is no selected items !';
+$lang['lmt_no_text'] = 'No text is filled !';
+$lang['lmt_nofilter'] = 'All licences';
+$lang['lmt_official_website'] = 'The official Creative Commons website';
+$lang['lmt_redirect_config'] = 'Redirections';
+$lang['lmt_redirect_urls'] = 'URL redirects';
+$lang['lmt_release'] = 'r';
+$lang['lmt_replace_caddie'] = 'Purge caddie and add the elements';
+$lang['lmt_save_config'] = 'Configuration saved';
+$lang['lmt_select_all'] = 'All';
+$lang['lmt_select_invert'] = 'Reverse';
+$lang['lmt_select_none'] = 'None';
+$lang['lmt_six_licences'] = 'The 6 licences';
+$lang['lmt_title'] = 'Licence Management Tool';
+$lang['lmt_warning_config'] = 'Footer text management';
+$lang['lmt_warning_texts_help'] = '';
+$lang['lmt_way_--'] = 'Attribution';
+$lang['lmt_way_nc'] = 'No Commercial Use';
+$lang['lmt_way_nd'] = 'No Derivative';
+$lang['lmt_way_sa'] = 'Share Alike';
+$lang['lmt_whatisit'] = 'What is <i>Creative Commons?</i>';
+$lang['lmt_whatisit_def1'] = 'Creative Commons is a non profit organization that offers flexible contracts, free of copyright to distribute your creations. Applied to your photos (or other media you put online) these contracts allow anyone to use without having to systematically seek to obtain a permit.';
+$lang['lmt_whatisit_def2'] = 'There are 6 licenses which are based on 4 principles that define the conditions of use.';
+$lang['lmt_yesno_n'] = 'No';
+$lang['lmt_yesno_y'] = 'Yes';
+
+
+?>
Index: /extensions/lmt/language/fr_FR/index.php
===================================================================
--- /extensions/lmt/language/fr_FR/index.php	(revision 3396)
+++ /extensions/lmt/language/fr_FR/index.php	(revision 3396)
@@ -0,0 +1,33 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | PhpWebGallery - a PHP based picture gallery                           |
+// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
+// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
+// +-----------------------------------------------------------------------+
+// | file          : $Id: index.php 1912 2007-03-16 06:30:07Z rub $
+// | last update   : $Date: 2007-03-16 07:30:07 +0100 (ven, 16 mar 2007) $
+// | last modifier : $Author: rub $
+// | revision      : $Revision: 1912 $
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/lmt/language/fr_FR/plugin.lang.php
===================================================================
--- /extensions/lmt/language/fr_FR/plugin.lang.php	(revision 3396)
+++ /extensions/lmt/language/fr_FR/plugin.lang.php	(revision 3396)
@@ -0,0 +1,180 @@
+<?php
+
+/* -----------------------------------------------------------------------------
+
+----------------------------------------------------------------------------- */
+
+
+
+$lang['lmt_title'] = 'Licence Management Tool';
+$lang['lmt_list'] = 'Photos sous licence';
+$lang['lmt_manage'] = 'Gérer les affectations';
+$lang['lmt_help'] = 'Aide';
+$lang['lmt_config'] = 'Configuration';
+$lang['lmt_manageaut'] = 'Gérer les auteurs';
+$lang['lmt_release'] = 'v';
+
+$lang['lmt_licence'] = 'Licence';
+$lang['lmt_category'] = 'Catégorie';
+$lang['lmt_image'] = 'Image';
+$lang['lmt_name'] = 'Nom';
+$lang['lmt_author'] = 'Auteur';
+
+
+$lang['lmt_cc_url'] = 'http://creativecommons.org/international/';
+$lang['lmt_official_website'] = 'Le site officiel Creative Commons';
+$lang['lmt_whatisit'] = 'Qu\'est-ce que <i>Creative Commons</i> ?';
+$lang['lmt_whatisit_def1'] = 'Creative Commons est une organisation à but non lucratif qui propose gratuitement des contrats flexibles de droit d\'auteur pour diffuser vos créations. Appliqués à vos photos (ou autres médias que vous mettez en ligne) ces contrats permettent à quiconque de les exploiter sans avoir à vous solliciter systématiquement pour obtenir une autorisation.';
+$lang['lmt_whatisit_def2'] = 'Il existe 6 licences qui s\'articulent autour de 4 principes et qui définissent les conditions d\'utilisation.';
+$lang['lmt_four_way'] = 'Les 4 principes';
+$lang['lmt_six_licences'] = 'Les 6 licences';
+
+$lang['lmt_way_--'] = 'Paternité';
+$lang['lmt_way_nd'] = 'Pas de Modification';
+$lang['lmt_way_nc'] = 'Pas d\'Utilisation Commerciale';
+$lang['lmt_way_sa'] = 'Partage à l\'Identique des Conditions Initiales';
+
+$lang['lmt_cc-all'] = 'Toutes licences';
+$lang['lmt_lbl_cc-by'] = 'Paternité';
+$lang['lmt_lbl_cc-by-nd'] = 'Paternité, Pas de Modification';
+$lang['lmt_lbl_cc-by-nc'] = 'Paternité, Pas d\'Utilisation Commerciale';
+$lang['lmt_lbl_cc-by-nc-nd'] = 'Paternité, Pas d\'Utilisation Commerciale, Pas de Modification';
+$lang['lmt_lbl_cc-by-nc-sa'] = 'Paternité, Pas d\'Utilisation Commerciale, Partage des Conditions Initiales à l\'Identique';
+$lang['lmt_lbl_cc-by-sa'] = 'Paternité, Partage des Conditions Initiales à l\'Identique';
+$lang['lmt_lbl_cc-cright'] = 'Copyright';
+$lang['lmt_lbl_cc-cleft'] = 'Copyleft';
+$lang['lmt_lbl_cc-default'] = 'Licence par défaut';
+
+$lang['lmt_lbl_cc_s-by'] = 'Creative Commons BY';
+$lang['lmt_lbl_cc_s-by-nd'] = 'Creative Commons BY-ND';
+$lang['lmt_lbl_cc_s-by-nc'] = 'Creative Commons BY-NC';
+$lang['lmt_lbl_cc_s-by-nc-nd'] = 'Creative Commons BY-NC-ND';
+$lang['lmt_lbl_cc_s-by-nc-sa'] = 'Creative Commons BY-NC-SA';
+$lang['lmt_lbl_cc_s-by-sa'] = 'Creative Commons BY-SA';
+$lang['lmt_lbl_cc_s-cright'] = '&copy;&nbsp;Copyright';
+$lang['lmt_lbl_cc_s-cleft'] = 'Copyleft';
+$lang['lmt_lbl_cc_s-default'] = ' - ';
+
+$lang['lmt_lbl_under-by'] = 'Publié sous licence';
+$lang['lmt_lbl_under-by-nd'] = 'Publié sous licence';
+$lang['lmt_lbl_under-by-nc'] = 'Publié sous licence';
+$lang['lmt_lbl_under-by-nc-nd'] = 'Publié sous licence';
+$lang['lmt_lbl_under-by-nc-sa'] = 'Publié sous licence';
+$lang['lmt_lbl_under-by-sa'] = 'Publié sous licence';
+$lang['lmt_lbl_under-cright'] = '';
+$lang['lmt_lbl_under-cleft'] = 'Publié sous licence';
+$lang['lmt_lbl_under-default'] = '';
+
+
+$lang['lmt_nofilter'] = 'Toutes licences';
+
+$lang['lmt_def_--'] = 'L\'oeuvre peut être librement utilisée, à la condition de l\'attribuer à son l\'auteur en citant son nom';
+$lang['lmt_def_nc'] = 'Le titulaire de droits peut autoriser tous les types d’utilisation ou au contraire restreindre aux utilisations non commerciales (les utilisations commerciales restant soumises à son autorisation).';
+$lang['lmt_def_nd'] = 'Le titulaire de droits peut continuer à réserver la faculté de réaliser des oeuvres de type dérivées ou au contraire autoriser à l\'avance les modifications, traductions...';
+$lang['lmt_def_sa'] = 'A la possibilité d\'autoriser à l\'avance les modifications peut se superposer l\'obligation pour les oeuvres dites dérivées d\'être proposées au public avec les mêmes libertés (sous les mêmes options Creative Commons) que l\'oeuvre originaire.';
+
+$lang['lmt_general_text'] = "[logo=80x15]Les médias de ce site sont soumis au droit d'auteur et sont, sauf indications contraires, diffusés sous licence Creative Commons [logo=text]";
+
+$lang['lmt_lst_default_licence'] = "Les photos sont par défaut publiées sous la licence suivante";
+$lang['lmt_lst_special_licence'] = "Les photos suivantes sont publiées avec une licence particulière";
+$lang['lmt_lst_apply_filter'] = 'Filtrer';
+$lang['lmt_lst_nb_photos'] = 'photos';
+
+$lang['lmt_caddie_items'] = 'Eléments du panier';
+$lang['lmt_apply_do_nothing'] = 'Appliquer la licence sans toucher au panier';
+$lang['lmt_apply_do_clear'] = 'Appliquer la licence et vider tout le panier';
+$lang['lmt_apply_do_clear_selected'] = 'Appliquer la licence et vider les élements sélectionnés du panier';
+$lang['lmt_dontapply_do_clear_selected'] = 'Vider les élements sélectionnés du panier sans appliquer de licence';
+
+$lang['lmt_apply'] = 'Appliquer';
+$lang['lmt_bydefault'] = "Appliquer la licence par défaut";
+$lang['lmt_choose_select'] = "<Gérer la sélection>";
+$lang['lmt_select_all'] = "Tout";
+$lang['lmt_select_none'] = "Aucun";
+$lang['lmt_select_invert'] = "Inverser";
+$lang['lmt_licence_to_apply'] = "Choix de la licence";
+$lang['lmt_no_element_selected'] = "Il n'y a aucun élément de sélectionné !";
+
+$lang["lmt_add_licence_ok"] = "La licence a été appliquée sur les élements sélectionnés";
+$lang["lmt_add_licence_ko"] = "La licence n'a pu être appliquée sur les élements sélectionnés";
+$lang["lmt_clear_caddie_ok"] = "Le panier a été purgé";
+$lang["lmt_clear_caddie_ko"] = "Le panier n'a pu être purgé";
+$lang["lmt_clear_si_caddie_ok"] = "Les éléments sélectionnés ont été purgés du panier";
+$lang["lmt_clear_si_caddie_ko"] = "Les éléments sélectionnés n'ont pu être purgés du panier";
+$lang["lmt_caddie_not_updated"] = "Le panier n'a pas pu être mis à jour";
+$lang["lmt_caddie_updated"] = "Le panier a été mis à jour";
+$lang["lmt_add_to_caddie"] = "Ajouter les élements dans le panier";
+$lang["lmt_replace_caddie"] = "Purger le panier et y ajouter les élements";
+$lang["lmt_caddie_is_empty_please_fill_it"] = "L'application d'une licence s'effectue sur le contenu du panier. Malheureusement celui-ci est vide...";
+
+$lang["lmt_redirect_config"] = "Redirections";
+$lang["lmt_general_config"] = "Options générales";
+$lang['lmt_display_config'] = "Options d'affichage";
+$lang['lmt_cfg_list_maxheight'] = "Hauteur maximale des listes";
+$lang['lmt_cfg_list_maxitems'] = "Nombre maximum d'éléments affichés";
+$lang['lmt_licence_config'] = "Gestion des licences";
+$lang["lmt_cfg_licence_activated"] = "Activer la gestion des licences";
+$lang["lmt_cfg_licence_visible"] = "La licence est toujours affichée, même s'il s'agit d'une licence par défaut";
+$lang["lmt_cfg_licence_logo"] = "Type de logo affiché";
+$lang["lmt_warning_config"] = "Gestion du texte de bas de page";
+$lang["lmt_cfg_warning_visible"] = "Afficher la licence appliquée par défaut en bas de page";
+$lang["lmt_cfg_warning_link"] = "Activer la redirection";
+$lang["lmt_cfg_warning_texts"] = "Texte de bas de page";
+$lang["lmt_do_save"] = "Enregistrer la configuration";
+$lang["lmt_save_config"] = "Configuration enregistrée";
+$lang["lmt_cfg_licence_default"] = "Choix de la licence appliquée par défaut";
+$lang['lmt_cfg_licence_default_author'] = "Choix de l'auteur pour la licence par défaut";
+
+$lang["lmt_yesno_y"] = "Oui";
+$lang["lmt_yesno_n"] = "Non";
+
+$lang["lmt_icon_80x15"] = "Icone 80x15";
+$lang["lmt_icon_88x31"] = "Icone 88x31";
+$lang["lmt_icon_text"] = "Texte";
+$lang['example'] = "Exemple de l'affichage";
+$lang['lmt_warning_texts_help'] = "";
+
+$lang["lmt_help_config"][1] = "En fonction du nombre d'éléments disposant d'une licence particulière ou du nombre du nombre d'éléments présents dans votre panier, la zone d'affichage va être plus ou moins grande. Une zone d'affichage trop grande peut réduire le confort de lecture de la page.<br/>Ce paramètre permet de forcer la hauteur maximale de la zone d'affichage.";
+$lang["lmt_help_config"][2] = "Permet d'activer ou non la gestion des licences. Par rapport à une désactivation complète du plugin, cette option permet de désactiver la gestion des licences sur la partie publique du site tout en conservant l'administration du plugin actif.";
+$lang["lmt_help_config"][3] = "Cette option permet d'afficher systématiquement la licence de l'élément, même si la licence par défaut lui est affecté.<br/>Si cette option n'est pas activée, la licence ne sera affichée que pour les éléments disposant d'une licence particulière.";
+$lang["lmt_help_config"][4] = "Cette option permet de sélectionner la licence qui sera appliquée par défaut aux éléments pour lesquels aucune licence particulière n'aura été affectée.";
+$lang["lmt_help_config"][5] = "Cette option permet de choisir s'il faut afficher ou non la licence par défaut sur toutes les pages (sera affiché en bas de page).";
+$lang["lmt_help_config"][6] = "Si activé, le logo indiquant la licence est un hyperlien redirigeant l'utilisateur sur une page expliquant plus en détail les conditions d'exploitation de l'élément.";
+$lang["lmt_help_config"][7] = "Le texte de licence affiché en bas de page est modifiable selon vos besoins.<br/>Il est possible d'afficher des éléments en automatique :<br/><b>[logo=80x15]</b> insère le logo 80x15 de la licence par défaut<br/><b>[logo=88x31]</b> insère le logo 88x31 de la licence par défaut<br/><b>[logo=text]</b> insère le texte de la licence par défaut";
+$lang["lmt_help_config"][8] = "Cette option permet de sélectionner l'auteur qui sera affecté pour la licence appliquée par défaut.";
+$lang["lmt_help_config"][9] = "Cette option permet de choisir le nombre d'éléments affichés par page.";
+
+$lang["lmt_author_nfo"] = "Lorsque le logo d'une licence est apposé sur la page d'un élément visualisé, il est possible de préciser l'auteur qui en détient les droits.";
+$lang["lmt_author_title"] = "Liste des auteurs";
+$lang["lmt_nb_author_zero"] = "Il n'y a aucun auteur de paramétré";
+$lang["lmt_nb_author_one"] = "1 auteur de paramétré";
+$lang["lmt_nb_authors"] = "auteurs de paramétrés";
+$lang["lmt_add_author"] = "Ajouter un auteur";
+$lang["lmt_author_txt1"] = "Texte 1";
+$lang["lmt_author_txt2"] = "Texte 2";
+$lang["lmt_action"] = "Actions";
+$lang["lmt_authoradd_title"] = "Ajouter un auteur";
+$lang["lmt_authormodify_title"] = "Modifier un auteur";
+$lang["lmt_add"] = "Ajouter";
+$lang["lmt_delete"] = "Supprimer";
+$lang["lmt_modify"] = "Modifier";
+$lang["lmt_cancel"] = "Annuler";
+$lang["lmt_no_text"] = "Aucun texte n'est renseigné !";
+$lang["lmt_author_added"] = "L'auteur a été ajouté";
+$lang["lmt_cannot_add_author"] = "L'auteur n'a pu être ajouté";
+$lang["lmt_author_deleted"] = "L'auteur a été supprimé";
+$lang["lmt_cannot_delete_author"] = "L'auteur n'a pu être supprimé";
+$lang["lmt_error_on_image_author"] = "Problème lors de la mise à jour des éléments rattachés à l'auteur supprimé";
+$lang["lmt_author_one_image_updated"] = "Une image rattachée à cet auteur a été mise à jour";
+$lang["lmt_author_nb_images_updated"] = "images rattachées à cet auteur ont été mises à jour";
+$lang["lmt_author_modified"] = "L'auteur a été modifé";
+$lang["lmt_cannot_modify_author"] = "L'auteur n'a pu être modifié";
+$lang['lmt_no_author'] = "<Pas d'auteur>";
+$lang['lmt_redirect_urls'] = "URLs de redirections";
+
+$lang["lmt_nav_first"] = "Premier";
+$lang["lmt_nav_prev"] = "Précédent";
+$lang["lmt_nav_next"] = "Suivant";
+$lang["lmt_nav_last"] = "Dernier";
+
+?>
Index: /extensions/lmt/language/index.php
===================================================================
--- /extensions/lmt/language/index.php	(revision 3396)
+++ /extensions/lmt/language/index.php	(revision 3396)
@@ -0,0 +1,33 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | PhpWebGallery - a PHP based picture gallery                           |
+// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
+// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
+// +-----------------------------------------------------------------------+
+// | file          : $Id: index.php 1912 2007-03-16 06:30:07Z rub $
+// | last update   : $Date: 2007-03-16 07:30:07 +0100 (ven, 16 mar 2007) $
+// | last modifier : $Author: rub $
+// | revision      : $Revision: 1912 $
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/lmt/lmt_aim.class.inc.php
===================================================================
--- /extensions/lmt/lmt_aim.class.inc.php	(revision 3396)
+++ /extensions/lmt/lmt_aim.class.inc.php	(revision 3396)
@@ -0,0 +1,43 @@
+<?php
+/* -----------------------------------------------------------------------------
+  Plugin     : LMT
+  Author     : Grum
+    email    : grum@piwigo.org
+    website  : http://photos.grum.dnsalias.com
+
+    << May the Little SpaceFrog be with you ! >>
+  ------------------------------------------------------------------------------
+  See main.inc.php for release information
+
+  LMT_AIM : classe to manage plugin integration into plugin menu
+
+  --------------------------------------------------------------------------- */
+
+if (!defined('PHPWG_ROOT_PATH')) { die('Hacking attempt!'); }
+
+include_once('lmt_root.class.inc.php');
+
+class LMT_AIM extends LMT_root
+{ 
+  public function LMT_AIM($prefixeTable, $filelocation)
+  {
+    parent::__construct($prefixeTable, $filelocation);
+  }
+
+  /*
+    initialize events call for the plugin
+  */
+  public function init_events()
+  {
+    parent::init_events();
+    add_event_handler('get_admin_plugin_menu_links', array(&$this, 'plugin_admin_menu') );
+  }
+
+  /* ---------------------------------------------------------------------------
+  Function needed for plugin activation
+  --------------------------------------------------------------------------- */
+
+} // LMT_AIM class
+
+
+?>
Index: /extensions/lmt/lmt_aip.class.inc.php
===================================================================
--- /extensions/lmt/lmt_aip.class.inc.php	(revision 3396)
+++ /extensions/lmt/lmt_aip.class.inc.php	(revision 3396)
@@ -0,0 +1,996 @@
+<?php
+/* -----------------------------------------------------------------------------
+  Plugin     : LMT
+  Author     : Grum
+    email    : grum@piwigo.org
+    website  : http://photos.grum.dnsalias.com
+
+    << May the Little SpaceFrog be with you ! >>
+  ------------------------------------------------------------------------------
+  See main.inc.php for release information
+
+  LMT_AIP : classe to manage plugin admin pages 
+
+  --------------------------------------------------------------------------- */
+
+include_once('lmt_root.class.inc.php');
+include_once(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/translate.class.inc.php');
+include_once(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/tables.class.inc.php');
+include_once(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/genericjs.class.inc.php');
+include_once(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/pages_navigation.class.inc.php');
+include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php');
+
+class LMT_AIP extends LMT_root
+{
+  protected $google_translate;
+  protected $tabsheet;
+
+  public function LMT_AIP($prefixeTable, $filelocation)
+  {
+    parent::__construct($prefixeTable, $filelocation);
+    $this->load_config();
+    $this->init_events();
+
+    $this->tabsheet = new tabsheet();
+    $this->tabsheet->add('list',
+                          l10n('lmt_list'),
+                          $this->page_link."&amp;f_tabsheet=list");
+    $this->tabsheet->add('manage',
+                          l10n('lmt_manage'),
+                          $this->page_link."&amp;f_tabsheet=manage");
+    $this->tabsheet->add('manageaut',
+                          l10n('lmt_manageaut'),
+                          $this->page_link."&amp;f_tabsheet=manageaut");
+    $this->tabsheet->add('config',
+                          l10n('lmt_config'),
+                          $this->page_link."&amp;f_tabsheet=config");
+    $this->tabsheet->add('help',
+                          l10n('lmt_help'),
+                          $this->page_link."&amp;f_tabsheet=help");
+
+    // don't create this object inside root classe otherwise header is modified
+    // everywhere in admin pages
+    $this->ajax = new Ajax();
+
+    // don't create the google_translate object everytime, otherwise google's js 
+    // code is always included in the header even if translation functionalities
+    // aren't needed
+    // translation is needed only if we are in a ajax request
+    /*if((isset($_POST['fmypolls_gomodify_translation'])||isset($_POST['fmypolls_goadd_translation'])))
+    {
+      $this->google_translate = new translate();
+    }
+    */
+  }
+
+  /*
+    initialize events call for the plugin
+  */
+  public function init_events()
+  {
+    parent::init_events();
+    add_event_handler('loc_end_page_header', array(&$this->css, 'apply_CSS'));
+    add_event_handler('loc_end_page_header', array(&$this->css_icn, 'apply_CSS'));
+  }
+
+  /*
+    display administration page
+  */
+  public function manage()
+  {
+    global $template;
+
+    $this->return_ajax_content();
+
+    $template->set_filename('plugin_admin_content', dirname(__FILE__)."/admin/lmt_admin.tpl");
+
+    if(!isset($_REQUEST['f_tabsheet']))
+    {
+      $_REQUEST['f_tabsheet']='list';
+    }
+
+    switch($_REQUEST['f_tabsheet'])
+    {
+      case 'list':
+        $this->display_list_page();
+        break;
+      case 'manage':
+        $this->display_manage_page();
+        break;
+      case 'manageaut':
+        $this->display_manageaut_page();
+        break;
+      case 'managedoc':
+        $this->display_managedoc_page();
+        break;
+      case 'help':
+        $this->display_help_page();
+        break;
+      case 'config':
+        $this->display_config_page();
+        break;
+    }
+
+    $this->tabsheet->select($_REQUEST['f_tabsheet']);
+    $this->tabsheet->assign();
+    $selected_tab=$this->tabsheet->get_selected();
+    $template->assign($this->tabsheet->get_titlename(), "[".$selected_tab['caption']."]");
+
+    $template_plugin["LMT_VERSION"] = "<i>".$this->plugin_name."</i> ".l10n('lmt_release').LMT_VERSION;
+    $template_plugin["LMT_PAGE"] = $_REQUEST['f_tabsheet'];
+    $template_plugin["LMT_TITLE"] = "";
+
+    $template->assign('plugin', $template_plugin);
+    $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
+  }
+
+
+  /*
+    return ajax content
+  */
+  protected function return_ajax_content()
+  {
+    global $ajax, $template;
+
+    if(isset($_REQUEST['ajaxfct']))
+    {
+      //$this->debug("AJAXFCT:".$_REQUEST['ajaxfct']);
+      $result="<p class='errors'>An error has occured</p>";
+      switch($_REQUEST['ajaxfct'])
+      {
+        case 'img_list':
+          $result=$this->ajax_img_list($_REQUEST['numpage']);
+          break;
+        case 'manage_list':
+          $result=$this->ajax_manage_list($_REQUEST['numpage']);
+          break;
+      }
+      //$template->
+      $this->ajax->return_result($result);
+    }
+  }
+
+
+  /*
+    manage display of config page & save config
+  */
+  protected function display_config_page()
+  {
+    $languages=get_languages();
+    if(!$this->adviser_abort())
+    {
+
+      if(isset($_POST['submit_save_config']))
+      {
+        foreach($this->my_config as $key => $val)
+        {
+          if(is_array($val))
+          {
+            foreach($languages as $key2 => $val2)
+            {
+              if(isset($_REQUEST[str2url('f_'.$key.'_'.$key2)]))
+              {
+                $this->my_config[$key][$key2] = htmlspecialchars(stripslashes($_REQUEST[str2url('f_'.$key.'_'.$key2)]), ENT_QUOTES);
+              }
+            }
+          }
+          else
+          {
+            if(isset($_REQUEST['f_'.$key]))
+            {
+              $this->my_config[$key] = $_REQUEST['f_'.$key];
+            }
+          }
+
+        }
+        $this->display_result(l10n('lmt_save_config'), $this->save_config());
+      }
+    }
+    $this->display_config();
+  }
+
+
+  /*
+  
+  */
+  protected function display_help_page()
+  {
+    global $template;
+
+    $template->set_filename('body_page',
+                dirname($this->filelocation).'/admin/plugin_admin_help.tpl');
+
+    $template->assign('imgdir', LMT_PATH."img/");
+
+    $template->assign_var_from_handle('LMT_BODY_PAGE', 'body_page');
+  }
+
+  /*
+  */
+  protected function display_list_page()
+  {
+    global $template, $conf, $user;
+
+    $template->set_filename('body_page',
+                dirname($this->filelocation).'/admin/plugin_admin_list.tpl');
+
+    if(!isset($_REQUEST['filter']) ||
+       !($_REQUEST['filter']=="BY" ||
+         $_REQUEST['filter']=="BY-SA" ||
+         $_REQUEST['filter']=="BY-ND" ||
+         $_REQUEST['filter']=="BY-NC-ND" ||
+         $_REQUEST['filter']=="BY-NC-SA" ||
+         $_REQUEST['filter']=="BY-NC" ||
+         $_REQUEST['filter']=="CRIGHT" ||
+         $_REQUEST['filter']=="CLEFT"
+      ))
+    {
+      $_REQUEST['filter']='';
+    }
+
+    $datas=array(
+      "LMT_AJAX_URL_LIST" =>  $this->page_link.'&ajaxfct=img_list&numpage='
+    );
+
+    $filter_list_selected = '';
+    $filter_list_values = array_slice($this->licences,0,count($this->licences)-1);
+    $filter_list_labels = array();
+    foreach($filter_list_values as $key=>$val)
+    {
+      $filter_list_labels[] = "[".l10n("lmt_lbl_cc_s-".strtolower($val))."] ".l10n("lmt_lbl_cc-".strtolower($val));
+      if($val==$_REQUEST['filter']) 
+      {
+        $filter_list_selected = $val;
+      }
+    }
+  
+    $filter_list_values = array_merge(array(''), $filter_list_values);
+    $filter_list_labels = array_merge(array(l10n('lmt_nofilter')), $filter_list_labels);
+    $default_licence = l10n("lmt_lbl_cc-".strtolower($this->my_config['lmt_licence_default']));
+    $default_licence_img =LMT_PATH."img/".strtolower($this->my_config['lmt_licence_default'])."_80x15.png";
+
+    $results=true;
+    if(isset($_POST["submit_replace_caddie"]))
+    {
+      $sql="DELETE FROM ".CADDIE_TABLE." WHERE user_id='".$user['id']."'";
+      $result=pwg_query($sql);
+      ($result)?$results=true:$results=false;
+    }
+
+    if(isset($_POST["submit_add_to_caddie"]) || isset($_POST["submit_replace_caddie"]))
+    {
+      $sql="REPLACE INTO ".CADDIE_TABLE." SELECT '".$user['id']."', id FROM ".IMAGES_TABLE." WHERE id IN (".implode(",", $img_ids).");";
+      $result=pwg_query($sql);
+      if((!$results)||(!$result))
+      {
+        $this->display_result(l10n("lmt_caddie_not_updated"), false);
+      }
+      else
+      {
+        $this->display_result(l10n("lmt_caddie_updated"), true);
+      }
+    }
+  
+    $template->assign('datas', $datas);
+    $template->assign('default_licence', $default_licence);
+    $template->assign('default_licence_img', $default_licence_img);
+    $template->assign('filter_list_values', $filter_list_values);
+    $template->assign('filter_list_labels', $filter_list_labels);
+    $template->assign('filter_list_selected', $filter_list_selected);
+    $template->assign_var_from_handle('LMT_BODY_PAGE', 'body_page');
+  }
+
+
+  /*
+  */
+  protected function display_manage_page()
+  {
+    global $template, $conf, $user;
+
+    /*
+      apply licence
+    */
+    if(isset($_POST['submit_apply_licence']))
+    {
+      $results=array("", "");
+      $lst=array();
+      foreach($_POST as $key => $val)
+      {
+        if((substr($key,0,2)=="fn")&&($val=="1")) $lst[]=substr($key,2);
+      }
+
+      if(count($lst)>0)
+      {
+        if($_POST['manage_caddie']!="napp_clear_selected")
+        {
+          if($_POST['licence']=='DEFAULT')
+          {
+            $sql="DELETE FROM ".$this->tables['images']." 
+                    WHERE image_id IN (".implode(",", $lst).")";
+          }
+          else
+          {
+            $sql="REPLACE INTO ".$this->tables['images']." 
+                    SELECT id, '".$_POST['licence']."', '".$_POST['author']."'
+                    FROM ".IMAGES_TABLE." 
+                    WHERE id IN (".implode(",", $lst).")";
+          }
+          $result=pwg_query($sql);
+          ($result)?$results[0].=l10n("lmt_add_licence_ok")."<br/>":$results[1].=l10n("lmt_add_licence_ko")."<br/>";
+        }
+
+        switch($_POST['manage_caddie'])
+        {
+          case 'app_clear':
+            $sql="DELETE FROM ".CADDIE_TABLE." WHERE user_id = '".$user['id']."'";
+            $result=pwg_query($sql);
+            ($result)?$results[0].=l10n("lmt_clear_caddie_ok")."<br/>":$results[1].=l10n("lmt_clear_caddie_ko")."<br/>";
+            break;
+          case 'app_clear_selected':
+          case 'napp_clear_selected':
+            $sql="DELETE FROM ".CADDIE_TABLE." 
+                  WHERE user_id = '".$user['id']."'
+                  AND element_id IN (".implode(",", $lst).")";
+            $result=pwg_query($sql);
+            ($result)?$results[0].=l10n("lmt_clear_si_caddie_ok")."<br/>":$results[1].=l10n("lmt_clear_si_caddie_ko")."<br/>";
+            break;
+        }
+
+        if($results[0]!="")
+        {
+          $this->display_result($results[0], true);
+        }
+
+        if($results[1]!="")
+        {
+          $this->display_result($results[1], false);
+        }
+      }
+      else
+      {
+        $this->display_result(l10n("lmt_no_element_selected"), false);
+      }
+    }
+
+
+    $template->set_filename('body_page',
+                dirname($this->filelocation).'/admin/plugin_admin_manage.tpl');
+
+    $datas=array(
+      "LMT_AJAX_URL_LIST" =>  $this->page_link.'&ajaxfct=manage_list&numpage='
+    );
+
+    if(!isset($_REQUEST['select']))
+    {
+      $_REQUEST['select']="caddie";
+    }
+
+    $sql="SELECT count(element_id) FROM ".CADDIE_TABLE." WHERE user_id = '".$user['id']."'";
+    $result=pwg_query($sql);
+    $nbphotos=mysql_fetch_array($result);
+
+    $author_list_values = array(0);
+    $author_list_labels = array(l10n("lmt_no_author"));
+    $sql="SELECT * FROM ".$this->tables["licence_author"]." ORDER BY id";
+    $result=pwg_query($sql);
+    if($result)
+    {
+      while($row=mysql_fetch_array($result))
+      {
+        $author_list_values[]=$row['id'];
+        $author_list_labels[]=$row['text1']."&nbsp;".$row['text2'];
+      }
+    }
+
+    $licences_list_values = array();
+    $licences_list_values = $this->licences;
+    $licences_list_labels = array();
+    foreach($licences_list_values as $key=>$val)
+    {
+      $licences_list_labels[] = "[".l10n("lmt_lbl_cc_s-".strtolower($val))."] ".l10n("lmt_lbl_cc-".strtolower($val));
+    }
+  
+/*    $licences_list_values = array_merge(array('DEFAULT'), $licences_list_values);
+    $licences_list_labels = array_merge(array(l10n('lmt_bydefault')), $licences_list_labels);*/
+
+    $selectlist_list_values=array("-", "all", "none", "invert");
+    $selectlist_list_values=array_merge($selectlist_list_values, $licences_list_values);
+
+    $selectlist_list_labels=array(
+        l10n("lmt_choose_select"), 
+        l10n("lmt_select_all"), 
+        l10n("lmt_select_none"), 
+        l10n("lmt_select_invert") 
+    );
+    $selectlist_list_labels=array_merge($selectlist_list_labels, $licences_list_labels);
+
+    $template->assign('datas', $datas);
+    $template->assign('nbphotos', $nbphotos[0]);
+    $template->assign('selectlist_list_values', $selectlist_list_values);
+    $template->assign('selectlist_list_labels', $selectlist_list_labels);
+    $template->assign('filter_list_selected', "");
+    $template->assign('licences_list_values', $licences_list_values);
+    $template->assign('licences_list_labels', $licences_list_labels);
+    $template->assign('licences_list_selected', "");
+    $template->assign('author_list_values', $author_list_values);
+    $template->assign('author_list_labels', $author_list_labels);
+    $template->assign_var_from_handle('LMT_BODY_PAGE', 'body_page');
+  }
+
+
+  /*
+    display config page
+  */
+  protected function display_config()
+  {
+    global $template, $lang;
+
+    $template->set_filename('body_page',
+                dirname($this->filelocation).'/admin/plugin_admin_config.tpl');
+
+    
+    $datas=array(
+      "img_directory" => LMT_PATH."img/"
+    );
+    foreach($this->my_config as $key => $val)
+    {
+      if(!is_array($val))
+      {
+        $datas[$key]=$val;
+      }
+    }
+
+    $lmt_yesno_values=array("y", "n");
+    $lmt_yesno_labels=array(l10n("lmt_yesno_y"), l10n("lmt_yesno_n"));
+
+    $lmt_licence_logo_values=array("80x15", "88x31", "text");
+    $lmt_licence_logo_labels=array(l10n("lmt_icon_80x15"), l10n("lmt_icon_88x31"), l10n("lmt_icon_text"));
+
+    $datas['lmt_redirect_urls']=array();
+    $lmt_licence_default_values = array_slice($this->licences,0,count($this->licences)-1);
+    $lmt_licence_default_labels = array();
+
+    $tmp=array();    
+    foreach($lmt_licence_default_values as $key=>$val)
+    {
+      $lmt_licence_default_labels[] = "[".l10n("lmt_lbl_cc_s-".strtolower($val))."] ".l10n("lmt_lbl_cc-".strtolower($val));
+
+      $tmp[]="'".str2url("ilmt_redirect_url-".strToLower($val))."'";
+      $datas['lmt_redirect_urls'][str2url('lmt_redirect_url-'.strToLower($val))]=array(
+        'text' => l10n("lmt_lbl_cc_s-".strToLower($val)),
+        'langs' => array()
+      );
+    }
+    $datas['objnames2'] = implode(",", $tmp);
+
+
+    //langs list & texts
+    $datas['lmt_warning_texts']=array();
+
+    $lmt_language_list=array();
+    $lmt_language_list_values=array();
+    $lmt_language_list_labels=array();
+    $lmt_language_selected=str2url(get_default_language());
+    $languages=get_languages();
+
+    foreach($languages as $key => $val)
+    {
+      $lmt_language_list_values[]=str2url($key);
+      $lmt_language_list_labels[]=$val;
+
+      $datas['lmt_warning_texts'][]=array(
+        'lang' => str2url($key),
+        'text' => $this->my_config['lmt_warning_texts'][$key]
+      );
+      
+      foreach($lmt_licence_default_values as $key2 => $val2)
+      {
+        $datas['lmt_redirect_urls'][str2url('lmt_redirect_url-'.strToLower($val2))]['langs'][str2url($key)]=
+            $this->my_config['lmt_redirect_url-'.strToLower($val2)][$key];
+      }
+    }
+
+    $datas['help']=array();
+    foreach($lang["lmt_help_config"] as $key => $val)
+    {
+      $datas['help']['hlp'.$key]=addslashes($val);
+    }
+    
+    $lmt_licence_default_author_values=array(0);
+    $lmt_licence_default_author_labels=array(l10n("lmt_no_author"));
+    $sql="SELECT * FROM ".$this->tables['licence_author']." ORDER BY id";
+    $result=pwg_query($sql);
+    if($result)
+    {
+      while($row=mysql_fetch_array($result))
+      {
+        $lmt_licence_default_author_values[]=$row['id'];
+        $lmt_licence_default_author_labels[]=$row['text1']." ".$row['text2'];
+      }
+    }
+
+    $template->assign('datas', $datas);
+    $template->assign('extended_code', $this->generate_js_licence_author());
+    $template->assign('lmt_yesno_values', $lmt_yesno_values);
+    $template->assign('lmt_yesno_labels', $lmt_yesno_labels);
+    $template->assign('lmt_licence_logo_values', $lmt_licence_logo_values);
+    $template->assign('lmt_licence_logo_labels', $lmt_licence_logo_labels);
+    $template->assign('lmt_licence_default_values', $lmt_licence_default_values);
+    $template->assign('lmt_licence_default_labels', $lmt_licence_default_labels);
+    $template->assign('lmt_licence_default_author_values', $lmt_licence_default_author_values);
+    $template->assign('lmt_licence_default_author_labels', $lmt_licence_default_author_labels);
+    $template->assign('lmt_language_list_values', $lmt_language_list_values);
+    $template->assign('lmt_language_list_labels', $lmt_language_list_labels);
+    $template->assign('lmt_language_selected', $lmt_language_selected);
+    $template->assign_var_from_handle('LMT_BODY_PAGE', 'body_page');
+
+  } //display_config
+
+
+
+
+  /*
+  */
+  protected function display_manageaut_page()
+  {
+    global $template, $conf, $user;
+
+    if(!isset($_REQUEST['action']))
+    {
+      $_REQUEST['action']="list";
+    }
+    if(!isset($_REQUEST['id']))
+    {
+      $_REQUEST['id']="";
+    }
+
+
+    /* ------------------------------------------------------------------------
+     * Add an author     
+     * ---------------------------------------------------------------------- */
+    if(isset($_POST['submit_add_author']))
+    {
+      if($_POST["text1"]!="")
+      {
+        $sql="INSERT INTO ".$this->tables["licence_author"]." VALUES('', '". addslashes($_POST["text1"])."', '".addslashes($_POST["text2"])."')";
+        $result=pwg_query($sql);
+        if($result)
+        {
+          $this->display_result(l10n("lmt_author_added"), true);
+          $_REQUEST['action']="list";
+        }
+        else
+        {
+          $this->display_result(l10n("lmt_cannot_add_author"), false);
+        }
+      }
+      else
+      {
+        $this->display_result(l10n("lmt_no_text"), false);
+      }
+    }
+  
+    /* ------------------------------------------------------------------------
+     * Modify an author     
+     * ---------------------------------------------------------------------- */
+    if(isset($_POST['submit_modify_author']))
+    {
+      if($_POST["text1"]!="")
+      {
+        $sql="UPDATE ".$this->tables["licence_author"]." 
+              SET text1 = '". addslashes($_POST["text1"])."', 
+                  text2 = '".addslashes($_POST["text2"])."' 
+              WHERE id = '".$_POST["id"]."'";
+        $result=pwg_query($sql);
+        if($result)
+        {
+          $this->display_result(l10n("lmt_author_modified"), true);
+          $_REQUEST['action']="list";
+        }
+        else
+        {
+          $this->display_result(l10n("lmt_cannot_modify_author"), false);
+        }
+      }
+      else
+      {
+        $this->display_result(l10n("lmt_no_text"), false);
+      }
+    }
+
+    /* ------------------------------------------------------------------------
+     * delete an author     
+     * ---------------------------------------------------------------------- */
+    if($_REQUEST['action']=="delete")
+    {
+      $sql="DELETE FROM ".$this->tables['licence_author']." WHERE id = '".$_REQUEST['id']."'";
+      $result=pwg_query($sql);
+      if($result)
+      {
+        if(mysql_affected_rows()==1)
+        {
+          $this->display_result(l10n("lmt_author_deleted"), true);
+
+          $sql="UPDATE ".$this->tables["images"]." SET author_id = NULL 
+                WHERE author_id = '".$_REQUEST['id']."'";
+          $result=pwg_query($sql);
+          if($result)
+          {
+            $nbimages=mysql_affected_rows();
+            if($nbimages>0)
+            {
+              $this->display_result($nbimages."&nbsp;".l10n("lmt_author_nb_images_updated"), true);
+            }
+          }
+          else
+          {
+            $this->display_result(l10n("lmt_cannot_delete_author"), false);
+          }
+        }
+        else
+        {
+          $this->display_result(l10n("lmt_cannot_delete_author"), false);
+        }  
+      }
+      else
+      {
+        $this->display_result(l10n("lmt_cannot_delete_author"), false);
+      }
+      $this->display_manageaut_page_list();
+    }
+    elseif($_REQUEST['action']=="add")
+    {
+      $this->display_manageaut_page_add_modify("add");
+    }
+    elseif($_REQUEST['action']=="edit")
+    {
+      $this->display_manageaut_page_add_modify("edit");
+    }
+    else
+    {
+      // list
+      $this->display_manageaut_page_list();
+    }
+  } //display_manageaut
+
+  protected function display_manageaut_page_list()
+  {
+    global $template;
+
+    $template->set_filename('body_page',
+                dirname($this->filelocation).'/admin/plugin_admin_manageaut.tpl');
+
+    $datas=array(
+      "author_list" => array(),
+      "img_directory" => LMT_PATH."img/",
+      "default_licencepublished" => l10n("lmt_lbl_under-".strToLower($this->my_config['lmt_licence_default'])),
+      "default_licenceL" => strToLower($this->my_config['lmt_licence_default']),
+      "default_licenceU" => l10n("lmt_lbl_cc_s-".strToLower($this->my_config['lmt_licence_default'])),
+      "lmt_licence_logo" => $this->my_config['lmt_licence_logo'],
+      "nbauthor" => 0,
+      "add_link" => $this->page_link.'&amp;f_tabsheet=manageaut&amp;action=add'
+    );
+
+    $sql="SELECT * FROM ".$this->tables['licence_author']." ORDER BY id";
+    $result=pwg_query($sql);
+    if($result)
+    {
+      while($row=mysql_fetch_array($result))
+      {
+        $datas["author_list"][]=array(
+          "id" => $row['id'],
+          "text1" => $row['text1'],
+          "text2" => $row['text2'],
+          "lnk_delete" => $this->page_link.'&amp;f_tabsheet=manageaut&amp;action=delete&amp;id='.$row['id'],
+          "lnk_edit" => $this->page_link.'&amp;f_tabsheet=manageaut&amp;action=edit&amp;id='.$row['id']
+        );
+      }
+      $datas["nbauthor"] = count($datas["author_list"]);
+    }
+
+    $template->assign('datas', $datas);
+    //$template->assign('extended_code', $this->generate_js_licence_author());
+    $template->assign_var_from_handle('LMT_BODY_PAGE', 'body_page');
+  }
+
+  protected function display_manageaut_page_add_modify()
+  {
+    global $template;
+
+    $template->set_filename('body_page',
+                dirname($this->filelocation).'/admin/plugin_admin_manageaut_edit.tpl');
+
+    if($_REQUEST["action"]=="edit")
+    {    
+      $sql="SELECT * FROM ".$this->tables['licence_author']." WHERE id = '".$_REQUEST['id']."'";
+      $result = pwg_query($sql);
+      if($result)
+      {
+        while($row=mysql_fetch_array($result))
+        {
+          $datas=array(
+            "action" => "modify",
+            "id" => $_REQUEST['id'],
+            "text1" => $row["text1"],
+            "text2" => $row["text2"]
+          );
+        }
+      }
+      else
+      {
+        $datas=array(
+          "action" => "add",
+          "id" => "",
+          "text1" => "",
+          "text2" => "",
+        );
+      }
+    }
+    else
+    {
+      $datas=array(
+        "action" => "add",
+        "id" => "",
+        "text1" => "",
+        "text2" => "",
+      );
+    }
+
+    $datas["urllist"] = $this->page_link.'&f_tabsheet=manageaut';
+
+    $template->assign('datas', $datas);
+    //$template->assign('extended_code', $this->generate_js_licence_author());
+    $template->assign_var_from_handle('LMT_BODY_PAGE', 'body_page');
+  }
+
+
+  /*
+    manage adviser profile
+      return true if user is adviser
+  */
+  protected function adviser_abort()
+  {
+    if(is_adviser())
+    {
+      $this->display_result(l10n("lmt_adviser_not_allowed"), false);
+      return(true);
+    }
+    return(false);
+  }
+
+
+  /*
+    this function return a js to manage licence text 
+  */
+  protected function generate_js_licence_author()
+  {
+    $local_tpl = new Template(LMT_PATH."admin/", "");
+    $local_tpl->set_filename('body_page',
+                  dirname($this->filelocation).'/admin/lmt_js.tpl');
+
+    $lmt_licence_default_values=array_slice($this->licences,0,count($this->licences)-1);
+    $datas['shortlicencetext']=array();
+    foreach($lmt_licence_default_values as $key=>$val)
+    {
+      $datas['shortlicencetext'][$val] = array(
+        "txt" => l10n("lmt_lbl_cc_s-".strtolower($val)),
+        "published" => l10n("lmt_lbl_under-".strtolower($val))
+      );
+    }
+
+    $local_tpl->assign("datas",$datas);
+
+    return($local_tpl->parse('body_page', true));
+  }
+
+
+  /* ---------------------------------------------------------------------------
+    function to manage database manipulation
+  --------------------------------------------------------------------------- */
+
+
+
+
+
+  /* ---------------------------------------------------------------------------
+    ajax functions
+  --------------------------------------------------------------------------- */
+
+  protected function ajax_img_list($pagenum)
+  {
+    global $conf;
+
+    $local_tpl = new Template(LMT_PATH."admin/", "");
+    $local_tpl->set_filename('body_page',
+                  dirname($this->filelocation).'/admin/plugin_admin_listitems.tpl');
+
+    if(!isset($_REQUEST['filter']) ||
+       !($_REQUEST['filter']=="BY" ||
+         $_REQUEST['filter']=="BY-SA" ||
+         $_REQUEST['filter']=="BY-ND" ||
+         $_REQUEST['filter']=="BY-NC-ND" ||
+         $_REQUEST['filter']=="BY-NC-SA" ||
+         $_REQUEST['filter']=="BY-NC" ||
+         $_REQUEST['filter']=="CRIGHT" ||
+         $_REQUEST['filter']=="CLEFT"
+      ))
+    {
+      $_REQUEST['filter']='';
+    }
+
+    $img_ids=array();
+    $img_liste = array();
+    $sql="SELECT SQL_CALC_FOUND_ROWS lmti.*, img.file, img.path, img.tn_ext, cat.id as catid, cat.name as catname, cat.permalink, lmtla.text1, lmtla.text2   
+          FROM ".$this->tables["images"]." lmti LEFT OUTER JOIN ".$this->tables["licence_author"]." lmtla ON lmtla.id = lmti.author_id, ".IMAGES_TABLE." img, ".CATEGORIES_TABLE." cat
+          WHERE lmti.image_id = img.id 
+            AND img.storage_category_id = cat.id ";
+    if($_REQUEST['filter']!="")
+    {
+      $sql.=" AND lmti.licence_type='".$_REQUEST['filter']."'";
+    }
+
+    $sql.=" ORDER BY cat.id, img.id ";
+  
+    if($this->my_config['lmt_list_maxitems']>0)
+    {
+      $refdbt = ($pagenum-1)*$this->my_config['lmt_list_maxitems'];
+      $sql.=" LIMIT ".$refdbt.", ".$this->my_config['lmt_list_maxitems'];
+    }
+
+    $result=pwg_query($sql);
+    if($result)
+    {
+      while($row = mysql_fetch_array($result))
+      {
+        $filenfo = pathinfo($row['path']);
+        preg_match("/(.*)\./i", $filenfo["basename"], $tmp);
+        $filenfo['filename'] = $tmp[1];
+
+        $img_ids[]=$row['image_id'];
+        $img_liste[]=array(
+          'id' => $row['image_id'],
+          'licence' => ($row['licence_type']=="CRIGHT")?l10n("lmt_lbl_cc_s-".strtolower($row['licence_type'])):"",
+          'licencei' => LMT_PATH."img/".strtolower($row['licence_type'])."_80x15.png",
+          'aut_text1' => $row['text1'],
+          'aut_text2' => $row['text2'],
+          'file' => $row['file'],
+          'catname' => $row['catname'],
+          'catlink' => make_index_url(
+                          array(
+                            'category' => array(
+                              'id' => $row['catid'],
+                              'name' => $row['catname'],
+                              'permalink' => $row['permalink'])
+                          )
+                        ),
+          'imglink' => make_picture_url(
+                          array(
+                            'image_id' => $row['image_id'],
+                            'category' => array(
+                              'id' => $row['catid'],
+                              'name' => $row['catname'],
+                              'permalink' => $row['permalink'])
+                          )
+                        ),
+          'thumb' => $filenfo["dirname"]."/thumbnail/".$conf["prefix_thumbnail"].$filenfo["filename"].".".$row["tn_ext"]
+        );
+      }
+    }  
+
+    $sql="select FOUND_ROWS()";
+    $result=pwg_query($sql);
+    $nb=mysql_fetch_array($result);
+
+    $pages_navigation = new pages_navigation();
+    $pages_navigation->set_nb_items($nb[0]);
+    $pages_navigation->set_nb_items_per_page($this->my_config['lmt_list_maxitems']);
+    $pages_navigation->set_current_page($pagenum);   
+    $pages_navigation->set_options(array(
+      "text_prev" => l10n("lmt_nav_prev"),
+      "text_next" => l10n("lmt_nav_next"),
+      "text_first" => l10n("lmt_nav_first"),
+      "text_last" => l10n("lmt_nav_last")
+    ));
+    $navbar=$pages_navigation->make_navigation("loadpage");
+    if($navbar!="")
+    {
+      $navbar=", ".$navbar;
+    }
+
+    $local_tpl->assign('imgliste', $img_liste);
+    return($nb[0]."&nbsp;".l10n("lmt_lst_nb_photos").$navbar."#".$local_tpl->parse('body_page', true));
+  }
+
+  protected function ajax_manage_list($pagenum)
+  {
+    global $conf, $user;
+
+    $local_tpl = new Template(LMT_PATH."admin/", "");
+    $local_tpl->set_filename('body_page',
+                  dirname($this->filelocation).'/admin/plugin_admin_manageitems.tpl');
+
+    if(!isset($_REQUEST['select']))
+    {
+      $_REQUEST['select']="caddie";
+    }
+
+    $img_liste = array();
+    $sql="SELECT SQL_CALC_FOUND_ROWS img.id as image_id, img.file, img.path, img.tn_ext, cat.id as catid, cat.name as catname, cat.permalink,
+                 lmti.licence_type, lmtla.text1, lmtla.text2 
+          FROM ".CATEGORIES_TABLE." cat, ".CADDIE_TABLE." caddie, ".IMAGES_TABLE." img 
+            LEFT OUTER JOIN ".$this->tables["images"]." AS lmti
+              ON img.id = lmti.image_id  
+            LEFT OUTER JOIN ".$this->tables["licence_author"]." lmtla 
+              ON lmtla.id = lmti.author_id
+          WHERE img.storage_category_id = cat.id 
+            AND img.id = caddie.element_id
+            AND caddie.user_id = '".$user['id']."'
+          ORDER BY cat.id, img.id ";
+
+    if($this->my_config['lmt_list_maxitems']>0)
+    {
+      $refdbt = ($pagenum-1)*$this->my_config['lmt_list_maxitems'];
+      $sql.=" LIMIT ".$refdbt.", ".$this->my_config['lmt_list_maxitems'];
+    }
+
+    $result=pwg_query($sql);
+
+    if($result)
+    {
+      while($row = mysql_fetch_array($result))
+      {
+        $filenfo = pathinfo($row['path']);
+        preg_match("/(.*)\./i", $filenfo["basename"], $tmp);
+        $filenfo['filename'] = $tmp[1];
+
+        $img_liste[]=array(
+          'id' => $row['image_id'],
+          'licence' => ($row['licence_type']=="")?"DEFAULT":$row['licence_type'],
+          'licencei' => ($row['licence_type']=="")?"":LMT_PATH."img/".strtolower($row['licence_type'])."_80x15.png",
+          'aut_text1' => $row['text1'],
+          'aut_text2' => $row['text2'],
+          'file' => $row['file'],
+          'catname' => $row['catname'],
+          'catlink' => make_index_url(
+                          array(
+                            'category' => array(
+                              'id' => $row['catid'],
+                              'name' => $row['catname'],
+                              'permalink' => $row['permalink'])
+                          )
+                        ),
+          'imglink' => make_picture_url(
+                          array('image_id' => $row['image_id'])
+                        ),
+          'thumb' => $filenfo["dirname"]."/thumbnail/".$conf["prefix_thumbnail"].$filenfo["filename"].".".$row["tn_ext"]
+        );
+      }
+    }  
+
+    $sql="select FOUND_ROWS()";
+    $result=pwg_query($sql);
+    $nb=mysql_fetch_array($result);
+
+    $pages_navigation = new pages_navigation();
+    $pages_navigation->set_nb_items($nb[0]);
+    $pages_navigation->set_nb_items_per_page($this->my_config['lmt_list_maxitems']);
+    $pages_navigation->set_current_page($pagenum);   
+    $pages_navigation->set_options(array(
+      "text_prev" => l10n("lmt_nav_prev"),
+      "text_next" => l10n("lmt_nav_next"),
+      "text_first" => l10n("lmt_nav_first"),
+      "text_last" => l10n("lmt_nav_last")
+    ));
+    $navbar=$pages_navigation->make_navigation("loadpage");
+    if($navbar!="")
+    {
+      $navbar=", ".$navbar;
+    }
+
+    $local_tpl->assign('imgliste', $img_liste);
+    return($nb[0]."&nbsp;".l10n("lmt_lst_nb_photos").$navbar."#".$local_tpl->parse('body_page', true));
+  }
+
+} //class
+
+?>
Index: /extensions/lmt/lmt_install.class.inc.php
===================================================================
--- /extensions/lmt/lmt_install.class.inc.php	(revision 3396)
+++ /extensions/lmt/lmt_install.class.inc.php	(revision 3396)
@@ -0,0 +1,102 @@
+<?php
+/* -----------------------------------------------------------------------------
+  Plugin     : LMT
+  Author     : Grum
+    email    : grum@piwigo.org
+    website  : http://photos.grum.fr
+
+    << May the Little SpaceFrog be with you ! >>
+  ------------------------------------------------------------------------------
+  See main.inc.php for release information
+
+  LMT_Install : classe to manage plugin install
+
+  --------------------------------------------------------------------------- */
+  @include_once('lmt_root.class.inc.php');
+  @include_once(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/tables.class.inc.php');
+
+
+  /* lmt class for install process */
+  class LMT_Install extends LMT_root
+  {
+    private $tablef;
+    private $exportfile;
+
+    public function LMT_Install($prefixeTable, $filelocation)
+    {
+      parent::__construct($prefixeTable, $filelocation);
+      $this->tablef= new manage_tables($this->tables);
+      $this->exportfile=dirname($this->filelocation).'/'.$this->plugin_name_files.'.sql';
+    }
+
+    /* 
+        function for installation process 
+        return true if install process is ok, otherwise false 
+    */ 
+    public function install()
+    {
+      $tables_def=array(
+"CREATE TABLE   `".$this->tables['images']."` (
+  `image_id` mediumint(8) unsigned NOT NULL default '0',
+  `licence_type` char(8) NOT NULL default 'cc-none',
+  `author_id` int UNSIGNED NOT NULL default '0',
+  PRIMARY KEY  (`image_id`),
+  KEY `by_licence` (`licence_type`),
+  KEY `by_author_id` (`author_id`)
+) 
+ENGINE=MyISAM 
+CHARACTER SET utf8 COLLATE utf8_general_ci",
+
+"CREATE TABLE `".$this->tables['licence_author']."` (
+  `id` int UNSIGNED NOT NULL AUTO_INCREMENT,
+  `text1` CHAR(25)  NOT NULL,
+  `text2` CHAR(25)  NOT NULL,
+  PRIMARY KEY (`id`)
+)
+ENGINE = MyISAM
+CHARACTER SET utf8 COLLATE utf8_general_ci",
+      );
+
+      //if present, try to import backup
+      //if backup file 
+      $import=$this->tablef->import($this->exportfile);
+      if($import['errors']<0)
+      {
+        $result=$this->tablef->create_tables($tables_def);
+        return($result);
+      }
+      else
+      {
+        return(true);
+      }
+    }
+
+
+    /*
+        function for uninstall process
+    */
+    public function uninstall()
+    {
+      $this->tablef->export($this->exportfile);
+      $this->delete_config();
+      $this->tablef->drop_tables();
+      return('');
+    }
+
+    public function activate()
+    {
+      global $template;
+
+      $this->init_config();
+      $this->load_config();
+      $this->save_config();
+      return('');
+    }
+
+    public function deactivate()
+    {
+    }
+
+  } //class
+
+?>
Index: /extensions/lmt/lmt_pip.class.inc.php
===================================================================
--- /extensions/lmt/lmt_pip.class.inc.php	(revision 3396)
+++ /extensions/lmt/lmt_pip.class.inc.php	(revision 3396)
@@ -0,0 +1,188 @@
+<?php
+/* -----------------------------------------------------------------------------
+  Plugin     : LMT
+  Author     : Grum
+    email    : grum@piwigo.org
+    website  : http://photos.grum.fr
+
+    << May the Little SpaceFrog be with you ! >>
+  ------------------------------------------------------------------------------
+  See main.inc.php for release information
+
+  LMT_PIP : classe to manage plugin public pages
+
+  --------------------------------------------------------------------------- */
+
+include_once('lmt_root.class.inc.php');
+include_once(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/public_integration.class.inc.php');
+
+class LMT_PIP extends LMT_root
+{
+  protected $section_page;
+
+  public function LMT_PIP($prefixeTable, $filelocation)
+  {
+    parent::__construct($prefixeTable, $filelocation);
+    $this->load_config();
+
+    // don't create this object inside root classe otherwise header is modified
+    // everywhere in admin pages
+    $this->ajax = new Ajax();
+
+    $this->init_events();
+    $this->load_lang();
+  }
+
+  /*
+    load language file
+  */
+  public function load_lang()
+  {
+    global $lang;
+
+    load_language('plugin.lang', LMT_PATH);
+
+    // ajax is managed here ; this permit to use user&language properties inside
+    // ajax content
+    //$this->return_ajax_content();
+  }
+
+  /*
+    initialize events call for the plugin
+  */
+  public function init_events()
+  {
+    parent::init_events();
+/*
+    add_event_handler('blockmanager_apply', array(&$this, 'blockmanager_apply') );
+    add_event_handler('loading_lang', array(&$this, 'load_lang'));
+*/
+    if($this->my_config['lmt_licence_activated']=='y')
+    {
+      add_event_handler('loc_end_page_header', array(&$this->css_icn, 'apply_CSS'));
+      add_event_handler('loc_end_picture', array(&$this, 'manage_licence_element'));
+
+      if($this->my_config['lmt_warning_visible']=='y')
+      {
+        add_event_handler('loc_end_page_tail', array(&$this, 'manage_warning_text'));
+      }
+    }
+  }
+
+
+
+  /* -------------------------------------------------------------------------
+    FUNCTIONS TO MANAGE LMT DISPLAY
+  ------------------------------------------------------------------------- */
+  public function manage_licence_element()
+  {
+    global $template, $page, $user;
+
+    $licence=$this->get_image_licence($page['image_id']);
+    if($licence['licence']=="")
+    {
+      return("");
+    }
+
+    if($this->my_config['lmt_redirect_activated']=='y')
+    {
+      $url=$this->my_config['lmt_redirect_url-'.strToLower($licence['licence'])][$user['language']];
+      if($url=='')
+      {
+        $url=$this->my_config['lmt_redirect_url-'.strToLower($licence['licence'])]['en_UK'];
+      }      
+    }
+    else
+    {
+      $url="";
+    }
+
+    $style="";
+    $text="";
+    switch($this->my_config['lmt_licence_logo'])
+    {
+      case '80x15':
+        if($url!="")
+        {
+          $text = "<br/><a href='".$url."'><img class='logo80x15' src='". LMT_PATH."img/".strToLower($licence['licence'])."_80x15.png'></a>".$licence['aut_text1']." ".$licence['aut_text2'];
+        }
+        else
+        {
+          $text = "<br/><img class='logo80x15' src='". LMT_PATH."img/".strToLower($licence['licence'])."_80x15.png'>".$licence['aut_text1']." ".$licence['aut_text2'];
+        } 
+      break;
+      case '88x31';
+        $style=" style='text-align:left;'";
+        if($url!="")
+        {
+          $text = "<table style='margin:auto;'><tr><td><a href='".$url."'><img class='logo88x31' style='top:-4px;' src='". LMT_PATH."img/".strToLower($licence['licence'])."_88x31.png'></a></td><td>".$licence['aut_text1']."<br/>".$licence['aut_text2']."</td></tr></table>";
+        }
+        else
+        {
+          $text = "<table style='margin:auto;'><tr><td><img class='logo88x31' style='top:-4px;' src='". LMT_PATH."img/".strToLower($licence['licence'])."_88x31.png'></td><td>".$licence['aut_text1']."<br/>".$licence['aut_text2']."</td></tr></table>";
+        }
+        break;
+      case 'text';
+        if($url!="")
+        {
+          $text ="<br/>".l10n("lmt_lbl_under-".strToLower($licence['licence']))." <a href='".$url."'>".l10n("lmt_lbl_cc_s-".strToLower($licence['licence']))."</a> ".$licence['aut_text1']." ".$licence['aut_text2'];
+        }
+        else
+        {
+          $text ="<br/>".l10n("lmt_lbl_under-".strToLower($licence['licence']))." ".l10n("lmt_lbl_cc_s-".strToLower($licence['licence']))." ".$licence['aut_text1']." ".$licence['aut_text2'];
+        }
+        break;
+    }
+    
+    $template->concat('COMMENT_IMG', '<span class="licencetag" '.$style.'>'.$text.'</span>');
+  }
+
+  public function manage_warning_text()
+  {
+    global $template, $user;
+
+
+    if(isset($this->my_config['lmt_warning_texts'][$user['language']]))
+    {
+      $text=$this->my_config['lmt_warning_texts'][$user['language']];
+    }
+    else
+    {
+      $text=$this->my_config['lmt_warning_texts']['en_UK'];
+    }
+
+    $patterns = array('/\[logo=80x15\]/i', '/\[logo=88x31\]/i', '/\[logo=text\]/i');
+    $replacements = array(
+      "<img class='logo80x15' src='". LMT_PATH."img/".strToLower($this->my_config['lmt_licence_default'])."_80x15.png'>",
+      "<img class='logo88x31' src='". LMT_PATH."img/".strToLower($this->my_config['lmt_licence_default'])."_88x31.png'>",
+      l10n("lmt_lbl_cc_s-".strToLower($this->my_config['lmt_licence_default']))
+    );
+
+    if($this->my_config['lmt_redirect_activated']=='y')
+    {
+      $url=$this->my_config['lmt_redirect_url-'.strToLower($this->my_config['lmt_licence_default'])][$user['language']];
+      if($url=='')
+      {
+        $url=$this->my_config['lmt_redirect_url-'.strToLower($this->my_config['lmt_licence_default'])]['en_UK'];
+      }
+      if($url!="")
+      {
+        $replacements[0]="<a href='".$url."'>".$replacements[0]."</a>";
+        $replacements[1]="<a href='".$url."'>".$replacements[1]."</a>";
+        $replacements[2]="<a href='".$url."'>".$replacements[2]."</a>";
+      }
+    }
+
+    $text = preg_replace($patterns, $replacements, $text);
+
+    $template->append("footer_elements", "<span>".htmlspecialchars_decode($text)."</span>");
+  }
+
+
+  /* ---------------------------------------------------------------------------
+    ajax functions
+  --------------------------------------------------------------------------- */
+
+} //class
+
+?>
Index: /extensions/lmt/lmt_root.class.inc.php
===================================================================
--- /extensions/lmt/lmt_root.class.inc.php	(revision 3396)
+++ /extensions/lmt/lmt_root.class.inc.php	(revision 3396)
@@ -0,0 +1,376 @@
+<?php
+/* -----------------------------------------------------------------------------
+  Plugin     : LMT
+  Author     : Grum
+    email    : grum@piwigo.org
+    website  : http://photos.grum.dnsalias.com
+
+    << May the Little SpaceFrog be with you ! >>
+  ------------------------------------------------------------------------------
+  See main.inc.php for release information
+
+  LMT_root : common classe for admin and public classes
+
+  --------------------------------------------------------------------------- */  
+  include_once(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/common_plugin.class.inc.php');
+  include_once(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/css.class.inc.php');
+  include_once(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/ajax.class.inc.php');
+  global $ajax;
+
+  class LMT_root extends common_plugin
+  {
+    protected $css;   //the css object
+    protected $css_icn;   //the css object
+
+    protected $licences=array('BY', 'BY-ND', 'BY-NC', 'BY-NC-ND', 'BY-NC-SA', 'BY-SA', 'CRIGHT', 'CLEFT', 'DEFAULT');
+
+    public function LMT_root($prefixeTable, $filelocation)
+    {
+      $this->plugin_name='LMT';
+      $this->plugin_name_files="lmt";
+      parent::common_plugin($prefixeTable, $filelocation);
+      $this->section_name=$this->plugin_name_files;
+
+      $this->set_tables_list(array('images', 'licence_author', 'licence_doc'));
+
+
+      $this->css = new css(dirname($this->filelocation).'/'.$this->plugin_name_files.".css");
+      $this->css_icn = new css(dirname($this->filelocation).'/'.$this->plugin_name_files."_icn.css");
+    }
+
+    public function init_events()
+    {
+      add_event_handler('blockmanager_register_blocks', array(&$this, 'register_blocks') );
+    }
+
+    /*
+      menu block management
+    */
+    public function register_blocks()
+    {
+    }
+
+
+
+    /*
+      surchage of common_plugin->save_config function
+    */
+    public function save_config()
+    {
+      if(parent::save_config())
+      {
+        $this->css->make_CSS($this->generate_CSS());
+        $this->css_icn->make_CSS($this->generate_CSS2());
+        return(true);
+      }
+      return(false);
+    }
+
+    /*
+      surchage of common_plugin->save_config function
+    */
+    public function load_config()
+    {
+      parent::load_config();
+      if(!$this->css->css_file_exists())
+      {
+        $this->css->make_CSS($this->generate_CSS());
+      }
+      if(!$this->css_icn->css_file_exists())
+      {
+        $this->css_icn->make_CSS($this->generate_CSS2());
+      }
+    }
+
+    /*
+      intialize default values 
+    */
+    public function init_config()
+    {
+      //global $user;
+      $this->my_config=array(
+        'lmt_mouseovercolor' => '303030', /**/
+        'lmt_list_maxheight' => '650',
+        'lmt_list_maxitems' => '0',    /* limit number of item displayed ; 0 : no limit */
+        'lmt_licence_default' => 'BY', 
+        'lmt_licence_default_author' => 0, 
+        'lmt_licence_activated' => 'n',
+        'lmt_licence_visible' => 'n',  /* y:always visible, n:only if needed */
+        'lmt_licence_logo' => '80x15', /* 80x15, 88x31, text */
+        'lmt_warning_visible' => 'y',     /* y: display a text at the bottom of each page */ 
+        'lmt_warning_texts' => array(), /* text displayed - multi lang */
+        'lmt_redirect_activated' => 'y',     /* y: the text is an url to a warning page */  
+        'lmt_redirect_url-by' => array(),    
+        'lmt_redirect_url-by-nd' => array(),    
+        'lmt_redirect_url-by-nc' => array(),    
+        'lmt_redirect_url-by-nc-nd' => array(),    
+        'lmt_redirect_url-by-nc-sa' => array(),    
+        'lmt_redirect_url-by-sa' => array(),    
+        'lmt_redirect_url-cright' => array(),    
+        'lmt_redirect_url-cleft' => array(),   
+      );
+
+      $languages=get_languages();
+      foreach($languages as $key => $val)
+      {
+        $lang=substr($key,0,2)."/";
+        if($lang=="en/") { $lang=""; }
+        $this->my_config['lmt_warning_texts'][$key]='';
+        $this->my_config['lmt_redirect_url-by'][$key]='http://creativecommons.org/licenses/by/2.0/'.$lang;
+        $this->my_config['lmt_redirect_url-by-nd'][$key]='http://creativecommons.org/licenses/by-nd/2.0/'.$lang;
+        $this->my_config['lmt_redirect_url-by-nc'][$key]='http://creativecommons.org/licenses/by-nc/2.0/'.$lang;
+        $this->my_config['lmt_redirect_url-by-nc-nd'][$key]='http://creativecommons.org/licenses/by-nc-nd/2.0/'.$lang;
+        $this->my_config['lmt_redirect_url-by-nc-sa'][$key]='http://creativecommons.org/licenses/by-nc-sa/2.0/'.$lang;
+        $this->my_config['lmt_redirect_url-by-sa'][$key]='http://creativecommons.org/licenses/by-sa/2.0/'.$lang;
+        $this->my_config['lmt_redirect_url-cright'][$key]='';
+        $this->my_config['lmt_redirect_url-cleft'][$key]='';
+      }
+
+    }
+
+    /*
+      generate the css code
+    */
+    protected function generate_CSS()
+    {
+      $text = "
+.TableRow:hover
+{
+  background-color:#".$this->my_config['lmt_mouseovercolor'].";
+}
+
+.formtable
+{
+  text-align:justify;
+  display:block;
+  margin-top:0px;
+  margin-bottom:0px;
+  width:100%;
+}
+
+.formtable tr {
+  vertical-align:top;
+}
+
+.littlefont { font-size:90%; }
+table.littlefont th { text-align:center; padding:3px;padding-left:9px;padding-right:9px; }
+table.littlefont td { text-align:left; padding:0px;padding-left:3px;padding-right:3px; }
+
+.lmt_page
+{
+  text-align:justify;
+  margin:8px;
+}
+
+.lmt  {
+  text-align:justify;  
+}
+
+#list {
+  width:100%;
+  overflow-y:scroll;
+  min-height:250px;
+  max-height:650px;
+}
+
+#ullist li {
+  width:300px;
+  display:block; 
+  float:left;
+  text-align:left;
+}
+
+#ullist label {
+  float:left;
+}
+
+#ullist li table {
+  margin:0px;
+  text-align:left;
+  width:300px;
+  font-size:80%;
+}
+
+#ullist li tr {
+  vertical-align:top;
+}
+
+.content ul.thumbnails span.extendwrap1 {
+  margin:0px;
+  cursor:pointer;
+}
+
+.is_on, .is_off {
+  z-index:20;
+  width:12px;
+  height:12px;
+  display:block;
+  cursor:pointer;
+}
+
+.is_on {
+  background:url(./img/cb_on.png);
+}
+.is_off {
+  background:url(./img/cb_off.png);
+}
+
+.icnhelp {
+  weight:bold;
+  text-decoration:none;
+  cursor:help;
+}
+
+.hinthlp {
+  position:absolute;
+  max-width:400px;
+  border:1px solid #000000;
+  background:#ffffa0;
+  color:#000000;
+  top:0px;
+  left:-450px;  
+  padding:2px;
+  text-align:justify;
+}
+
+      ";
+      return($text);
+    }
+
+    /*
+      generate the css code 
+    */
+    protected function generate_CSS2()
+    {
+      $text = "
+.logo80x15 {
+  position:relative;
+  top:4px;
+  margin-right:4px;
+  border:0px none;
+}
+
+.logo88x31 {
+  position:relative;
+  margin-right:4px;
+  border:0px none;
+}
+
+#theImage img.logo80x15, #theImage img.logo88x31 {
+  border:0px none;
+}
+
+.licencetag {
+  display:block;
+  padding-top:10px;
+  font-size:80%;
+}
+      ";
+      return($text);
+    }
+
+
+
+
+    /* -------------------------------------------------------------------------
+     return the licence type for an image
+      $default = 'y' => if no licence for the picture, return de default licence
+                 'n' => if no licence for the picture, return empty values
+    ------------------------------------------------------------------------- */
+    public function get_image_licence($image_id)
+    {
+
+      $return=array(
+        "default" => "",
+        "licence" => "",
+        "aut_text1" => "",
+        "aut_text2" => ""
+      );
+      $sql="SELECT lmti.licence_type, lmta.text1, lmta.text2 
+            FROM ".$this->tables['images']." lmti
+              LEFT OUTER JOIN ".$this->tables['licence_author']." lmta ON lmti.author_id = lmta.id
+            WHERE lmti.image_id = '".$image_id."'";
+      $result=pwg_query($sql);
+      if($result)
+      {
+        while($row=mysql_fetch_array($result))
+        {
+          $return=array(
+            "defaut" => "n",
+            "licence" => $row['licence_type'],
+            "aut_text1" => $row['text1'],
+            "aut_text2" => $row['text2']
+          );
+        }
+      }
+
+      if(($return["licence"]=="")&&($this->my_config["lmt_licence_visible"]=="y"))
+      {
+        $return=array(
+          "defaut" => "y",
+          "licence" => $this->my_config["lmt_licence_default"],
+          "aut_text1" => "",
+          "aut_text2" => ""
+        );
+
+        $sql="SELECT * FROM ".$this->tables['licence_author']." 
+              WHERE id = '".$this->my_config["lmt_licence_default_author"]."'";
+        $result=pwg_query($sql);
+        if($result)     
+        {
+          while($row=mysql_fetch_array($result))
+          {
+            $return["aut_text1"]=$row['text1'];
+            $return["aut_text2"]=$row['text2'];
+          }
+        }
+      }
+
+      return($return);      
+    }
+
+
+    /* -------------------------------------------------------------------------
+     returns an array of image id with the licence type
+      if $licence = "" => return all picture with a specific licences
+    ------------------------------------------------------------------------- */
+    public function get_images_licences($licence)
+    {
+      $sql="".$this->tables['lmt'];
+
+      $result=pwg_query($sql.$sql_where.$sql_order);
+      if($result)
+      {
+        $returned=array();
+        while($row=mysql_fetch_assoc($result))
+        {
+          array_push($returned, $row);
+        }
+        return($returned);
+      }  
+      return(false); 
+    }
+
+  protected function display_result($action_msg, $result)
+  {
+    global $page;
+
+    if($result)
+    {
+      array_push($page['infos'], $action_msg);
+    }
+    else
+    {
+      array_push($page['errors'], $action_msg);
+    }
+  }
+
+
+    /* ---------------------------------------------------------------------------
+      ajax functions
+    --------------------------------------------------------------------------- */
+
+
+  } //class
+
+?>
Index: /extensions/lmt/main.inc.php
===================================================================
--- /extensions/lmt/main.inc.php	(revision 3396)
+++ /extensions/lmt/main.inc.php	(revision 3396)
@@ -0,0 +1,75 @@
+<?php
+/*
+Plugin Name: LMT
+Version: 1.0.1
+Description: Appliquer une licence sur ses photos / Apply a licence on photos
+Plugin URI: http://phpwebgallery.net/ext/extension_view.php?eid=282
+Author: grum@piwigo.org
+Author URI: http://photos.grum.fr
+*/
+
+/*
+--------------------------------------------------------------------------------
+  Author     : Grum
+    email    : grum@piwigo.com
+    website  : http://photos.grum.fr
+    PWG user : http://forum.phpwebgallery.net/profile.php?id=3706
+
+    << May the Little SpaceFrog be with you ! >>
+--------------------------------------------------------------------------------
+
+:: HISTORY
+
+| release | date       |
+| 1.0.0   | 2009/03/01 | first release
+| 1.0.1   | 2009/05/01 | * modify de style for 80x15&text logo (to be centered 
+|         |            |   like the 88x31 logo)
+|         |            | * modify the footer (allows to use html markup)
+|         |            |
+  
+
+:: TO DO
+
+--------------------------------------------------------------------------------
+
+:: NFO
+  LMT_root : common classe for admin and public classes
+  LMT_AIM  : classe to manage plugin integration into plugin menu
+  LMT_AIP  : classe to manage plugin admin pages
+  LMT_PIP  : classe to manage plugin public pages
+
+--------------------------------------------------------------------------------
+*/
+
+// pour faciliter le debug :o)
+ //ini_set('error_reporting', E_ALL);
+ //ini_set('display_errors', true);
+
+if(!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+
+define('LMT_DIR' , basename(dirname(__FILE__)));
+define('LMT_PATH' , PHPWG_PLUGINS_PATH . LMT_DIR . '/');
+
+define('LMT_VERSION' , '1.0.1'); // => ne pas oublier la version dans l'entête !!
+
+global $prefixeTable;
+
+
+if(defined('IN_ADMIN'))
+{
+  //LMT admin interface loaded and active only if in admin page
+  include_once("lmt_aim.class.inc.php");
+  $obj=new LMT_AIM($prefixeTable, __FILE__);
+  $obj->init_events();
+}
+else
+{
+  //LMT public interface loaded and active only if in public page
+  include_once("lmt_pip.class.inc.php");
+  $obj=new LMT_PIP($prefixeTable, __FILE__);
+}
+
+set_plugin_data($plugin['id'], $obj);
+
+?>
Index: /extensions/lmt/maintain.inc.php
===================================================================
--- /extensions/lmt/maintain.inc.php	(revision 3396)
+++ /extensions/lmt/maintain.inc.php	(revision 3396)
@@ -0,0 +1,119 @@
+<?php
+/* -----------------------------------------------------------------------------
+  Plugin     : LMT
+  Author     : Grum
+    email    : grum@piwigo.org
+    website  : http://photos.grum.fr
+
+    << May the Little SpaceFrog be with you ! >>
+  ------------------------------------------------------------------------------
+  See main.inc.php for release information
+
+  --------------------------------------------------------------------------- */
+
+if (!defined('PHPWG_ROOT_PATH')) { die('Hacking attempt!'); }
+
+define('LMT_DIR' , basename(dirname(__FILE__)));
+define('LMT_PATH' , PHPWG_PLUGINS_PATH . LMT_DIR . '/');
+
+//ini_set('error_reporting', E_ALL);
+//ini_set('display_errors', true);
+
+global $gpc_installed, $lang; //needed for plugin manager compatibility
+
+/* -----------------------------------------------------------------------------
+LMT needs the Grum Plugin Classe
+----------------------------------------------------------------------------- */
+$gpc_installed=false;
+if(file_exists(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/common_plugin.class.inc.php'))
+{
+  @include_once(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/main.inc.php');
+  // need GPC release greater or equal than 2.0.2
+  if(checkGPCRelease(2,0,2))
+  {
+    @include_once('lmt_install.class.inc.php');
+    $gpc_installed=true;
+  }
+}
+
+function gpcMsgError(&$errors)
+{
+  array_push($errors, sprintf(l10n('lmt_gpc2_not_installed'), "2.0.2"));
+}
+// -----------------------------------------------------------------------------
+
+
+
+
+load_language('plugin.lang', LMT_PATH);
+
+
+function plugin_install($plugin_id, $plugin_version, &$errors) 
+{
+  global $prefixeTable, $gpc_installed;
+
+  if($gpc_installed)
+  {
+    $obj = new LMT_Install($prefixeTable, __FILE__);
+    $result=$obj->install();
+    if(!$result)
+    {
+      array_push($errors, "error");
+    }
+  }
+  else
+  {
+    gpcMsgError($errors);
+  }
+}
+
+function plugin_activate($plugin_id, $plugin_version, &$errors)
+{
+  global $prefixeTable, $gpc_installed;
+
+  if($gpc_installed)
+  {
+    $obj = new LMT_Install($prefixeTable, __FILE__);
+    $result=$obj->activate();
+    if($result===false or $result!='')
+    {
+      if(is_string($result))
+      {
+        array_push($errors, $result);
+      }
+      else
+      {
+        array_push($errors, "");
+      }
+    }
+  }
+  else
+  {
+    gpcMsgError($errors);
+  }
+}
+
+function plugin_deactivate($plugin_id)
+{
+/*  global $prefixeTable;
+  $obj = new install_mypolls($prefixeTable, __FILE__);
+  $obj->deactivate(); */
+}
+
+function plugin_uninstall($plugin_id)
+{
+  global $prefixeTable, $gpc_installed;
+
+  if($gpc_installed)
+  {
+    $obj = new LMT_Install($prefixeTable, __FILE__);
+    $obj->uninstall();
+  }
+  else
+  {
+    gpcMsgError($errors);
+  }
+}
+
+
+?>
Index: /extensions/lmt/templates/index.php
===================================================================
--- /extensions/lmt/templates/index.php	(revision 3396)
+++ /extensions/lmt/templates/index.php	(revision 3396)
@@ -0,0 +1,33 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | PhpWebGallery - a PHP based picture gallery                           |
+// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
+// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
+// +-----------------------------------------------------------------------+
+// | file          : $Id: index.php 1912 2007-03-16 06:30:07Z rub $
+// | last update   : $Date: 2007-03-16 07:30:07 +0100 (ven, 16 mar 2007) $
+// | last modifier : $Author: rub $
+// | revision      : $Revision: 1912 $
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
