Ignore:
Timestamp:
Nov 20, 2009, 10:56:32 PM (14 years ago)
Author:
LucMorizur
Message:

[Event Cats] Finish duplication management, configuration management, code cleaning

Location:
extensions/event_cats/admin
Files:
1 added
12 edited

Legend:

Unmodified
Added
Removed
  • extensions/event_cats/admin/autolog_entries.inc.php

    r4228 r4329  
    3838if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
    3939
    40 global $template, $conf, $page,
    41  $ec_lists,   // array of following arrays :
    42               //   $ec_lists['ec_table'] :
    43               //     Event Cats table, in function of each entry id
    44               //   $ec_lists['ec_codes'] : // Used ?
    45               //     array of useful data, in function of entries codes
    46               //   $ec_lists['add_pages'] :
    47               //     array of Add. Pages names in function of their id
    48               //   $ec_lists['categories'] :
    49               //     array of category names in function of their id
    50               //   $ec_lists['user_ids'] :
    51               //     array of usernames in function of their id
    52  $ec_ap_ok;   // whether Additional Pages is installed and activated
     40global $template, $conf, $page, $ec_lists;
    5341
    5442/****************************************************************************/
     
    9482      switch ($a) {
    9583        case 0: // Home
    96           $dspl = l10n('ec_dspl_ok_home');
     84          $dspl = l10n('Home');
    9785        break;
    9886        case 1: // Category
    9987        case 3: // Image
    10088          $url_end = ($ec_entry['forced'] == 'true') ? '' : '&cat='.$arg1;
    101           $dspl =
    102            l10n('ec_dspl_ok_cat_pre').
    103            $arg1.
    104            l10n('ec_dspl_ok_cat_mid').
    105            $ec_lists['categories'][$arg1_int].
    106            l10n('ec_dspl_ok_cat_end')
    107           ;
     89          $dspl = sprintf(
     90            l10n('ec_dspl_ok_cat'), $arg1, $ec_lists['categories'][$arg1_int]
     91          );
    10892          if (is_in($ec_entry['action'], '_img_pb')) {
    10993            $url_end.= ($url_end == '') ? '' : '&img='.$arg2;
     
    11296            $dspl.=
    11397             '<br>'.$span_err_pre.
    114              l10n('ec_dspl_nok_img2_pre').
    115              $arg2.
    116              l10n('ec_dspl_nok_img2_mid').
    117              $arg1.
    118              l10n('ec_dspl_nok_img2_end').
     98             sprintf(l10n('ec_dspl_nok_img2'), $arg2, $arg1).
    11999             $span_err_end
    120100            ;
     
    122102          elseif ($a == 3) { // Image
    123103            $url_end.= ($url_end == '') ? '' : '&amp;img='.$arg2;
    124             $t = mysql_fetch_row(pwg_query('
     104            $t = mysql_fetch_row(pwg_query("
    125105             SELECT `name`, `file`
    126              FROM `'.IMAGES_TABLE.'`
    127              WHERE `id` = "'.$arg2.'"
    128             '));
    129             $dspl.=
    130              '<br>'.
    131              l10n('ec_dspl_ok_img2_pre').
    132              $arg2.
    133              l10n('ec_dspl_ok_img2_mid1').
    134              $t[0].
    135              l10n('ec_dspl_ok_img2_mid2').
    136              $t[1].
    137              l10n('ec_dspl_ok_img2_end')
    138             ;
     106             FROM `".IMAGES_TABLE."`
     107             WHERE `id` = $arg2
     108            "));
     109            $dspl.= '<br>'.
     110             sprintf(l10n('ec_dspl_ok_img2'), $arg2, $t[0], $t[1]);
    139111          }
    140112        break;
    141113        case 2: // Additional Page
    142114          $url_end = ($ec_entry['forced'] == 'true') ? '' : '&amp;ap='.$arg2;
    143           $dspl = ($ec_ap_ok) ?
    144            l10n('ec_dspl_ok_ap_pre').
    145            $arg2.
    146            l10n('ec_dspl_ok_ap_mid').
    147            $ec_lists['add_pages'][$arg2_int].
    148            l10n('ec_dspl_ok_ap_end')
    149           :
    150            l10n('ec_dspl_ok_home')
    151           ;
     115          $dspl = (EC_AP_OK) ? sprintf(
     116            l10n('ec_dspl_ok_ap'),
     117            $arg2, $ec_lists['add_pages'][$arg2_int]
     118          ) : l10n('Home');
    152119        break;
    153120      }
     
    156123    case 'ec_nok' :
    157124      if (empty($ec_entry['arg2'])) {
    158         $dspl = l10n('ec_dspl_nok_acc_denied');
     125        $dspl = l10n('Access denied');
    159126      }
    160127      else {
    161         $dspl = ($ec_ap_ok) ?
    162          l10n('ec_dspl_ok_ap_pre').
    163          $arg2.
    164          l10n('ec_dspl_ok_ap_mid').
    165          $ec_lists['add_pages'][$arg2_int].
    166          l10n('ec_dspl_ok_ap_end')
    167         :
    168          l10n('ec_dspl_nok_acc_denied')
    169         ;
     128        $dspl = (EC_AP_OK) ? sprintf(
     129            l10n('ec_dspl_ok_ap'),
     130            $arg2, $ec_lists['add_pages'][$arg2_int]
     131          ) : l10n('Access denied');
    170132      }
    171133    break;
     
    177139      if (is_in($ec_entry['action'], 'ec_ok')) {
    178140        $url_end = ($ec_entry['forced'] == 'true') ? '' : '&amp;ap='.$arg2;
    179         $dspl = l10n('ec_dspl_ok_home');
     141        $dspl = l10n('Home');
    180142      }
    181143      else {
    182         $dspl = l10n('ec_dspl_nok_acc_denied');
     144        $dspl = l10n('Access denied');
    183145      }
    184146      $dspl.=
    185147       $span_err_pre.
    186        l10n('ec_dspl_nok_ap_pre').
    187        $arg2.
    188        l10n('ec_dspl_nok_ap_end').
     148       sprintf(l10n('ec_dspl_nok_ap'), $arg2).
    189149       $span_err_end
    190150      ;
     
    196156       $ec_entry['code'].' : '.l10n('ec_category_miss');
    197157      $dspl =
    198        l10n('ec_dspl_nok_home').
    199        $span_err_pre.
    200        l10n('ec_dspl_nok_img1_pre').
    201        $arg1.
    202        l10n('ec_dspl_nok_img1_end').
     158       l10n('Home').
     159       $span_err_pre.
     160       sprintf(l10n('ec_dspl_nok_cat'), $arg1).
    203161       $span_err_end
    204162      ;
     
    213171       $span_err_end
    214172      ;
    215       $dspl = l10n('ec_dspl_ok_home');
     173      $dspl = l10n('Home');
    216174    break;
    217175   
     
    224182       $span_err_end
    225183      ;
    226       $dspl = l10n('ec_dspl_ok_home');
     184      $dspl = l10n('Home');
    227185    break;
    228186   
     
    232190      $username =
    233191       $span_err_pre.
    234        l10n('ec_dspl_nok_usr_pre').
    235        $ec_entry['user_id'].
    236        l10n('ec_dspl_nok_usr_end').
    237        $span_err_end
    238       ;
    239       $dspl = l10n('ec_dspl_ok_home');
     192       sprintf(l10n('ec_dspl_nok_usr'), $ec_entry['user_id']).
     193       $span_err_end
     194      ;
     195      $dspl = l10n('Home');
    240196    break;
    241197  }
     
    264220}
    265221
    266 $template->assign('ec_ap_ok',$ec_ap_ok);
    267 $template->assign('code_list',$code_list);
     222$template->assign('ec_ap_ok',  EC_AP_OK);
     223$template->assign('ec_ap_ok2', (count($ec_lists['add_pages']) > 0));
     224$template->assign('code_list', $code_list);
    268225
    269226?>
  • extensions/event_cats/admin/autolog_new.inc.php

    r4173 r4329  
    3838if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
    3939
    40 global $template, $conf, $page,
    41  $ec_lists,   // array of following arrays :
    42               //   $ec_lists['ec_table'] :
    43               //     Event Cats table, in function of each entry id
    44               //   $ec_lists['ec_codes'] : // Used ?
    45               //     array of useful data, in function of entries codes
    46               //   $ec_lists['add_pages'] :
    47               //     array of Add. Pages names in function of their id
    48               //   $ec_lists['categories'] :
    49               //     array of category names in function of their id
    50               //   $ec_lists['user_ids'] :
    51               //     array of usernames in function of their id
    52  $ec_ap_ok;   // whether Additional Pages is installed and activated
     40global $template, $conf, $page, $ec_lists, $ec_conf_possible_values;
    5341
    5442/****************************************************************************/
     
    7967      case 'create':
    8068        $ec_default_action = $_POST['ec_act1'];
    81         $ec_default_entry = $_POST['ec_entry_sel'];
     69        $ec_default_entry =  $_POST['ec_entry_sel'];
    8270      break;
    8371      default:
    84         $page['errors'][] = 'Demande inconnue : $_POST[\'ec_act1\'] = '.$_POST['ec_act1'];
     72        $page['errors'][] =
     73         'Bad argument : $_POST[\'ec_act1\'] = '.$_POST['ec_act1'];
    8574    }
    8675  }
    8776  else
    88    $page['errors'][] = 'Tentative d\'utilisation d\'une entrée inexistante ($_POST[\'ec_entry_sel\'] = '.$_POST['ec_entry_sel'].')';
     77   $page['errors'][] =
     78    'Entry doesn\'t exist ($_POST[\'ec_entry_sel\'] = '.
     79    $_POST['ec_entry_sel'].')';
    8980}
    9081
     
    9788  (count($ec_lists['user_ids']) == 0) ? 'style = "display:none;"' : ''
    9889);
    99 $template->assign('ec_no_assoc', ((mysql_num_rows(pwg_query('
     90$template->assign('ec_no_assoc', ((mysql_num_rows(pwg_query("
    10091  SELECT *
    101   FROM `'.IMAGE_CATEGORY_TABLE.'`
    102 '))) == 0));
     92  FROM `".IMAGE_CATEGORY_TABLE."`
     93"))) == 0));
    10394$template->assign('ec_is_creation', (
    10495    $ec_default_action == 'duplicate_entry_submit' or
     
    10899  )
    109100);
    110 $template->assign('ec_ap_ok',               $ec_ap_ok);
     101$template->assign('ec_ap_ok',               EC_AP_OK);
    111102$template->assign('ec_lists',               $ec_lists);
    112103$template->assign('ec_default_entry',       $ec_default_entry);
    113104$template->assign('ec_default_action',      $ec_default_action);
    114105$template->assign('ec_def_auto_code_dg_nb', $ec_def_auto_code_dg_nb);
     106$template->assign('ec_auto_code_dg_nb',
     107 $ec_conf_possible_values['auto_code_dg_nb']);
    115108
    116109?>
  • extensions/event_cats/admin/config.inc.php

    r4092 r4329  
    11<?php
     2// +-----------------------------------------------------------------------+
     3// | Plugin Name : Event Cats                                              |
     4// | Plugin Version : 1.0                                                  |
     5// | File Version : 1.0                                                    |
     6// | Plugin Version author : LucMorizur                                    |
     7// | Plugin description : (plugin for Piwigo, http://piwigo.org )          |
     8// | This plugin allows an account to be automatically logged in ; and to  |
     9// | let users duplicate the account they are logged with, to get benefits |
     10// | of the groups of the previous account, immediately on their new acc.  |
     11// | Ce plugin permet d'identifier automatiquement un compte ; et permet à |
     12// | un utilisateur de dupliquer un compte, pour que le nouveau compte     |
     13// | bénéficie immédiatement de l'affectation aux groupes de l'ancien cpte |
     14// +-----------------------------------------------------------------------+
     15
     16// +-----------------------------------------------------------------------+
     17// | Piwigo - a PHP based picture gallery                                  |
     18// +-----------------------------------------------------------------------+
     19// | Copyright(C) 2008-2009 Piwigo Team                  http://piwigo.org |
     20// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
     21// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
     22// +-----------------------------------------------------------------------+
     23// | This program is free software; you can redistribute it and/or modify  |
     24// | it under the terms of the GNU General Public License as published by  |
     25// | the Free Software Foundation                                          |
     26// |                                                                       |
     27// | This program is distributed in the hope that it will be useful, but   |
     28// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
     29// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
     30// | General Public License for more details.                              |
     31// |                                                                       |
     32// | You should have received a copy of the GNU General Public License     |
     33// | along with this program; if not, write to the Free Software           |
     34// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
     35// | USA.                                                                  |
     36// +-----------------------------------------------------------------------+
     37
     38if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
     39
     40global $ec_conf_default, $ec_conf;
     41
     42// +-----------------------------------------------------------------------+
     43// | Global configuration management                                       |
     44// +-----------------------------------------------------------------------+
     45
     46// Gets $lang['Register'] and $lang['Duplicate']
     47load_language('common.lang');
     48load_language('duplic.lang', EVNTCATS_PATH);
     49
     50$template->assign(
     51  'ec_dup_link_conf',
     52  sprintf(
     53    l10n('Register replacement'),
     54    '&nbsp;&nbsp;<br />', // nicer line feed
     55    $lang['Register'],
     56    $lang['Duplicate']
     57  )
     58);
     59
     60// In case some $lang have the same index, overwrites them to have the ones
     61// needed here
     62load_language('plugin.lang', EVNTCATS_PATH);
     63
     64$template->assign('ec_ap_ok', EC_AP_OK);
     65$template->assign('add_pages', $ec_lists['add_pages']);
     66
     67// Sends configuration values to the template, described per key
     68$ec_conf2 = array(); $i = 0;
     69foreach ($ec_conf_default as $k => $v) { $ec_conf2[$k] = $ec_conf[$i]; $i++; }
     70$template->assign('ec_conf', $ec_conf2);
    271
    372?>
  • extensions/event_cats/admin/duplication.inc.php

    r4276 r4329  
    11<?php
     2// +-----------------------------------------------------------------------+
     3// | Plugin Name : Event Cats                                              |
     4// | Plugin Version : 1.0                                                  |
     5// | File Version : 1.0                                                    |
     6// | Plugin Version author : LucMorizur                                    |
     7// | Plugin description : (plugin for Piwigo, http://piwigo.org )          |
     8// | This plugin allows an account to be automatically logged in ; and to  |
     9// | let users duplicate the account they are logged with, to get benefits |
     10// | of the groups of the previous account, immediately on their new acc.  |
     11// | Ce plugin permet d'identifier automatiquement un compte ; et permet à |
     12// | un utilisateur de dupliquer un compte, pour que le nouveau compte     |
     13// | bénéficie immédiatement de l'affectation aux groupes de l'ancien cpte |
     14// +-----------------------------------------------------------------------+
    215
     16// +-----------------------------------------------------------------------+
     17// | Piwigo - a PHP based picture gallery                                  |
     18// +-----------------------------------------------------------------------+
     19// | Copyright(C) 2008-2009 Piwigo Team                  http://piwigo.org |
     20// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
     21// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
     22// +-----------------------------------------------------------------------+
     23// | This program is free software; you can redistribute it and/or modify  |
     24// | it under the terms of the GNU General Public License as published by  |
     25// | the Free Software Foundation                                          |
     26// |                                                                       |
     27// | This program is distributed in the hope that it will be useful, but   |
     28// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
     29// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
     30// | General Public License for more details.                              |
     31// |                                                                       |
     32// | You should have received a copy of the GNU General Public License     |
     33// | along with this program; if not, write to the Free Software           |
     34// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
     35// | USA.                                                                  |
     36// +-----------------------------------------------------------------------+
    337
     38if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
    439
     40global $ec_conf_default;
    541
     42// +-----------------------------------------------------------------------+
     43// | Duplication granted per groups/types/users management                 |
     44// +-----------------------------------------------------------------------+
    645
    7 
    8 /* */
    9 
    10 
    11 
    12 
    13 
    14 
    15 
    16 
     46// In evntcats_main_funcs.inc.php ; determines all granted groups/types/users
     47// Thanks to "true" parameter, assigns to the template all needed variables
    1748build_dup_arrays(true);
    1849
     50// Gets $lang['Register'] and $lang['Duplicate']
     51load_language('common.lang');
     52load_language('duplic.lang', EVNTCATS_PATH);
    1953
     54$template->assign(
     55  'ec_dup_link_conf',
     56  sprintf(
     57    l10n('Register replacement'),
     58    '&nbsp;&nbsp;<br />', // nicer line feed
     59    $lang['Register'],
     60    $lang['Duplicate']
     61  )
     62);
    2063
     64// In case some $lang have the same index, overwrites them to have the ones
     65// needed here
     66load_language('plugin.lang', EVNTCATS_PATH);
    2167
    22 
    23 
    24 
    25 
    26 
    27 
    28 
     68$ec_conf2 = array();
     69$ec_conf2['dup_allow'] = read_ec_conf('dup_allow');
     70$ec_conf2['duplic_display'] = read_ec_conf('duplic_display');
     71$template->assign('ec_conf', $ec_conf2);
    2972
    3073?>
  • extensions/event_cats/admin/evntcats_admin.php

    r4282 r4329  
    3838if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
    3939
    40 global $template, $conf, $lang, $prefixeTable, $ec_conf, $page, $ec_debug,
    41  $ec_lists,   // array of following arrays :
    42               //   $ec_lists['ec_table'] :
    43               //     Event Cats table, in function of each entry id
    44               //   $ec_lists['ec_codes'] : // Used ?
    45               //     array of useful data, in function of entries codes
    46               //   $ec_lists['add_pages'] :
    47               //     array of Add. Pages names in function of their id
    48               //   $ec_lists['categories'] :
    49               //     array of category names in function of their id
    50               //   $ec_lists['user_ids'] :
    51               //     array of usernames in function of their id
    52  $ec_ap_ok;   // whether Additional Pages is installed and activated
     40global $template, $conf, $lang, $prefixeTable,
     41       $ec_conf, $page, $ec_debug, $ec_lists;
    5342
    5443load_language('plugin.lang', EVNTCATS_PATH);
     
    8877build_ec_lists(); // in evntcats_main_funcs.php
    8978
    90 // If no entry exist, default page is 'autolog_new'.
     79// If no entry exist, default tab is 'autolog_new'.
    9180$page['tab'] = (!($ec_exist_entries = (mysql_num_rows(pwg_query("
    9281  SELECT * FROM `".EVNTCATS_TABLE."`
     
    9483")) != 0))) ? 'autolog_new' : 'autolog_entries';
    9584
    96 $ec_exist_duplic = ((mysql_num_rows(pwg_query("
    97   SELECT * FROM `".EVNTCATS_TABLE."`
    98   WHERE `code` IS NULL
    99   AND `arg1` IS NOT NULL
    100   AND `arg2` IS NOT NULL ;
    101   ")) != 0) or
    102   (read_ec_conf('duplic_gen') != 0) or
    103   (read_ec_conf('duplic_type') != 0)
    104 );
    105 
    106 // If no entry exist, but some duplication management entries exist, default tab is 'duplication'.
    107 if (!$ec_exist_entries and $ec_exist_duplic) $page['tab'] = 'duplication';
    108 
    109 
    110 /*
    111 
    112 if (isset($_POST[''])) {
    113 }
    114 
    115 
    116 if (isset($_POST['ec_duplic_conf_submit'])) {
    117 }
    118 
    119 if (isset($_POST['deny_groups_submit'])) {
    120 }
    121 
    122 if (isset($_POST['grant_groups_submit'])) {
    123 }
    124 
    125 if (isset($_POST['deny_types_submit'])) {
    126 }
    127 
    128 if (isset($_POST['grant_types_submit'])) {
    129 }
    130 
    131 if (isset($_POST['deny_users_submit'])) {
    132 }
    133 
    134 if (isset($_POST['grant_users_submit'])) {
    135 }
    136 
    137 
    138 
    139 
    140 */
    141 
    142 
    143 
    144 
    145 
    146 if (isset($_POST['ec_act1'])) {
     85// If no entry exist, but some duplication management entries exist, default
     86// tab is 'duplication'.
     87if (!$ec_exist_entries and read_ec_conf('dup_allow') == '2') $page['tab'] = 'duplication';
     88
     89// If a modification of duplication management has been posted, default tab
     90// is 'duplication'.
     91if (
     92  count($_POST) > 0 and
     93  count(array_intersect(array(
     94    'ec_duplic_conf_submit',
     95    'deny_groups_submit',
     96    'grant_groups_submit',
     97    'deny_types_submit',
     98    'grant_types_submit',
     99    'deny_users_submit',
     100    'grant_users_submit',
     101  ),
     102  array_keys($_POST))) > 0
     103) $page['tab'] = 'duplication';
     104
     105if (isset($_POST['ec_conf_submit'])) {
     106  if (isset($_POST['ec_dup_conf']))
     107   if (!change_ec_conf('dup_allow', $_POST['ec_dup_conf']))
     108    ec_end2(7);
     109  if (isset($_POST['ec_dup_disp']))
     110   if (!change_ec_conf('duplic_display', $_POST['ec_dup_disp']))
     111    ec_end2(8);
     112  if (isset($_POST['ec_unknown']))
     113   if (!change_ec_conf('unknown_code', $_POST['ec_unknown']))
     114    ec_end2(9);
     115  if (isset($_POST['ec_in_up_aps']))
     116   if (!change_ec_conf('unknown_code_ap_id', $_POST['ec_in_up_aps']))
     117    ec_end2(10);
     118  $page['tab'] = 'config';
     119  $page['infos'][] = l10n('ec_config_saved');
     120}
     121elseif (isset($_POST['ec_duplic_conf_submit'])) {
     122  if (isset($_POST['ec_dup_conf'])) {
     123    if (
     124      read_ec_conf('dup_allow') == '2' and
     125      $_POST['ec_dup_conf'] != '2'
     126    ) $page['tab'] = 'config';
     127    if (!change_ec_conf('dup_allow', $_POST['ec_dup_conf']))
     128     ec_end2(5);
     129  }
     130  if (isset($_POST['ec_dup_disp']))
     131   if (!change_ec_conf('duplic_display', $_POST['ec_dup_disp']))
     132    ec_end2(6);
     133  $page['infos'][] = l10n('ec_config_saved');
     134}
     135elseif (
     136  isset($_POST['deny_groups_submit']) and
     137  isset($_POST['deny_groups']) and
     138  count($_POST['deny_groups']) > 0
     139) {
     140  if (pwg_query("
     141    DELETE
     142    FROM `".EVNTCATS_TABLE."`
     143    WHERE `arg1` = 1
     144      AND `arg2` IN (".implode(',', $_POST['deny_groups']).");
     145  ") === false) ec_end2(1);
     146  else $page['infos'][] = l10n('ec_config_saved');
     147}
     148elseif (
     149  isset($_POST['grant_groups_submit']) and
     150  isset($_POST['grant_groups']) and
     151  count($_POST['grant_groups']) > 0
     152) {
     153  $inserts = array();
     154  foreach ($_POST['grant_groups'] as $v) $inserts[] = array(
     155    'arg1' => 1,
     156    'arg2' => intval($v)
     157  );
     158  mass_inserts(EVNTCATS_TABLE, array('arg1', 'arg2'), $inserts);
     159  $page['infos'][] = l10n('ec_config_saved');
     160}
     161elseif (
     162  isset($_POST['deny_types_submit']) and (
     163    isset($_POST['deny_types']) and
     164    count($_POST['deny_types']) > 0 or
     165    isset($_POST['deny_generic'])
     166  )
     167) {
     168  $c = ($no_previous = (count($t = mysql_fetch_row(pwg_query("
     169    SELECT `arg2`
     170    FROM `".EVNTCATS_TABLE."`
     171    WHERE `code` IS NULL
     172      AND `arg1` = 3
     173      AND `arg2` IS NOT NULL
     174    LIMIT 1;
     175  "))) == 0)) ? 0 : intval($t[0]);
     176  if (isset($_POST['deny_types']))
     177   foreach ($_POST['deny_types'] as $v) $c = $c & ~$v;
     178  if (isset($_POST['deny_generic'])) $c = $c & 7;
     179  $q = ($no_previous) ? "
     180    INSERT INTO `".EVNTCATS_TABLE."`
     181    (`arg1`, `arg2`)
     182    VALUES (3, $c);
     183  " : "
     184    UPDATE `".EVNTCATS_TABLE."`
     185    SET `arg2` = $c
     186    WHERE `arg1` = 3
     187    LIMIT 1 ;
     188  ";
     189  if (pwg_query($q) === false) ec_end2(3);
     190  else $page['infos'][] = l10n('ec_config_saved');
     191}
     192elseif (
     193  isset($_POST['grant_types_submit']) and (
     194    isset($_POST['grant_types']) and
     195    count($_POST['grant_types']) > 0 or
     196    isset($_POST['grant_generic'])
     197  )
     198) {
     199  $c = ($no_previous = (count($t = mysql_fetch_row(pwg_query("
     200    SELECT `arg2`
     201    FROM `".EVNTCATS_TABLE."`
     202    WHERE `code` IS NULL
     203      AND `arg1` = 3
     204      AND `arg2` IS NOT NULL
     205    LIMIT 1;
     206  "))) == 0)) ? 0 : intval($t[0]);
     207  if (isset($_POST['grant_types']))
     208   foreach ($_POST['grant_types'] as $v) $c = $c | $v;
     209  if (isset($_POST['grant_generic'])) $c = $c | 8;
     210  $q = ($no_previous) ? "
     211    INSERT INTO `".EVNTCATS_TABLE."`
     212    (`arg1`, `arg2`)
     213    VALUES (3, $c);
     214  " : "
     215    UPDATE `".EVNTCATS_TABLE."`
     216    SET `arg2` = $c
     217    WHERE `arg1` = 3
     218    LIMIT 1 ;
     219  ";
     220  if (pwg_query($q) === false) ec_end2(4);
     221  else $page['infos'][] = l10n('ec_config_saved');
     222}
     223elseif (
     224  isset($_POST['deny_users_submit']) and
     225  isset($_POST['deny_users']) and
     226  count($_POST['deny_users']) > 0
     227) {
     228  if (pwg_query("
     229    DELETE
     230    FROM `".EVNTCATS_TABLE."`
     231    WHERE `arg1` = 2
     232      AND `arg2` IN (".implode(',', $_POST['deny_users']).");
     233  ") === false) ec_end2(2);
     234  else $page['infos'][] = l10n('ec_config_saved');
     235}
     236elseif (
     237  isset($_POST['grant_users_submit']) and
     238  isset($_POST['grant_users']) and
     239  count($_POST['grant_users']) > 0
     240) {
     241  $inserts = array();
     242  foreach ($_POST['grant_users'] as $v) $inserts[] = array(
     243    'arg1' => 2,
     244    'arg2' => intval($v)
     245  );
     246  mass_inserts(EVNTCATS_TABLE, array('arg1', 'arg2'), $inserts);
     247  $page['infos'][] = l10n('ec_config_saved');
     248}
     249elseif (isset($_POST['ec_act1'])) {
    147250  if (
    148251    $_POST['ec_act1'] == 'disable' and
     
    180283          build_ec_table();
    181284        }
    182         else ec_end1('ec_entry_sel', 'ec_bad_argument1');
     285        else ec_end1('ec_entry_sel', 'Bad argument : ');
    183286      }
    184287      else if ($_POST['ec_act1'] == 'toggle_forced')
     
    193296    break;
    194297    case 'duplication':
    195       if ($ec_exist_duplic) $page['tab'] = $_GET['tab'];
     298      if (read_ec_conf('dup_allow') == '2') $page['tab'] = $_GET['tab'];
    196299    break;
    197300    case 'autolog_new':
     
    211314")) != 0);
    212315
    213 $ec_exist_duplic = ((mysql_num_rows(pwg_query("
    214   SELECT * FROM `".EVNTCATS_TABLE."`
    215   WHERE `code` IS NULL
    216   AND `arg1` IS NOT NULL
    217   AND `arg2` IS NOT NULL ;
    218   ")) != 0) or
    219   (read_ec_conf('duplic_gen') != 0) or
    220   (read_ec_conf('duplic_type') != 0)
    221 );
     316if (
     317  $page['tab'] == 'duplication' and
     318  read_ec_conf('dup_allow') != '2'
     319) $page['tab'] = 'config';
    222320
    223321$tabsheet = new tabsheet();
     
    233331               l10n('ec_tab_autoid_new'),
    234332               $my_base_url.'&amp;tab=autolog_new');
    235 if ($ec_exist_duplic) $tabsheet->add('duplication',
     333if (read_ec_conf('dup_allow') == '2') $tabsheet->add('duplication',
    236334               l10n('ec_tab_duplication'),
    237335               $my_base_url.'&amp;tab=duplication');
  • extensions/event_cats/admin/evntcats_theme.css

    r4092 r4329  
    7272  vertical-align:middle;
    7373}
     74
     75.content h4 {
     76  text-align:center;
     77}
  • extensions/event_cats/admin/template/autolog_entries.tpl

    r4228 r4329  
    66<div style = "text-align:right; font-style:italic;">
    77  {if $ec_ap_ok}
    8     {'ec_plugin_ap_ok'|@translate}
     8    {'Additional Pages active'|@translate}
    99    <script type = "text/javascript">
    10       var ec_ap_ok = true;
     10      var ec_ap_ok = {if $ec_ap_ok2}true{else}false{/if};
    1111    </script>
    1212  {else}
    13     {'ec_plugin_ap_nok'|@translate}
     13    {'Additional Pages inactive'|@translate}
    1414    <script type = "text/javascript">
    1515      var ec_ap_ok = false;
     
    2424 
    2525  <div style = "text-align:center; font-weight:bold; font-size:120%;">
    26     <a href = "#ec_top" name = "ec_top" title = "{'ec_top_title'|@translate}">
     26    <a href = "#ec_top" name = "ec_top" title = "{'Place title on top ttip'|@translate}">
    2727      <!--[if !IE]> <--> <label> <!--> <![endif]-->
    28         {'ec_entry_table_title'|@translate}
     28        {'Autolog entries'|@translate}
    2929      <!--[if !IE]> <--> </label> <!--> <![endif]-->
    3030      <!-- What we're able to do for our "prefered" browser |-( ...!  -->
    31     </a><br>
    32   </div><br>
     31    </a><br />
     32  </div><br />
    3333 
    3434  {* <!-- Table to show codes present in MySQL table --> *}
    35   <table class = "table2" width = "97%" {* id = "" *}>
     35  <table class = "table2" width = "97%">
    3636    <thead>
    3737      <tr class = "throw">
    38         <td>{'ec_col_name_entry'|@translate}</td>
    39         <td>{'ec_col_name_code'|@translate}</td>
    40         <td>{'ec_col_name_user'|@translate}</td>
    41         <td>{'ec_col_name_bhvr'|@translate}</td>
    42         <td>{'ec_col_name_dspl'|@translate}</td>
    43         <td>{'ec_col_name_actn'|@translate}</td>
     38        <td>{'Entry'|@translate}</td>
     39        <td>{'Code'|@translate}</td>
     40        <td>{'Username'|@translate}</td>
     41        <td>{'Identification'|@translate}</td>
     42        <td>{'Displayed page'|@translate}</td>
     43        <td>{'Tools'|@translate}</td>
    4444      </tr>
    4545    </thead>
     
    6262            <a href = "javascript:void(0);" onclick = "ec_check_ds({$code_line.id});">
    6363              <img src = "{$EVNTCATS_URLS.ROOT}icon/disable.png" class = "button"
    64                alt = "{'ec_url_disable'|@translate}" title = "{'ec_url_disable'|@translate}" />
     64               alt = "{'Outdate entry ttip'|@translate}" title = "{'Outdate entry ttip'|@translate}" />
    6565            </a>
    6666            {if $code_line.Forced == 'true'}
    67               <a href = "javascript:void(0);" title = "{'ec_url_forced'|@translate}" onclick = "ec_toggle_forced({$code_line.id}, false);">
     67              <a href = "javascript:void(0);" title = "{'Unforce display ttip'|@translate}" onclick = "ec_toggle_forced({$code_line.id}, false);">
    6868                <img class = "button" src = "{$EVNTCATS_URLS.ROOT}icon/forced.png"
    69                  alt = "{'ec_url_forced'|@translate}" title = "{'ec_url_forced'|@translate}"
     69                 alt = "{'Unforce display ttip'|@translate}" title = "{'Unforce display ttip'|@translate}"
    7070                />
    7171              </a>
    7272            {else}
    73               <a href = "javascript:void(0);" title = "{'ec_url_nforced'|@translate}" onclick = "ec_toggle_forced({$code_line.id}, true);">
     73              <a href = "javascript:void(0);" title = "{'Force display ttip'|@translate}" onclick = "ec_toggle_forced({$code_line.id}, true);">
    7474                <img class = "button" src = "{$EVNTCATS_URLS.ROOT}icon/nforced.png"
    75                  alt = "{'ec_url_nforced'|@translate}" title = "{'ec_url_nforced'|@translate}"/>
     75                 alt = "{'Force display ttip'|@translate}" title = "{'Force display ttip'|@translate}"/>
    7676              </a>
    77               <a href = "javascript:void(0);" title = "{'ec_url_duplicate'|@translate}" onclick = "ec_duplicate_entry({$code_line.id});">
     77              <a href = "javascript:void(0);" title = "{'Duplicate entry ttip'|@translate}" onclick = "ec_duplicate_entry({$code_line.id});">
    7878                <img src = "{$EVNTCATS_URLS.ROOT}icon/duplicate.png" class = "button" style = "border:none"
    79                  alt = "{'ec_url_duplicate'|@translate}" title = "{'ec_url_duplicate'|@translate}" />
     79                 alt = "{'Duplicate entry ttip'|@translate}" title = "{'Duplicate entry ttip'|@translate}" />
    8080              </a>
    8181            {/if}
     
    9191    <tr class = "row2">
    9292      <td style = "padding-top:5px; padding-bottom:5px; font-weight:bold;">
    93         {'ec_lower_tools_desc'|@translate}
     93        {'Selected entry'|@translate}
    9494      </td>
    95       <td style = "{* text-align:center; *}padding-top:5px; padding-bottom:5px;">
    96         <label title = "{'ec_url_tooltip'|@translate}">
    97           {'ec_show_URL'|@translate}
    98           <input type = "text" id = "ec_show_URL" size = "100%" title = "{'ec_url_tooltip'|@translate}" readonly = "readonly" />
    99         </label><br>
    100         <br>
     95      <td style = "padding-top:5px; padding-bottom:5px;">
     96        <label title = "{'Copy URL ttip'|@translate}">
     97          {'URL'|@translate}
     98          <input type = "text" id = "ec_show_URL" size = "100%" title = "{'Copy URL ttip'|@translate}" readonly = "readonly" />
     99        </label><br />
     100        <br />
    101101        <a
    102          href = "javascript:void(0);" title = "{'ec_test_tooltip'|@translate}" alt = "{'ec_test_tooltip'|@translate}"
     102         href = "javascript:void(0);" title = "{'Test URL ttip'|@translate}" alt = "{'Test URL ttip'|@translate}"
    103103         id = "ec_table_URL" onclick = "return ec_check_tst();" class = "ec_lower_tools"
    104104        />
    105105          <img src = "{$EVNTCATS_URLS.ROOT}icon/url2.png" class = "button"/>
    106           {'ec_test_text'|@translate}
     106          {'Test'|@translate}
    107107        </a>
    108108        &nbsp;&nbsp;
    109109        <a href = "javascript:void(0);" onclick = "ec_check_dl();" id = "ec_del_link_id" class = "ec_lower_tools"
    110          alt = "{'ec_url_delete'|@translate}" title = "{'ec_url_delete'|@translate}"
     110         alt = "{'Delete entry ttip'|@translate}" title = "{'Delete entry ttip'|@translate}"
    111111        >
    112112          <img src = "{$EVNTCATS_URLS.ROOT}icon/delete.png" class = "button"/>
    113           {'ec_delete_text'|@translate}
     113          {'Delete'|@translate}
    114114        </a>
    115115        &nbsp;&nbsp;
    116116        <a href = "javascript:void(0);" onclick = "ec_check_m();" id = "ec_mod_link_id" class = "ec_lower_tools"
    117          alt = "{'ec_modify_tooltip'|@translate}" title = "{'ec_modify_tooltip'|@translate}"
     117         alt = "{'Modify entry ttip'|@translate}" title = "{'Modify entry ttip'|@translate}"
    118118        >
    119119          <img src = "{$EVNTCATS_URLS.ROOT}icon/modify.png" class = "button"/>
    120           {'ec_modify_text'|@translate}
     120          {'Modify'|@translate}
    121121        </a>
    122122      </td>
    123123    </tr>
    124   </table><br>
     124  </table><br />
    125125</form>
    126126
     
    137137
    138138{include file='../../../plugins/event_cats/admin/template/footer.inc.tpl'}
    139 
    140 {* <!--
    141 --> *}
  • extensions/event_cats/admin/template/autolog_new.js

    r4263 r4329  
    11/* Event Cats Javascript functions LucMorizur June - ... 2009 */
    22
     3// All variables declarations
     4// Once this entire file has been read, some JS code is executed at the end
     5// of .tpl file, thus some values below are modified during the HTML page
     6// "reading and displaying"
    37var ec_avoid_infinite_loop      = true;
    48var ec_is_creation              = true;
     
    446450            d.ec_new_code.ec_in_up_cat.selectedIndex
    447451           ].label;
    448           /* if (cat_display) ec_new_user_text =
    449            (ec_reg_cat2.test(ec_cat_sel)) ?
    450             ec_reg_cat1.exec(ec_cat_sel)[1] : ec_cat_sel;
    451           else */ ec_new_user_text = ec_reg_cat3.exec(ec_cat_sel)[1];
     452          ec_new_user_text = ec_reg_cat3.exec(ec_cat_sel)[1];
    452453          ec_new_user_text = ec_new_user_text.replace(/\s/g, '_');
    453454          ec_new_user_text = ec_new_user_text.substr(0, 50);
     
    464465            return false;
    465466          }
    466           t2 = ec_JS_message['ec_up_code_lbl_home'];
     467          t2 = ec_JS_message['Home'];
    467468          ec_new_user_text = t2 + '_' + t1;
    468469        break;
  • extensions/event_cats/admin/template/autolog_new.tpl

    r4263 r4329  
    66<div style = "text-align:right; font-style:italic;">
    77  {if $ec_ap_ok}
    8     {'ec_plugin_ap_ok'|@translate}
    9     <script type = "text/javascript"><!--
    10       var ec_ap_ok = true; //-->
     8    {'Additional Pages active'|@translate}
     9    <script type = "text/javascript">
     10      var ec_ap_ok = {if count($ec_lists.add_pages) == 0}false{else}true{/if};
    1111    </script>
    1212  {else}
    13     {'ec_plugin_ap_nok'|@translate}
    14     <script type = "text/javascript"><!--
    15       var ec_ap_ok = false; //-->
     13    {'Additional Pages inactive'|@translate}
     14    <script type = "text/javascript">
     15      var ec_ap_ok = false;
    1616    </script>
    1717  {/if}
     
    2525  {* <!-- Page title. Can be "New entry" or "Entry modification" --> *}
    2626  <div style = "text-align:center;">
    27     <a style = "font-weight:bold; font-size:120%;" href = "#ec_top" name = "ec_top" title = "{'ec_top_title'|@translate}">
     27    <a style = "font-weight:bold; font-size:120%;" href = "#ec_top" name = "ec_top" title = "{'Place title on top ttip'|@translate}">
    2828      <!--[if !IE]> <--> <label> <!--> <![endif]-->
    2929        {if $ec_is_creation}
    30           {'ec_new_entry_title'|@translate}
     30          {'New entry title'|@translate}
    3131        {else}
    32           {'ec_modify_entry_title'|@translate}
     32          {'Modify entry title'|@translate}
    3333        {/if}
    3434      <!--[if !IE]> <--> </label> <!--> <![endif]-->
     
    3636    </a>
    3737    {if $ec_is_creation}
    38       <br><br>
    39       <input class = "submit" type = "button" name = "ec_submit_gen_full_auto" value = "{'ec_new_full_auto'|@translate}"
     38      <br /><br />
     39      <input class = "submit" type = "button" name = "ec_submit_gen_full_auto" value = "{'Full auto'|@translate}"
    4040       id = "ec_submit_gen_full_auto_id" onclick = "ec_gen_full_auto();" style = "margin-top:0;"/>
    4141    {/if}
    42   </div><br>
     42  </div><br />
    4343 
    4444  {* <!-- Table (borders not visible) with 3 rows for parameters adjustment --> *}
     
    5050      <td style = "vertical-align:top; font-weight:bold;">
    5151        {if $ec_is_creation}
    52           {'ec_new_entry'|@translate}
     52          {'Code'|@translate}
    5353        {else}
    54           {'ec_sel_entry'|@translate}
     54          {'Selected entry'|@translate}
    5555        {/if}
    5656      </td>
     
    6161            <label for = "ec_in_up_code_id" onclick = "ec_mark_code('ec_sel_code_new');" {$ec_hidden_when_no_code} >
    6262              <input type = "radio" name = "ec_sel_code" for = "ec_in_up_code_id" value = "new" id = "ec_sel_code_new"/>
    63               {'ec_up_code_lbl_code_new'|@translate}
     63              {'New code'|@translate}
    6464            </label>
    6565            <span {$ec_hidden_when_no_code} >&nbsp;</span>
    6666            <label for = "ec_in_up_code_id" style = "margin:0;">
    67               <input class = "submit" type = "button" name = "ec_submit_gen_code" value = "{'ec_new_entry_button'|@translate}"
     67              <input class = "submit" type = "button" name = "ec_submit_gen_code" value = "{'Auto code button'|@translate}"
    6868               id = "ec_submit_gen_code_id" onclick = "ec_gen_code();" style = "margin:0;"
    6969              />
    7070            </label>
    71             {'ec_gen_code_nb_pre'|@translate}
     71            {'Auto code mid'|@translate}
    7272            <select name = "ec_in_up_auto_code_length" id = "ec_in_up_auto_code_length_id" onchange = "ec_auto_code_digits_nb = this.value;">
    73               <option value =  "4" >4{'ec_gen_code_nb_min'|@translate}</option>
    74               <option value =  "5" >5</option>
    75               <option value =  "8" >8</option>
    76               <option value = "10">10</option>
    77               <option value = "12">12</option>
    78               <option value = "15">15</option>
    79               <option value = "16">16</option>
    80               <option value = "20">20</option>
    81               <option value = "24">24</option>
    82               <option value = "25">25</option>
    83               <option value = "30">30</option>
    84               <option value = "32">32{'ec_gen_code_nb_max'|@translate}</option>
     73              {foreach from=$ec_auto_code_dg_nb item=ec_item name=listloop}
     74                <option value = "{$ec_item}">
     75                  {$ec_item}
     76                  {if $smarty.foreach.listloop.index == 0}
     77                    {'Auto code min'|@translate}
     78                  {/if}
     79                  {if $smarty.foreach.listloop.index == count($ec_auto_code_dg_nb) - 1}
     80                    {'Auto code max'|@translate}
     81                  {/if}
     82                </option>
     83              {/foreach}
    8584            </select>
    86             {'ec_gen_code_nb_end'|@translate}<br>
     85            {'Auto code end'|@translate}<br />
    8786            <ul><li>
    8887              <input type = "text" name = "ec_in_up_code" maxlength = "32" size = "40"
     
    9695            <label for = "ec_in_up_code_list_id" onclick = "ec_mark_code('ec_sel_code_old');" {$ec_hidden_when_no_code}>
    9796              <input type = "radio" name = "ec_sel_code" for = "ec_in_up_code_list_id" {$ec_hidden_when_no_code} value = "old" id = "ec_sel_code_old" />
    98               {'ec_up_code_lbl_code_old'|@translate}
     97              {'Existing code'|@translate}
    9998            </label>
    10099            <select name = "ec_in_up_code_list" id = "ec_in_up_code_list_id" onchange = "ec_change_code_list(this.value);" {$ec_hidden_when_no_code} >
     
    102101                <option value = "{$ec_val.id}">{$ec_key}</option>
    103102              {/foreach}
    104             </select><br>
     103            </select><br />
    105104          </li>
    106105         
     
    124123    <tr>
    125124      <td style = "vertical-align:top; font-weight:bold;">
    126         {'ec_up_code_lbl_user'|@translate}<br>
    127         <br>
    128         <span style = "font-weight:bold; color:red;" id = "ec_in_up_pwd_warn">&nbsp;</span><br>
     125        {'Identified user'|@translate}<br />
     126        <br />
     127        <span style = "font-weight:bold; color:red;" id = "ec_in_up_pwd_warn">&nbsp;</span><br />
    129128      </td>
    130129      <td>
     
    134133            <label onclick = "return ec_mark_user('ec_sel_user_none');">
    135134              <input type = "radio" name = "ec_sel_user" value = "none" id = "ec_sel_user_none" />
    136               {'ec_up_code_lbl_user_none'|@translate}
    137             </label><br>
     135              {'No user'|@translate}
     136            </label><br />
    138137          </li>
    139138        {/if}
     
    143142          <label for = "ec_in_up_usr_txt_id" onclick = "return ec_mark_user('ec_sel_user_new');" {$ec_hidden_when_no_user} >
    144143            <input type = "radio" name = "ec_sel_user" for = "ec_in_up_usr_txt_id" value = "new" id = "ec_sel_user_new" {$ec_hidden_when_no_user} />
    145             {'ec_up_code_lbl_user_new'|@translate}
     144            {'New generic user'|@translate}
    146145          </label>
    147146          <span {$ec_hidden_when_no_user} >&nbsp;</span>
    148147          <label for = "ec_in_up_usr_txt_id" style = "margin:0;">
    149             <input class = "submit" type = "button" name = "ec_submit_gen_user" value = "{'ec_up_code_lbl_gen_user'|@translate}"
     148            <input class = "submit" type = "button" name = "ec_submit_gen_user" value = "{'Generate username'|@translate}"
    150149             id = "ec_submit_gen_user_id" onclick = "ec_gen_user();"
    151150            />
    152           </label><br>
     151          </label><br />
    153152          <ul><li>
    154             <label class = "ec_block" onclick = "return ec_mark_user('ec_sel_user_new');">{'ec_new_user_name'|@translate}<br>
     153            <label class = "ec_block" onclick = "return ec_mark_user('ec_sel_user_new');">{'New username'|@translate}<br />
    155154              <input type = "text" name = "login" id = "ec_in_up_usr_txt_id" maxlength = "50"
    156155               size = "20" onblur = "ec_new_user_text = this.value; ec_check_user_text();"
    157156              />
    158157            </label>
    159             <label class = "ec_block" onclick = "return ec_mark_user('ec_sel_user_new');">{'ec_new_user_pswd'|@translate}<br>
     158            <label class = "ec_block" onclick = "return ec_mark_user('ec_sel_user_new');">{'New password'|@translate}<br />
    160159              <input type = "text" name = "password" id = "ec_in_up_psd_txt_id" maxlength = "32"
    161160               size = "20" onblur = "ec_new_psd_text = this.value; ec_check_pwd_text();"
    162161              />
    163162            </label>
    164             <label class = "ec_block" onclick = "return ec_mark_user('ec_sel_user_new');">{'ec_confirm_pswd'|@translate}<br>
     163            <label class = "ec_block" onclick = "return ec_mark_user('ec_sel_user_new');">{'Confirm password'|@translate}<br />
    165164              <input type = "password" id = "ec_confirm_psd_txt_id" maxlength = "32" size = "20"/>
    166165            </label>
     
    170169              />
    171170              <span onMouseover = "ec_chk_over_grp = true;" onMouseout = "ec_chk_over_grp = false;">
    172                 {'ec_new_user_group'|@translate}
    173               </span><br>
     171                {'New group'|@translate}
     172              </span><br />
    174173              <input type = "text" name = "groupname" id = "ec_in_up_grp_txt_id" maxlength = "32"
    175174               size = "20" onblur = "ec_new_grp_text = this.value; if (this.value != '') ec_selected_old_group = true;"
    176175              />
    177176            </label>
    178           </li></ul><br>
     177          </li></ul><br />
    179178        </li>
    180179       
     
    183182          <label for = "ec_in_up_usr_list_id" onclick = "return ec_mark_user('ec_sel_user_old');" {$ec_hidden_when_no_user} >
    184183            <input type = "radio" name = "ec_sel_user" for = "ec_in_up_usr_list_id" {$ec_hidden_when_no_user} value = "old" id = "ec_sel_user_old" />
    185             {'ec_up_code_lbl_user_old'|@translate}
     184            {'Existing user'|@translate}
    186185          </label>
    187186          <select name = "ec_in_up_usr_list" id = "ec_in_up_usr_list_id" onchange = "ec_change_user_list(this.value);" {$ec_hidden_when_no_user} >
     
    189188              <option label = "{$ec_val}" value = "{$ec_key}" >{$ec_val}</option>
    190189            {/foreach}
    191           </select><br>
     190          </select><br />
    192191        </li>
    193192      </td>
     
    197196    <tr>
    198197      <td style = "vertical-align:top;">
    199         <span style = "font-weight:bold;">{'ec_up_code_lbl_action'|@translate}</span><br>
     198        <span style = "font-weight:bold;">{'Displayed page'|@translate}</span><br />
    200199        <label class = "ec_block" for = "ec_in_up_forced_id" style = "margin-top:5px;" onclick = "ec_mark_forced();">
    201200          <input type = "checkbox" name = "ec_in_up_forced" id = "ec_in_up_forced_id">
     
    209208          <label class = "ec_block" onclick = "return ec_mark_action('ec_input_action_home');">
    210209            <input type = "radio" name = "ec_input_action" value = "home" id = "ec_input_action_home" />
    211             {'ec_up_code_lbl_home'|@translate}
     210            {'Home'|@translate}
    212211          </label>
    213212         
     
    216215            <label class = "ec_block" onclick = "return ec_mark_action('ec_input_action_refused');">
    217216              <input type = "radio" name = "ec_input_action" value = "refused" id = "ec_input_action_refused" />
    218               {'ec_up_code_lbl_refused'|@translate}
     217              {'Access denied'|@translate}
    219218            </label>
    220219          {/if}
     
    225224          >
    226225            <input type = "radio" name = "ec_input_action" value = "img" id = "ec_input_action_img" for = "ec_in_up_imgs_id" />
    227             {'ec_up_code_lbl_img'|@translate}<br>
     226            {'Image id'|@translate}<br />
    228227            <input type = "text" name = "ec_in_up_img" id = "ec_in_up_imgs_id" maxlength = "6"
    229228             size = "10" onblur = "ec_selected_img = this.value; ec_check_img_text();" onfocus = "return ec_mark_action('ec_input_action_img');"
     
    239238          >
    240239            <input type = "radio" name = "ec_input_action" value = "add_p" id = "ec_input_action_add_p" for = "ec_in_up_aps_id" />
    241             {'ec_up_code_lbl_aps'|@translate}<br>
     240            {'Additional Page'|@translate}<br />
    242241            <select class = "categoryList" name = "ec_in_up_aps" size="30" id = "ec_in_up_aps_id" onchange = "ec_selected_AP = this.value;" >
    243242              {html_options options=$ec_lists.add_pages}
     
    252251              onMouseover = "ec_chk_nover_cat = false;" onMouseout = "ec_chk_nover_cat = true;"
    253252            />
    254             <span onMouseover = "ec_chk_nover_cat = false;" onMouseout = "ec_chk_nover_cat = true;">{'ec_up_code_lbl_cats'|@translate}</span><br>
     253            <span onMouseover = "ec_chk_nover_cat = false;" onMouseout = "ec_chk_nover_cat = true;">{'Category'|@translate}</span><br />
    255254            <select class = "categoryList" name = "ec_in_up_cat" size = "30" id = "ec_in_up_cats_id" onchange = "ec_selected_cat = this.value;">
    256255              {html_options options=$ec_lists.categories}
     
    271270<script type = "text/javascript"><!--
    272271  ec_is_creation                          = {if $ec_is_creation}true{else}false{/if};
    273   ec_up_code_lbl_forced_txt               = "{'ec_up_code_lbl_forced'|@translate}";
     272  ec_up_code_lbl_forced_txt               = "{'Forced'|@translate}";
    274273  ec_JS_message['ec_gen_user_act_miss']   = "{'ec_gen_user_act_miss'|@translate|@escape:javascript}";
    275274  ec_JS_message['ec_act_cat_miss']        = "{'ec_act_cat_miss'|@translate|@escape:javascript}";
     
    283282  ec_JS_message['ec_conf_pwd_dont_match'] = "{'ec_conf_pwd_dont_match'|@translate|@escape:javascript}";
    284283  ec_JS_message['ec_confirm_change_user'] = "{'ec_confirm_change_user'|@translate|@escape:javascript}";
    285   ec_JS_message['ec_up_code_lbl_home']    = "{'ec_up_code_lbl_home'|@translate}";
     284  ec_JS_message['Home']                   = "{'Home'|@translate}";
    286285  ec_JS_message['ec_submit_code_miss']    = "{'ec_submit_code_miss'|@translate}";
    287286  ec_JS_message['ec_submit_user_miss']    = "{'ec_submit_user_miss'|@translate}";
     
    304303
    305304{include file='../../../plugins/event_cats/admin/template/footer.inc.tpl'}
    306 
    307 {* <!--
    308 --> *}
  • extensions/event_cats/admin/template/config.tpl

    r4263 r4329  
    33{include file='../../../plugins/event_cats/admin/template/header.inc.tpl'}
    44
    5 {* <!-- Available soon... --> *}
     5{* <!-- Whether plugin Additionnal Pages is active or not --> *}
     6<div style = "text-align:right; font-style:italic;">
     7  {if $ec_ap_ok}
     8    {'Additional Pages active'|@translate}
     9    <script type = "text/javascript">
     10      var ec_ap_ok = {if count($add_pages) == 0}false{else}true{/if};
     11    </script>
     12  {else}
     13    {'Additional Pages inactive'|@translate}
     14    <script type = "text/javascript">
     15      var ec_ap_ok = false;
     16    </script>
     17  {/if}
     18</div>
    619
    7 <p>Bientôt disponible :-] !</p>
     20<form action = "" method = "post" class = "titrePage" name = "ec_gen_conf" onsubmit = "return ec_check_submit();">
     21 
     22  {* <!-- Duplication configuration parameters --> *}
     23  <h4>{'Duplication'|@translate}</h4>
     24  <table>
     25    <tr>
     26      <td style = "text-align:right; font-weight:bold;">
     27        {'Duplication allowance'|@translate}&nbsp;&nbsp;
     28      </td>
     29      <td>
     30        <label for = "ec_dup_conf_none_id">
     31          <input
     32            type = "radio" name = "ec_dup_conf" value = "0" id = "ec_dup_conf_none_id"
     33            {if $ec_conf.dup_allow == '0'} checked = "checked" {/if}
     34          />
     35          {'No account'|@translate}
     36        </label><br />
     37        <label for = "ec_dup_conf_group_id">
     38          <input
     39            type = "radio" name = "ec_dup_conf" value = "2" id = "ec_dup_conf_group_id"
     40            {if $ec_conf.dup_allow == '2'} checked = "checked" {/if}
     41          />
     42          {'Selection per group'|@translate}
     43        </label><br />
     44        <label for = "ec_dup_conf_all_id">
     45          <input
     46            type = "radio" name = "ec_dup_conf" value = "1" id = "ec_dup_conf_all_id"
     47            {if $ec_conf.dup_allow == '1'} checked = "checked" {/if}
     48          />
     49          {'All accounts'|@translate}
     50        </label>
     51      </td>
     52      <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td> {* <!-- sorry :-\ --> *}
     53      <td style = "text-align:right; font-weight:bold;">
     54        {* <!-- Replace "Register" link ? --> *}
     55        {$ec_dup_link_conf}&nbsp;&nbsp;
     56      </td>
     57      <td>
     58        <label for = "ec_dup_disp_normal_id">
     59          <input
     60            type = "radio" name = "ec_dup_disp" value = "0" id = "ec_dup_disp_normal_id"
     61            {if $ec_conf.duplic_display == '0'} checked = "checked" {/if}
     62          />
     63          {'No account'|@translate}
     64        </label><br />
     65        <label for = "ec_dup_disp_but_gen_id">
     66          <input
     67            type = "radio" name = "ec_dup_disp" value = "2" id = "ec_dup_disp_but_gen_id"
     68            {if $ec_conf.duplic_display == '2'} checked = "checked" {/if}
     69          />
     70          {'All but generics'|@translate}
     71        </label><br />
     72        <label for = "ec_dup_disp_dup_id">
     73          <input
     74            type = "radio" name = "ec_dup_disp" value = "1" id = "ec_dup_disp_dup_id"
     75            {if $ec_conf.duplic_display == '1'} checked = "checked" {/if}
     76          />
     77          {'All accounts'|@translate}
     78        </label><br />
     79      </td>
     80    </tr>
     81    <tr><td>&nbsp;</td><td>&nbsp;</td></tr>
     82  </table>
     83 
     84  {* <!-- What to do if an unknown code is used --> *}
     85  <h4>{'Unknown code'|@translate}</h4>
     86  <table>
     87    <tr>
     88      <td style = "text-align:right; vertical-align:top; font-weight:bold;">
     89        {'Page for unknown code'|@translate}&nbsp;&nbsp;
     90      </td>
     91      <td>
     92        <label for = "ec_unknown_0_id" onclick = "ec_mark_action('ec_unknown_0_id');">
     93          <input type = "radio" name = "ec_unknown" value = "0" id = "ec_unknown_0_id" />
     94          {'Home'|@translate}
     95        </label><br />
     96        <label for = "ec_unknown_1_id" onclick = "ec_mark_action('ec_unknown_1_id');">
     97          <input type = "radio" name = "ec_unknown" value = "1" id = "ec_unknown_1_id" />
     98          {'Access denied'|@translate}
     99        </label><br />
     100        {* <!-- Additionnal Page, provided the plugin is activated and at least one Add. P. is available --> *}
     101        <label class = "ec_block" for = "ec_in_up_aps_id" {if !$ec_ap_ok or count($add_pages) == 0} style = "display:none;" {/if}
     102         onclick = "ec_mark_action('ec_unknown_2_id');"
     103        >
     104          <input type = "radio" name = "ec_unknown" value = "2" id = "ec_unknown_2_id" for = "ec_in_up_aps_id" />
     105          {'Additional Page'|@translate}<br />
     106          <select class = "categoryList" name = "ec_in_up_aps" size="30" id = "ec_in_up_aps_id" onchange = "ec_selected_AP = this.value;" >
     107            {html_options options=$add_pages}
     108          </select>
     109        </label>
     110      </td>
     111    </tr>
     112    <tr><td>&nbsp;</td><td>&nbsp;</td></tr>
     113  </table>
     114 
     115  <div style = "text-align:center;">
     116    <input class = "submit" type = "submit" name = "ec_conf_submit" value = "{'Submit'|@translate}" />
     117  </div>
     118 
     119</form>
     120
    8121
    9122{* <!-- JavaScript functions --> *}
    10 {* <!--
    11 <script type = "text/javascript" src = "{$RACINE_URL}{$EVNTCATS_PATH}admin/template/autolog_new.js"></script>
     123<script type = "text/javascript" src = "{$RACINE_URL}{$EVNTCATS_PATH}admin/template/config.js"></script>
    12124<script type = "text/javascript"><!--
    13   ec_JS_message['ec_gen_user_act_miss'] = "{'ec_gen_user_act_miss'|@translate|@escape:javascript}";
    14   ec_JS_message['ec_act_cat_miss']      = "{'ec_act_cat_miss'|@translate|@escape:javascript}";
    15   ec_JS_message['ec_new_pwd_gen']       = "{'ec_new_pwd_gen'|@translate|@escape:javascript}";
    16   ec_JS_message['ec_up_code_lbl_home']  = "{'ec_up_code_lbl_home'|@translate}";
    17   ec_init();
     125  ec_JS_message                                              = "{'ec_gen_user_act_miss'|@translate|@escape:javascript}";
     126  ec_selected_action                                          = "{$ec_conf.unknown_code}";
     127  ec_selected_AP                                              = "{$ec_conf.unknown_code_ap_id}";
     128  document.ec_gen_conf.ec_unknown[ec_selected_action].checked = 'checked';
     129  if (de('ec_unknown_2_id').checked != '') ec_mark_action('ec_unknown_2_id');
    18130//--></script>
    19 --> *}
    20131
    21132{include file='../../../plugins/event_cats/admin/template/footer.inc.tpl'}
    22 
    23 {* <!--
    24 --> *}
  • extensions/event_cats/admin/template/duplication.tpl

    r4276 r4329  
    22
    33{include file='../../../plugins/event_cats/admin/template/header.inc.tpl'}
    4 
    5 {* <!-- Available soon... --> *}
    6 <p>Bientôt disponible :-] !</p>
    74
    85<!-- Aknowledgement ----------------------------------------------------------
     
    1411<form action = "" method = "post" class = "titrePage" name = "ec_duplic_conf">
    1512  <fieldset>
    16     <legend>{'ec_duplication_config'|@translate}</legend>
     13    <legend>{'Configuration'|@translate}</legend>
    1714    <table>
    1815      <tr>
    19         <td>
    20           <span style = "font-weight:bold;">{'ec_duplication_allowance'|@translate}&nbsp;&nbsp;</span>
     16        <td style = "text-align:right; font-weight:bold;">
     17          {'Duplication allowance'|@translate}&nbsp;&nbsp;
    2118        </td>
    2219        <td>
    2320          <label for = "ec_dup_conf_none_id">
    24             <input type = "radio" name = "ec_dup_conf[]" value = "none" id = "ec_dup_conf_none_id" />
    25             {'ec_dup_allowance_none'|@translate}
    26           </label><br>
     21            <input
     22              type = "radio" name = "ec_dup_conf" value = "0" id = "ec_dup_conf_none_id"
     23              {if $ec_conf.dup_allow == '0'} checked = "checked" {/if}
     24            />
     25            {'No account'|@translate}
     26          </label><br />
    2727          <label for = "ec_dup_conf_group_id">
    28             <input type = "radio" name = "ec_dup_conf[]" value = "group" id = "ec_dup_conf_group_id" />
    29             {'ec_dup_allowance_group'|@translate}
    30           </label><br>
     28            <input
     29              type = "radio" name = "ec_dup_conf" value = "2" id = "ec_dup_conf_group_id"
     30              {if $ec_conf.dup_allow == '2'} checked = "checked" {/if}
     31            />
     32            {'Selection per group'|@translate}
     33          </label><br />
    3134          <label for = "ec_dup_conf_all_id">
    32             <input type = "radio" name = "ec_dup_conf[]" value = "all" id = "ec_dup_conf_all_id" />
    33             {'ec_dup_allowance_all'|@translate}
     35            <input
     36              type = "radio" name = "ec_dup_conf" value = "1" id = "ec_dup_conf_all_id"
     37              {if $ec_conf.dup_allow == '1'} checked = "checked" {/if}
     38            />
     39            {'All accounts'|@translate}
    3440          </label>
     41        </td>
     42        <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td> {* <!-- sorry :-\ --> *}
     43        <td style = "text-align:right; font-weight:bold;">
     44          {$ec_dup_link_conf}&nbsp;&nbsp;
     45        </td>
     46        <td>
     47          <label for = "ec_dup_disp_normal_id">
     48            <input
     49              type = "radio" name = "ec_dup_disp" value = "0" id = "ec_dup_disp_normal_id"
     50              {if $ec_conf.duplic_display == '0'} checked = "checked" {/if}
     51            />
     52            {'No account'|@translate}
     53          </label><br />
     54          <label for = "ec_dup_disp_but_gen_id">
     55            <input
     56              type = "radio" name = "ec_dup_disp" value = "2" id = "ec_dup_disp_but_gen_id"
     57              {if $ec_conf.duplic_display == '2'} checked = "checked" {/if}
     58            />
     59            {'All but generics'|@translate}
     60          </label><br />
     61          <label for = "ec_dup_disp_dup_id">
     62            <input
     63              type = "radio" name = "ec_dup_disp" value = "1" id = "ec_dup_disp_dup_id"
     64              {if $ec_conf.duplic_display == '1'} checked = "checked" {/if}
     65            />
     66            {'All accounts'|@translate}
     67          </label><br />
    3568        </td>
    3669      </tr>
    3770    </table>
    38     <input class = "submit" type = "submit" name = "ec_duplic_conf_submit" value = "{'ec_dup_conf_sbmt_lbl'|@translate}" />
     71    <input class = "submit" type = "submit" name = "ec_duplic_conf_submit" value = "{'Save dup. config btn'|@translate}" />
    3972  </fieldset>
    4073</form>
     
    4679 
    4780  <fieldset>
    48     <legend>{'ec_duplic_ok'|@translate}</legend>
     81    <legend>{'Duplication allowed'|@translate}</legend>
    4982    <ul>
    5083      {foreach from=$groups_granted_ids item=id}
     
    5285      {/foreach}
    5386    </ul>
    54     <input class = "submit" type = "submit" name = "deny_groups_submit" value = "{'ec_dup_grp_ok_sbmt_lbl'|@translate}" />
     87    <input class = "submit" type = "submit" name = "deny_groups_submit" value = "{'Deny to groups btn'|@translate}" />
    5588  </fieldset>
    5689 
    5790  <fieldset>
    58     <legend>{'ec_duplic_nok'|@translate}</legend>
     91    <legend>{'Duplication denied'|@translate}</legend>
    5992    <ul>
    6093      {foreach from=$groups_denied_ids item=id}
     
    6295      {/foreach}
    6396    </ul>
    64     <input class = "submit" type = "submit" name = "grant_groups_submit" value = "{'ec_dup_grp_nok_sbmt_lbl'|@translate}" />
     97    <input class = "submit" type = "submit" name = "grant_groups_submit" value = "{'Grant to groups btn'|@translate}" />
    6598  </fieldset>
    6699 
    67   <h4>{'ec_dup_types'|@translate}</h4>
     100  <h4>{'Types'|@translate}</h4>
    68101 
    69102  <fieldset>
    70     <legend>{'ec_duplic_ok'|@translate}</legend>
     103    <legend>{'Duplication allowed'|@translate}</legend>
    71104    <ul>
    72105      {if $ec_gen_granted}
    73       <li><label><input type = "checkbox" name = "deny_generic" {* id = "ec_dup_types_generic_nok_id" *} /> {'user_status_generic'|@translate}</label></li>
     106      <li><label><input type = "checkbox" name = "deny_generic" /> {'user_status_generic'|@translate}</label></li>
    74107      <br />
    75108      {/if}
     
    78111      {/foreach}
    79112    </ul>
    80     <input class = "submit" type = "submit" name = "deny_types_submit" value = "{'ec_dup_typ_sbmt_nok_lbl'|@translate}" />
     113    <input class = "submit" type = "submit" name = "deny_types_submit" value = "{'Deny to types btn'|@translate}" />
    81114  </fieldset>
    82115 
    83116  <fieldset>
    84     <legend>{'ec_duplic_nok'|@translate}</legend>
     117    <legend>{'Duplication denied'|@translate}</legend>
    85118    <ul>
    86119      {if !$ec_gen_granted}
    87       <li><label><input type = "checkbox" name = "grant_generic" {* id = "ec_dup_types_generic_ok_id" *} /> {'user_status_generic'|@translate}</label></li>
     120      <li><label><input type = "checkbox" name = "grant_generic" /> {'user_status_generic'|@translate}</label></li>
    88121      <br />
    89122      {/if}
     
    92125      {/foreach}
    93126    </ul>
    94     <input class = "submit" type = "submit" name = "grant_types_submit" value = "{'ec_dup_typ_sbmt_ok_lbl'|@translate}" />
     127    <input class = "submit" type = "submit" name = "grant_types_submit" value = "{'Grant to types btn'|@translate}" />
    95128  </fieldset>
    96129 
     
    98131 
    99132  <fieldset>
    100     <legend>{'ec_duplic_ok'|@translate}</legend>
     133    <legend>{'Duplication allowed'|@translate}</legend>
    101134    <ul>
    102135      {foreach from=$users_granted_direct_ids item=id}
     
    104137      {/foreach}
    105138    </ul>
    106     <input class = "submit" type = "submit" name = "deny_users_submit" value = "{'ec_dup_usr_ok_sbmt_lbl'|@translate}" />
     139    <input class = "submit" type = "submit" name = "deny_users_submit" value = "{'Deny to users btn'|@translate}" />
    107140  </fieldset>
    108141 
    109142  <fieldset>
    110     <legend>{'ec_duplic_ok_groups'|@translate}</legend>
     143    <legend>{'Dup. allowed tks to'|@translate}</legend>
    111144    {if isset($user_granted_indirects) }
    112145    <ul>
     
    119152 
    120153  <fieldset>
    121     <legend>{'ec_duplic_nok'|@translate}</legend>
     154    <legend>{'Duplication denied'|@translate}</legend>
    122155    <ul>
    123156      {foreach from=$users_denied_ids item=id}
     
    125158      {/foreach}
    126159    </ul>
    127     <input class = "submit" type = "submit" name = "grant_users_submit" value = "{'ec_dup_usr_nok_sbmt_lbl'|@translate}" />
     160    <input class = "submit" type = "submit" name = "grant_users_submit" value = "{'Grant to users btn'|@translate}" />
    128161  </fieldset>
    129162 
    130163</form>
    131164
    132 
    133 
    134 
    135 {* <!-- JavaScript functions --> *}
    136 {* <!--
    137 <script type = "text/javascript" src = "{$RACINE_URL}{$EVNTCATS_PATH}admin/template/autolog_new.js"></script>
    138 <script type = "text/javascript"><!--
    139   ec_JS_message['ec_gen_user_act_miss'] = "{'ec_gen_user_act_miss'|@translate|@escape:javascript}";
    140   ec_JS_message['ec_act_cat_miss']      = "{'ec_act_cat_miss'|@translate|@escape:javascript}";
    141   ec_JS_message['ec_new_pwd_gen']       = "{'ec_new_pwd_gen'|@translate|@escape:javascript}";
    142   ec_JS_message['ec_up_code_lbl_home']  = "{'ec_up_code_lbl_home'|@translate}";
    143   ec_init();
    144 //--></script>
    145 --> *}
    146 
    147165{include file='../../../plugins/event_cats/admin/template/footer.inc.tpl'}
    148166
    149 {* <!--
    150 --> *}
    151 
  • extensions/event_cats/admin/template/header.inc.tpl

    r4247 r4329  
    55{* <!-- Page title --> *}
    66<div class = "titrePage" style = "margin-top: -20px;">
    7   <h2>{'ec_admin_page_title'|@translate} {$EVNTCATS_VERSION}</h2>
     7  <h2>{'Admin page title'|@translate} {$EVNTCATS_VERSION}</h2>
    88</div>
    99
    1010{* <!-- JavaScript warning message --> *}
    1111<div id = "ec_js_warn">
    12   {'ec_javascript_needed'|@translate}<br><br>
     12  {'JS needed'|@translate}<br /><br />
    1313</div>
    1414<script type = "text/javascript"><!-- // Removes JavaScript warning message
     
    1919{if $ec_howto}
    2020  <div>
    21     {'ec_admin_page_howto'|@translate}
     21    {'Acknowledgement'|@translate}
    2222  </div>
    2323  <p>
Note: See TracChangeset for help on using the changeset viewer.