I don’t use the Dashboards module but it always shows in the navbar.
I suggest the following change to dashboard_menu.php:
$listmenu = $dashboard->build_menu_array('view'); //BB: move this to get the list before including the menu in the navbar
if(!empty($listmenu)) { //BB: if the list is empty, don't put the menu in the navbar
// navbar link
$menu['tabs'][] = array(
'icon'=>'dashboard',
'text'=> dgettext("dashboard_messages","Dashboards"),
'path'=> 'dashboard/view',
'order' => 3,
'data'=> array('sidebar' => '#sidebar_dashboard')
);
}
I should have said that I find this menu annoying when I am providing an app with a read-only apikey to someone. In this situation they can’t use the menu to create a dashboard, so it is just a dead button.
Let me amend my proposal.
$listmenu = $dashboard->build_menu_array('view');
if(!empty($listmenu) || $session["write"]) { //if the dashboard menu isn't empty, or if the session is write, show the menu
// navbar link
$menu['tabs'][] = array(
'icon'=>'dashboard',
'text'=> dgettext("dashboard_messages","Dashboards"),
'path'=> 'dashboard/view',
'order' => 3,
'data'=> array('sidebar' => '#sidebar_dashboard')
);
}