Index: /extensions/event_cats/admin/autolog_entries.inc.php
===================================================================
--- /extensions/event_cats/admin/autolog_entries.inc.php	(revision 4001)
+++ /extensions/event_cats/admin/autolog_entries.inc.php	(revision 4002)
@@ -55,94 +55,5 @@
 
 $code_list = array();
-build_ec_lists(); // in evntcats_funcs.php
-
-if (isset($_GET['delete'])) {
-  if (array_key_exists($_GET['delete'],$ec_lists['ec_table'])) {
-    $t = $ec_lists['ec_table'][$_GET['delete']]['code'];
-    $q = pwg_query('
-     DELETE FROM '.EVNTCATS_TABLE.' 
-     WHERE id = '.$_GET['delete']
-    );
-    if ($q = 1) {
-      $page['infos']['infos'] = l10n('ec_entry_del_ok_pre').$t.
-       l10n('ec_entry_del_ok_end');
-    }
-    else {
-      $page['errors'][] = l10n('ec_entry_del_nok_pre').$t.
-       l10n('ec_entry_del_nok_end');
-    }
-    build_ec_table();
-  }
-}
-
-if (isset($_GET['disable'])) {
-  if (array_key_exists($_GET['disable'],$ec_lists['ec_table'])) {
-    $t = $ec_lists['ec_table'][$_GET['disable']]['code'];
-    $q = pwg_query('
-     UPDATE '.EVNTCATS_TABLE.' 
-     SET action = \'ec_outdated\' 
-     WHERE id = '.$_GET['disable']
-    );
-    if ($q = 1) {
-      $page['infos']['infos'] = l10n('ec_entry_dis_ok_pre1').$t.
-       l10n('ec_entry_dis_ok_end1');
-      if (isset($_GET['add_p'])) {
-        if (array_key_exists($_GET['add_p'],$ec_lists['add_pages'])) {
-          $q = pwg_query('
-           UPDATE '.EVNTCATS_TABLE.' 
-           SET arg1 = '.$_GET['add_p'].' 
-           WHERE id = '.$_GET['disable']
-          );
-          if ($q = 1) {
-            $page['infos']['infos'].=
-             l10n('ec_entry_dis_ok_pre2').
-             $_GET['add_p'].
-             l10n('ec_entry_dis_ok_mid2').
-             $ec_lists['add_pages'][$_GET['add_p']].
-             l10n('ec_entry_dis_ok_end2');
-          }
-          else {
-            $page['errors'][] =
-             l10n('ec_entry_dis_nok_pre2').
-             $t.
-             l10n('ec_entry_dis_nok_mid2').
-             $_GET['add_p'].
-             l10n('ec_entry_dis_nok_end2');
-          }
-        }
-      }
-      else {
-        $q = pwg_query('
-         UPDATE '.EVNTCATS_TABLE.' 
-         SET arg1 = NULL 
-         WHERE id = '.$_GET['disable']
-        );
-        if ($q != 1) {
-          $page['errors'][] =
-           l10n('ec_entry_dis_nok_pre3').
-           $t.
-           l10n('ec_entry_dis_nok_end3');
-        }
-      }
-    }
-    else {
-      $page['errors'][] = l10n('ec_entry_dis_nok_pre1').$t.
-       l10n('ec_entry_dis_nok_end1');
-    }
-    build_ec_table();
-  }
-}
-
-if (isset($_GET[''])) {
-}
-
-if (isset($_GET[''])) {
-}
-
-if (isset($_GET[''])) {
-}
-
-if (isset($_GET[''])) {
-}
+build_ec_lists(); // in evntcats_funcs.inc.php
 
 /****************************************************************
Index: /extensions/event_cats/admin/autolog_new.inc.php
===================================================================
--- /extensions/event_cats/admin/autolog_new.inc.php	(revision 4001)
+++ /extensions/event_cats/admin/autolog_new.inc.php	(revision 4002)
@@ -1,346 +1,68 @@
-{* <!-- Event Cats (event categories) LucMorizur June - ... 2009 --> *}
+<?php
+// +-----------------------------------------------------------------------+
+// | Plugin Name : Event Cats                                              |
+// | Plugin Version : 1.0                                                  |
+// | File Version : 1.0                                                    |
+// | Plugin Version author : LucMorizur                                    |
+// | Plugin description : (plugin for Piwigo, http://piwigo.org )          |
+// | This plugin allows an account to be automatically logged in ; and to  |
+// | let users duplicate the account they are logged with, to get benefits |
+// | of the groups of the previous account, immediately on their new acc.  |
+// | Ce plugin permet d'identifier automatiquement un compte ; et permet à |
+// | un utilisateur de dupliquer un compte, pour que le nouveau compte     |
+// | bénéficie immédiatement de l'affectation aux groupes de l'ancien cpte |
+// +-----------------------------------------------------------------------+
 
-{* <!-- Page title --> *}
-<div class = "titrePage" style="margin-top: -20px;">
-  <h2>{'ec_admin_page_title'|@translate} {$EVNTCATS_VERSION}</h2>
-</div>
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery                                  |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2009 Piwigo Team                  http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | 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.                                                                  |
+// +-----------------------------------------------------------------------+
 
-{* <!-- JavaScript warning message --> *}
-<div id = "ec_js_warn">
-  {'ec_javascript_needed'|@translate}<br><br>
-</div>
-<script type = "text/javascript"><!-- // Removes JavaScript warning message
-  document.getElementById('ec_js_warn').innerHTML = ''; //-->
-</script>
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
 
-{* <!-- EC Presentation --> *}
-{if $ec_howto}
-  <div>
-    {'ec_admin_page_howto'|@translate}
-  </div>
-{/if}
+global $template, $conf, $lang, $test1, $prefixeTable, $ec_err, $page,
+ $ec_lists,   // array of following arrays :
+              //   $ec_lists['ec_table'] :
+              //     Event Cats table, in function of each entry id
+              //   $ec_lists['ec_codes'] : // Used ?
+              //     array of useful data, in function of entries codes
+              //   $ec_lists['add_pages'] :
+              //     array of Add. Pages names in function of their id
+              //   $ec_lists['categories'] :
+              //     array of category names in function of their id
+              //   $ec_lists['user_ids'] :
+              //     array of usernames in function of their id
+ $ec_ap_ok;   // whether Additional Pages is installed and activated
 
-<p>
-  <hr width = 75% size = 3 />
-</p>
+/****************************************************************************/
 
-{* <!-- Whether plugin Additionnal Pages is active or not --> *}
-<div style = "text-align:right; font-style:italic;">
-  {if $ec_ap_ok}
-    {'ec_plugin_ap_ok'|@translate}
-    <script type = "text/javascript"><!--
-      var ec_ap_ok = true; //-->
-    </script>
-  {else}
-    {'ec_plugin_ap_nok'|@translate}
-    <script type = "text/javascript"><!--
-      var ec_ap_ok = false; //-->
-    </script>
-  {/if}
-</div>
+$code_list = array();
+build_ec_lists(); // in evntcats_funcs.php
 
