Ignore:
Timestamp:
Nov 6, 2009, 2:13:30 PM (15 years ago)
Author:
LucMorizur
Message:

[Event Cats] Add comments

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/event_cats/include/evntcats_admin_funcs.inc.php

    r4219 r4221  
    219219  switch ($_POST['ec_act1']) {
    220220   
     221    // This "switch" command is a little bit tricky... it has been a pain to
     222    // debug, and I wish to nobody to have to modify it :-\ !
     223    // Its principle is that it manages checks for four occurrences of
     224    // $_POST['ec_act1'] : 'create', 'modify_entry_submit',
     225    // 'duplicate_entry_submit', and 'toggle_forced'. Some checks are mutual
     226    // between different occurences, but never all checks of each occurrence
     227    // of $_POST['ec_act1']. So tests are done with "if" statements to
     228    // produce "break" statements when needed.
     229   
    221230    case 'create':
    222231     
     232      // Stops if given code or user type are incorrect
    223233      if (
    224234        !isset($_POST['ec_in_up_code']) or
     
    240250    case 'modify_entry_submit':
    241251     
     252      // First checks for user type and/or value
    242253      if (isset($_POST['ec_sel_user'])) {
    243254        if ($_POST['ec_sel_user'] == 'new') {
     
    264275    case 'duplicate_entry_submit':
    265276     
     277      // Checks of entry value validity
    266278      if (
    267279        !isset($_POST['ec_entry_sel']) or
     
    269281      ) return ec_end1('ec_entry_sel', 'ec_bad_argument5');
    270282     
     283      // Other checks for user type and value
    271284      if ($_POST['ec_act1'] == 'modify_entry_submit') if (
    272285        !isset($_POST['ec_sel_user']) or (
     
    282295    case 'toggle_forced':
    283296     
     297      // Establish default values for unchanged values
    284298      $ec_code    = $ec_lists['ec_table'][$_POST['ec_entry_sel']]['code'];
    285299      if ($action == 'ec_ok' and $ec_user_id == 'NULL')
     
    306320    }
    307321     
     322      // Final check for entry value
    308323      build_ec_duplicable_codes();
    309324      if (!array_key_exists($_POST['ec_entry_sel'],
     
    314329    default: ec_end1('ec_act1', 'ec_bad_argument1');
    315330  }
     331  // Pfew !
    316332 
    317333  if ($_POST['ec_act1'] != 'toggle_forced') {
     
    430446    }
    431447    else {
    432       build_ec_lists();
     448      build_ec_lists(); // Don't remember exactly why, but must be done here
    433449      $forced = ($forced == 'false') ? '' : l10n('ec_cnfrm_forced');
    434450      $page['infos'][] =
Note: See TracChangeset for help on using the changeset viewer.