Ignore:
Timestamp:
Dec 22, 2009, 1:29:01 AM (14 years ago)
Author:
LucMorizur
Message:

[Event Cats] Add feature 1335 (possibility to display the 'Connection' link in identification block menu for generic users)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/event_cats/main.inc.php

    r4487 r4553  
    4040//ini_set('display_errors', true);
    4141
    42 global $conf, $prefixeTable, $ec_lists;
     42global $conf, $prefixeTable, $ec_lists, $ec_page;
     43$ec_page = NULL;
    4344
    4445define( // -------------------------------------------------------------------
    4546  'EVNTCATS_INFO_VERSION', // VERSION HISTORY :
    46    '1.1.5'   // Fix bugs 1324 and 1325
    47 // '1.1.4'   // Improve help banner
    48 // '1.1.3'   // Better help banner management ; finalize banner texts
    49 // '1.1.2'   // Better help banner example : some examples
    50 // '1.1.1'   // Better help banner example ; but still no text in it
    51 // '1.1.0'   // First bugs (1305 and 1306) corrected ;
    52 //      add newly created user/group association with cat/AP (was forgotten) ;
    53 //      begin help banner
    54 // '1.0.0'   // Conception version
     47   '1.2.0' // Add feature 1335, Possibility to display the 'Connection'
     48           // link in identification block menu for generic users ;
     49           // finish (?) english translation
     50
     51// --------------------------------------------------------------------------- => à modifier :
     52                                                                               // evntcats_admin.php -> analyser un changement d'option dans la page d'options ;
     53                                                                               // config.tpl         -> proposer le réglage de cette nouvelle option ;
     54                                                                               // main.inc.php       -> afficher le lien si l'option le demande.
     55
     56// '1.1.5' // Fix bugs 1324 and 1325
     57// '1.1.4' // Improve help banner
     58// '1.1.3' // Better help banner management ; finalize banner texts
     59// '1.1.2' // Better help banner example : some examples
     60// '1.1.1' // Better help banner example ; but still no text in it
     61// '1.1.0' // First bugs (1305 and 1306) corrected ;
     62           // add newly created user/group association with cat/AP (was
     63           // forgotten) ; begin help banner
     64// '1.0.0' // Conception version
    5565); // ------------------------------------------------------------------------
    5666define(
     
    114124
    115125function auto_log_user() {
    116   global $ec_lists;
     126  global $ec_lists, $ec_page;
    117127
    118128  $ec_ap  = NULL;
     
    161171              }
    162172            }
    163             redirect(PHPWG_ROOT_PATH.'index.php?/category/'.$ec_cat);
     173            $ec_page = PHPWG_ROOT_PATH.'index.php?/category/'.$ec_cat;
     174            redirect($ec_page);
    164175          }
    165176        }
     
    276287 *
    277288 * duplicate_account_url()
    278  * adds a link "Duplicate" in Identification block menu.
     289 * adds a link for duplicating the currently identified user in
     290 * Identification block menu, in case the identifed user is granted to
     291 * duplication. Displays also the connection link for generic users, if
     292 * required in the configuration.
    279293 *
    280294 * @param no parameter
     
    285299
    286300function duplicate_account_url() {
    287   global $lang, $template, $user;
     301  global $lang, $template, $user, $ec_page;
    288302 
     303  // Adds duplication link, if needed
    289304  if (!is_admin() and !is_a_guest()) if (
    290305    read_ec_conf('dup_allow') == '1' or (
     
    301316    ) {
    302317      $lang['Register'] = $lang['Duplicate'];
    303       $lang['Create a new account'] = $lang['Create a new account with same properties'];
    304     }
     318      $lang['Create a new account'] =
     319       $lang['Create a new account with same properties'];
     320    }
     321  }
     322 
     323  // Adds connection link, if needed
     324  if (read_ec_conf('display_connection') == '1' and is_generic()) {
     325    // Adds connection link
     326    $template->assign(
     327      'U_LOGIN',
     328      get_root_url().'identification.php?redirect='.$_SERVER['REQUEST_URI']
     329    );
     330    // Removes "quick connection" fieldset (form)
     331    $template->set_filenames(array(
     332      'ec_no_quick_connect' =>
     333      realpath(EVNTCATS_PATH.'ec_no_quick_connect.tpl')
     334    ));
     335    $begin = 'PLUGIN_INDEX_CONTENT_BEFORE';
     336    $old_begin = $template->get_template_vars($begin);
     337    $template->assign_var_from_handle($begin, 'ec_no_quick_connect');
     338    $template->concat($begin, $old_begin);
    305339  }
    306340}
    307341
    308 add_event_handler('get_admin_plugin_menu_links', array(&$obj, 'plugin_admin_menu') );
     342add_event_handler(
     343 'get_admin_plugin_menu_links',
     344 array(&$obj, 'plugin_admin_menu')
     345);
    309346set_plugin_data($plugin['id'], $obj);
    310347
Note: See TracChangeset for help on using the changeset viewer.