-{* <!-- First section : form to view and modify codes, or create a new one --> *}
-<form class = "filter" method = "post" name = "ec_up_code" action = "">
-  <input type = "hidden" id = "ec_act1_id" name = "ec_act1" />
-  
-  <div style = "text-align:center; font-weight:bold; font-size:120%;">{'ec_entry_table_title'|@translate}</div><br>
-  
-  {* <!-- Table to show codes present in MySQL table --> *}
-  <table class = "table2" width = "97%" {* id = "" *}>
-    <thead>
-      <tr class = "throw">
-        <td>{'ec_col_name_entry'|@translate}</td>
-        <td>{'ec_col_name_code'|@translate}</td>
-        <td>{'ec_col_name_user'|@translate}</td>
-        <td>{'ec_col_name_bhvr'|@translate}</td>
-        <td>{'ec_col_name_dspl'|@translate}</td>
-        <td>{'ec_col_name_actn'|@translate}</td>
-      </tr>
-    </thead>
-    
-    {foreach from=$code_list item=code_line name=code_loop}
-      <tr class = "{if $smarty.foreach.code_loop.index is odd}row1{else}row2{/if}">
-        <td>
-          <input type = "radio" name = "ec_entry_sel" value = "{$code_line.id}" id = "selection-{$code_line.id}"
-           onclick = "ec_mark_line({$code_line.id});"
-          />
-          <label for = "selection-{$code_line.id}">{$code_line.id}</label>
-        </td>
-        <td><label for = "selection-{$code_line.id}" id = "ec_table_code_{$code_line.id}">{$code_line.Code}</label></td>
-        <td><label for = "selection-{$code_line.id}" id = "ec_table_usr_{$code_line.id}">{$code_line.Username}</label></td>
-        <td><label for = "selection-{$code_line.id}">{$code_line.Action|@translate}</label></td>
-        <td><label for = "selection-{$code_line.id}">{$code_line.Arg1}</label></td>
-        <td>
-          <a
-           href = "{$code_line.code_URL}" title = "{'ec_test_tooltip'|@translate}"
-           id = "ec_table_URL_{$code_line.id}" onclick = "return ec_check_tst({$code_line.id});"
-          />
-            <img src = "{$EVNTCATS_URLS.ROOT}icon/url2.png" class = "button" style = "border:none"
-             alt = "{'ec_test_tooltip'|@translate}" title = "{'ec_test_tooltip'|@translate}" />
-          </a>
-          <a href = "javascript:void();" onclick = "ec_check_d({$code_line.id}, 'delete');">
-            <img src = "{$EVNTCATS_URLS.ROOT}icon/delete.png" class = "button"
-             alt = "{'ec_url_delete'|@translate}" title = "{'ec_url_delete'|@translate}" />
-          </a>
-          {if $code_line.log_OK}
-            <a href = "javascript:void();" onclick = "ec_check_d({$code_line.id}, 'disable');">
-              <img src = "{$EVNTCATS_URLS.ROOT}icon/disable.png" class = "button"
-               alt = "{'ec_url_disable'|@translate}" title = "{'ec_url_disable'|@translate}" />
-            </a>
-            {if $code_line.Forced == 'true'}
-              <a href = "javascript:void()" title = "{'ec_url_forced'|@translate}" onclick = "ec_toggle_forced({$code_line.id}, false);">
-                <img class = "button" src = "{$EVNTCATS_URLS.ROOT}icon/forced.png"
-                 {if $code_line.f_pb} style = "border:solid medium red;" {/if}
-                 alt = "{'ec_url_forced'|@translate}" title = "{'ec_url_forced'|@translate}"
-                />
-              </a>
-            {else}
-              <a href = "javascript:void()" title = "{'ec_url_nforced'|@translate}" onclick = "ec_toggle_forced({$code_line.id}, true);">
-                <img class = "button" src = "{$EVNTCATS_URLS.ROOT}icon/nforced.png"
-                 alt = "{'ec_url_nforced'|@translate}" title = "{'ec_url_nforced'|@translate}"/>
-              </a>
-              {if !$code_line.f_pb}
-                <a href = "javascript:void()" title = "{'ec_url_duplicate'|@translate}" onclick = "ec_duplicate_entry({$code_line.id});">
-                  <img src = "{$EVNTCATS_URLS.ROOT}icon/duplicate.png" class = "button" style = "border:none"
-                   alt = "{'ec_url_duplicate'|@translate}" title = "{'ec_url_duplicate'|@translate}" />
-                </a>
-              {/if}
-            {/if}
-          {/if}
-        </td>
-      </tr>
-    {/foreach}
-  </table>
-  
-  {* <!-- This is not really a table, looks like a unique cell at the end of previous table,
-  to show URL for currently selected line in above table --> *}
-  <table class = "table2" width = "97%">
-    <tr class = "row2">
-      <td style = "text-align:center; padding-top:5px; padding-bottom:5px;">
-        <label title = "{'ec_url_tooltip'|@translate}">
-          {'ec_show_URL'|@translate}
-          <input type = "text" id = "ec_show_URL" size = "100%" title = "{'ec_url_tooltip'|@translate}" readonly = "readonly" />
-        </label>
-      </td>
-    </tr>
-  </table><br>
-  
-  {* <!-- Parameters list --> *}
-  <table style="border-spacing:30px" width = "97%">
-    
-    {* <!-- New entry --> *}
-    <tr>
-      <td>
-        <label for = "selection--1" onclick = "ec_mark_line(-1);">
-          <input type = "radio" name = "ec_entry_sel" value = "-1" id = "selection--1" onclick = "ec_mark_line(-1);" />
-          <span style = "font-weight:bold; font-style:italic; font-size:120%; text-decoration:underline;">{'ec_create_modify_code'|@translate}</span>
-        </label>
-      </td>
-      <td>
-        <input class = "submit" type = "button" name = "ec_submit_gen_full_auto" value = "{'ec_new_full_auto'|@translate}"
-         id = "ec_submit_gen_full_auto_id" onclick = "ec_gen_full_auto();" style = "margin-top:0;"
-        /><br>
-      </td>
-    </tr>
-    
-    {* <!-- Code selection --> *}
-    <tr>
-      <td><strong><span onclick = "Test();">{'ec_new_entry'|@translate}</span></strong></td>
-      <td>
-        <input type = "text" name = "ec_in_up_code" maxlength = "32" size = "40"
-         id = "ec_in_up_code_id" onclick = "ec_mark_line(-1);" onblur = "ec_new_code_text = this.value;"
-        />
-        &nbsp;
-        <label for = "ec_in_up_code_id" style = "margin:0;">
-          <input class = "submit" type = "button" name = "ec_submit_gen_code" value = "{'ec_new_entry_button'|@translate}"
-           id = "ec_submit_gen_code_id" onclick = "ec_gen_code();" style = "margin:0;"
-          />
-        </label>
-        {'ec_gen_code_nb_pre'|@translate}
-        <select name = "ec_in_up_auto_code_length" id = "ec_in_up_auto_code_length_id" onchange = "ec_auto_code_digits_nb = this.value;">
-          <option value = "4">4</option>
-          <option value = "5">5</option>
-          <option value = "8">8</option>
-          <option value = "10" selected = "selected">10</option>
-          <option value = "12">12</option>
-          <option value = "15">15</option>
-          <option value = "16">16</option>
-          <option value = "20">20</option>
-          <option value = "24">24</option>
-          <option value = "25">25</option>
-          <option value = "30">30</option>
-          <option value = "32">32{'ec_gen_code_nb_max'|@translate}</option>
-        </select>
-        {'ec_gen_code_nb_end'|@translate}
-      </td>
-    </tr>
-    
-    {* <!-- User to identify --> *}
-    <tr>
-      <td style = "vertical-align:top;"><strong>{'ec_up_code_lbl_user'|@translate}</strong></td>
-      <td>
-      <li>
-        {* <!-- None --> *}
-        <label onclick = "ec_mark_user('ec_sel_user_none');">
-          <input type = "radio" name = "ec_sel_user" value = "none" id = "ec_sel_user_none"
-           onclick = "ec_mark_user('ec_sel_user_none');"
-          />
-          {'ec_up_code_lbl_user_none'|@translate}
-        </label><br>
-      </li>
-        
-      <li>
-        {* <!-- New user (to create) --> *}
-        <label for = "ec_in_up_usr_txt_id" onclick = "ec_mark_user('ec_sel_user_new');">
-          <input type = "radio" name = "ec_sel_user" for = "ec_in_up_usr_txt_id" value = "new"
-           id = "ec_sel_user_new" onclick = "ec_mark_user('ec_sel_user_new');"
-          />
-          {'ec_up_code_lbl_user_new'|@translate}
-        </label>
-        &nbsp;
-        <input class = "submit" type = "button" name = "ec_submit_gen_user" value = "{'ec_up_code_lbl_gen_user'|@translate}"
-         id = "ec_submit_gen_user_id" onclick = "ec_gen_user();"
-        /><br>
-        <ul><li>
-          <label class = "ec_block">{'ec_new_user_name'|@translate}<br>
-            <input type = "text" name = "ec_in_up_usr_txt" id = "ec_in_up_usr_txt_id" maxlength = "32"
-             size = "20" onclick = "ec_mark_user('ec_sel_user_new');" onblur = "ec_new_user_text = this.value;"
-            />
-          </label>
-          <label class = "ec_block">{'ec_new_user_pswd'|@translate}<br>
-            <input type = "text" name = "ec_in_up_psd_txt" id = "ec_in_up_psd_txt_id" maxlength = "32"
-             size = "20" onclick = "ec_mark_user('ec_sel_user_new');" onblur = "ec_new_psd_text = this.value; ec_check_pwd_text();"
-            />
-          </label>
-          <label class = "ec_block">&nbsp;<br>
-            <span style = "font-weight:bold; color:red;" id = "ec_in_up_pwd_warn">&nbsp;</span>
-          </label>
-          
-        </li></ul><br>
-      </li>
-      
-      <li>
-        {* <!-- Known user --> *}
-        <label for = "ec_in_up_usr_list_id" onclick = "ec_mark_user('ec_sel_user_old');">
-          <input type = "radio" name = "ec_sel_user" for = "ec_in_up_usr_list_id"
-           value = "old" id = "ec_sel_user_old" onclick = "ec_mark_user('ec_sel_user_old');"
-          />
-          {'ec_up_code_lbl_user_old'|@translate}
-        </label>
-        <select name = "ec_in_up_usr_list" id = "ec_in_up_usr_list_id" onclick = "ec_mark_user('ec_sel_user_old');"
-         onchange = "ec_selected_old_user = this.value;"
-        >
-          <option label = "------------" value = "-1" id = "ec_old_user_-1">------------</option>
-          {foreach from=$ec_lists.user_ids key=ec_key item=ec_val name=opt_loop}
-            <option label = "{$ec_val}" value = "{$ec_key}" id = "ec_old_user_{$ec_key}">{$ec_val}</option>
-          {/foreach}
-        </select><br>
-      </li>
-      </td>
-    </tr>
-    
-    {* <!-- Page to display --> *}
-    <tr>
-      <td style = "vertical-align:top;"><strong>{'ec_up_code_lbl_action'|@translate}</strong></td>
-      <td>
-        
-        {* <!-- Additionnal Page, provided the plugin is activated --> *}
-        <label class = "ec_block" for = "ec_in_up_aps_id" onclick = "ec_mark_action('ec_input_action_add_p');"
-         {if !$ec_ap_ok}style = "display:none;"{/if}
-        >
-          <input type = "radio" name = "ec_input_action" value = "add_p" id = "ec_input_action_add_p" for = "ec_in_up_aps_id"
-           onclick = "ec_mark_action('ec_input_action_add_p');"
-          />
-          {'ec_up_code_lbl_aps'|@translate}<br>
-          <select class = "categoryList" name = "ec_in_up_aps" size="30" id = "ec_in_up_aps_id"
-           onclick = "ec_mark_action('ec_input_action_add_p');" onchange = "ec_selected_AP = this.value;"
-          >
-            <option label = "------------" value = "-1" style = "display:none;">------------</option>
-            {html_options options=$ec_lists.add_pages}
-          </select>
-        </label>
-        
-        {* <!-- Category --> *}
-        <label class = "ec_block" for = "ec_in_up_cats_id" onclick = "ec_mark_action('ec_input_action_cat');">
-          <input type = "radio" name = "ec_input_action" value = "cat" id = "ec_input_action_cat" for = "ec_in_up_cats_id"
-           onclick = "ec_mark_action('ec_input_action_cat');"
-          />
-          {'ec_up_code_lbl_cats'|@translate}<br>
-          <select class = "categoryList" name = "ec_in_up_cat" size = "30" id = "ec_in_up_cats_id"
-           onclick = "ec_mark_action('ec_input_action_cat');" onchange = "ec_selected_cat = this.value;"
-          >
-            <option label = "------------" value = "-1" style = "display:none;">------------</option>
-            {html_options options=$ec_lists.categories}
-          </select>
-        </label>
-        
-        {* <!-- Image --> *}
-        <label class = "ec_block" for = "ec_in_up_imgs_id" onclick = "ec_mark_action('ec_input_action_img');">
-          <input type = "radio" name = "ec_input_action" value = "img" id = "ec_input_action_img" for = "ec_in_up_imgs_id"
-           onclick = "ec_mark_action('ec_input_action_img');"
-          />
-          {'ec_up_code_lbl_img'|@translate}<br>
-          <input type = "text" name = "ec_in_up_imgs" id = "ec_in_up_imgs_id" maxlength = "6"
-           size = "10" onblur = "ec_selected_img = this.value; ec_check_img_text();" onfocus = "ec_mark_action('ec_input_action_img');"
-          /><br>
-          <span id = "ec_in_up_imgs_warn">&nbsp;</span>
-        </label>
-        
-        {* <!-- Index page --> *}
-        <label class = "ec_block" onclick = "ec_mark_action('ec_input_action_home');">
-          <input type = "radio" name = "ec_input_action" value = "home" id = "ec_input_action_home"
-           onclick = "ec_mark_action('ec_input_action_home');"
-          />
-          {'ec_up_code_lbl_home'|@translate}
-        </label>
-      </td>
-    </tr>
-  </table>
-  <p>
-    <input class = "submit" type = "submit" name = "ec_submit" value = "{'Submit'|@translate}"/>
-    <input class = "submit" type = "reset" name = "ec_reset" value = "{'Reset'|@translate}" onclick = "ec_init();"/>
-  </p>
-</form>
+/*****************************************************************************
+* $_GET and $_POST analysis.                                                 *
+*****************************************************************************/
 
