/** * Get navbar as array to eg. set as vars for a template (from idots' navbar.inc.php) * * Reimplemented so set the vars for the navbar itself (uses $this->tpl and the blocks a and b) * * @internal PHP5 protected * @param array $apps navbar apps from _get_navbar_apps * @return array */ function _get_navbar($apps) { $var = parent::_get_navbar($apps); if ($GLOBALS['egw_info']['user']['preferences']['common']['click_or_onmouseover'] == 'onmouseover') { $var['show_menu_event'] = 'onMouseOver'; } else { $var['show_menu_event'] = 'onClick'; } if ($GLOBALS['egw_info']['user']['userid'] == 'anonymous') { $config_reg = config::read('registration'); $this->tpl->set_var(array('url' => $GLOBALS['egw']->link('/logout.php'), 'title' => lang('Login'))); $this->tpl->fp('upper_tabs', 'upper_tab_block'); if ($config_reg[enable_registration] == 'True' && $config_reg[register_link] == 'True') { $this->tpl->set_var(array('url' => $GLOBALS['egw']->link('/registration/index.php'), 'title' => lang('Register'))); } } if (!($max_icons = $GLOBALS['egw_info']['user']['preferences']['common']['max_icons'])) { $max_icons = 30; } if ($GLOBALS['egw_info']['user']['preferences']['common']['start_and_logout_icons'] == 'no') { $tdwidth = 100 / $max_icons; } else { $tdwidth = 100 / ($max_icons + 1); // +1 for logout } $this->tpl->set_var('tdwidth', round($tdwidth)); // not shown in the navbar foreach ($apps as $app => $app_data) { if ($app != 'preferences' && $app != 'about' && $app != 'logout' && $app != 'manual' && ($app != 'home' || $GLOBALS['egw_info']['user']['preferences']['common']['start_and_logout_icons'] != 'no')) { $this->tpl->set_var($app_data); if ($i < $max_icons) { $this->tpl->set_var($app_data); if ($GLOBALS['egw_info']['user']['preferences']['common']['navbar_format'] != 'text') { $this->tpl->fp('app_icons', 'app_icon_block', true); } if ($GLOBALS['egw_info']['user']['preferences']['common']['navbar_format'] != 'icons') { $this->tpl->fp('app_titles', 'app_title_block', true); } } else { $this->tpl->fp('app_extra_icons', 'app_extra_block', true); } $i++; } } // settings for the extra icons dif if ($i <= $max_icons) { $this->tpl->set_var('app_extra_icons_div', ''); $this->tpl->set_var('app_extra_icons_icon', ''); } else { $var['lang_close'] = lang('Close'); $var['lang_show_more_apps'] = lang('show_more_apps'); } if ($GLOBALS['egw_info']['user']['preferences']['common']['start_and_logout_icons'] != 'no' && $GLOBALS['egw_info']['user']['userid'] != 'anonymous') { $this->tpl->set_var($apps['logout']); if ($GLOBALS['egw_info']['user']['preferences']['common']['navbar_format'] != 'text') { $this->tpl->fp('app_icons', 'app_icon_block', true); } if ($GLOBALS['egw_info']['user']['preferences']['common']['navbar_format'] != 'icons') { $this->tpl->fp('app_titles', 'app_title_block', true); } } if ($GLOBALS['egw_info']['user']['preferences']['common']['navbar_format'] == 'icons') { $var['app_titles'] = '<td colspan="' . $max_icons . '"> </td>'; } return $var; }