Changeset 5947


Ignore:
Timestamp:
01/18/12 19:19:46 (4 months ago)
Author:
vain
Message:
  • use name as title, if title is undefined on menu items
  • when the condition is false, the element is not shown anymore, so display a short notice of that, when we are in debug mode
Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/core/viewhelper/smarty/function.modulenavigation.php

    r5946 r5947  
    5858 * 1) convert short urls 
    5959 * 2) execute callback conditions of menu items 
     60 * 3) use name as title, if title is not defined 
    6061 * 
    6162 * @param array $modulenavigation 
     
    9899    } 
    99100 
     101    /** 
     102     * 3) use name as title, if title is not defined 
     103     */ 
     104    if($modulenavigation['title'] == '') 
     105    { 
     106        $modulenavigation['title'] = $modulenavigation['name']; 
     107    } 
     108 
    100109    return $modulenavigation; 
    101110} 
  • trunk/themes/core/view/smarty/modulenavigation-generic.tpl

    r5945 r5947  
    8181    {* if the condition is not met, then do not display the menu item *} 
    8282    {if isset($item.condition) === true and $item.condition === false} 
    83     {continue} 
     83 
     84    {* the condition is not met, let's show that, but only in debug mode *} 
     85    {if DEBUG == true} 
     86    <li> 
     87        <a href="{$item.url}" 
     88           title="{$item.title} The condition of this menu item is false. The menu item will not be displayed, when DEBUG mode is off."> 
     89            <span>{$item.name} <font color="red">(!)</font></span> 
     90        </a> 
     91    </li> 
     92    {else} 
     93        {continue} 
    8494    {/if} 
    85      
     95 
     96    {else} 
    8697    <li> 
    8798        <a href="{$item.url}" title="{$item.title}"> <span>{$item.name}</span> </a> 
    8899    </li> 
     100    {/if} 
     101 
    89102    {/foreach} 
    90103    </ul> 
Note: See TracChangeset for help on using the changeset viewer.