📄 navbar.inc.php
字号:
<?php /**************************************************************************\ * phpGroupWare * * http://www.phpgroupware.org * * -------------------------------------------- * * This program is free software; you can redistribute it and/or modify it * * under the terms of the GNU General Public License as published by the * * Free Software Foundation; either version 2 of the License, or (at your * * option) any later version. * \**************************************************************************/ /* $Id: navbar.inc.php,v 1.7.2.1 2004/08/04 17:14:01 mgalgoci Exp $ */ function parse_navbar($force = False) { $GLOBALS['idots_tpl'] = createobject('phpgwapi.Template',PHPGW_TEMPLATE_DIR); $GLOBALS['idots_tpl']->set_file( array( 'navbar' => 'navbar.tpl' ) ); $GLOBALS['idots_tpl']->set_block('navbar','navbar_header','navbar_header'); $GLOBALS['idots_tpl']->set_block('navbar','extra_blocks_header','extra_block_header'); $GLOBALS['idots_tpl']->set_block('navbar','extra_block_row','extra_block_row'); $GLOBALS['idots_tpl']->set_block('navbar','extra_block_row_raw','extra_block_row_raw'); $GLOBALS['idots_tpl']->set_block('navbar','extra_block_row_no_link','extra_block_row_no_link'); $GLOBALS['idots_tpl']->set_block('navbar','extra_block_spacer','extra_block_spacer'); $GLOBALS['idots_tpl']->set_block('navbar','extra_blocks_footer','extra_blocks_footer'); $GLOBALS['idots_tpl']->set_block('navbar','sidebox_hide_header','sidebox_hide_header'); $GLOBALS['idots_tpl']->set_block('navbar','sidebox_hide_footer','sidebox_hide_footer'); $GLOBALS['idots_tpl']->set_block('navbar','appbox','appbox'); $GLOBALS['idots_tpl']->set_block('navbar','navbar_footer','navbar_footer'); $var['img_root'] = $GLOBALS['phpgw_info']['server']['webserver_url'] . '/phpgwapi/templates/idots/images'; $var['table_bg_color'] = $GLOBALS['phpgw_info']['theme']['navbar_bg']; if($GLOBALS['phpgw_info']['user']['preferences']['common']['click_or_onmouseover']=='onmouseover') { $show_menu_event = 'onMouseOver'; } else { $show_menu_event = 'onClick'; } $applications = ''; // == 'icons_and_text') $max_icons=$GLOBALS['phpgw_info']['user']['preferences']['common']['max_icons']; if(!$max_icons) { $max_icons=200; } foreach($GLOBALS['phpgw_info']['navbar'] as $app => $app_data) { if($app != 'preferences' && $app != 'about' && $app != 'logout') { $title = $GLOBALS['phpgw_info']['apps'][$app]['title']; $icon = '<img src="' . $app_data['icon'] . '" alt="' . $title . '" title="'. $title . '" border="0" />'; if($app=='home') { $title = lang('home'); $icon = '<img src="' . $app_data['icon'] . '" alt="' . lang('home') . '" title="' . lang('home') . '" border="0" />'; } if($i<$max_icons) { if($GLOBALS['phpgw_info']['user']['preferences']['common']['start_and_logout_icons']=='no') { $tdwidth = 100/($max_icons); } else { $tdwidth = 100/($max_icons+2); } $app_icons .= '<td width="'.$tdwidth.'%" height="66" valign="bottom" align="center" style="text-align:center"><a href="' . $app_data['url'] . '"'; if(isset($GLOBALS['phpgw_info']['flags']['navbar_target']) && $GLOBALS['phpgw_info']['flags']['navbar_target']) { $app_icons .= ' target="' . $GLOBALS['phpgw_info']['flags']['navbar_target'] . '"'; } $app_icons .= $app_data['target'].'>' . $icon . '</a></td>'; $app_titles .= '<td align="center" valign="top" class="appTitles" style="text-align:center"><a href="'.$app_data['url'] . '"'; if(isset($GLOBALS['phpgw_info']['flags']['navbar_target']) && $GLOBALS['phpgw_info']['flags']['navbar_target']) { $app_titles .= ' target="' . $GLOBALS['phpgw_info']['flags']['navbar_target'] . '"'; } $app_titles .= $app_data['target'].'>' . $title . '</a></td>'; } // else // generate extra icon layer | always shows icons and text else // generate extra icon layer shows icons and/or text { // check for small icon version else use default and let the browser resize $icon = '<img src="' . $app_data['icon'] . '" alt="' . $title . '" width="16" title="'. $title . '" border="0" />'; $app_extra_icons .= '<tr>'; if($GLOBALS['phpgw_info']['user']['preferences']['common']['navbar_format']!='text') { $app_extra_icons .= '<td class="extraIconsRow"><a href="' . $app_data['url'] . '"'; if(isset($GLOBALS['phpgw_info']['flags']['navbar_target']) && $GLOBALS['phpgw_info']['flags']['navbar_target']) { $app_extra_icons .= ' target="' . $GLOBALS['phpgw_info']['flags']['navbar_target'] . '"'; } $app_extra_icons .= ' >' . $icon . '</a></td>'; } // $app_extra_icons .= '<tr><td><a href="' . $app_data['url'] . '"'; // if(isset($GLOBALS['phpgw_info']['flags']['navbar_target']) && $GLOBALS['phpgw_info']['flags']['navbar_target']) // { // $app_extra_icons .= ' target="' . $GLOBALS['phpgw_info']['flags']['navbar_target'] . '"'; // } // $app_extra_icons .= '>' . $icon . '</a></td>'; $app_extra_icons .= '<td align="left" class="extraIconsRow" style=""><a href="'.$app_data['url'] . '"'; if(isset($GLOBALS['phpgw_info']['flags']['navbar_target']) && $GLOBALS['phpgw_info']['flags']['navbar_target']) { $app_extra_icons .= ' target="' . $GLOBALS['phpgw_info']['flags']['navbar_target'] . '"'; } $app_extra_icons .= '>' . $title . '</a></td></tr>'; } unset($icon); unset($title); $i++; } } if($GLOBALS['phpgw_info']['user']['preferences']['common']['start_and_logout_icons']!='no') { $app_icons .= '<td width="'.$tdwidth.'%" height="32" valign="bottom" align="center" style="text-align:center"><a href="'.$GLOBALS['phpgw_info']['navbar']['logout']['url'].'"><img src="'.$GLOBALS['phpgw_info']['navbar']['logout']['icon'].'" title="'.$GLOBALS['phpgw_info']['navbar']['logout']['title'].'" alt="'.$GLOBALS['phpgw_info']['navbar']['logout']['title'].'"></a></td>'; $app_titles .= '<td align="center" valign="top" class="appTitles" style="text-align:center"><a href="'.$GLOBALS['phpgw_info']['navbar']['logout']['url'].'">'.$GLOBALS['phpgw_info']['navbar']['logout']['title'].'</a></td>'; }// $var['app_icons'] = $app_icons; if($GLOBALS['phpgw_info']['user']['preferences']['common']['navbar_format']!='text') { $var['app_icons'] = $app_icons; } if($i > $max_icons) {// table width=100% fixed layout bug (ndee130204) $app_extra_icons_div = ' <script language="javascript"> new ypSlideOutMenu("menu1", "down", 10, 114, 160, 200,\'right\') </script> <div id="menu1Container"> <div id="menu1Content" style="position: relative; left: 0; text-align: left;"> <div id="extraIcons"> <table cellspacing="0" cellpadding="0" border="0" width="100%"> <tr><td colspan="2" nowrap="nowrap" align="right" style="background-color:#dddddd;padding:1px;"> <a href="#" '.$show_menu_event.'="ypSlideOutMenu.hide(\'menu1\')" title="'.lang('close').'"> <img style="" border="0" src="'.$var['img_root'].'/close.png"/></a></td></tr> '.$app_extra_icons.'</table> </div> </div> </div> '; $var['app_extra_icons_div']= $app_extra_icons_div; // $var['app_extra_icons_icon']= '<td width="26" valign="top" align="right" style="padding-right:3px;padding-top:50px;"><a title="'.lang('show_more_apps').'" href="javascript:void(0);" onClick="HideShow(\'extraIcons\');"><img src="'.$var['img_root'].'/extra_icons.png" border="0" /></a></td>'; $var['app_extra_icons_icon']= '<td width="26" valign="top" align="right" style="padding-right:3px;padding-top:50px;"><a title="'.lang('show_more_apps').'" href="#" '.$show_menu_event.'="ypSlideOutMenu.showMenu(\'menu1\')"><img src="'.$var['img_root'].'/extra_icons.png" border="0" /></a></td>'; } if($GLOBALS['phpgw_info']['user']['preferences']['common']['navbar_format']!='icons') { $var['app_titles'] = $app_titles; } else { $var['app_titles'] = '<td colspan="'.$max_icons.'"> </td>'; } if(isset($GLOBALS['phpgw_info']['flags']['app_header'])) { $var['current_app_title'] = $GLOBALS['phpgw_info']['flags']['app_header']; } else { $var['current_app_title']=$GLOBALS['phpgw_info']['navbar'][$GLOBALS['phpgw_info']['flags']['currentapp']]['title']; }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -