Index: /extensions/event_cats/admin/autolog_new.inc.php
===================================================================
--- /extensions/event_cats/admin/autolog_new.inc.php	(revision 4170)
+++ /extensions/event_cats/admin/autolog_new.inc.php	(revision 4171)
@@ -110,4 +110,5 @@
 $template->assign('ec_ap_ok',               $ec_ap_ok);
 $template->assign('ec_lists',               $ec_lists);
+$template->assign('cat_display',            (read_ec_conf('cat_display') == '0'));
 $template->assign('ec_default_entry',       $ec_default_entry);
 $template->assign('ec_default_action',      $ec_default_action);
Index: /extensions/event_cats/admin/evntcats_admin.php
===================================================================
--- /extensions/event_cats/admin/evntcats_admin.php	(revision 4170)
+++ /extensions/event_cats/admin/evntcats_admin.php	(revision 4171)
@@ -38,5 +38,5 @@
 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
 
-global $template, $conf, $lang, $test1, $prefixeTable, $ec_err, $page,
+global $template, $conf, $lang, $test1, $prefixeTable, $ec_conf, $page,
  $ec_lists,   // array of following arrays :
               //   $ec_lists['ec_table'] :
@@ -188,4 +188,5 @@
   'POST'      => str_from_var($_POST),
   'page'      => str_from_var($page),
+  'ec_conf'   => str_from_var($ec_conf),
   'ec_lists'  => (isset($ec_lists)) ? str_from_var($ec_lists) : '(unset)',
   'code_list' => (isset($code_list)) ? str_from_var($code_list) : '(unset)',
Index: /extensions/event_cats/admin/template/autolog_entries.js
===================================================================
--- /extensions/event_cats/admin/template/autolog_entries.js	(revision 4170)
+++ /extensions/event_cats/admin/template/autolog_entries.js	(revision 4171)
@@ -28,7 +28,11 @@
 
 function ec_check_ds(ec_id) {
+  var t = true;
   ec_mark_line(ec_id);
-  document.getElementById('ec_act1_id').value = 'disable';
-  document.forms['ec_view_codes'].submit();
+  if (!ec_ap_ok) t = confirm(ec_JS_message['ec_confirm_disable']);
+  if (t) {
+    document.getElementById('ec_act1_id').value = 'disable';
+    document.forms['ec_view_codes'].submit();
+  }
 }
 
@@ -56,5 +60,5 @@
     return false;
   }
-  else return true;
+  else return confirm(ec_JS_message['ec_confirm_test']);
 }
 
Index: /extensions/event_cats/admin/template/autolog_entries.tpl
===================================================================
--- /extensions/event_cats/admin/template/autolog_entries.tpl	(revision 4170)
+++ /extensions/event_cats/admin/template/autolog_entries.tpl	(revision 4171)
@@ -124,4 +124,5 @@
 <script type = "text/javascript"><!--
   ec_JS_message['ec_confirm_delete']  = "{'ec_confirm_delete'|@translate|@escape:javascript}";
+  ec_JS_message['ec_confirm_disable'] = "{'ec_confirm_disable'|@translate|@escape:javascript}";
   ec_JS_message['ec_confirm_test']    = "{'ec_confirm_test'|@translate|@escape:javascript}";
   ec_JS_message['ec_confirm_force']   = "{'ec_confirm_force'|@translate|@escape:javascript}";
Index: /extensions/event_cats/admin/template/autolog_new.js
===================================================================
--- /extensions/event_cats/admin/template/autolog_new.js	(revision 4170)
+++ /extensions/event_cats/admin/template/autolog_new.js	(revision 4171)
@@ -7,4 +7,5 @@
 var ec_flag1                    = false;
 var ec_flag2                    = false;
+var cat_display                 = false;
 var ec_dont_check               = false;
 var ec_selected_old_group       = false;
