source: extensions/event_cats/admin/autolog_new.inc.php @ 3999

Last change on this file since 3999 was 3999, checked in by LucMorizur, 15 years ago

[Event Cats] Many changes, mainly separate existing/new entries

File size: 15.2 KB
Line 
1{* <!-- Event Cats (event categories) LucMorizur June - ... 2009 --> *}
2
3{* <!-- Page title --> *}
4<div class = "titrePage" style="margin-top: -20px;">
5  <h2>{'ec_admin_page_title'|@translate} {$EVNTCATS_VERSION}</h2>
6</div>
7
8{* <!-- JavaScript warning message --> *}
9<div id = "ec_js_warn">
10  {'ec_javascript_needed'|@translate}<br><br>
11</div>
12<script type = "text/javascript"><!-- // Removes JavaScript warning message
13  document.getElementById('ec_js_warn').innerHTML = ''; //-->
14</script>
15
16{* <!-- EC Presentation --> *}
17{if $ec_howto}
18  <div>
19    {'ec_admin_page_howto'|@translate}
20  </div>
21{/if}
22
23<p>
24  <hr width = 75% size = 3 />
25</p>
26
27{* <!-- Whether plugin Additionnal Pages is active or not --> *}
28<div style = "text-align:right; font-style:italic;">
29  {if $ec_ap_ok}
30    {'ec_plugin_ap_ok'|@translate}
31    <script type = "text/javascript"><!--
32      var ec_ap_ok = true; //-->
33    </script>
34  {else}
35    {'ec_plugin_ap_nok'|@translate}
36    <script type = "text/javascript"><!--
37      var ec_ap_ok = false; //-->
38    </script>
39  {/if}
40</div>
41
42{* <!-- First section : form to view and modify codes, or create a new one --> *}
43<form class = "filter" method = "post" name = "ec_up_code" action = "">
44  <input type = "hidden" id = "ec_act1_id" name = "ec_act1" />
45 
46  <div style = "text-align:center; font-weight:bold; font-size:120%;">{'ec_entry_table_title'|@translate}</div><br>
47 
48  {* <!-- Table to show codes present in MySQL table --> *}
49  <table class = "table2" width = "97%" {* id = "" *}>
50    <thead>
51      <tr class = "throw">
52        <td>{'ec_col_name_entry'|@translate}</td>
53        <td>{'ec_col_name_code'|@translate}</td>
54        <td>{'ec_col_name_user'|@translate}</td>
55        <td>{'ec_col_name_bhvr'|@translate}</td>
56        <td>{'ec_col_name_dspl'|@translate}</td>
57        <td>{'ec_col_name_actn'|@translate}</td>
58      </tr>
59    </thead>
60   
61    {foreach from=$code_list item=code_line name=code_loop}
62      <tr class = "{if $smarty.foreach.code_loop.index is odd}row1{else}row2{/if}">
63        <td>
64          <input type = "radio" name = "ec_entry_sel" value = "{$code_line.id}" id = "selection-{$code_line.id}"
65           onclick = "ec_mark_line({$code_line.id});"
66          />
67          <label for = "selection-{$code_line.id}">{$code_line.id}</label>
68        </td>
69        <td><label for = "selection-{$code_line.id}" id = "ec_table_code_{$code_line.id}">{$code_line.Code}</label></td>
70        <td><label for = "selection-{$code_line.id}" id = "ec_table_usr_{$code_line.id}">{$code_line.Username}</label></td>
71        <td><label for = "selection-{$code_line.id}">{$code_line.Action|@translate}</label></td>
72        <td><label for = "selection-{$code_line.id}">{$code_line.Arg1}</label></td>
73        <td>
74          <a
75           href = "{$code_line.code_URL}" title = "{'ec_test_tooltip'|@translate}"
76           id = "ec_table_URL_{$code_line.id}" onclick = "return ec_check_tst({$code_line.id});"
77          />
78            <img src = "{$EVNTCATS_URLS.ROOT}icon/url2.png" class = "button" style = "border:none"
79             alt = "{'ec_test_tooltip'|@translate}" title = "{'ec_test_tooltip'|@translate}" />
80          </a>
81          <a href = "javascript:void();" onclick = "ec_check_d({$code_line.id}, 'delete');">
82            <img src = "{$EVNTCATS_URLS.ROOT}icon/delete.png" class = "button"
83             alt = "{'ec_url_delete'|@translate}" title = "{'ec_url_delete'|@translate}" />
84          </a>
85          {if $code_line.log_OK}
86            <a href = "javascript:void();" onclick = "ec_check_d({$code_line.id}, 'disable');">
87              <img src = "{$EVNTCATS_URLS.ROOT}icon/disable.png" class = "button"
88               alt = "{'ec_url_disable'|@translate}" title = "{'ec_url_disable'|@translate}" />
89            </a>
90            {if $code_line.Forced == 'true'}
91              <a href = "javascript:void()" title = "{'ec_url_forced'|@translate}" onclick = "ec_toggle_forced({$code_line.id}, false);">
92                <img class = "button" src = "{$EVNTCATS_URLS.ROOT}icon/forced.png"
93                 {if $code_line.f_pb} style = "border:solid medium red;" {/if}
94                 alt = "{'ec_url_forced'|@translate}" title = "{'ec_url_forced'|@translate}"
95                />
96              </a>
97            {else}
98              <a href = "javascript:void()" title = "{'ec_url_nforced'|@translate}" onclick = "ec_toggle_forced({$code_line.id}, true);">
99                <img class = "button" src = "{$EVNTCATS_URLS.ROOT}icon/nforced.png"
100                 alt = "{'ec_url_nforced'|@translate}" title = "{'ec_url_nforced'|@translate}"/>
101              </a>
102              {if !$code_line.f_pb}
103                <a href = "javascript:void()" title = "{'ec_url_duplicate'|@translate}" onclick = "ec_duplicate_entry({$code_line.id});">
104                  <img src = "{$EVNTCATS_URLS.ROOT}icon/duplicate.png" class = "button" style = "border:none"
105                   alt = "{'ec_url_duplicate'|@translate}" title = "{'ec_url_duplicate'|@translate}" />
106                </a>
107              {/if}
108            {/if}
109          {/if}
110        </td>
111      </tr>
112    {/foreach}
113  </table>
114 
115  {* <!-- This is not really a table, looks like a unique cell at the end of previous table,
116  to show URL for currently selected line in above table --> *}
117  <table class = "table2" width = "97%">
118    <tr class = "row2">
119      <td style = "text-align:center; padding-top:5px; padding-bottom:5px;">
120        <label title = "{'ec_url_tooltip'|@translate}">
121          {'ec_show_URL'|@translate}
122          <input type = "text" id = "ec_show_URL" size = "100%" title = "{'ec_url_tooltip'|@translate}" readonly = "readonly" />
123        </label>
124      </td>
125    </tr>
126  </table><br>
127 
128  {* <!-- Parameters list --> *}
129  <table style="border-spacing:30px" width = "97%">
130   
131    {* <!-- New entry --> *}
132    <tr>
133      <td>
134        <label for = "selection--1" onclick = "ec_mark_line(-1);">
135          <input type = "radio" name = "ec_entry_sel" value = "-1" id = "selection--1" onclick = "ec_mark_line(-1);" />
136          <span style = "font-weight:bold; font-style:italic; font-size:120%; text-decoration:underline;">{'ec_create_modify_code'|@translate}</span>
137        </label>
138      </td>
139      <td>
140        <input class = "submit" type = "button" name = "ec_submit_gen_full_auto" value = "{'ec_new_full_auto'|@translate}"
141         id = "ec_submit_gen_full_auto_id" onclick = "ec_gen_full_auto();" style = "margin-top:0;"
142        /><br>
143      </td>
144    </tr>
145   
146    {* <!-- Code selection --> *}
147    <tr>
148      <td><strong><span onclick = "Test();">{'ec_new_entry'|@translate}</span></strong></td>
149      <td>
150        <input type = "text" name = "ec_in_up_code" maxlength = "32" size = "40"
151         id = "ec_in_up_code_id" onclick = "ec_mark_line(-1);" onblur = "ec_new_code_text = this.value;"
152        />
153        &nbsp;
154        <label for = "ec_in_up_code_id" style = "margin:0;">
155          <input class = "submit" type = "button" name = "ec_submit_gen_code" value = "{'ec_new_entry_button'|@translate}"
156           id = "ec_submit_gen_code_id" onclick = "ec_gen_code();" style = "margin:0;"
157          />
158        </label>
159        {'ec_gen_code_nb_pre'|@translate}
160        <select name = "ec_in_up_auto_code_length" id = "ec_in_up_auto_code_length_id" onchange = "ec_auto_code_digits_nb = this.value;">
161          <option value = "4">4</option>
162          <option value = "5">5</option>
163          <option value = "8">8</option>
164          <option value = "10" selected = "selected">10</option>
165          <option value = "12">12</option>
166          <option value = "15">15</option>
167          <option value = "16">16</option>
168          <option value = "20">20</option>
169          <option value = "24">24</option>
170          <option value = "25">25</option>
171          <option value = "30">30</option>
172          <option value = "32">32{'ec_gen_code_nb_max'|@translate}</option>
173        </select>
174        {'ec_gen_code_nb_end'|@translate}
175      </td>
176    </tr>
177   
178    {* <!-- User to identify --> *}
179    <tr>
180      <td style = "vertical-align:top;"><strong>{'ec_up_code_lbl_user'|@translate}</strong></td>
181      <td>
182      <li>
183        {* <!-- None --> *}
184        <label onclick = "ec_mark_user('ec_sel_user_none');">
185          <input type = "radio" name = "ec_sel_user" value = "none" id = "ec_sel_user_none"
186           onclick = "ec_mark_user('ec_sel_user_none');"
187          />
188          {'ec_up_code_lbl_user_none'|@translate}
189        </label><br>
190      </li>
191       
192      <li>
193        {* <!-- New user (to create) --> *}
194        <label for = "ec_in_up_usr_txt_id" onclick = "ec_mark_user('ec_sel_user_new');">
195          <input type = "radio" name = "ec_sel_user" for = "ec_in_up_usr_txt_id" value = "new"
196           id = "ec_sel_user_new" onclick = "ec_mark_user('ec_sel_user_new');"
197          />
198          {'ec_up_code_lbl_user_new'|@translate}
199        </label>
200        &nbsp;
201        <input class = "submit" type = "button" name = "ec_submit_gen_user" value = "{'ec_up_code_lbl_gen_user'|@translate}"
202         id = "ec_submit_gen_user_id" onclick = "ec_gen_user();"
203        /><br>
204        <ul><li>
205          <label class = "ec_block">{'ec_new_user_name'|@translate}<br>
206            <input type = "text" name = "ec_in_up_usr_txt" id = "ec_in_up_usr_txt_id" maxlength = "32"
207             size = "20" onclick = "ec_mark_user('ec_sel_user_new');" onblur = "ec_new_user_text = this.value;"
208            />
209          </label>
210          <label class = "ec_block">{'ec_new_user_pswd'|@translate}<br>
211            <input type = "text" name = "ec_in_up_psd_txt" id = "ec_in_up_psd_txt_id" maxlength = "32"
212             size = "20" onclick = "ec_mark_user('ec_sel_user_new');" onblur = "ec_new_psd_text = this.value; ec_check_pwd_text();"
213            />
214          </label>
215          <label class = "ec_block">&nbsp;<br>
216            <span style = "font-weight:bold; color:red;" id = "ec_in_up_pwd_warn">&nbsp;</span>
217          </label>
218         
219        </li></ul><br>
220      </li>
221     
222      <li>
223        {* <!-- Known user --> *}
224        <label for = "ec_in_up_usr_list_id" onclick = "ec_mark_user('ec_sel_user_old');">
225          <input type = "radio" name = "ec_sel_user" for = "ec_in_up_usr_list_id"
226           value = "old" id = "ec_sel_user_old" onclick = "ec_mark_user('ec_sel_user_old');"
227          />
228          {'ec_up_code_lbl_user_old'|@translate}
229        </label>
230        <select name = "ec_in_up_usr_list" id = "ec_in_up_usr_list_id" onclick = "ec_mark_user('ec_sel_user_old');"
231         onchange = "ec_selected_old_user = this.value;"
232        >
233          <option label = "------------" value = "-1" id = "ec_old_user_-1">------------</option>
234          {foreach from=$ec_lists.user_ids key=ec_key item=ec_val name=opt_loop}
235            <option label = "{$ec_val}" value = "{$ec_key}" id = "ec_old_user_{$ec_key}">{$ec_val}</option>
236          {/foreach}
237        </select><br>
238      </li>
239      </td>
240    </tr>
241   
242    {* <!-- Page to display --> *}
243    <tr>
244      <td style = "vertical-align:top;"><strong>{'ec_up_code_lbl_action'|@translate}</strong></td>
245      <td>
246       
247        {* <!-- Additionnal Page, provided the plugin is activated --> *}
248        <label class = "ec_block" for = "ec_in_up_aps_id" onclick = "ec_mark_action('ec_input_action_add_p');"
249         {if !$ec_ap_ok}style = "display:none;"{/if}
250        >
251          <input type = "radio" name = "ec_input_action" value = "add_p" id = "ec_input_action_add_p" for = "ec_in_up_aps_id"
252           onclick = "ec_mark_action('ec_input_action_add_p');"
253          />
254          {'ec_up_code_lbl_aps'|@translate}<br>
255          <select class = "categoryList" name = "ec_in_up_aps" size="30" id = "ec_in_up_aps_id"
256           onclick = "ec_mark_action('ec_input_action_add_p');" onchange = "ec_selected_AP = this.value;"
257          >
258            <option label = "------------" value = "-1" style = "display:none;">------------</option>
259            {html_options options=$ec_lists.add_pages}
260          </select>
261        </label>
262       
263        {* <!-- Category --> *}
264        <label class = "ec_block" for = "ec_in_up_cats_id" onclick = "ec_mark_action('ec_input_action_cat');">
265          <input type = "radio" name = "ec_input_action" value = "cat" id = "ec_input_action_cat" for = "ec_in_up_cats_id"
266           onclick = "ec_mark_action('ec_input_action_cat');"
267          />
268          {'ec_up_code_lbl_cats'|@translate}<br>
269          <select class = "categoryList" name = "ec_in_up_cat" size = "30" id = "ec_in_up_cats_id"
270           onclick = "ec_mark_action('ec_input_action_cat');" onchange = "ec_selected_cat = this.value;"
271          >
272            <option label = "------------" value = "-1" style = "display:none;">------------</option>
273            {html_options options=$ec_lists.categories}
274          </select>
275        </label>
276       
277        {* <!-- Image --> *}
278        <label class = "ec_block" for = "ec_in_up_imgs_id" onclick = "ec_mark_action('ec_input_action_img');">
279          <input type = "radio" name = "ec_input_action" value = "img" id = "ec_input_action_img" for = "ec_in_up_imgs_id"
280           onclick = "ec_mark_action('ec_input_action_img');"
281          />
282          {'ec_up_code_lbl_img'|@translate}<br>
283          <input type = "text" name = "ec_in_up_imgs" id = "ec_in_up_imgs_id" maxlength = "6"
284           size = "10" onblur = "ec_selected_img = this.value; ec_check_img_text();" onfocus = "ec_mark_action('ec_input_action_img');"
285          /><br>
286          <span id = "ec_in_up_imgs_warn">&nbsp;</span>
287        </label>
288       
289        {* <!-- Index page --> *}
290        <label class = "ec_block" onclick = "ec_mark_action('ec_input_action_home');">
291          <input type = "radio" name = "ec_input_action" value = "home" id = "ec_input_action_home"
292           onclick = "ec_mark_action('ec_input_action_home');"
293          />
294          {'ec_up_code_lbl_home'|@translate}
295        </label>
296      </td>
297    </tr>
298  </table>
299  <p>
300    <input class = "submit" type = "submit" name = "ec_submit" value = "{'Submit'|@translate}"/>
301    <input class = "submit" type = "reset" name = "ec_reset" value = "{'Reset'|@translate}" onclick = "ec_init();"/>
302  </p>
303</form>
304
305{* <!-- JavaScript functions --> *}
306<script type = "text/javascript" src = "{$RACINE_URL}{$EVNTCATS_PATH}admin/evntcats_admin.js"></script>
307<script type = "text/javascript">
308  <!--
309 
310  // ec_test();
311 
312  ec_JS_message['ec_confirm_disable']   = "{'ec_confirm_disable'|@translate|@escape:javascript}";
313  ec_JS_message['ec_confirm_delete']    = "{'ec_confirm_delete'|@translate|@escape:javascript}";
314  ec_JS_message['ec_confirm_test']      = "{'ec_confirm_test'|@translate|@escape:javascript}";
315  ec_JS_message['ec_gen_user_act_miss'] = "{'ec_gen_user_act_miss'|@translate|@escape:javascript}";
316  ec_JS_message['ec_act_cat_miss']      = "{'ec_act_cat_miss'|@translate|@escape:javascript}";
317  ec_JS_message['ec_new_pwd_gen']       = "{'ec_new_pwd_gen'|@translate|@escape:javascript}";
318  ec_JS_message['ec_confirm_force']       = "{'ec_confirm_force'|@translate|@escape:javascript}";
319  ec_JS_message['ec_up_code_lbl_home']  = "{'ec_up_code_lbl_home'|@translate}";
320 
321  ec_init();
322 
323  {literal}
324 
325  function Test() {                                                /*
326    document.getElementById('ec_sel_user_none').checked = '';
327    document.getElementById('ec_sel_user_new').checked = '';
328    document.getElementById('ec_sel_user_old').checked = '';       */
329  }
330 
331  //-->{/literal}
332</script>
333
334{* <!-- {$test0tpl} --> *}
335<p>$_GET :</p>
336{$GET}
337<p>$_POST :</p>
338{$POST}
339<p>Autres :</p>
340{$test1tpl}
341{$test2tpl}
342{$test3tpl}
343
344{* <!--
345--> *}
346
Note: See TracBrowser for help on using the repository browser.