Ignore:
Timestamp:
Mar 5, 2010, 3:10:29 PM (14 years ago)
Author:
LucMorizur
Message:

[Event Cats] Add "Event Cats" fieldset in admin category modification page ;
modify header information about developpement period of all files

File:
1 edited

Legend:

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

    r4885 r5058  
    4040//ini_set('display_errors', true);
    4141
    42 global $conf, $prefixeTable, $ec_lists;
     42global $conf, $prefixeTable, $ec_lists, $template;
    4343
    4444define( // -------------------------------------------------------------------
     
    7373include_once(EVNTCATS_PATH.'include/evntcats_main_funcs.inc.php');
    7474
     75function ec_cat_modify_prefilter($content, &$smarty) {
     76  $search = '<fieldset id="image_order">';
     77  // $addon = '<fieldset id="event_cats_inc"><legend>YESSSSSSSSSSSSSS !!!</legend></fieldset>';
     78  $addon = "{include file='../../../plugins/event_cats/admin/template/ec_cat_modify.inc.tpl'} ";
     79  $replacement = $addon.$search;
     80  return str_replace($search, $replacement, $content);
     81  // return $content;
     82}
     83
    7584class event_cats {
    7685// Sets the administration panel of the plugin
    7786  function plugin_admin_menu($menu) {
     87    global $template;
     88   
    7889    array_push($menu,
    7990      array(
     
    8394      )
    8495    );
     96   
     97                                                                               // to be removed :
     98                                                                                  $template->delete_compiled_templates();
     99    $template->set_prefilter('categories', 'ec_cat_modify_prefilter');
     100   
    85101    return $menu;
    86102  }
     103 
     104  function ec_cat_modify() {
     105    global $template;
     106    $template->set_prefilter('categories', 'ec_cat_modify_prefilter');
     107  }
     108 
    87109} // End class
    88110
     
    127149    if (!is_a_guest()) {
    128150      $url = '';
    129       foreach ($_GET as $item => $value) {
    130         $url.= '&'.$item.'='.$value;
    131       }
     151      foreach ($_GET as $item => $value) $url.= '&'.$item.'='.$value;
    132152      logout_user();
    133153      redirect(make_index_url().$url);
     
    293313function duplicate_account_url() {
    294314  global $lang, $template, $user;
     315   
     316    // Makes the "quick connect" fieldset able to redirect to current page
     317    // after user identification, just as does above "connection" link.
     318    $template->assign(array('U_REDIRECT' => $_SERVER['REQUEST_URI']));
     319    $template->set_prefilter('menubar', 'ec_duplicate_prefilter');
    295320 
    296321  // Adds duplication link, if needed
     
    321346      get_root_url().'identification.php?redirect='.$_SERVER['REQUEST_URI']
    322347    );
    323     // Removes "quick connection" fieldset (form)
    324     $template->set_filenames(array(
    325       'ec_no_quick_connect' =>
    326       realpath(EVNTCATS_PATH.'ec_no_quick_connect.tpl')
    327     ));
    328     $begin = 'PLUGIN_INDEX_CONTENT_BEFORE';
    329     $old_begin = $template->get_template_vars($begin);
    330     $template->assign_var_from_handle($begin, 'ec_no_quick_connect');
    331     $template->concat($begin, $old_begin);
    332   }
    333 }
     348  }
     349}
     350
     351function ec_duplicate_prefilter($content, &$smarty) {
     352  $search = "<legend>{'Quick connect'|@translate}</legend>";
     353  $addon = '<input type="hidden" name="redirect" value="{$U_REDIRECT}">';
     354  $replacement = "<legend>{'Quick connect'|@translate}</legend>".$addon;
     355  return str_replace($search, $replacement, $content);
     356}
     357
     358// add_event_handler('get_admin_plugin_menu_links','ec_cat_modify');
    334359
    335360add_event_handler(
Note: See TracChangeset for help on using the changeset viewer.