Dotclear

Changeset 566:0a0f493ca970


Ignore:
Timestamp:
07/11/11 10:21:19 (14 years ago)
Author:
Franck <carnet.franck.paul@…>
Branch:
themes
Message:

Rajout d'un attribut description (title ou span) dans la balise pour préciser la place de la description (title du <a> ou <span> après le libellé)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • plugins/simpleMenu/_public.php

    r538 r566  
    2121          $class = isset($attr['class']) ? trim($attr['class']) : ''; 
    2222          $id = isset($attr['id']) ? trim($attr['id']) : ''; 
     23          $description = isset($attr['description']) ? trim($attr['description']) : ''; 
    2324           
    2425          return '<?php echo tplSimpleMenu::displayMenu('. 
    2526                    "'".addslashes($class)."',". 
    26                     "'".addslashes($id)."'". 
     27                    "'".addslashes($id)."',". 
     28                    "'".addslashes($description)."'". 
    2729               '); ?>'; 
    2830     } 
    2931      
    30      public static function displayMenu($class,$id) 
     32     public static function displayMenu($class='',$id='',$description='') 
    3133     { 
    3234          $ret = ''; 
     
    6163                         $active = true; 
    6264                    } 
     65                    $title = $span = ''; 
     66                    if ($m['descr']) { 
     67                         if ($description == 'title') { 
     68                              $title = ' title="'.__($m['descr']).'"'; 
     69                         } else { 
     70                              $span = ' <span>'.__($m['descr']).'</span>'; 
     71                         } 
     72                    } 
    6373                    $ret .= '<li class="li'.($i+1). 
    6474                                   ($active ? ' active' : ''). 
     
    6676                                   ($i == count($menu)-1 ? ' li-last' : ''). 
    6777                              '">'. 
    68                               '<a href="'.$href.'">'.__($m['label']).($m['descr'] ? '<span>'.__($m['descr']).'</span>' : '').'</a>'. 
     78                              '<a href="'.$href.'"'.$title.'>'.__($m['label']).$span.'</a>'. 
    6979                              '</li>'; 
    7080               } 
Note: See TracChangeset for help on using the changeset viewer.

Sites map