Changeset 3985
- Timestamp:
- Oct 7, 2009, 9:31:04 AM (15 years ago)
- Location:
- extensions/event_cats
- Files:
-
- 7 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} -
extensions/event_cats/include/evntcats_funcs.inc.php
r3971 r3985 183 183 foreach ($ec_lists['ec_table'] as &$ec_entry) { // & is needed here 184 184 if (isset($to_correct[$ec_entry['code']])) { 185 $ec_entry['action'] = $new_action; 185 $ec_entry['action'] = ($check_forced) ? 186 $ec_entry['action'].$new_action : $new_action; 186 187 } 187 188 } … … 195 196 196 197 // Multiple "forced" params for a single code check 197 ec_inpect('forced', ' ec_ok_forced_pb', true, true);198 ec_inpect('forced', '_f_pb', true, true); 198 199 199 200 // User id and associated page validities checks … … 202 203 // Check if associated user_id exists 203 204 if ( 204 $ec_entry['action'] == 'ec_ok'and205 is_in($ec_entry['action'], 'ec_ok') and 205 206 !array_key_exists($ec_entry['user_id'], $ec_lists['user_ids']) 206 207 ) { … … 211 212 $a = 0; 212 213 if (!empty($ec_entry['arg1']) and 213 (strpos($ec_entry['action'], 'ec_ok') !== false)) $a++; // Only arg2214 is_in($ec_entry['action'], 'ec_ok')) $a++; // Only arg2 214 215 // is significant if action is ec_nok[_xxx] . 215 216 if (!empty($ec_entry['arg2'])) $a+= 2; … … 220 221 if ( 221 222 $ec_ap_ok and ( 222 $ec_entry['action'] == 'ec_ok'or223 is_in($ec_entry['action'], 'ec_ok') or 223 224 $ec_entry['action'] == 'ec_nok' 224 225 ) and … … 231 232 case 1: // Category 232 233 case 3: // Image 233 if ( $ec_entry['action'] == 'ec_ok') {234 if (is_in($ec_entry['action'], 'ec_ok')) { 234 235 if (array_key_exists($ec_entry['arg1'], $ec_lists['categories'])) { 235 236 if ($a == 3) { // case 3: // Image … … 274 275 $res = pwg_query('SELECT id,title FROM '.ADD_PAGES_TABLE); 275 276 while ($r = mysql_fetch_assoc($res)) { 276 $c = ( strpos($r['title'], '/user_id=')) ? '/user_id=' : '/group_id=';277 $c = (is_in($r['title'], '/user_id=')) ? '/user_id=' : '/group_id='; 277 278 $a = explode($c ,$r['title']); 278 279 $ec_lists['add_pages'][$r['id']] = $a[0]; … … 297 298 // Construction of $ec_lists['ec_table'] array var 298 299 build_ec_table(); 300 } 301 302 /* 303 * is_in($haystack, $needle) 304 * returns true or false whether $needle is a string found in string $haystack 305 * 306 * @param 307 * $haystack : the string in which to search 308 * $needle : the string looked for 309 * @return 310 * true if $needle is found in $haystack ; false if not 311 */ 312 function is_in($haystack, $needle) { 313 return (strpos($haystack, $needle) !== false); 299 314 } 300 315 -
extensions/event_cats/language/fr_FR/plugin.lang.php
r3970 r3985 64 64 // In PHP files 65 65 // Errors 66 $lang['ec_action_pb'] = ' Champ "action" corrompu (plusieurs valeurs pour un même code dans la base de données)';67 $lang['ec_username_pb'] = ' Champ "user_id" corrompu (plusieurs valeurs pour un même code dans la base de données)';68 $lang['ec_forced_pb'] = ' Champ "forced" corrompu (au moins une fois "true" pour un même code dans la base de données)';69 $lang['ec_username_miss'] = ' Utilisateur inexistant (probablement supprimé)';70 $lang['ec_category_miss'] = ' Catégorie inexistante (probablement supprimée)';71 $lang['ec_image_miss'] = ' Image inexistante (probablement supprimée)';72 $lang['ec_add_page_miss'] = ' Page Additional Pages inexistante (probablement supprimée)';66 $lang['ec_action_pb'] = 'champ "action" corrompu (plusieurs valeurs pour un code ayant plusieurs entrées)'; 67 $lang['ec_username_pb'] = 'champ "user_id" corrompu (plusieurs valeurs pour un code ayant plusieurs entrées)'; 68 $lang['ec_forced_pb'] = 'champ "forced" corrompu (au moins une fois "true" pour un code ayant plusieurs entrées)'; 69 $lang['ec_username_miss'] = 'utilisateur inexistant (probablement supprimé)'; 70 $lang['ec_category_miss'] = 'catégorie inexistante (probablement supprimée)'; 71 $lang['ec_image_miss'] = 'image inexistante (probablement supprimée)'; 72 $lang['ec_add_page_miss'] = 'page Additional Pages inexistante (probablement supprimée)'; 73 73 $lang['ec_entry_del_nok_pre'] = 'Problème avec suppression entrée '; 74 74 $lang['ec_entry_del_nok_end'] = ''; … … 92 92 // actions 93 93 $lang['ec_ok'] = 'OUI'; 94 $lang['ec_ok_f orced_pb']= 'OUI (page non forcée)';94 $lang['ec_ok_f_pb'] = 'OUI (page non forcée)'; 95 95 $lang['ec_ok_ap_pb'] = 'OUI (Add. Page inconnue)'; 96 96 $lang['ec_ok_cat_pb'] = 'OUI (catégorie inconnue)'; 97 97 $lang['ec_ok_img_pb'] = 'OUI (image inconnue)'; 98 $lang['ec_ok_f_pb_ap_pb'] = 'OUI (page non forcée et Add. Page inconnue)'; 99 $lang['ec_ok_f_pb_cat_pb'] = 'OUI (page non forcée et catégorie inconnue)'; 100 $lang['ec_ok_f_pb_img_pb'] = 'OUI (page non forcée et image inconnue)'; 98 101 $lang['ec_nok'] = 'NON'; 99 102 $lang['ec_nok_ap_pb'] = 'NON'; -
extensions/event_cats/main.inc.php
r3975 r3985 117 117 } 118 118 if ($code_exists) { 119 if ( strpos($ec_entry['action'], 'ec_ok') !== false) {119 if (is_in($ec_entry['action'], 'ec_ok')) { 120 120 log_user($ec_entry['user_id'], false); 121 121 if (isset($_GET['ap'])) $ec_ap = $_GET['ap']; … … 124 124 if ( 125 125 $ec_entry['forced'] == 'true' and 126 $ec_entry['action'] != 'ec_forced_pb'126 !is_in($ec_entry['action'], '_f_pb') 127 127 ) { 128 128 if (empty($ec_entry['arg1']) and !empty($ec_entry['arg2'])) { -
extensions/event_cats/maintain.inc.php
r3971 r3985 110 110 the user ids table ; 111 111 ec_nok_ap_pb : not valid Additional Page id -> access denied ; 112 ec_ok_f orced_pb: the same "code" is used in more than one entries in the112 ec_ok_f_pb : the same "code" is used in more than one entries in the 113 113 DB (which is allowed) and the "forced" argument is 114 114 "true" for at least one of these entries, which should … … 119 119 ec_ok_cat_pb : not valid category id -> home page ; 120 120 ec_ok_img_pb : not valid image id -> category page ; 121 ec_ok_f_pb_ap_pb : ec_ok_ap_pb + "forced problem" -> home page ; 122 ec_ok_f_pb_cat_pb : ec_ok_cat_pb + "forced problem" -> home page ; 123 ec_ok_f_pb_img_pb : ec_ok_img_pb + "forced problem" -> category page ; 121 124 122 125 _ the two main fields are "user_id" and "code", as the main purpose of the
Note: See TracChangeset
for help on using the changeset viewer.