aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorpatdenice <patdenice@piwigo.org>2010-12-22 11:12:44 +0000
committerpatdenice <patdenice@piwigo.org>2010-12-22 11:12:44 +0000
commit7f08759357dd0f4c2fb059fbc3ecbdff42738a05 (patch)
treeb91d2a10c430e99a10e48abbe8b8f56247115c5f /include
parent8dad5f459fa50a9f46c62273eed1aecda733ec50 (diff)
bug 2078: Links must not be displayed in menubar if empty.
git-svn-id: http://piwigo.org/svn/branches/2.1@8222 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include')
-rw-r--r--include/menubar.inc.php10
1 files changed, 6 insertions, 4 deletions
diff --git a/include/menubar.inc.php b/include/menubar.inc.php
index 133aab6ec..add259460 100644
--- a/include/menubar.inc.php
+++ b/include/menubar.inc.php
@@ -41,7 +41,7 @@ function initialize_menu()
//--------------------------------------------------------------- external links
if ( ($block=$menu->get_block('mbLinks')) and !empty($conf['links']) )
{
- $data = array();
+ $block->data = array();
foreach ($conf['links'] as $url => $url_data)
{
if (!is_array($url_data))
@@ -69,11 +69,13 @@ function initialize_menu()
'FEATURES' => (isset($url_data['nw_features']) ? $url_data['nw_features'] : '')
);
}
- $data[] = $tpl_var;
+ $block->data[] = $tpl_var;
}
}
- $block->template = 'menubar_links.tpl';
- $block->data = $data;
+ if ( !empty($block->data) )
+ {
+ $block->template = 'menubar_links.tpl';
+ }
}
//-------------------------------------------------------------- categories