Index: /extensions/event_cats/admin/evntcats_admin.js
===================================================================
--- /extensions/event_cats/admin/evntcats_admin.js	(revision 3960)
+++ /extensions/event_cats/admin/evntcats_admin.js	(revision 3960)
@@ -0,0 +1,289 @@
+﻿/* Event Cats Javascript functions LucMorizur June - ... 2009 */
+
+var ec_err = '';
+var ec_avoid_infinite_loop = true;
+var ec_checked_line = 0;
+var ec_selected_user = 'ec_sel_user_old';
+var ec_selected_old_user = '-1';
+var ec_selected_AP = '-1';
+var ec_selected_cat = '-1';
+var ec_selected_action = '';
+var ec_selected_img = '';
+var ec_auto_code_digits_nb = '8';
+var ec_new_code_text = '';
+var ec_new_user_text = '';
+var ec_new_psd_text = '';
+var ec_old_new_psd_text = '';
+var ec_checked_URL = new Array();
+var ec_JS_message = new Array();
+var ec_test_reg = '';
+
+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_URL[ec_checked_line];
+  }
+  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("Raté :\n" + ec_err);
+    ec_new_code_text = 'Raté...';
+  }
+  else {
+    ec_new_code_text = t;
+  }
+  ec_mark_line(-1);
+}
+
+function ec_gen_user() {
+  var ec_reg_ap = /^\S+/;
+  var ec_reg_cat = /\/\s(.+)$/;
+  var ec_word = '';
+  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 {
+    var t = '';
+    t = ec_gen_txt('8');
+    if (t == '') {
+      alert("Raté :\n" + ec_err);
+      ec_new_psd_text = 'Raté...';
+      return false;
+    }
+    else {
+      ec_new_psd_text = t;
+      ec_old_new_psd_text = ec_new_psd_text;
+    }
+    
+   if (false) {
+    ec_new_user_text = 'Nouvel utilisateur !';
+   }
+   else
+   {
+    
+    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_new_user_text = ec_reg_cat.exec(
+document.ec_up_code.ec_in_up_cat.options[document.ec_up_code.ec_in_up_cat.selectedIndex].label
+        )[1];
+      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
+      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 =
+   (ec_selected_img != '' && ec_selected_cat == '-1') ?
+   ec_JS_message['ec_act_cat_miss'] : '';
+}
+
+function ec_check_pwd_text() {
+  document.getElementById('ec_in_up_pwd_warn').innerHTML =
+   (ec_new_psd_text == ec_old_new_psd_text &&
+    ec_selected_user == 'ec_sel_user_new') ?
+   ec_JS_message['ec_new_pwd_gen'] : '';
+  // document.getElementById('ec_in_up_pwd_warn').innerHTML = ec_test_reg;
+}
+
+function ec_check_dis(ec_id) {
+  ec_mark_line(ec_id);
+  return confirm(ec_JS_message['ec_confirm_disable']);
+}
+
+function ec_check_del(ec_id) {
+  ec_mark_line(ec_id);
+  return confirm(ec_JS_message['ec_confirm_delete']);
+}
+
+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_mark_line(0);
+}
+
Index: /extensions/event_cats/admin/evntcats_admin.php
===================================================================
--- /extensions/event_cats/admin/evntcats_admin.php	(revision 3960)
+++ /extensions/event_cats/admin/evntcats_admin.php	(revision 3960)
@@ -0,0 +1,432 @@
+﻿<?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 |
+// +-----------------------------------------------------------------------+
+
+// +-----------------------------------------------------------------------+
+// | 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.                                                                  |
+// +-----------------------------------------------------------------------+
+
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+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
+
+load_language('plugin.lang', EVNTCATS_PATH);
+
+include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
+include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php');
+include_once(PHPWG_ROOT_PATH.'include/functions_url.inc.php');
+include_once(EVNTCATS_PATH.'include/evntcats_funcs.inc.php');
+$my_base_url = get_admin_plugin_menu_link(__FILE__);
+
+$template->assign( 'EVNTCATS_VERSION' , EVNTCATS_INFO_VERSION);
+$me = get_plugin_data($plugin_id);
+$template->clear_assign('ec_infos');
+$template->append('head_elements',
+  '<link rel="stylesheet" type="text/css" href="'.
+  EVNTCATS_PATH.'admin/evntcats_theme.css">'
+);
+
+// +-----------------------------------------------------------------------+
+// |                            Tabsheet
+// +-----------------------------------------------------------------------+
+if (!isset($_GET['tab']))
+    $page['tab'] = 'autolog';
+else
+    $page['tab'] = $_GET['tab'];
+
+$tabsheet = new tabsheet();
+$tabsheet->add('autolog',
+               l10n('ec_tab_autoid'),
+               $my_base_url.'&amp;tab=autolog');
+$tabsheet->add('config',
+               l10n('ec_tab_config'),
+               $my_base_url.'&amp;tab=config');
+$tabsheet->select($page['tab']);
+$tabsheet->assign();
+
+$template->assign(
+ array('U_HELP' => get_root_url().'popuphelp.php?page=event_cats'));
+
+$template->assign('EVNTCATS_URLS', array (
+ 'ROOT'     => EVNTCATS_PATH,
+ 'DISABLE'  => PHPWG_ROOT_PATH.
+  'admin.php?page=plugin&section=event_cats%2Fadmin%2Fevntcats_admin.php&disable=',
+ 'DELETE'   => PHPWG_ROOT_PATH.
+  'admin.php?page=plugin&section=event_cats%2Fadmin%2Fevntcats_admin.php&delete='
+));
+
+/****************************************************************************/
+
+$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[''])) {
+}
+
+/****************************************************************
+* Construction of array var to be transmitted to tpl file,      *
+* containing all infos to be displayed in the code array table. *
+****************************************************************/
+
+$span_err_pre = '<span style = "color: red; font-weight: bold;">';
+$span_err_end = '</span>';
+
+foreach ($ec_lists['ec_table'] as $ec_entry) {
+    
+  $a = NULL;
+  $dspl     = '';
+  $url_end  = '';
+  $i        = intval($ec_entry['id']);
+  $arg1     = $ec_entry['arg1'];
+  $arg1_int = intval($arg1);
+  $arg2     = $ec_entry['arg2'];
+  $arg2_int = intval($arg2);
+  $log_OK   = (strpos($ec_entry['action'], 'ec_ok') !== false);
+  
+  // No specific need for "code" displaying
+  
+  // "username" displaying
+  $username = ($log_OK) ?
+   $ec_lists['user_ids'][intval($ec_entry['user_id'])] : '';
+  
+  // No specific need for "action" displaying
+  
+  // "displayed page" : # of the AP, or of the category...
+  switch ($ec_entry['action']) {
+    
+    case 'ec_ok_forced_pb' :
+      $page['errors'][$ec_entry['code']] = l10n('ec_forced_pb');
+    case 'ec_ok' :
+    case 'ec_ok_img_pb' :
+      $a = 0;
+      if (!empty($ec_entry['arg1'])) $a++;
+      if (!empty($ec_entry['arg2'])) $a+= 2;
+      switch ($a) {
+        case 0: // Home
+          $dspl = l10n('ec_dspl_ok_home');
+        break;
+        case 1: // Category
+        case 3: // Image
+          $url_end = '&cat='.$arg1;
+          $dspl =
+           l10n('ec_dspl_ok_cat_pre').
+           $arg1.
+           l10n('ec_dspl_ok_cat_mid').
+           $ec_lists['categories'][$arg1_int].
+           l10n('ec_dspl_ok_cat_end')
+          ;
+          if ($ec_entry['action'] == 'ec_ok_img_pb') {
+            $url_end.= '&img='.$arg2;
+            $page['errors'][] = l10n('ec_image_miss');
+            $dspl.=
+             '<br>'.$span_err_pre.
+             l10n('ec_dspl_nok_img2_pre').
+             $arg2.
+             l10n('ec_dspl_nok_img2_mid').
+             $arg1.
+             l10n('ec_dspl_nok_img2_end').
+             $span_err_end
+            ;
+          }
+          elseif ($a == 3) { // Image
+            $url_end.= '&img='.$arg2;
+            $t = mysql_fetch_row(pwg_query('
+             SELECT `name`, `file`
+             FROM `'.IMAGES_TABLE.'`
+             WHERE `id` = "'.$arg2.'"
+            '));
+            $dspl.=
+             '<br>'.
+             l10n('ec_dspl_ok_img2_pre').
+             $arg2.
+             l10n('ec_dspl_ok_img2_mid1').
+             $t[0].
+             l10n('ec_dspl_ok_img2_mid2').
+             $t[1].
+             l10n('ec_dspl_ok_img2_end')
+            ;
+          }
+        break;
+        case 2: // Additional Page
+          $url_end = '&ap='.$arg2;
+          $dspl = ($ec_ap_ok) ?
+           l10n('ec_dspl_ok_ap_pre').
+           $arg2.
+           l10n('ec_dspl_ok_ap_mid').
+           $ec_lists['add_pages'][$arg2_int].
+           l10n('ec_dspl_ok_ap_end')
+          :
+           l10n('ec_dspl_ok_home')
+          ;
+        break;
+      }
+    break;
+    
+    case 'ec_nok' :
+      if (empty($ec_entry['arg2'])) {
+        $dspl = l10n('ec_dspl_ok_acc_denied');
+      }
+      else {
+        $url_end = '&ap='.$arg2;
+        $dspl = ($ec_ap_ok) ?
+         l10n('ec_dspl_ok_ap_pre').
+         $arg2.
+         l10n('ec_dspl_ok_ap_mid').
+         $ec_lists['add_pages'][$arg2_int].
+         l10n('ec_dspl_ok_ap_end')
+        :
+         l10n('ec_dspl_ok_acc_denied')
+        ;
+      }
+    break;
+    
+    case 'ec_nok_ap_pb' : // No need to check here if Additional Pages is
+    case 'ec_ok_ap_pb' :  // active : we can arrive here only when it is.
+      $url_end = '&ap='.$arg2;
+      $page['errors'][] = l10n('ec_add_page_miss');
+      $dspl = ($ec_entry['action'] == 'ec_ok_ap_pb') ?
+       l10n('ec_dspl_ok_home') : l10n('ec_dspl_nok_acc_denied');
+      $dspl.=
+       $span_err_pre.
+       l10n('ec_dspl_nok_ap_pre').
+       $arg2.
+       l10n('ec_dspl_nok_ap_end').
+       $span_err_end
+      ;
+    break;
+    
+    case 'ec_ok_cat_pb' :
+      $url_end = '&cat='.$arg1;
+      $page['errors'][] = l10n('ec_category_miss');
+      $dspl =
+       l10n('ec_dspl_nok_home').
+       $span_err_pre.
+       l10n('ec_dspl_nok_img1_pre').
+       $arg1.
+       l10n('ec_dspl_nok_img1_end').
+       $span_err_end
+      ;
+    break;
+    
+    case 'ec_nok_action_pb' :
+      $page['errors'][$ec_entry['code']] = l10n('ec_action_pb');
+      $username =
+       $span_err_pre.
+       l10n('ec_dspl_nok_actn').
+       $span_err_end
+      ;
+      $dspl = l10n('ec_dspl_ok_home');
+    break;
+    
+    case 'ec_nok_userid_pb' :
+      $page['errors'][$ec_entry['code']] = l10n('ec_username_pb');
+      $username =
+       $span_err_pre.
+       l10n('ec_dspl_usr_pb').
+       $span_err_end
+      ;
+      $dspl = l10n('ec_dspl_ok_home');
+    break;
+    
+    case 'ec_nok_userid_miss' :
+      $page['errors'][$ec_entry['code']] = l10n('ec_username_miss');
+      $username =
+       $span_err_pre.
+       l10n('ec_dspl_nok_usr_pre').
+       $ec_entry['user_id'].
+       l10n('ec_dspl_nok_usr_end').
+       $span_err_end
+      ;
+      $dspl = l10n('ec_dspl_ok_home');
+    break;
+  }
+  
+  // construction of $code_URL
+  $code_URL =
+   ROOT_URL.
+   'index.php?autolog='.
+   $ec_entry['code'].
+   $url_end
+  ;
+  
+  $code_list[$i] = array(
+   'id'       => $i,
+   'Code'     => $ec_entry['code'],
+   'Username' => $username,
+   'Action'   => $ec_entry['action'],
+   'Arg1'     => $dspl,
+   'Forced'   => $ec_entry['forced'],
+   'code_URL' => $code_URL,
+   'log_OK'   => $log_OK,
+  );
+}
+
+/*
+print '<pre>';
+//print_r('ROOT_URL : '.ROOT_URL.'<br>EVNTCATS_PATH : '.EVNTCATS_PATH);
+print('ROOT_URL : '.ROOT_URL.'<br>EVNTCATS_PATH : '.EVNTCATS_PATH);
+print '</pre>';
+*/
+
+$template->assign('ec_howto', (count($page['errors']) == 0 and count($page['infos']) == 0));
+
+$template->assign('ec_ap_ok',$ec_ap_ok);
+$template->assign('code_list',$code_list);
+$template->assign('ec_lists',$ec_lists);
+$template->assign('EVNTCATS_PATH',EVNTCATS_PATH);
+$template->assign('RACINE_URL',ROOT_URL);
+
+// $template->assign('test0tpl',str_from_var($ec_lists['ec_codes']));
+$template->assign('test1tpl',str_from_var($ec_lists));
+$template->assign('test2tpl',str_from_var($page['errors']));
+$template->assign('test3tpl',str_from_var($code_list));
+
+/* C'est quoi, ça ?...
+if ( isset($_POST['submit']) )
+  {
+    if (isset($_POST['account']) and isset($_POST['code']))
+      {
+        $conf['auto_log'][$_POST['code']] = $_POST['account'];
+      }
+    else
+      {
+        $page['errors']='arg_missing';
+      }
+
+    if (isset($_POST['duplication']))
+      {
+        $conf['allow_user_registration'] = ($_POST['duplication'] == '1');
+      }
+  }
+*/
+
+$template->set_filenames(array('evntcats_admin_content' => dirname(__FILE__).'/evntcats_admin.tpl'));
+$template->assign_var_from_handle('ADMIN_CONTENT','evntcats_admin_content');
+?>
Index: /extensions/event_cats/admin/evntcats_admin.tpl
===================================================================
--- /extensions/event_cats/admin/evntcats_admin.tpl	(revision 3960)
+++ /extensions/event_cats/admin/evntcats_admin.tpl	(revision 3960)
@@ -0,0 +1,371 @@
+﻿{* <!-- Event Cats (event categories) LucMorizur June - ... 2009 --> *}
+
+{* <!-- Tabs for admin page surfing --> *} {*
+<ul class = "tabsheet">
+  <li class = "selected_tab">
+    <a href = "??...">
+      <span>{'ec_tab_autoid'|@translate}</span>
+    </a>
+  </li>
+  <li class = "normal_tab">
+    <a href = "??...">
+      <span>{'ec_tab_config'|@translate}</span>
+    </a>
+  </li>
+</ul> *}
+
+{* <!-- Help button --> *} {*
+<ul class = "HelpActions">
+  <li>
+    <a href = "aide" onclick = "popuphelp(this.href); return false;" title = "{'ec_help'|@translate}" style = "margin-top: -28px;" >
+      <img src = "{$ROOT_URL}{$themeconf.admin_icon_dir}/help.png" class = "button" alt = "(?)" />
+    </a>
+  </li>
+</ul> *}
+
+{* <!-- 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>
+
+{* <!-- Upper banner : infos, errors... --> *}
+{if $ec_howto}
+  <div>
+    {'ec_admin_page_howto'|@translate}
+  </div>
+{/if}
+
+<p>
+  <hr width = 75% size = 3 />
+</p>
+
+{* <!-- First section : form to view and modify codes, or create a new one --> *}
+<form class = "filter" method = "post" name = "ec_up_code" action = "">
+  
+  <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>
+  
+  <div style = "text-align:center; font-weight:bold; font-size:120%;">{'ec_entry_table_title'|@translate}</div><br>
+  
+  <table class = "table2" width = "97%"> {* <!-- Table to show codes present in MySQL table --> *}
+    <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}">&nbsp;{$code_line.id}</label>
+        </td>
+        <td><label for = "selection-{$code_line.id}">{$code_line.Code}</label></td>
+        <td><label for = "selection-{$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}"
+           name = "ec_code_URL" 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>
+          &nbsp;
+          <a href = "javascript:void()" onclick = "return ec_check_del({$code_line.id});">
+     {* envoi formulaire par JS : document.forms[nom_formulaire].submit() ( http://www.toutjavascript.com/reference/reference.php?iref=178 ) *}
+            <img src = "{$EVNTCATS_URLS.ROOT}icon/delete.png" class = "button" style = "border:none"
+             alt = "{'ec_url_delete'|@translate}" title = "{'ec_url_delete'|@translate}" />
+          </a>
+          {if $code_line.log_OK}
+            &nbsp;
+            <a href = "javascript:void()" onclick = "return ec_check_dis({$code_line.id});">
+              <img src = "{$EVNTCATS_URLS.ROOT}icon/disable.png" class = "button" style = "border:none"
+               alt = "{'ec_url_disable'|@translate}" title = "{'ec_url_disable'|@translate}" />
+            </a>
+            {if $code_line.Forced == 'true'}
+              &nbsp;
+              <a href = "javascript:void()" title = "{'ec_toggle_forced'|@translate}" onclick = "return ec_toggle_forced({$code_line.id});">
+                <img class = "button" style = "border:none" src = "{$EVNTCATS_URLS.ROOT}icon/forced.png"
+                 alt = "{'ec_url_forced'|@translate}" title = "{'ec_url_forced'|@translate}"/>
+              </a>
+            {else}
+              &nbsp;
+              <a href = "javascript:void()" title = "{'ec_toggle_forced'|@translate}" onclick = "return ec_toggle_forced({$code_line.id});">
+                <img class = "button" style = "border:none" src = "{$EVNTCATS_URLS.ROOT}icon/nforced.png"
+                 alt = "{'ec_url_nforced'|@translate}" title = "{'ec_url_nforced'|@translate}"/>
+              </a>
+              &nbsp;
+              <a href = "javascript:void()" title = "{'ec_duplicate_entry'|@translate}" onclick = "return 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}
+        </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>
+</form>
+
+{* <!-- JavaScript functions --> *}
+<script type = "text/javascript" src = "{$RACINE_URL}{$EVNTCATS_PATH}admin/evntcats_admin.js"></script>
+<script type = "text/javascript">
+  <!--
+  
+  // ec_test();
+  
+  ec_checked_URL[-1] = '';
+  {foreach from=$code_list key=ec_key item=code_line name=code_loop}
+    ec_checked_URL[{$ec_key}] = '{$code_line.code_URL}';
+  {/foreach}
+  
+  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_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} --> *}
+{$test1tpl}
+{$test2tpl}
+{$test3tpl}
+
+{* <!--
+--> *}
+
+{* Peut-être utile ?
+
+Colonne "outils" :
+Titre colonne :
+Cellules :
+          <td style = "text-align:center;">
+          </td>
+
+*}
Index: /extensions/event_cats/admin/evntcats_theme.css
===================================================================
--- /extensions/event_cats/admin/evntcats_theme.css	(revision 3960)
+++ /extensions/event_cats/admin/evntcats_theme.css	(revision 3960)
@@ -0,0 +1,69 @@
+#ec_js_warn {
+  text-align:center;
+  font-weight:bold;
+  font-size:120%;
+  color:red;
+}
+
+.infos {
+  text-align:left;
+  padding-left:45px;
+  font-size:14px;
+}
+
+.errors {
+  text-align:left;
+  padding-left:45px;
+  font-size:14px;
+  color:red;
+}
+
+form.filter label {
+  display:inline;
+  float:none;
+}
+
+form.filter label.ec_block {
+  display:inline;
+  float:left;
+  text-align:left;
+  margin-right: 1em;
+}
+
+form.filter ul {
+  margin: 5px 0 0 35px;
+  display:block;
+  float:left;
+  margin-right:1em;
+  padding:0;
+}
+
+form.filter li {
+  list-style-type:none;
+  list-style-position:outside;
+  float:left;
+  clear:left;
+  margin-bottom:0.5em;
+}
+
+form.filter * label input {
+  vertical-align:middle;
+}
+
+input, select {
+  vertical-align:middle;
+}
+
+form.filter label input, form.filter label select, form.filter label span {
+  display:inline;
+}
+
+a.ec_forced {
+  font-weight:bold;
+  color:red;
+}
+
+a.ec_nforced {
+  font-weight:bold;
+  color:green;
+}
