Changeset 12554


Ignore:
Timestamp:
11/05/11 17:31:56 (8 years ago)
Author:
patdenice
Message:

feature:2493
Extended Description write correct url name for tags.

Location:
extensions/ExtendedDescription
Files:
1 added
1 edited

Legend:

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

    r12400 r12554  
    22/* 
    33Plugin Name: Extended Description 
    4 Version: 2.3.a 
     4Version: auto 
    55Description: Add multilinguale descriptions, banner, NMB, category name, etc... 
    66Plugin URI: http://piwigo.org/ext/extension_view.php?eid=175 
     
    2828 
    2929// Traite les balises [lang=xx] 
    30 function get_user_language_desc($desc) 
    31 { 
    32   global $user; 
    33  
    34   $user_lang = substr($user['language'], 0, 2); 
     30function get_user_language_desc($desc, $user_lang=null) 
     31{ 
     32  if (is_null($user_lang)) 
     33  { 
     34    global $user; 
     35    $user_lang = substr($user['language'], 0, 2); 
     36  } 
    3537 
    3638  if (!substr_count(strtolower($desc), '[lang=' . $user_lang . ']')) 
     
    5759  } 
    5860  return preg_replace($patterns, $replacements, $desc); 
     61} 
     62 
     63function get_user_language_tag_url($tag) 
     64{ 
     65  return get_user_language_desc($tag, get_default_language()); 
    5966} 
    6067 
     
    382389add_event_handler ('render_category_description', 'get_extended_desc', EVENT_HANDLER_PRIORITY_NEUTRAL, 2); 
    383390add_event_handler ('render_tag_name', 'get_user_language_desc'); 
     391add_event_handler ('render_tag_url', 'get_user_language_tag_url', 40); 
    384392add_event_handler ('render_element_description', 'get_extended_desc'); 
    385393add_event_handler ('nbm_render_user_customize_mail_content', 'get_extended_desc'); 
Note: See TracChangeset for help on using the changeset viewer.