Changeset 17767


Ignore:
Timestamp:
09/05/12 22:50:15 (7 years ago)
Author:
rvelices
Message:

extended description provides the liste of alternate names for tags (used in tag auto completion)

File:
1 edited

Legend:

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

    r17433 r17767  
    6464{ 
    6565  return get_user_language_desc($tag, get_default_language()); 
     66} 
     67 
     68function ed_get_all_alt_names($arr, $name) 
     69{ 
     70  if (preg_match_all('#\[lang=(.*?)\](.*?)\[/lang\]#is', $name, $matches)) 
     71  { 
     72    foreach ($matches[2] as $alt) 
     73    { 
     74      $arr[] = $alt; 
     75    } 
     76  } 
     77  return $arr; 
    6678} 
    6779 
     
    731743add_event_handler ('render_tag_name', 'get_user_language_desc'); 
    732744add_event_handler ('render_tag_url', 'get_user_language_tag_url', 40); 
     745add_event_handler ('get_tag_alt_names', 'ed_get_all_alt_names', EVENT_HANDLER_PRIORITY_NEUTRAL, 2); 
    733746add_event_handler ('render_element_description', 'get_extended_desc'); 
    734747add_event_handler ('nbm_render_user_customize_mail_content', 'get_extended_desc'); 
Note: See TracChangeset for help on using the changeset viewer.