Dotclear

Changeset 2928:0471a74f04ed for plugins


Ignore:
Timestamp:
01/26/15 13:44:21 (11 years ago)
Author:
franck <carnet.franck.paul@…>
Branch:
default
Message:

Add item description option, closes #2060

Location:
plugins/simpleMenu
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • plugins/simpleMenu/_public.php

    r2912 r2928  
    3131          $description = isset($attr['description']) ? trim($attr['description']) : ''; 
    3232 
    33           if (!preg_match('#^(title|span)$#',$description)) { 
     33          if (!preg_match('#^(title|span|both|none)$#',$description)) { 
    3434               $description = ''; 
    3535          } 
     
    4747          global $core, $_ctx; 
    4848 
     49          $descr_type = array(0 => 'span',1 => 'title',2 => 'both',3 => 'none'); 
     50 
    4951          if (!(boolean) $core->blog->settings->system->simpleMenu_active) 
    5052               return; 
     
    5860          } 
    5961 
    60           $menu = tplSimpleMenu::displayMenu('','','title'); 
     62          $description = 'title'; 
     63          if (isset($descr_type[$w->description])) { 
     64               $description = $descr_type[$w->description]; 
     65          } 
     66          $menu = tplSimpleMenu::displayMenu('','',$description); 
    6167          if ($menu == '') { 
    6268               return; 
     
    107113                    $title = $span = ''; 
    108114                    if ($m['descr']) { 
    109                          if ($description == 'title') { 
     115                         if ($description == 'title' || $description == 'both') { 
    110116                              $title = ' title="'.html::escapeHTML(__($m['descr'])).'"'; 
    111                          } else { 
     117                         } 
     118                         if ($description == 'span' || $description == 'both') { 
    112119                              $span = ' <span>'.html::escapeHTML(__($m['descr'])).'</span>'; 
    113120                         } 
  • plugins/simpleMenu/_widgets.php

    r2778 r2928  
    2020          $w->create('simplemenu',__('Simple menu'),array('tplSimpleMenu','simpleMenuWidget'),null,'List of simple menu items'); 
    2121          $w->simplemenu->setting('title',__('Title (optional)').' :',__('Menu')); 
     22          $w->simplemenu->setting('description',__('Item description'),0,'combo', 
     23               array( 
     24                    __('Displayed in link') => 0,                     // span 
     25                    __('Used as link title') => 1,                         // title 
     26                    __('Displayed in link and used as title') => 2,   // both 
     27                    __('Not displayed nor used') => 3                 // none 
     28                    ) 
     29               ); 
    2230          $w->simplemenu->setting('homeonly',__('Display on:'),0,'combo', 
    2331               array( 
     
    2634                    __('Except on home page') => 2 
    2735                    ) 
    28           ); 
     36               ); 
    2937          $w->simplemenu->setting('content_only',__('Content only'),0,'check'); 
    3038          $w->simplemenu->setting('class',__('CSS class:'),''); 
Note: See TracChangeset for help on using the changeset viewer.

Sites map