Changeset 3985 for extensions/event_cats/admin
- Timestamp:
- Oct 7, 2009, 9:31:04 AM (15 years ago)
- Location:
- extensions/event_cats/admin
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/event_cats/admin/evntcats_admin.js
r3970 r3985 10 10 var ec_selected_action = ''; 11 11 var ec_selected_img = ''; 12 var ec_auto_code_digits_nb = '8'; 12 var ec_auto_code_digits_default = 13 document.getElementById('ec_in_up_auto_code_length_id').value; 14 var ec_auto_code_digits_nb = ec_auto_code_digits_default; 13 15 var ec_new_code_text = ''; 14 16 var ec_new_user_text = ''; … … 265 267 } 266 268 267 function ec_check_d is(ec_id) {269 function ec_check_d(ec_id, ec_act) { 268 270 ec_mark_line(ec_id); 269 return confirm(ec_JS_message['ec_confirm_disable']); 270 } 271 272 function ec_check_del(ec_id) { 273 ec_mark_line(ec_id); 274 return confirm(ec_JS_message['ec_confirm_delete']); 271 if (confirm(ec_JS_message['ec_confirm_' + ec_act])) { 272 document.getElementById('ec_act1_id').value = ec_act; 273 document.forms['ec_up_code'].submit(); 274 /* return true; 275 } 276 else { 277 return false; */ 278 } 275 279 } 276 280 … … 285 289 286 290 function ec_init() { 291 ec_err = ''; 292 ec_checked_line = 0; 293 ec_selected_user = 'ec_sel_user_old'; 294 ec_selected_old_user = '-1'; 295 ec_selected_AP = '-1'; 296 ec_selected_cat = '-1'; 297 ec_selected_action = ''; 298 ec_selected_img = ''; 299 ec_new_code_text = ''; 300 ec_new_user_text = ''; 301 ec_new_psd_text = ''; 302 ec_old_new_psd_text = ''; 303 ec_test_reg = ''; 304 document.getElementById('ec_act1_id').value = ''; 305 document.getElementById('ec_in_up_pwd_warn').innerHTML = ''; 287 306 ec_mark_line(0); 288 307 } -
extensions/event_cats/admin/evntcats_admin.php
r3971 r3985 209 209 $arg2 = $ec_entry['arg2']; 210 210 $arg2_int = intval($arg2); 211 $log_OK = (strpos($ec_entry['action'], 'ec_ok') !== false);211 $log_OK = is_in($ec_entry['action'], 'ec_ok'); 212 212 213 213 // No specific need for "code" displaying … … 222 222 switch ($ec_entry['action']) { 223 223 224 case 'ec_ok_forced_pb' : 225 $page['errors'][$ec_entry['code']] = l10n('ec_forced_pb'); 224 case 'ec_ok_f_pb' : 225 case 'ec_ok_f_pb_img_pb' : 226 $page['errors'][$ec_entry['code']] = 227 $ec_entry['code'].' : '.l10n('ec_forced_pb'); 226 228 case 'ec_ok' : 227 229 case 'ec_ok_img_pb' : … … 243 245 l10n('ec_dspl_ok_cat_end') 244 246 ; 245 if ( $ec_entry['action'] == 'ec_ok_img_pb') {247 if (is_in($ec_entry['action'], '_img_pb')) { 246 248 $url_end.= '&img='.$arg2; 247 $page['errors'][] = l10n('ec_image_miss'); 249 $page['errors'][] = 250 $ec_entry['code'].' : '.l10n('ec_image_miss'); 248 251 $dspl.= 249 252 '<br>'.$span_err_pre. … … 307 310 break; 308 311 312 case 'ec_ok_f_pb_ap_pb' : 313 $page['errors'][$ec_entry['code']] = 314 $ec_entry['code'].' : '.l10n('ec_forced_pb'); 309 315 case 'ec_nok_ap_pb' : // No need to check here if Additional Pages is 310 316 case 'ec_ok_ap_pb' : // active : we can arrive here only when it is. 311 $page['errors'][] = l10n('ec_add_page_miss'); 312 if ($ec_entry['action'] == 'ec_ok_ap_pb') { 317 $page['errors'][] = 318 $ec_entry['code'].' : '.l10n('ec_add_page_miss'); 319 if (is_in($ec_entry['action'], 'ec_ok')) { 313 320 $url_end = '&ap='.$arg2; 314 321 $dspl = l10n('ec_dspl_ok_home'); … … 326 333 break; 327 334 335 case 'ec_ok_f_pb_cat_pb' : 336 $page['errors'][$ec_entry['code']] = 337 $ec_entry['code'].' : '.l10n('ec_forced_pb'); 328 338 case 'ec_ok_cat_pb' : 329 339 $url_end = '&cat='.$arg1; 330 $page['errors'][] = l10n('ec_category_miss'); 340 $page['errors'][] = 341 $ec_entry['code'].' : '.l10n('ec_category_miss'); 331 342 $dspl = 332 343 l10n('ec_dspl_nok_home'). … … 340 351 341 352 case 'ec_nok_action_pb' : 342 $page['errors'][$ec_entry['code']] = l10n('ec_action_pb'); 353 $page['errors'][$ec_entry['code']] = 354 $ec_entry['code'].' : '.l10n('ec_action_pb'); 343 355 $username = 344 356 $span_err_pre. … … 350 362 351 363 case 'ec_nok_userid_pb' : 352 $page['errors'][$ec_entry['code']] = l10n('ec_username_pb'); 364 $page['errors'][$ec_entry['code']] = 365 $ec_entry['code'].' : '.l10n('ec_username_pb'); 353 366 $username = 354 367 $span_err_pre. … … 360 373 361 374 case 'ec_nok_userid_miss' : 362 $page['errors'][$ec_entry['code']] = l10n('ec_username_miss'); 375 $page['errors'][$ec_entry['code']] = 376 $ec_entry['code'].' : '.l10n('ec_username_miss'); 363 377 $username = 364 378 $span_err_pre. … … 382 396 $code_list[$i] = array( 383 397 'id' => $i, 384 'Code' => $ec_entry['code'], 398 'Code' => (isset($page['errors'][$ec_entry['code']])) ? 399 $span_err_pre.$ec_entry['code'].$span_err_end : $ec_entry['code'], 385 400 'Username' => $username, 386 'Action' => $ec_entry['action'], 401 'Action' => (is_in($ec_entry['action'], 'ec_nok_')) ? 402 $span_err_pre.$ec_entry['action'].$span_err_end : $ec_entry['action'], 387 403 'Arg1' => $dspl, 388 404 'Forced' => $ec_entry['forced'], 389 405 'code_URL' => $code_URL, 390 406 'log_OK' => $log_OK, 407 'f_pb' => is_in($ec_entry['action'], '_f_pb'), 391 408 ); 392 409 } … … 407 424 $template->assign('RACINE_URL',ROOT_URL); 408 425 409 // $template->assign('test0tpl',str_from_var($ec_lists['ec_codes'])); 426 $template->assign('GET',str_from_var($_GET)); 427 $template->assign('POST',str_from_var($_POST)); 410 428 $template->assign('test1tpl',str_from_var($ec_lists)); 411 429 $template->assign('test2tpl',str_from_var($page['errors'])); 412 430 $template->assign('test3tpl',str_from_var($code_list)); 413 431 414 /* C'est quoi, ça ?...415 if ( isset($_POST['submit']) )416 {417 if (isset($_POST['account']) and isset($_POST['code']))418 {419 $conf['auto_log'][$_POST['code']] = $_POST['account'];420 }421 else422 {423 $page['errors']='arg_missing';424 }425 426 if (isset($_POST['duplication']))427 {428 $conf['allow_user_registration'] = ($_POST['duplication'] == '1');429 }430 }431 */432 433 432 $template->set_filenames(array('evntcats_admin_content' => dirname(__FILE__).'/evntcats_admin.tpl')); 434 433 $template->assign_var_from_handle('ADMIN_CONTENT','evntcats_admin_content'); -
extensions/event_cats/admin/evntcats_admin.tpl
r3970 r3985 1 1 {* <!-- Event Cats (event categories) LucMorizur June - ... 2009 --> *} 2 3 {* <!-- Tabs for admin page surfing --> *} {*4 <ul class = "tabsheet">5 <li class = "selected_tab">6 <a href = "??...">7 <span>{'ec_tab_autoid'|@translate}</span>8 </a>9 </li>10 <li class = "normal_tab">11 <a href = "??...">12 <span>{'ec_tab_config'|@translate}</span>13 </a>14 </li>15 </ul> *}16 17 {* <!-- Help button --> *} {*18 <ul class = "HelpActions">19 <li>20 <a href = "aide" onclick = "popuphelp(this.href); return false;" title = "{'ec_help'|@translate}" style = "margin-top: -28px;" >21 <img src = "{$ROOT_URL}{$themeconf.admin_icon_dir}/help.png" class = "button" alt = "(?)" />22 </a>23 </li>24 </ul> *}25 2 26 3 {* <!-- Page title --> *} … … 37 14 </script> 38 15 39 {* <!-- Upper banner : infos, errors...--> *}16 {* <!-- EC Presentation --> *} 40 17 {if $ec_howto} 41 18 <div> … … 48 25 </p> 49 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 50 42 {* <!-- First section : form to view and modify codes, or create a new one --> *} 51 43 <form class = "filter" method = "post" name = "ec_up_code" action = ""> 52 53 <div style = "text-align:right; font-style:italic;"> 54 {if $ec_ap_ok} 55 {'ec_plugin_ap_ok'|@translate} 56 <script type = "text/javascript"><!-- 57 var ec_ap_ok = true; //--> 58 </script> 59 {else} 60 {'ec_plugin_ap_nok'|@translate} 61 <script type = "text/javascript"><!-- 62 var ec_ap_ok = false; //--> 63 </script> 64 {/if} 65 </div> 44 <input type = "hidden" id = "ec_act1_id" name = "ec_act1" /> 66 45 67 46 <div style = "text-align:center; font-weight:bold; font-size:120%;">{'ec_entry_table_title'|@translate}</div><br> … … 100 79 </a> 101 80 102 <a href = "javascript:void()" onclick = "return ec_check_del({$code_line.id});"> 103 {* envoi formulaire par JS : document.forms[nom_formulaire].submit() ( http://www.toutjavascript.com/reference/reference.php?iref=178 ) *} 104 <img src = "{$EVNTCATS_URLS.ROOT}icon/delete.png" class = "button" style = "border:none" 81 <a href = "javascript:void();" onclick = "ec_check_d({$code_line.id}, 'delete');"> 82 <img src = "{$EVNTCATS_URLS.ROOT}icon/delete.png" class = "button" 105 83 alt = "{'ec_url_delete'|@translate}" title = "{'ec_url_delete'|@translate}" /> 106 84 </a> 107 85 {if $code_line.log_OK} 108 86 109 <a href = "javascript:void() " onclick = "return ec_check_dis({$code_line.id});">110 <img src = "{$EVNTCATS_URLS.ROOT}icon/disable.png" class = "button" style = "border:none"87 <a href = "javascript:void();" onclick = "ec_check_d({$code_line.id}, 'disable');"> 88 <img src = "{$EVNTCATS_URLS.ROOT}icon/disable.png" class = "button" 111 89 alt = "{'ec_url_disable'|@translate}" title = "{'ec_url_disable'|@translate}" /> 112 90 </a> … … 114 92 115 93 <a href = "javascript:void()" title = "{'ec_toggle_forced'|@translate}" onclick = "return ec_toggle_forced({$code_line.id});"> 116 <img class = "button" style = "border:none" src = "{$EVNTCATS_URLS.ROOT}icon/forced.png" 117 alt = "{'ec_url_forced'|@translate}" title = "{'ec_url_forced'|@translate}"/> 94 <img class = "button" src = "{$EVNTCATS_URLS.ROOT}icon/forced.png" 95 {if $code_line.f_pb} style = "border:solid medium red;" {/if} 96 alt = "{'ec_url_forced'|@translate}" title = "{'ec_url_forced'|@translate}" 97 /> 118 98 </a> 119 99 {else} 120 100 121 101 <a href = "javascript:void()" title = "{'ec_toggle_forced'|@translate}" onclick = "return ec_toggle_forced({$code_line.id});"> 122 <img class = "button" s tyle = "border:none" src = "{$EVNTCATS_URLS.ROOT}icon/nforced.png"102 <img class = "button" src = "{$EVNTCATS_URLS.ROOT}icon/nforced.png" 123 103 alt = "{'ec_url_nforced'|@translate}" title = "{'ec_url_nforced'|@translate}"/> 124 104 </a> 125 126 <a href = "javascript:void()" title = "{'ec_duplicate_entry'|@translate}" onclick = "return ec_duplicate_entry({$code_line.id});"> 127 <img src = "{$EVNTCATS_URLS.ROOT}icon/duplicate.png" class = "button" style = "border:none" 128 alt = "{'ec_url_duplicate'|@translate}" title = "{'ec_url_duplicate'|@translate}" /> 129 </a> 105 {if !$code_line.f_pb} 106 107 <a href = "javascript:void()" title = "{'ec_duplicate_entry'|@translate}" onclick = "return ec_duplicate_entry({$code_line.id});"> 108 <img src = "{$EVNTCATS_URLS.ROOT}icon/duplicate.png" class = "button" style = "border:none" 109 alt = "{'ec_url_duplicate'|@translate}" title = "{'ec_url_duplicate'|@translate}" /> 110 </a> 111 {/if} 130 112 {/if} 131 113 {/if} … … 319 301 </tr> 320 302 </table> 303 <p> 304 <input class = "submit" type = "submit" name = "ec_submit" value = "{'Submit'|@translate}"/> 305 <input class = "submit" type = "reset" name = "ec_reset" value = "{'Reset'|@translate}" onclick = "ec_init();"/> 306 </p> 321 307 </form> 322 308 … … 333 319 {/foreach} 334 320 335 ec_JS_message['ec_confirm_disable'] = "{'ec_confirm_disable'|@translate|@escape:javascript}";336 ec_JS_message['ec_confirm_delete'] = "{'ec_confirm_delete'|@translate|@escape:javascript}";337 ec_JS_message['ec_confirm_test'] = "{'ec_confirm_test'|@translate|@escape:javascript}";321 ec_JS_message['ec_confirm_disable'] = "{'ec_confirm_disable'|@translate|@escape:javascript}"; 322 ec_JS_message['ec_confirm_delete'] = "{'ec_confirm_delete'|@translate|@escape:javascript}"; 323 ec_JS_message['ec_confirm_test'] = "{'ec_confirm_test'|@translate|@escape:javascript}"; 338 324 ec_JS_message['ec_gen_user_act_miss'] = "{'ec_gen_user_act_miss'|@translate|@escape:javascript}"; 339 ec_JS_message['ec_act_cat_miss'] = "{'ec_act_cat_miss'|@translate|@escape:javascript}";340 ec_JS_message['ec_new_pwd_gen'] = "{'ec_new_pwd_gen'|@translate|@escape:javascript}";325 ec_JS_message['ec_act_cat_miss'] = "{'ec_act_cat_miss'|@translate|@escape:javascript}"; 326 ec_JS_message['ec_new_pwd_gen'] = "{'ec_new_pwd_gen'|@translate|@escape:javascript}"; 341 327 342 328 ec_init(); … … 354 340 355 341 {* <!-- {$test0tpl} --> *} 342 <p>$_GET :</p> 343 {$GET} 344 <p>$_POST :</p> 345 {$POST} 346 <p>Autres :</p> 356 347 {$test1tpl} 357 348 {$test2tpl}
Note: See TracChangeset
for help on using the changeset viewer.