Dotclear

Changeset 1062:8f51b2e77efe for plugins


Ignore:
Timestamp:
12/11/12 16:45:43 (13 years ago)
Author:
franck <carnet.franck.paul@…>
Branch:
default
Message:

New behaviour publicSimpleMenuItem in SimpleMenu? plugin, let other plays with menu item before rendering it. Addresses #1295

File:
1 edited

Legend:

Unmodified
Added
Removed
  • plugins/simpleMenu/_public.php

    r945 r1062  
    5959     public static function displayMenu($class='',$id='',$description='') 
    6060     { 
     61          global $core; 
     62 
    6163          $ret = ''; 
    6264 
     
    98100                         } 
    99101                    } 
     102 
     103                    $item = new ArrayObject(array( 
     104                         'url' => $href,                         // URL 
     105                         'label' => __($m['label']),        // <a> link label 
     106                         'title' => $title,                 // <a> link title (optional) 
     107                         'span' => $span,                   // description (will be displayed after <a> link) 
     108                         'active' => $active,               // status (true/false) 
     109                         'class' => ''                      // additional <li> class (optional) 
     110                         )); 
     111 
     112                    # --BEHAVIOR-- publicSimpleMenuItem 
     113                    $core->callBehavior('publicSimpleMenuItem',$i,$item); 
     114 
    100115                    $ret .= '<li class="li'.($i+1). 
    101                                    ($active ? ' active' : ''). 
     116                                   ($item['active'] ? ' active' : ''). 
    102117                                   ($i == 0 ? ' li-first' : ''). 
    103118                                   ($i == count($menu)-1 ? ' li-last' : ''). 
     119                                   ($item['class'] ? $item['class'] : ''). 
    104120                              '">'. 
    105                               '<a href="'.$href.'"'.$title.'>'.__($m['label']).$span.'</a>'. 
     121                              '<a href="'.$href.'"'.$item['title'].'>'.$item['label'].$item['span'].'</a>'. 
    106122                              '</li>'; 
    107123               } 
Note: See TracChangeset for help on using the changeset viewer.

Sites map