Dotclear


Ignore:
Timestamp:
09/03/17 19:50:53 (8 years ago)
Author:
Gnieark<remi@…>
Branch:
allow-target-blank-simpleMenu
Message:

fix dont overwrite title, otherwise, it's seems always being empty

File:
1 edited

Legend:

Unmodified
Added
Removed
  • plugins/simpleMenu/_public.php

    r3582 r3583  
    101101                    $href = html::escapeHTML($href); 
    102102 
     103                    $targetBlank = ((isset($m['targetBlank'])) && ($m['targetBlank']))? true:false; 
     104                     
    103105                    # Active item test 
    104106                    $active = false; 
     
    110112                    } 
    111113                    $title = $span = ''; 
     114                     
    112115                    if ($m['descr']) { 
    113                          if ($description == 'title' || $description == 'both') { 
     116                         if (($description == 'title' || $description == 'both') && $targetBlank) { 
     117                              $title = ' title="'.html::escapeHTML(__($m['descr'])).' ('. 
     118                              __("the link will open a new window").')"'; 
     119                         }elseif($description == 'title' || $description == 'both'){ 
    114120                              $title = ' title="'.html::escapeHTML(__($m['descr'])).'"'; 
    115121                         } 
     
    118124                         } 
    119125                    } 
     126                     
     127                    if( empty($title) && $targetBlank){ 
     128                         $title = ' title="'.__("the link will open a new window").'"'; 
     129                    } 
     130                               
    120131                    $label = html::escapeHTML(__($m['label'])); 
    121132 
     
    139150                              '">'. 
    140151                              '<a href="'.$href.'"'.$item['title']. 
    141                               ((isset($m['targetBlank']) && ($m['targetBlank'])) ?  
    142                                    'target="_blank" title="'.__("the link will open a new window").'"'  
    143                                    : '').'>'. 
     152                              (($targetBlank) ? 'target="_blank"': '').'>'. 
    144153                              '<span class="simple-menu-label">'.$item['label'].'</span>'. 
    145154                              $item['span'].'</a>'. 
Note: See TracChangeset for help on using the changeset viewer.

Sites map