-{* <!-- JavaScript functions --> *}
-<script type = "text/javascript" src = "{$RACINE_URL}{$EVNTCATS_PATH}admin/evntcats_admin.js"></script>
-<script type = "text/javascript">
-  <!--
-  
-  // ec_test();
-  
-  ec_JS_message['ec_confirm_disable']   = "{'ec_confirm_disable'|@translate|@escape:javascript}";
-  ec_JS_message['ec_confirm_delete']    = "{'ec_confirm_delete'|@translate|@escape:javascript}";
-  ec_JS_message['ec_confirm_test']      = "{'ec_confirm_test'|@translate|@escape:javascript}";
-  ec_JS_message['ec_gen_user_act_miss'] = "{'ec_gen_user_act_miss'|@translate|@escape:javascript}";
-  ec_JS_message['ec_act_cat_miss']      = "{'ec_act_cat_miss'|@translate|@escape:javascript}";
-  ec_JS_message['ec_new_pwd_gen']       = "{'ec_new_pwd_gen'|@translate|@escape:javascript}";
-  ec_JS_message['ec_confirm_force']       = "{'ec_confirm_force'|@translate|@escape:javascript}";
-  ec_JS_message['ec_up_code_lbl_home']  = "{'ec_up_code_lbl_home'|@translate}";
-  
-  ec_init();
-  
-  {literal}
-  
-  function Test() {                                                /*
-    document.getElementById('ec_sel_user_none').checked = '';
-    document.getElementById('ec_sel_user_new').checked = '';
-    document.getElementById('ec_sel_user_old').checked = '';       */
-  }
-  
-  //-->{/literal}
-</script>
+/****************************************************************************/
 
-{* <!-- {$test0tpl} --> *}
-<p>$_GET :</p>
-{$GET}
-<p>$_POST :</p>
-{$POST}
-<p>Autres :</p>
-{$test1tpl}
-{$test2tpl}
-{$test3tpl}
+$template->assign('ec_ap_ok',$ec_ap_ok);
+$template->assign('code_list',$code_list);
 