@@ -62,4 +63,5 @@
 function ec_mark_entry(ec_id) {
   var i = 0;
+  ec_chk_nover_cat = false;
   if (ec_id == '-1') de('ec_in_up_entry_list_id').selectedIndex = '-1';
   else {
@@ -87,5 +89,5 @@
         case 2: // Additionnal Page
           ec_selected_action = 'ec_input_action_add_p';
-          ec_selected_cat = (ec_check_exist_value('ec_in_up_aps_id',
+          ec_selected_AP = (ec_check_exist_value('ec_in_up_aps_id',
            ec_lists['arg2'][ec_id])) ? ec_lists['arg2'][ec_id] : '-1';
         break;
@@ -113,4 +115,5 @@
     }
   }
+  ec_chk_nover_cat = true;
 }
 
@@ -267,5 +270,8 @@
       switch (ec_selected_action) {
         case 'ec_input_action_add_p': // Additional Page
-          de('ec_in_up_aps_id').value = ec_selected_AP;
+          if (ec_selected_AP == '-1')
+           de('ec_in_up_aps_id').selectedIndex = '-1';
+          else
+           de('ec_in_up_aps_id').value = ec_selected_AP;
           de('ec_in_up_cats_id').selectedIndex = '-1';
           de('ec_in_up_imgs_id').value = '';
@@ -274,5 +280,8 @@
         case 'ec_input_action_cat': // Category
           de('ec_in_up_aps_id').selectedIndex = '-1';
-          de('ec_in_up_cats_id').value = ec_selected_cat;
+          if (ec_selected_cat == '-1')
+           de('ec_in_up_cats_id').selectedIndex = '-1';
+          else
+           de('ec_in_up_cats_id').value = ec_selected_cat;
           de('ec_in_up_imgs_id').value = '';
           ec_selected_user = (ec_selected_user == 'ec_sel_user_none') ?
@@ -282,6 +291,12 @@
         case 'ec_input_action_img': // Image
           de('ec_in_up_aps_id').selectedIndex = '-1';
-          de('ec_in_up_cats_id').value = ec_selected_cat;
-          de('ec_in_up_imgs_id').value = ec_selected_img;
+          if (ec_selected_img == '-1') {
+            de('ec_in_up_cats_id').selectedIndex = '-1';
+            de('ec_in_up_imgs_id').value = '';
+          }
+          else {
+            de('ec_in_up_cats_id').value = ec_selected_cat;
+            de('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;
@@ -394,4 +409,5 @@
   var ec_reg_ap   = /^\S+/;
   var ec_reg_cat1 = /\/\s(.+)$/;
+  var ec_reg_cat3 = /^\s*\-\s(.+)$/;
   if (
    ec_selected_action == '' ||
@@ -420,5 +436,6 @@
             d.ec_new_code.ec_in_up_aps.selectedIndex
            ].label
-          );
+          )[0];
+          ec_new_user_text = ec_new_user_text.substr(0, 32);
           t2 = ec_new_user_text;
         break;
@@ -428,7 +445,10 @@
             d.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;
-          ec_new_user_text = ec_new_user_text.replace(/\s/, '_');
+          if (cat_display) ec_new_user_text =
+           (ec_reg_cat2.test(ec_cat_sel)) ?
+            ec_reg_cat1.exec(ec_cat_sel)[1] : ec_cat_sel;
+          else ec_new_user_text = ec_reg_cat3.exec(ec_cat_sel)[1];
+          ec_new_user_text = ec_new_user_text.replace(/\s/g, '_');
+          ec_new_user_text = ec_new_user_text.substr(0, 32);
           t2 = ec_new_user_text;
         if (ec_selected_action == 'ec_input_action_img') {
Index: /extensions/event_cats/admin/template/autolog_new.tpl
===================================================================
--- /extensions/event_cats/admin/template/autolog_new.tpl	(revision 4170)
+++ /extensions/event_cats/admin/template/autolog_new.tpl	(revision 4171)
@@ -267,4 +267,5 @@
 <script type = "text/javascript"><!--
   ec_is_creation                          = {if $ec_is_creation}true{else}false{/if};
+  cat_display                             = {if $cat_display}true{else}false{/if};
   ec_up_code_lbl_forced_txt               = "{'ec_up_code_lbl_forced'|@translate}";
   ec_JS_message['ec_gen_user_act_miss']   = "{'ec_gen_user_act_miss'|@translate|@escape:javascript}";
Index: /extensions/event_cats/include/ec_conf.inc.php
===================================================================
--- /extensions/event_cats/include/ec_conf.inc.php	(revision 4170)
+++ /extensions/event_cats/include/ec_conf.inc.php	(revision 4171)
@@ -33,13 +33,16 @@
  _ the number of digits when creating a new code automatically
    ($ec_conf[2] <=> read_ec_conf('auto_code_dg_nb')) ;
+ _ whether categories are displayed "cat / under_cat / ..." or
+   "cat <CR LF> - under_cat <CR LF> - ..." ($ec_conf[3] <=>
+   read_ec_conf('cat_display')) ;
  _ whether the "how to" banner has already been displayed or not
-   ($ec_conf[3] <=> read_ec_conf('howto')) ;
+   ($ec_conf[4] <=> read_ec_conf('howto')) ;
  _ what to do in case an unknown code is used with "autolog" parameter
-   ($ec_conf[4] <=> read_ec_conf('unknown_code')) :
+   ($ec_conf[5] <=> read_ec_conf('unknown_code')) :
    0 : nothing ("goto" home page, index.php (not logged in of course)) ;
    1 : redirected to "access denied" page ;
    2 : redirected to an Additional Page precised below.
  _ the id of the Additional Page which must be used in case of usage of an
-   unknow code ($ec_conf[5] <=> read_ec_conf('unknown_code_ap_id')).
+   unknow code ($ec_conf[6] <=> read_ec_conf('unknown_code_ap_id')).
 *****************************************************************************/
 
@@ -55,5 +58,5 @@
 }
 else {
-  $ec_conf = explode(',' , '0,1,10,0,0,0');
+  $ec_conf = explode(',' , '0,1,10,0,0,0,0');
   change_ec_conf('activated', 0);
 }
@@ -82,12 +85,15 @@
       $ec_conf[2] = $v;
     break;
-    case 'howto':
+    case 'cat_display':
       $ec_conf[3] = $v;
     break;
-    case 'unknown_code':
+    case 'howto':
       $ec_conf[4] = $v;
     break;
+    case 'unknown_code':
+      $ec_conf[5] = $v;
+    break;
     case 'unknown_code_ap_id':
-      $ec_conf[5] = $v;
+      $ec_conf[6] = $v;
     break;
     default: return false;
@@ -115,7 +121,8 @@
     case 'dup_allow'         : return $ec_conf[1];
     case 'auto_code_dg_nb'   : return $ec_conf[2];
-    case 'howto'             : return $ec_conf[3];
-    case 'unknown_code'      : return $ec_conf[4];
-    case 'unknown_code_ap_id': return $ec_conf[5];
+    case 'cat_display'       : return $ec_conf[3];
+    case 'howto'             : return $ec_conf[4];
+    case 'unknown_code'      : return $ec_conf[5];
+    case 'unknown_code_ap_id': return $ec_conf[6];
     default                  : return false;
   }
Index: /extensions/event_cats/include/evntcats_main_funcs.inc.php
===================================================================
--- /extensions/event_cats/include/evntcats_main_funcs.inc.php	(revision 4170)
+++ /extensions/event_cats/include/evntcats_main_funcs.inc.php	(revision 4171)
@@ -330,5 +330,5 @@
      SELECT id,name,uppercats,global_rank
      FROM '.CATEGORIES_TABLE,
-   $c, 'category_options', true);
+   $c, 'category_options', (read_ec_conf('cat_display') == '0'));
   $ec_lists['categories'] = $template->smarty->_tpl_vars['category_options'];
   