-{* <!--
---> *}
-
+?>
Index: tensions/event_cats/admin/evntcats_admin.js
===================================================================
--- /extensions/event_cats/admin/evntcats_admin.js	(revision 4001)
+++ 	(revision )
@@ -1,322 +1,0 @@
-/* Event Cats Javascript functions LucMorizur June - ... 2009 */
-
-var ec_avoid_infinite_loop      = true;
-var ec_checked_line             = 0;
-var ec_err                      = '';
-var ec_selected_action          = '';
-var ec_selected_img             = '';
-var ec_new_code_text            = '';
-var ec_new_user_text            = '';
-var ec_new_psd_text             = '';
-var ec_old_new_psd_text         = '';
-var ec_test_reg                 = '';
-var ec_selected_old_user        = '-1';
-var ec_selected_AP              = '-1';
-var ec_selected_cat             = '-1';
-var ec_selected_user            = 'ec_sel_user_old';
-var ec_JS_message               = new Array();
-var ec_auto_code_digits_default =
- document.getElementById('ec_in_up_auto_code_length_id').value;
-var ec_auto_code_digits_nb      = ec_auto_code_digits_default;
-
-function ec_mark_line(ec_id) {
-  ec_checked_line = ec_id;
-  if (ec_checked_line == 0) {
-    document.getElementById('selection--1').checked = 'checked';
-    document.getElementById('selection--1').checked = '';
-    document.getElementById('ec_show_URL').value = '';
-  }
-  else {
-    document.getElementById("selection-" + ec_checked_line).checked =
-     'checked';
-    document.getElementById('ec_show_URL').value =
-     (ec_checked_line < 0) ? '' :
-     document.getElementById('ec_table_URL_' + ec_checked_line).href;
-  }
-  if (ec_checked_line >= 0) {
-    document.getElementById('ec_sel_user_none').checked = 'checked';
-    document.getElementById('ec_input_action_home').checked = 'checked';
-    document.getElementById('ec_in_up_usr_txt_id').value = '';
-    document.getElementById('ec_in_up_psd_txt_id').value = '';
-    document.getElementById('ec_in_up_usr_list_id').value = '-1';
-    document.getElementById('ec_in_up_code_id').value = '';
-    document.getElementById('ec_in_up_aps_id').value = '-1';
-    document.getElementById('ec_in_up_cats_id').value = '-1';
-    document.getElementById('ec_in_up_imgs_id').value = '';
-    document.getElementById('ec_sel_user_none').checked = '';
-    document.getElementById('ec_input_action_home').checked = '';
-  }
-  else {
-    document.getElementById('ec_in_up_code_id').value = ec_new_code_text;
-    ec_avoid_infinite_loop = true;
-    ec_mark_user(ec_selected_user);
-  }
-}
-
-function ec_mark_user(ec_id) {
-  ec_selected_user = ec_id;
-  document.getElementById(ec_selected_user).checked = 'checked';
-  switch (ec_selected_user) {
-    case 'ec_sel_user_none': // None
-      ec_selected_action =
-       (ec_ap_ok && (ec_selected_action != 'ec_input_action_home')) ?
-       'ec_input_action_add_p' : 'ec_input_action_home';
-      document.getElementById('ec_in_up_usr_txt_id').value = '';
-      document.getElementById('ec_in_up_psd_txt_id').value = '';
-      document.getElementById('ec_in_up_usr_list_id').value = '-1';
-    break;
-    case 'ec_sel_user_new': // New user
-      document.getElementById('ec_in_up_usr_txt_id').value =
-       ec_new_user_text;
-      document.getElementById('ec_in_up_psd_txt_id').value =
-       ec_new_psd_text;
-      document.getElementById('ec_in_up_usr_list_id').value = '-1';
-    break;
-    case 'ec_sel_user_old': // "Old" user
-      document.getElementById('ec_in_up_usr_txt_id').value = '';
-      document.getElementById('ec_in_up_psd_txt_id').value = '';
-      document.getElementById('ec_in_up_usr_list_id').value =
-       ec_selected_old_user;
-    break;
-  }
-  ec_check_pwd_text();
-  if (ec_avoid_infinite_loop) {
-    ec_avoid_infinite_loop = false;
-    ec_mark_action(ec_selected_action);
-    ec_avoid_infinite_loop = true;
-  }
-}
-
-function ec_mark_action(ec_id) {
-  ec_selected_action = ec_id;
-  if (ec_selected_action != '') {
-    document.getElementById(ec_selected_action).checked = 'checked';
-    switch (ec_selected_action) {
-      case 'ec_input_action_add_p': // Additional Page
-        document.getElementById('ec_in_up_aps_id').value = ec_selected_AP;
-        document.getElementById('ec_in_up_cats_id').value = '-1';
-        document.getElementById('ec_in_up_imgs_id').value = '';
-        document.getElementById('ec_in_up_imgs_warn').innerHTML = '';
-      break;
-      case 'ec_input_action_cat': // Category
-        document.getElementById('ec_in_up_aps_id').value = '-1';
-        document.getElementById('ec_in_up_cats_id').value = ec_selected_cat;
-        document.getElementById('ec_in_up_imgs_id').value = '';
-        ec_selected_user = (ec_selected_user == 'ec_sel_user_none') ?
-         'ec_sel_user_old' : ec_selected_user;
-        document.getElementById('ec_in_up_imgs_warn').innerHTML = '';
-      break;
-      case 'ec_input_action_img': // Image
-        document.getElementById('ec_in_up_aps_id').value = '-1';
-        document.getElementById('ec_in_up_cats_id').value = ec_selected_cat;
-        document.getElementById('ec_in_up_imgs_id').value = ec_selected_img;
-        ec_selected_user = (ec_selected_user == 'ec_sel_user_none') ?
-         'ec_sel_user_old' : ec_selected_user;
-        ec_check_img_text();
-      break;
-      case 'ec_input_action_home': // Home
-        document.getElementById('ec_in_up_aps_id').value = '-1';
-        document.getElementById('ec_in_up_cats_id').value = '-1';
-        document.getElementById('ec_in_up_imgs_id').value = '';
-        document.getElementById('ec_in_up_imgs_warn').innerHTML = '';
-      break;
-    }
-    if (ec_avoid_infinite_loop) {
-      ec_avoid_infinite_loop = false;
-      ec_mark_user(ec_selected_user);
-      ec_avoid_infinite_loop = true;
-    }
-  }
-}
-
-function ec_rnd(ec_min, ec_max) {
-  return Math.floor(ec_min + (ec_max - ec_min + 1) * Math.random() );
-}
-
-function ec_gen_txt(ec_length) {
-  var t = '';
-  var ec_reg_A = /[A-Z]+/;
-  var ec_reg_a = /[a-z]+/;
-  var ec_reg_0 = /[0-9]+/;
-  var i = 0;
-  var ec_l = 0;
-  ec_l = parseInt(ec_length);
-  if (ec_l < 3) {
-    ec_err = '< 3';
-    return '';
-  }
-  do {
-    i++;
-    switch (ec_rnd(0, 2)) {
-      case 0: // A - Z
-        t += String.fromCharCode(ec_rnd(65, 90));
-      break;
-      case 1: // a - z
-        t += String.fromCharCode(ec_rnd(97, 122));
-      break;
-      case 2: // 0 - 9
-        t += String.fromCharCode(ec_rnd(48, 57));
-      break;
-    }
-    if (i > 500) {
-      break;
-    }
-    if ((t.length) > (ec_l)) {
-      t = t.substr(1, ec_l);
-    }
-  } while (
-   (t.length < ec_l) ||
-   !( ec_reg_A.test(t) && ec_reg_a.test(t) && ec_reg_0.test(t) )
-  );
-  if (i > 500) {
-    ec_err = '> 500\n' + t;
-    return '';
-  }
-  else {
-    return t;
-  }
-}
-
-function ec_gen_code() {
-  var t = '';
-  t = ec_gen_txt(ec_auto_code_digits_nb);
-  if (t == '') {
-    alert("Failed :\n" + ec_err);
-    ec_new_code_text = 'Failed...';
-  }
-  else {
-    ec_new_code_text = t;
-  }
-  ec_mark_line(-1);
-}
-
-function ec_gen_user() {
-  var t           = '';
-  var ec_word     = '';
-  var ec_cat_sel  = '';
-  var ec_reg_cat2 = /\//;
-  var ec_reg_ap   = /^\S+/;
-  var ec_reg_cat1 = /\/\s(.+)$/;
-  if (
-   ec_selected_action == '' ||
-   (ec_selected_action == 'ec_input_action_cat' && ec_selected_cat == '-1') ||
-   (ec_selected_action == 'ec_input_action_img' &&
-    (ec_selected_img == '' || ec_selected_cat == '-1')) ||
-   (ec_selected_action == 'ec_input_action_add_p' && ec_selected_AP == '-1')
-  ) {
-    alert(ec_JS_message['ec_gen_user_act_miss']);
-    return false;
-  }
-  else {
-    t = ec_gen_txt('8');
-    if (t == '') {
-      alert("Failed :\n" + ec_err);
-      ec_new_psd_text = 'Failed...';
-      return false;
-    }
-    else {
-      ec_new_psd_text = t;
-      ec_old_new_psd_text = ec_new_psd_text;
-    }
-    switch (ec_selected_action) {
-      case 'ec_input_action_add_p': // Additional Page
-        ec_new_user_text = ec_reg_ap.exec(
-         document.ec_up_code.ec_in_up_aps.options[
-          document.ec_up_code.ec_in_up_aps.selectedIndex
-         ].label
-        );
-      break;
-      case 'ec_input_action_cat': // Category
-      case 'ec_input_action_img': // Image
-        ec_cat_sel = document.ec_up_code.ec_in_up_cat.options[
-          document.ec_up_code.ec_in_up_cat.selectedIndex
-         ].label;
-        ec_new_user_text = (ec_reg_cat2.test(ec_cat_sel)) ?
-         ec_reg_cat1.exec(ec_cat_sel)[1] : ec_cat_sel;
-      if (ec_selected_action == 'ec_input_action_img') {
-        ec_new_user_text +=  '_' + document.ec_up_code.ec_in_up_imgs_id.value;
-      }
-      break;
-      case 'ec_input_action_home': // Home
-        t = ec_gen_txt('3');
-        if (t == '') {
-          alert("Failed :\n" + ec_err);
-          ec_new_psd_text = 'Failed...';
-          return false;
-        }
-        ec_new_user_text = ec_JS_message['ec_up_code_lbl_home'] + '_' + t;
-      break;
-    }
-    ec_mark_user('ec_sel_user_new');
-    return true;
-  }
-}
-
-function ec_gen_full_auto() {
-  if (ec_gen_user()) ec_gen_code();
-}
-
-function ec_check_img_text() {
-  document.getElementById('ec_in_up_imgs_warn').innerHTML = (
-   document.getElementById('ec_in_up_imgs_id').value != '' &&
-   document.getElementById('ec_in_up_cats_id').value == '-1'
-  ) ? ec_JS_message['ec_act_cat_miss'] : '';
-}
-
-function ec_check_pwd_text() {
-  document.getElementById('ec_in_up_pwd_warn').innerHTML = (
-   document.getElementById('ec_in_up_psd_txt_id').value == ec_old_new_psd_text
-   && ec_old_new_psd_text != ''
-   && ec_selected_user == 'ec_sel_user_new'
-  ) ? ec_JS_message['ec_new_pwd_gen'] : '';
-}
-
-function ec_check_d(ec_id, ec_act) {
-  ec_mark_line(ec_id);
-  if (confirm(ec_JS_message['ec_confirm_' + ec_act])) {
-    document.getElementById('ec_act1_id').value = ec_act;
-    document.forms['ec_up_code'].submit();
-  }
-}
-
-function ec_toggle_forced(ec_id, ec_ask) {
-  var t = true;
-  ec_mark_line(ec_id);
-  if (ec_ask) t = confirm(ec_JS_message['ec_confirm_force']);
-  if (t) {
-    document.getElementById('ec_act1_id').value = 'toggle_forced';
-    document.forms['ec_up_code'].submit();
-  }
-}
-
-function ec_duplicate_entry(ec_id) {
-  ec_mark_line(-1);
-}
-
-function ec_check_tst(ec_id) {
-  ec_mark_line(ec_id);
-  return confirm(ec_JS_message['ec_confirm_test']);  
-}
-
-function ec_test() {
-  alert('OK.');
-}
-
-function ec_init() {
-  ec_err = '';
-  ec_checked_line = 0;
-  ec_selected_user = 'ec_sel_user_old';
-  ec_selected_old_user = '-1';
-  ec_selected_AP = '-1';
-  ec_selected_cat = '-1';
-  ec_selected_action = '';
-  ec_selected_img = '';
-  ec_new_code_text = '';
-  ec_new_user_text = '';
-  ec_new_psd_text = '';
-  ec_old_new_psd_text = '';
-  ec_test_reg = '';
-  document.getElementById('ec_act1_id').value = '';
-  document.getElementById('ec_in_up_pwd_warn').innerHTML = '';
-  ec_mark_line(0);
-}
Index: /extensions/event_cats/admin/evntcats_admin.php
===================================================================
--- /extensions/event_cats/admin/evntcats_admin.php	(revision 4001)
+++ /extensions/event_cats/admin/evntcats_admin.php	(revision 4002)
@@ -71,8 +71,8 @@
 // |                            Tabsheet
 // +-----------------------------------------------------------------------+
-$page['tab'] = (!mysql_fetch_row(pwg_query('
+$page['tab'] = (!($ec_exist_entries = (mysql_fetch_row(pwg_query('
   SELECT * FROM `'.EVNTCATS_TABLE.'`
   WHERE `code` IS NOT NULL
-'))) ? 'autolog_new' : 'autolog_entries';
+'))))) ? 'autolog_new' : 'autolog_entries';
 if (isset($_POST['ec_act1']) and
  ($_POST['ec_act1'] == 'autolog_new' or $_POST['ec_act1'] == 'duplicate_entry'))
@@ -86,5 +86,5 @@
 
 $tabsheet = new tabsheet();
-$tabsheet->add('autolog_entries',
+if ($ec_exist_entries) $tabsheet->add('autolog_entries',
                l10n('ec_tab_autoid_entries'),
                $my_base_url.'&amp;tab=autolog_entries');
@@ -129,7 +129,7 @@
 $template->assign('test1tpl',str_from_var($ec_lists));
 $template->assign('test2tpl',str_from_var($page['errors']));
-$template->assign('test3tpl',str_from_var($code_list));
+if (isset($code_list)) $template->assign('test3tpl',str_from_var($code_list));
 
-$template->set_filenames(array('evntcats_admin_content' => dirname(__FILE__).'template/'.$page['tab'].'.tpl'));
+$template->set_filenames(array('evntcats_admin_content' => dirname(__FILE__).'/template/'.$page['tab'].'.tpl'));
 $template->assign_var_from_handle('ADMIN_CONTENT','evntcats_admin_content');
 ?>
Index: /extensions/event_cats/admin/template/autolog_entries.js
===================================================================
--- /extensions/event_cats/admin/template/autolog_entries.js	(revision 4002)
+++ /extensions/event_cats/admin/template/autolog_entries.js	(revision 4002)
@@ -0,0 +1,56 @@
+/* Event Cats Javascript functions LucMorizur June - ... 2009 */
+
+var ec_checked_line = 0;
+var ec_JS_message   = new Array();
+
+function ec_mark_line(ec_id) {
+  ec_checked_line = ec_id;
+  if (ec_checked_line == 0) {
+    document.getElementById('selection--1').checked = 'checked';
+    document.getElementById('selection--1').checked = '';
+    document.getElementById('ec_show_URL').value = '';
+  }
+  else {
+    document.getElementById("selection-" + ec_checked_line).checked =
+     'checked';
+    document.getElementById('ec_show_URL').value =
+     (ec_checked_line < 0) ? '' :
+     document.getElementById('ec_table_URL_' + ec_checked_line).href;
+  }
+}
+
+function ec_check_d(ec_id, ec_act) {
+  ec_mark_line(ec_id);
+  if (confirm(ec_JS_message['ec_confirm_' + ec_act])) {
+    document.getElementById('ec_act1_id').value = ec_act;
+    document.forms['ec_view_codes'].submit();
+  }
+}
+
+function ec_toggle_forced(ec_id, ec_ask) {
+  var t = true;
+  ec_mark_line(ec_id);
+  if (ec_ask) t = confirm(ec_JS_message['ec_confirm_force']);
+  if (t) {
+    document.getElementById('ec_act1_id').value = 'toggle_forced';
+    document.forms['ec_view_codes'].submit();
+  }
+}
+
+function ec_duplicate_entry(ec_id) {
+}
+
+function ec_check_tst(ec_id) {
+  ec_mark_line(ec_id);
+  return confirm(ec_JS_message['ec_confirm_test']);  
+}
+
+function ec_test() {
+  alert('OK.');
+}
+
+function ec_init() {
+  ec_checked_line = 0;
+  document.getElementById('ec_act1_id').value = '';
+  ec_mark_line(0);
+}
Index: /extensions/event_cats/admin/template/autolog_entries.tpl
===================================================================
--- /extensions/event_cats/admin/template/autolog_entries.tpl	(revision 4001)
+++ /extensions/event_cats/admin/template/autolog_entries.tpl	(revision 4002)
@@ -40,7 +40,8 @@
 </div>
 
-{* <!-- First section : form to view and modify codes, or create a new one --> *}
-<form class = "filter" method = "post" name = "ec_up_code" action = "">
+{* <!-- Form to view codes --> *}
+<form class = "filter" method = "post" name = "ec_view_codes" action = "">
   <input type = "hidden" id = "ec_act1_id" name = "ec_act1" />
+  <input type = "radio" name = "ec_entry_sel" value = "-1" id = "selection--1" style = "display:none;"/>
   
   <div style = "text-align:center; font-weight:bold; font-size:120%;">{'ec_entry_table_title'|@translate}</div><br>
@@ -128,31 +129,12 @@
 
 {* <!-- JavaScript functions --> *}
-<script type = "text/javascript" src = "{$RACINE_URL}{$EVNTCATS_PATH}admin/evntcats_admin.js"></script>
-<script type = "text/javascript">
-  <!--
-  
-  // ec_test();
-  
+<script type = "text/javascript" src = "{$RACINE_URL}{$EVNTCATS_PATH}admin/template/autolog_entries.js"></script>
+<script type = "text/javascript"><!--
   ec_JS_message['ec_confirm_disable']   = "{'ec_confirm_disable'|@translate|@escape:javascript}";
   ec_JS_message['ec_confirm_delete']    = "{'ec_confirm_delete'|@translate|@escape:javascript}";
   ec_JS_message['ec_confirm_test']      = "{'ec_confirm_test'|@translate|@escape:javascript}";
-  ec_JS_message['ec_gen_user_act_miss'] = "{'ec_gen_user_act_miss'|@translate|@escape:javascript}";
-  ec_JS_message['ec_act_cat_miss']      = "{'ec_act_cat_miss'|@translate|@escape:javascript}";
-  ec_JS_message['ec_new_pwd_gen']       = "{'ec_new_pwd_gen'|@translate|@escape:javascript}";
-  ec_JS_message['ec_confirm_force']       = "{'ec_confirm_force'|@translate|@escape:javascript}";
-  ec_JS_message['ec_up_code_lbl_home']  = "{'ec_up_code_lbl_home'|@translate}";
-  
+  ec_JS_message['ec_confirm_force']     = "{'ec_confirm_force'|@translate|@escape:javascript}";
   ec_init();
-  
-  {literal}
-  
-  function Test() {                                                /*
-    document.getElementById('ec_sel_user_none').checked = '';
-    document.getElementById('ec_sel_user_new').checked = '';
-    document.getElementById('ec_sel_user_old').checked = '';       */
-  }
-  
-  //-->{/literal}
-</script>
+//--></script>
 
 {* <!-- {$test0tpl} --> *}
Index: /extensions/event_cats/admin/template/autolog_new.js
===================================================================
--- /extensions/event_cats/admin/template/autolog_new.js	(revision 4002)
+++ /extensions/event_cats/admin/template/autolog_new.js	(revision 4002)
@@ -0,0 +1,269 @@
+/* Event Cats Javascript functions LucMorizur June - ... 2009 */
+
+var ec_avoid_infinite_loop      = true;
+var ec_err                      = '';
+var ec_selected_action          = '';
+var ec_selected_img             = '';
+var ec_new_code_text            = '';
+var ec_new_user_text            = '';
+var ec_new_psd_text             = '';
+var ec_old_new_psd_text         = '';
+var ec_test_reg                 = '';
+var ec_selected_old_user        = '-1';
+var ec_selected_AP              = '-1';
+var ec_selected_cat             = '-1';
+var ec_selected_user            = 'ec_sel_user_old';
+var ec_JS_message               = new Array();
+var ec_auto_code_digits_default =
+ document.getElementById('ec_in_up_auto_code_length_id').value;
+var ec_auto_code_digits_nb      = ec_auto_code_digits_default;
+
+function ec_mark_user(ec_id) {
+  ec_selected_user = ec_id;
+  document.getElementById(ec_selected_user).checked = 'checked';
+  switch (ec_selected_user) {
+    case 'ec_sel_user_none': // None
+      ec_selected_action =
+       (ec_ap_ok && (ec_selected_action != 'ec_input_action_home')) ?
+       'ec_input_action_add_p' : 'ec_input_action_home';
+      document.getElementById('ec_in_up_usr_txt_id').value = '';
+      document.getElementById('ec_in_up_psd_txt_id').value = '';
+      document.getElementById('ec_in_up_usr_list_id').value = '-1';
+    break;
+    case 'ec_sel_user_new': // New user
+      document.getElementById('ec_in_up_usr_txt_id').value =
+       ec_new_user_text;
+      document.getElementById('ec_in_up_psd_txt_id').value =
+       ec_new_psd_text;
+      document.getElementById('ec_in_up_usr_list_id').value = '-1';
+    break;
+    case 'ec_sel_user_old': // "Old" user
+      document.getElementById('ec_in_up_usr_txt_id').value = '';
+      document.getElementById('ec_in_up_psd_txt_id').value = '';
+      document.getElementById('ec_in_up_usr_list_id').value =
+       ec_selected_old_user;
+    break;
+  }
+  ec_check_pwd_text();
+  if (ec_avoid_infinite_loop) {
+    ec_avoid_infinite_loop = false;
+    ec_mark_action(ec_selected_action);
+    ec_avoid_infinite_loop = true;
+  }
+}
+
+function ec_mark_action(ec_id) {
+  ec_selected_action = ec_id;
+  if (ec_selected_action != '') {
+    document.getElementById(ec_selected_action).checked = 'checked';
+    switch (ec_selected_action) {
+      case 'ec_input_action_add_p': // Additional Page
+        document.getElementById('ec_in_up_aps_id').value = ec_selected_AP;
+        document.getElementById('ec_in_up_cats_id').value = '-1';
+        document.getElementById('ec_in_up_imgs_id').value = '';
+        document.getElementById('ec_in_up_imgs_warn').innerHTML = '';
+      break;
+      case 'ec_input_action_cat': // Category
+        document.getElementById('ec_in_up_aps_id').value = '-1';
+        document.getElementById('ec_in_up_cats_id').value = ec_selected_cat;
+        document.getElementById('ec_in_up_imgs_id').value = '';
+        ec_selected_user = (ec_selected_user == 'ec_sel_user_none') ?
+         'ec_sel_user_old' : ec_selected_user;
+        document.getElementById('ec_in_up_imgs_warn').innerHTML = '';
+      break;
+      case 'ec_input_action_img': // Image
+        document.getElementById('ec_in_up_aps_id').value = '-1';
+        document.getElementById('ec_in_up_cats_id').value = ec_selected_cat;
+        document.getElementById('ec_in_up_imgs_id').value = ec_selected_img;
+        ec_selected_user = (ec_selected_user == 'ec_sel_user_none') ?
+         'ec_sel_user_old' : ec_selected_user;
+        ec_check_img_text();
+      break;
+      case 'ec_input_action_home': // Home
+        document.getElementById('ec_in_up_aps_id').value = '-1';
+        document.getElementById('ec_in_up_cats_id').value = '-1';
+        document.getElementById('ec_in_up_imgs_id').value = '';
+        document.getElementById('ec_in_up_imgs_warn').innerHTML = '';
+      break;
+    }
+    if (ec_avoid_infinite_loop) {
+      ec_avoid_infinite_loop = false;
+      ec_mark_user(ec_selected_user);
+      ec_avoid_infinite_loop = true;
+    }
+  }
+}
+
+function ec_rnd(ec_min, ec_max) {
+  return Math.floor(ec_min + (ec_max - ec_min + 1) * Math.random() );
+}
+
+function ec_gen_txt(ec_length) {
+  var t = '';
+  var ec_reg_A = /[A-Z]+/;
+  var ec_reg_a = /[a-z]+/;
+  var ec_reg_0 = /[0-9]+/;
+  var i = 0;
+  var ec_l = 0;
+  ec_l = parseInt(ec_length);
+  if (ec_l < 3) {
+    ec_err = '< 3';
+    return '';
+  }
+  do {
+    i++;
+    switch (ec_rnd(0, 2)) {
+      case 0: // A - Z
+        t += String.fromCharCode(ec_rnd(65, 90));
+      break;
+      case 1: // a - z
+        t += String.fromCharCode(ec_rnd(97, 122));
+      break;
+      case 2: // 0 - 9
+        t += String.fromCharCode(ec_rnd(48, 57));
+      break;
+    }
+    if (i > 500) {
+      break;
+    }
+    if ((t.length) > (ec_l)) {
+      t = t.substr(1, ec_l);
+    }
+  } while (
+   (t.length < ec_l) ||
+   !( ec_reg_A.test(t) && ec_reg_a.test(t) && ec_reg_0.test(t) )
+  );
+  if (i > 500) {
+    ec_err = '> 500\n' + t;
+    return '';
+  }
+  else {
+    return t;
+  }
+}
+
+function ec_gen_code() {
+  var t = '';
+  t = ec_gen_txt(ec_auto_code_digits_nb);
+  if (t == '') {
+    alert("Failed :\n" + ec_err);
+    ec_new_code_text = 'Failed...';
+  }
+  else {
+    ec_new_code_text = t;
+  }
+  document.getElementById('ec_in_up_code_id').value = ec_new_code_text;
+}
+
+function ec_gen_user() {
+  var t           = '';
+  var ec_word     = '';
+  var ec_cat_sel  = '';
+  var ec_reg_cat2 = /\//;
+  var ec_reg_ap   = /^\S+/;
+  var ec_reg_cat1 = /\/\s(.+)$/;
+  if (
+   ec_selected_action == '' ||
+   (ec_selected_action == 'ec_input_action_cat' && ec_selected_cat == '-1') ||
+   (ec_selected_action == 'ec_input_action_img' &&
+    (ec_selected_img == '' || ec_selected_cat == '-1')) ||
+   (ec_selected_action == 'ec_input_action_add_p' && ec_selected_AP == '-1')
+  ) {
+    alert(ec_JS_message['ec_gen_user_act_miss']);
+    return false;
+  }
+  else {
+    t = ec_gen_txt('8');
+    if (t == '') {
+      alert("Failed :\n" + ec_err);
+      ec_new_psd_text = 'Failed...';
+      return false;
+    }
+    else {
+      ec_new_psd_text = t;
+      ec_old_new_psd_text = ec_new_psd_text;
+    }
+    switch (ec_selected_action) {
+      case 'ec_input_action_add_p': // Additional Page
+        ec_new_user_text = ec_reg_ap.exec(
+         document.ec_new_code.ec_in_up_aps.options[
+          document.ec_new_code.ec_in_up_aps.selectedIndex
+         ].label
+        );
+      break;
+      case 'ec_input_action_cat': // Category
+      case 'ec_input_action_img': // Image
+        ec_cat_sel = document.ec_new_code.ec_in_up_cat.options[
+          document.ec_new_code.ec_in_up_cat.selectedIndex
+         ].label;
+        ec_new_user_text = (ec_reg_cat2.test(ec_cat_sel)) ?
+         ec_reg_cat1.exec(ec_cat_sel)[1] : ec_cat_sel;
+      if (ec_selected_action == 'ec_input_action_img') {
+        ec_new_user_text +=  '_' + document.ec_new_code.ec_in_up_imgs_id.value;
+      }
+      break;
+      case 'ec_input_action_home': // Home
+        t = ec_gen_txt('3');
+        if (t == '') {
+          alert("Failed :\n" + ec_err);
+          ec_new_psd_text = 'Failed...';
+          return false;
+        }
+        ec_new_user_text = ec_JS_message['ec_up_code_lbl_home'] + '_' + t;
+      break;
+    }
+    ec_mark_user('ec_sel_user_new');
+    return true;
+  }
+}
+
+function ec_gen_full_auto() {
+  if (ec_gen_user()) ec_gen_code();
+}
+
+function ec_check_img_text() {
+  document.getElementById('ec_in_up_imgs_warn').innerHTML = (
+   document.getElementById('ec_in_up_imgs_id').value != '' &&
+   document.getElementById('ec_in_up_cats_id').value == '-1'
+  ) ? ec_JS_message['ec_act_cat_miss'] : '';
+}
+
+function ec_check_pwd_text() {
+  document.getElementById('ec_in_up_pwd_warn').innerHTML = (
+   document.getElementById('ec_in_up_psd_txt_id').value == ec_old_new_psd_text
+   && ec_old_new_psd_text != ''
+   && ec_selected_user == 'ec_sel_user_new'
+  ) ? ec_JS_message['ec_new_pwd_gen'] : '';
+}
+
+function ec_test() {
+  alert('OK.');
+}
+
+function ec_init() {
+  ec_err = '';
+  ec_selected_user = 'ec_sel_user_old';
+  ec_selected_old_user = '-1';
+  ec_selected_AP = '-1';
+  ec_selected_cat = '-1';
+  ec_selected_action = '';
+  ec_selected_img = '';
+  ec_new_code_text = '';
+  ec_new_user_text = '';
+  ec_new_psd_text = '';
+  ec_old_new_psd_text = '';
+  ec_test_reg = '';
+  document.getElementById('ec_act1_id').value = '';
+  document.getElementById('ec_in_up_pwd_warn').innerHTML = '';
+  document.getElementById('ec_sel_user_none').checked = 'checked';
+  document.getElementById('ec_sel_user_none').checked = '';
+  document.getElementById('ec_input_action_home').checked = 'checked';
+  document.getElementById('ec_input_action_home').checked = '';
+  document.getElementById('ec_in_up_usr_txt_id').value = '';
+  document.getElementById('ec_in_up_psd_txt_id').value = '';
+  document.getElementById('ec_in_up_usr_list_id').value = '-1';
+  document.getElementById('ec_in_up_code_id').value = '';
+  document.getElementById('ec_in_up_aps_id').value = '-1';
+  document.getElementById('ec_in_up_cats_id').value = '-1';
+  document.getElementById('ec_in_up_imgs_id').value = '';
+}
Index: /extensions/event_cats/admin/template/autolog_new.tpl
===================================================================
--- /extensions/event_cats/admin/template/autolog_new.tpl	(revision 4001)
+++ /extensions/event_cats/admin/template/autolog_new.tpl	(revision 4002)
@@ -41,29 +41,36 @@
 
 {* <!-- Parameters list --> *}
-<form class = "filter" method = "post" name = "ec_up_code" action = "">
+<form class = "filter" method = "post" name = "ec_new_code" action = "">
+  <input type = "hidden" id = "ec_act1_id" name = "ec_act1" />
+  
+  <div style = "text-align:center;">
+    <span style = "font-weight:bold; font-size:120%;">{'ec_new_entry_table_title'|@translate}</span><br>
+    <br>
+    <input class = "submit" type = "button" name = "ec_submit_gen_full_auto" value = "{'ec_new_full_auto'|@translate}"
+     id = "ec_submit_gen_full_auto_id" onclick = "ec_gen_full_auto();" style = "margin-top:0;"/>
+  </div>
   
   <table style="border-spacing:30px" width = "97%">
     
     {* <!-- New entry --> *}
-    <tr>
-      <td>
-        <label for = "selection--1" onclick = "ec_mark_line(-1);">
-          <input type = "radio" name = "ec_entry_sel" value = "-1" id = "selection--1" onclick = "ec_mark_line(-1);" />
+    {* <!--
+    <tr>
+      <td>
+        <label for = "selection--1">
+          <input type = "radio" name = "ec_entry_sel" value = "-1" id = "selection--1" />
           <span style = "font-weight:bold; font-style:italic; font-size:120%; text-decoration:underline;">{'ec_create_modify_code'|@translate}</span>
         </label>
       </td>
       <td>
-        <input class = "submit" type = "button" name = "ec_submit_gen_full_auto" value = "{'ec_new_full_auto'|@translate}"
-         id = "ec_submit_gen_full_auto_id" onclick = "ec_gen_full_auto();" style = "margin-top:0;"
-        /><br>
-      </td>
-    </tr>
+      </td>
+    </tr>
+    --> *}
     
     {* <!-- Code selection --> *}
     <tr>
-      <td><strong><span onclick = "Test();">{'ec_new_entry'|@translate}</span></strong></td>
+      <td><strong>{'ec_new_entry'|@translate}</strong></td>
       <td>
         <input type = "text" name = "ec_in_up_code" maxlength = "32" size = "40"
-         id = "ec_in_up_code_id" onclick = "ec_mark_line(-1);" onblur = "ec_new_code_text = this.value;"
+         id = "ec_in_up_code_id" onblur = "ec_new_code_text = this.value;"
         />
         &nbsp;
@@ -220,31 +227,12 @@
 
 {* <!-- JavaScript functions --> *}
-<script type = "text/javascript" src = "{$RACINE_URL}{$EVNTCATS_PATH}admin/evntcats_admin.js"></script>
-<script type = "text/javascript">
-  <!--
-  
-  // ec_test();
-  
-  ec_JS_message['ec_confirm_disable']   = "{'ec_confirm_disable'|@translate|@escape:javascript}";
-  ec_JS_message['ec_confirm_delete']    = "{'ec_confirm_delete'|@translate|@escape:javascript}";
-  ec_JS_message['ec_confirm_test']      = "{'ec_confirm_test'|@translate|@escape:javascript}";
+<script type = "text/javascript" src = "{$RACINE_URL}{$EVNTCATS_PATH}admin/template/autolog_new.js"></script>
+<script type = "text/javascript"><!--
   ec_JS_message['ec_gen_user_act_miss'] = "{'ec_gen_user_act_miss'|@translate|@escape:javascript}";
   ec_JS_message['ec_act_cat_miss']      = "{'ec_act_cat_miss'|@translate|@escape:javascript}";
   ec_JS_message['ec_new_pwd_gen']       = "{'ec_new_pwd_gen'|@translate|@escape:javascript}";
-  ec_JS_message['ec_confirm_force']       = "{'ec_confirm_force'|@translate|@escape:javascript}";
   ec_JS_message['ec_up_code_lbl_home']  = "{'ec_up_code_lbl_home'|@translate}";
-  
   ec_init();
-  
-  {literal}
-  
-  function Test() {                                                /*
-    document.getElementById('ec_sel_user_none').checked = '';
-    document.getElementById('ec_sel_user_new').checked = '';
-    document.getElementById('ec_sel_user_old').checked = '';       */
-  }
-  
-  //-->{/literal}
-</script>
+//--></script>
 
 {* <!-- {$test0tpl} --> *}
Index: /extensions/event_cats/admin/template/config.tpl
===================================================================
--- /extensions/event_cats/admin/template/config.tpl	(revision 4001)
+++ /extensions/event_cats/admin/template/config.tpl	(revision 4002)
@@ -0,0 +1,54 @@
+{* <!-- Event Cats (event categories) LucMorizur June - ... 2009 --> *}
+
+{* <!-- Page title --> *}
+<div class = "titrePage" style="margin-top: -20px;">
+  <h2>{'ec_admin_page_title'|@translate} {$EVNTCATS_VERSION}</h2>
+</div>
+
+{* <!-- JavaScript warning message --> *}
+<div id = "ec_js_warn">
+  {'ec_javascript_needed'|@translate}<br><br>
+</div>
+<script type = "text/javascript"><!-- // Removes JavaScript warning message
+  document.getElementById('ec_js_warn').innerHTML = ''; //-->
+</script>
+
+{* <!-- EC Presentation --> *}
+{if $ec_howto}
+  <div>
+    {'ec_admin_page_howto'|@translate}
+  </div>
+{/if}
+
+<p>
+  <hr width = 75% size = 3 />
+</p>
+
+{* <!-- Available soon... --> *}
+
+<p>Bientôt disponible :-] !</p>
+
+{* <!-- JavaScript functions --> *}
+{* <!--
+<script type = "text/javascript" src = "{$RACINE_URL}{$EVNTCATS_PATH}admin/template/autolog_new.js"></script>
+<script type = "text/javascript"><!--
+  ec_JS_message['ec_gen_user_act_miss'] = "{'ec_gen_user_act_miss'|@translate|@escape:javascript}";
+  ec_JS_message['ec_act_cat_miss']      = "{'ec_act_cat_miss'|@translate|@escape:javascript}";
+  ec_JS_message['ec_new_pwd_gen']       = "{'ec_new_pwd_gen'|@translate|@escape:javascript}";
+  ec_JS_message['ec_up_code_lbl_home']  = "{'ec_up_code_lbl_home'|@translate}";
+  ec_init();
+//--></script>
+--> *}
+
+{* <!-- {$test0tpl} --> *}
+<p>$_GET :</p>
+{$GET}
+<p>$_POST :</p>
+{$POST}
+<p>Autres :</p>
+{$test1tpl}
+{$test2tpl}
+{$test3tpl}
+
+{* <!--
+--> *}
Index: /extensions/event_cats/admin/template/duplication.tpl
===================================================================
--- /extensions/event_cats/admin/template/duplication.tpl	(revision 4001)
+++ /extensions/event_cats/admin/template/duplication.tpl	(revision 4002)
@@ -0,0 +1,55 @@
+{* <!-- Event Cats (event categories) LucMorizur June - ... 2009 --> *}
+
+{* <!-- Page title --> *}
+<div class = "titrePage" style="margin-top: -20px;">
+  <h2>{'ec_admin_page_title'|@translate} {$EVNTCATS_VERSION}</h2>
+</div>
+
+{* <!-- JavaScript warning message --> *}
+<div id = "ec_js_warn">
+  {'ec_javascript_needed'|@translate}<br><br>
+</div>
+<script type = "text/javascript"><!-- // Removes JavaScript warning message
+  document.getElementById('ec_js_warn').innerHTML = ''; //-->
+</script>
+
+{* <!-- EC Presentation --> *}
+{if $ec_howto}
+  <div>
+    {'ec_admin_page_howto'|@translate}
+  </div>
+{/if}
+
+<p>
+  <hr width = 75% size = 3 />
+</p>
+
+{* <!-- Available soon... --> *}
+
+<p>Bientôt disponible :-] !</p>
+
+{* <!-- JavaScript functions --> *}
+{* <!--
+<script type = "text/javascript" src = "{$RACINE_URL}{$EVNTCATS_PATH}admin/template/autolog_new.js"></script>
+<script type = "text/javascript"><!--
+  ec_JS_message['ec_gen_user_act_miss'] = "{'ec_gen_user_act_miss'|@translate|@escape:javascript}";
+  ec_JS_message['ec_act_cat_miss']      = "{'ec_act_cat_miss'|@translate|@escape:javascript}";
+  ec_JS_message['ec_new_pwd_gen']       = "{'ec_new_pwd_gen'|@translate|@escape:javascript}";
+  ec_JS_message['ec_up_code_lbl_home']  = "{'ec_up_code_lbl_home'|@translate}";
+  ec_init();
+//--></script>
+--> *}
+
+{* <!-- {$test0tpl} --> *}
+<p>$_GET :</p>
+{$GET}
+<p>$_POST :</p>
+{$POST}
+<p>Autres :</p>
+{$test1tpl}
+{$test2tpl}
+{$test3tpl}
+
+{* <!--
+--> *}
+
Index: /extensions/event_cats/language/fr_FR/plugin.lang.php
===================================================================
--- /extensions/event_cats/language/fr_FR/plugin.lang.php	(revision 4001)
+++ /extensions/event_cats/language/fr_FR/plugin.lang.php	(revision 4002)
@@ -20,4 +20,5 @@
 $lang['ec_plugin_ap_nok']         = 'Plugin <a href = "http://fr.piwigo.org/ext/extension_view.php?eid=153" title = "Ouvrir une nouvelle fenêtre sur le plugin Additional Pages" target = "_blank">Additional Pages</a> : inactif';
 $lang['ec_entry_table_title']     = 'Entrées du paramètre "autolog"';
+$lang['ec_new_entry_table_title'] = 'Nouvelle entrée du paramètre "autolog"';
 // Table
 $lang['ec_col_name_entry']        = 'Entrée';