Index: /extensions/event_cats/language/en_UK/plugin.lang.php
===================================================================
--- /extensions/event_cats/language/en_UK/plugin.lang.php	(revision 4170)
+++ /extensions/event_cats/language/en_UK/plugin.lang.php	(revision 4171)
@@ -7,17 +7,4 @@
 */
 
-// $ec_err :
-$lang['ec_err_AP_fail'] = 'Reference to an Additional Page which doesn\'t exist'; // 1
-$lang['ec_err_cod_dupl_frbdn'] = 'Code should be unique '; // 2
-$lang['ec_err_AP_miss'] = 'Redirection to Additional Page, but AP not specified'; // 3
-$lang['ec_err_USR_fail'] = 'An entry associates a code to an unknown user_id or username'; // 4
-$lang['ec_err_CAT_fail'] = 'An unknown category has been given as arg1'; // 5
-$lang['ec_err_IMG_fail'] = 'An image id not found in a certain category, has been given as arg2'; // 6
-$lang['ec_err_USR_prbl'] = 'User not clear'; // 7
-$lang['ec_err_USR_dupl'] = 'Code is associated to more than one user_id'; // 8
-$lang['ec_err_CAT_miss'] = 'Category id misses'; // 9
-$lang['ec_err_IMG_miss'] = 'Image id misses'; // 10
-$lang['ec_err_forced_prbl'] = 'Outdated code should always be forced'; // 11
-
 
 // $lang[''] = '';
Index: /extensions/event_cats/language/fr_FR/plugin.lang.php
===================================================================
--- /extensions/event_cats/language/fr_FR/plugin.lang.php	(revision 4170)
+++ /extensions/event_cats/language/fr_FR/plugin.lang.php	(revision 4171)
@@ -75,4 +75,5 @@
 $lang['ec_confirm_test']          = "Vraiment tester le code sélectionné ?\n\rCela terminera votre session d'administration.";
 $lang['ec_confirm_delete']        = "Vraiment supprimer l'entrée sélectionnée ?";
+$lang['ec_confirm_disable']       = "Vraiment rendre périmé le code sélectionné ?\n\rCela supprimera toutes les autres entrées utilisant le même code, s'il y en a.";
 $lang['ec_confirm_force']         = "Vraiment forcer l'affichage pour le code sélectionné ?\n\rCela supprimera toutes les autres entrées utilisant le même code, s'il y en a.";
 $lang['ec_confirm_del_other']     = "Cela supprimera toutes les autres entrées utilisant le même code, s'il y en a.\n\rOK ?";
