[2] | 1 | <?php |
---|
[2529] | 2 | /**************************************************************************\ |
---|
| 3 | * phpGroupWare * |
---|
| 4 | * http://www.phpgroupware.org * |
---|
| 5 | * -------------------------------------------- * |
---|
| 6 | * This program is free software; you can redistribute it and/or modify it * |
---|
| 7 | * under the terms of the GNU General Public License as published by the * |
---|
| 8 | * Free Software Foundation; either version 2 of the License, or (at your * |
---|
| 9 | * option) any later version. * |
---|
| 10 | \**************************************************************************/ |
---|
[2] | 11 | |
---|
| 12 | |
---|
[2529] | 13 | function parse_navbar($force = False) |
---|
| 14 | { |
---|
| 15 | $GLOBALS['celepar_tpl'] = createobject('phpgwapi.Template',PHPGW_TEMPLATE_DIR); |
---|
[2] | 16 | |
---|
[2529] | 17 | $GLOBALS['celepar_tpl']->set_file( |
---|
| 18 | array( |
---|
| 19 | 'navbar' => 'navbar.tpl' |
---|
| 20 | ) |
---|
| 21 | ); |
---|
[2] | 22 | |
---|
[2529] | 23 | $GLOBALS['celepar_tpl']->set_block('navbar','navbar_header','navbar_header'); |
---|
| 24 | $GLOBALS['celepar_tpl']->set_block('navbar','extra_blocks_header','extra_block_header'); |
---|
| 25 | $GLOBALS['celepar_tpl']->set_block('navbar','extra_block_row','extra_block_row'); |
---|
| 26 | $GLOBALS['celepar_tpl']->set_block('navbar','extra_block_spacer','extra_block_spacer'); |
---|
| 27 | $GLOBALS['celepar_tpl']->set_block('navbar','extra_blocks_footer','extra_blocks_footer'); |
---|
| 28 | $GLOBALS['celepar_tpl']->set_block('navbar','sidebox_hide_header','sidebox_hide_header'); |
---|
| 29 | $GLOBALS['celepar_tpl']->set_block('navbar','sidebox_hide_footer','sidebox_hide_footer'); |
---|
| 30 | $GLOBALS['celepar_tpl']->set_block('navbar','appbox','appbox'); |
---|
| 31 | $GLOBALS['celepar_tpl']->set_block('navbar','navbar_footer','navbar_footer'); |
---|
[2] | 32 | |
---|
[2529] | 33 | $GLOBALS['celepar_tpl']->set_var('my_preferences', lang("My Preferences")); |
---|
| 34 | $GLOBALS['celepar_tpl']->set_var('title_my_preferences', lang("Click here to change your Expresso password and other preferences")); |
---|
| 35 | $GLOBALS['celepar_tpl']->set_var('title_suggestions', lang("Send your critics, doubts or suggestions")); |
---|
| 36 | $GLOBALS['celepar_tpl']->set_var('suggestions', lang("Suggestions")); |
---|
| 37 | $GLOBALS['celepar_tpl']->set_var('help', lang("Help")); |
---|
| 38 | $GLOBALS['celepar_tpl']->set_var('title_help', lang("Click here for help")); |
---|
| 39 | $GLOBALS['celepar_tpl']->set_var('template',$GLOBALS['phpgw_info']['server']['template_set']); |
---|
[1247] | 40 | |
---|
[2529] | 41 | $var['img_root'] = $GLOBALS['phpgw_info']['server']['webserver_url'] . '/phpgwapi/templates/'.$GLOBALS['phpgw_info']['server']['template_set'].'/images'; |
---|
| 42 | $var['dir_root'] = $GLOBALS['phpgw_info']['server']['webserver_url']; |
---|
| 43 | $var['table_bg_color'] = $GLOBALS['phpgw_info']['theme']['navbar_bg']; |
---|
[2] | 44 | |
---|
[2529] | 45 | if($GLOBALS['phpgw_info']['user']['preferences']['common']['click_or_onmouseover']=='onmouseover') |
---|
| 46 | { |
---|
| 47 | $show_menu_event = 'onMouseOver'; |
---|
| 48 | } |
---|
| 49 | else |
---|
| 50 | { |
---|
| 51 | $show_menu_event = 'onClick'; |
---|
| 52 | } |
---|
[1247] | 53 | |
---|
| 54 | |
---|
[2529] | 55 | $applications = ''; |
---|
[1247] | 56 | |
---|
[2529] | 57 | // == 'icons_and_text') |
---|
| 58 | |
---|
| 59 | $max_icons=$GLOBALS['phpgw_info']['user']['preferences']['common']['max_icons']; |
---|
| 60 | |
---|
| 61 | if(!$max_icons) |
---|
| 62 | { |
---|
| 63 | $max_icons=200; |
---|
| 64 | } |
---|
| 65 | |
---|
[2578] | 66 | $curr_app = NULL; |
---|
[2529] | 67 | $i = 0; |
---|
| 68 | foreach($GLOBALS['phpgw_info']['navbar'] as $app => $app_data) |
---|
| 69 | { |
---|
| 70 | $current_app = False; |
---|
| 71 | if($app != 'preferences' && $app != 'about' && $app != 'logout') |
---|
[1247] | 72 | { |
---|
[2529] | 73 | $icon = '<a href="'.$app_data['url'].'" cacheit="' |
---|
| 74 | . ( ( $app == 'admin' || $app == 'expressoAdmin1_2' || $app == 'expressoMail1_2' || $app == 'contactcenter' || $app == 'jabberit_messenger' || $app == 'filemanager' ) ? 'true' : 'false') |
---|
| 75 | . '">'; |
---|
| 76 | $title = $GLOBALS['phpgw_info']['apps'][$app]['title']; |
---|
| 77 | if($app == 'home') $title = lang('Home'); |
---|
[2505] | 78 | |
---|
[2529] | 79 | if ($GLOBALS['phpgw_info']['flags']['currentapp'] == $app) |
---|
| 80 | { |
---|
| 81 | $current_app = True; |
---|
[2578] | 82 | $curr_app = $app; |
---|
[2529] | 83 | } |
---|
[1247] | 84 | |
---|
[2529] | 85 | $icon .= '<img id="'.str_replace('_','',$app).'id" src="' . $app_data['icon'] . '" alt="' . $title . '" title="'. $title |
---|
| 86 | . '" border="0" width="'.($current_app ? 35 : 24 ).'" height="'.($current_app ? 35 : 24 ).'" nowrap="nowrap"/></a>'; |
---|
[2505] | 87 | |
---|
[2529] | 88 | if($app=='home') |
---|
| 89 | { |
---|
| 90 | if($GLOBALS['phpgw_info']['user']['preferences']['common']['start_and_logout_icons']=='no') |
---|
| 91 | { |
---|
| 92 | continue; |
---|
| 93 | } |
---|
| 94 | } |
---|
[1247] | 95 | |
---|
[2529] | 96 | // Verifica qual o formato da Barra de navegação: |
---|
| 97 | // Icone ou Texto, ou Icone e Texto |
---|
[1247] | 98 | |
---|
| 99 | |
---|
[2529] | 100 | if($GLOBALS['phpgw_info']['user']['preferences']['common']['navbar_format']=='icons') { |
---|
| 101 | $title_extra = $title; |
---|
| 102 | $title = ''; |
---|
| 103 | } |
---|
| 104 | else if($GLOBALS['phpgw_info']['user']['preferences']['common']['navbar_format']=='text'){ |
---|
| 105 | $icon = ''; |
---|
| 106 | } |
---|
[1247] | 107 | |
---|
[2529] | 108 | if($i< $max_icons) { |
---|
[1247] | 109 | |
---|
[2529] | 110 | if($GLOBALS['phpgw_info']['user']['preferences']['common']['start_and_logout_icons']=='no') |
---|
| 111 | { |
---|
| 112 | $tdwidth = 100/($max_icons); |
---|
| 113 | } |
---|
| 114 | else |
---|
| 115 | { |
---|
| 116 | $tdwidth = 100/($max_icons+2); |
---|
| 117 | } |
---|
[1247] | 118 | |
---|
[2529] | 119 | $app_icons .= '<td nowrap' |
---|
| 120 | . ' onmouseover="if ( this.className != \'navbar_butOut\'){this.className=\'navbar_butOver\'; zoom_in(this.firstChild.firstChild.id);}"' |
---|
| 121 | . ' onmouseout="if ( this.className != \'navbar_butOut\'){this.className=\'navbar_but\'; zoom_out(this.firstChild.firstChild.id);}"' |
---|
| 122 | . ' onclick="if ( this.className != \'navbar_butOut\'){this.className=\'navbar_butOut\'; zoom_out(curr_app);' |
---|
[2578] | 123 | . 'var app = document.getElementById(curr_app); if ( app ) app.parentNode.parentNode.className=\'navbar_but\';curr_app=\'' . str_replace('_','',$app) . 'id\'}"' |
---|
[2529] | 124 | . ' class="navbar_but'.($current_app?'Out':'').'">'; |
---|
[1247] | 125 | |
---|
[2529] | 126 | if(isset($GLOBALS['phpgw_info']['flags']['navbar_target']) && $GLOBALS['phpgw_info']['flags']['navbar_target']) |
---|
| 127 | { |
---|
| 128 | $app_icons .= ' target="' . $GLOBALS['phpgw_info']['flags']['navbar_target'] . '"'; |
---|
| 129 | } |
---|
| 130 | $app_icons .= $icon; |
---|
| 131 | } |
---|
[1247] | 132 | |
---|
| 133 | |
---|
[2529] | 134 | $icon = '<img align="center" src="' . $app_data['icon'] . '" alt="' . $title . '" width="16" title="'. $title . '" border="0" />'; |
---|
[1247] | 135 | |
---|
[2529] | 136 | $app_extra_icons .= '<tr>'; |
---|
[1247] | 137 | |
---|
[2529] | 138 | if($GLOBALS['phpgw_info']['user']['preferences']['common']['navbar_format']!='text') |
---|
| 139 | { |
---|
| 140 | $app_extra_icons .= '<td class="extraIconsRow"><a href="' . $app_data['url'] . '"'; |
---|
[1247] | 141 | |
---|
[2529] | 142 | if(isset($GLOBALS['phpgw_info']['flags']['navbar_target']) && $GLOBALS['phpgw_info']['flags']['navbar_target']) |
---|
| 143 | { |
---|
| 144 | $app_extra_icons .= ' target="' . $GLOBALS['phpgw_info']['flags']['navbar_target'] . '"'; |
---|
[2] | 145 | } |
---|
[2529] | 146 | |
---|
| 147 | $app_extra_icons .= ' >' . $icon . '</a></td>'; |
---|
[1247] | 148 | } |
---|
[2529] | 149 | |
---|
| 150 | |
---|
| 151 | $app_extra_icons .= '<td align="left" class="extraIconsRow" style=""><a href="'.$app_data['url'] . '"'; |
---|
| 152 | |
---|
| 153 | if(isset($GLOBALS['phpgw_info']['flags']['navbar_target']) && $GLOBALS['phpgw_info']['flags']['navbar_target']) |
---|
[1247] | 154 | { |
---|
[2529] | 155 | $app_extra_icons .= ' target="' . $GLOBALS['phpgw_info']['flags']['navbar_target'] . '"'; |
---|
| 156 | } |
---|
[1247] | 157 | |
---|
[2529] | 158 | $app_extra_icons .= '>' . $title_extra . '</a></td></tr>'; |
---|
[1247] | 159 | |
---|
[2529] | 160 | unset($icon); |
---|
| 161 | unset($title); |
---|
| 162 | $i++; |
---|
| 163 | } |
---|
| 164 | } |
---|
| 165 | |
---|
[2578] | 166 | echo '<script>var curr_app = "' . ( ( $curr_app ) ? str_replace( '_','',$curr_app ) . 'id' : '' ) . '";</script>'; |
---|
| 167 | |
---|
[2529] | 168 | if($GLOBALS['phpgw_info']['user']['preferences']['common']['start_and_logout_icons']!='no') |
---|
| 169 | { |
---|
| 170 | |
---|
| 171 | $hint = $GLOBALS['phpgw_info']['navbar']['logout']['title']; |
---|
| 172 | $icon = '<img id="logout_id" width="24" height="24" src="'.$GLOBALS['phpgw_info']['navbar']['logout']['icon'].'" alt="'.$hint.'" title="'.$hint.'">'; |
---|
| 173 | |
---|
| 174 | if($GLOBALS['phpgw_info']['user']['preferences']['common']['navbar_format']=='icons') { |
---|
| 175 | |
---|
| 176 | $title = ''; |
---|
| 177 | } |
---|
| 178 | else if($GLOBALS['phpgw_info']['user']['preferences']['common']['navbar_format']=='text'){ |
---|
| 179 | |
---|
| 180 | $icon = ''; |
---|
| 181 | } |
---|
| 182 | $app_icons .= '<td nowrap '. |
---|
| 183 | 'onmouseover="javascript:this.className=\'navbar_butOver\'; zoom_in(this.firstChild.firstChild.id)" '. |
---|
| 184 | 'onmouseout="javascript:this.className=\'navbar_but\'; zoom_out(this.firstChild.firstChild.id)" '. |
---|
| 185 | 'class="navbar_but"><a onclick="location.href=\''.$GLOBALS['phpgw_info']['navbar']['logout']['url'].'\'">'.$icon.'</td>'; |
---|
| 186 | } // window.location.href=\''.$GLOBALS['phpgw_info']['navbar']['logout']['url'].'\' |
---|
| 187 | |
---|
| 188 | $var['app_icons'] = $app_icons; |
---|
| 189 | |
---|
| 190 | $hint = $GLOBALS['phpgw_info']['navbar']['logout']['title']; |
---|
| 191 | $icon = '<img src="'.$GLOBALS['phpgw_info']['navbar']['logout']['icon'].'" alt="'.$hint.'" title="'.$hint.'">'; |
---|
| 192 | $title = $GLOBALS['phpgw_info']['navbar']['logout']['title']; |
---|
| 193 | |
---|
| 194 | $app_extra_icons .= '<td class="extraIconsRow"> |
---|
| 195 | <a href="'.$GLOBALS['phpgw_info']['navbar']['logout']['url'].'">'.$icon.'</a></td>'; |
---|
| 196 | |
---|
| 197 | $app_extra_icons .= '<td class="extraIconsRow"> |
---|
| 198 | <a href="'.$GLOBALS['phpgw_info']['navbar']['logout']['url'].'">'.$title.'</a></td>'; |
---|
| 199 | |
---|
| 200 | |
---|
| 201 | $app_extra_icons_div = ' |
---|
| 202 | <script language="javascript"> |
---|
| 203 | new ypSlideOutMenu("menu1", "down", 5, 24, 160, 200,\'left\') |
---|
[1247] | 204 | </script> |
---|
| 205 | <div id="menu1Container"> |
---|
| 206 | <div id="menu1Content" style="position: relative; left: 0; text-align: left;"> |
---|
| 207 | |
---|
| 208 | <div id="extraIcons"> |
---|
| 209 | |
---|
| 210 | <table cellspacing="0" cellpadding="0" border="0" width="100%"> |
---|
| 211 | <tr> |
---|
| 212 | <td colspan="2" nowrap="nowrap" align="right" style="background-color:#dddddd;padding:1px;"> |
---|
| 213 | <a href="#" '.$show_menu_event.'="ypSlideOutMenu.hide(\'menu1\')" title="'.lang('close').'"> |
---|
| 214 | <img style="" border="0" src="'.$var['img_root'].'/close.png"/></a></span></td></tr> |
---|
| 215 | <tr> |
---|
| 216 | <td colspan="1" valign="top" nowrap="nowrap" align="left" style="background-color:#dddddd;padding:1px;"> |
---|
| 217 | <a href="#" onClick="javascript:ypSlideOutMenu.hide(\'menu1\');showBar()" title="'.lang('Expand Menu').'"> |
---|
| 218 | <img src = "'.$var['img_root'].'/down.button.png"></a> |
---|
| 219 | </td> |
---|
| 220 | <td colspan="1" valign="top" nowrap="nowrap" align="left" style="background-color:#dddddd;padding:1px;"> |
---|
| 221 | <a href="#" onClick="javascript:ypSlideOutMenu.hide(\'menu1\');showBar()" title="'.lang('Expand Menu').'"> |
---|
| 222 | <b>'.lang('Expand Menu').'</b></a></td></tr> |
---|
| 223 | '.$app_extra_icons.'</table> |
---|
| 224 | </div> |
---|
| 225 | |
---|
| 226 | </div> |
---|
| 227 | </div> |
---|
| 228 | '; |
---|
| 229 | |
---|
| 230 | $var['app_extra_icons_div']= $app_extra_icons_div; |
---|
| 231 | $var['app_extra_icons_icon']= '<td width="26" valign="top" align="right" style="zIndex:10000;padding-right:3px;padding-top:10px;"><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>'; |
---|
| 232 | |
---|
| 233 | |
---|
| 234 | if(isset($GLOBALS['phpgw_info']['flags']['app_header'])) |
---|
| 235 | { |
---|
| 236 | $var['current_app_title'] = $GLOBALS['phpgw_info']['flags']['app_header']; |
---|
[2] | 237 | } |
---|
| 238 | else |
---|
| 239 | { |
---|
[1247] | 240 | $var['current_app_title']=$GLOBALS['phpgw_info']['navbar'][$GLOBALS['phpgw_info']['flags']['currentapp']]['title']; |
---|
| 241 | } |
---|
[2] | 242 | |
---|
[1247] | 243 | if(isset($GLOBALS['phpgw_info']['navbar']['admin']) && $GLOBALS['phpgw_info']['user']['preferences']['common']['show_currentusers']) |
---|
| 244 | { |
---|
| 245 | $var['current_users'] = '<a href="' |
---|
| 246 | . $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uicurrentsessions.list_sessions') . '">' |
---|
| 247 | . lang('Current users') . ': ' . $GLOBALS['phpgw']->session->total() . '</a>'; |
---|
[2] | 248 | } |
---|
[1247] | 249 | $now = time(); |
---|
| 250 | $var['user_info'] = '<b>'.$GLOBALS['phpgw']->common->display_fullname() .'</b>'. ' - ' |
---|
| 251 | . lang($GLOBALS['phpgw']->common->show_date($now,'l')) . ' ' |
---|
| 252 | . $GLOBALS['phpgw']->common->show_date($now,$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']); |
---|
[2529] | 253 | |
---|
[1247] | 254 | if($GLOBALS['phpgw_info']['server']['use_frontend_name']) |
---|
| 255 | $var['frontend_name'] = " - ".$GLOBALS['phpgw_info']['server']['use_frontend_name']; |
---|
[2] | 256 | |
---|
[1247] | 257 | /* |
---|
| 258 | * Forçar termo de aceite por parte do usuário |
---|
| 259 | */ |
---|
[2] | 260 | |
---|
[1247] | 261 | if(($GLOBALS['phpgw_info']['user']['agree_terms'] != 1) && ($GLOBALS['phpgw_info']['server']['use_agree_term']=='True')) //Ele deverá confirmar o termo de aceite. |
---|
| 262 | { |
---|
| 263 | $agreeterm_url = $_SERVER['HTTP_HOST'] . $GLOBALS['phpgw_info']['server']['webserver_url'] . '/preferences/termo_aceite.php'; |
---|
[2529] | 264 | |
---|
[1247] | 265 | if ($GLOBALS['phpgw_info']['server']['use_https'] == 2) |
---|
| 266 | $agreeterm_url = 'https://' . $agreeterm_url; |
---|
| 267 | else |
---|
| 268 | $agreeterm_url = 'http://' . $agreeterm_url; |
---|
[2529] | 269 | |
---|
[1247] | 270 | echo '<script>' . |
---|
[2529] | 271 | 'if(location.href.indexOf("termo_aceite.php") == -1){' . |
---|
| 272 | 'location.href = "' . $agreeterm_url . '"' . |
---|
| 273 | '}' . |
---|
| 274 | '</script>'; |
---|
[1247] | 275 | } |
---|
| 276 | |
---|
[2529] | 277 | |
---|
[1247] | 278 | if(($GLOBALS['phpgw_info']['user']['lastpasswd_change'] == '0') && (($GLOBALS['phpgw_info']['user']['agree_terms'] == 1) || ($GLOBALS['phpgw_info']['server']['use_agree_term']!='True'))) |
---|
| 279 | { |
---|
| 280 | $changepasswd_url = $_SERVER['HTTP_HOST'] . $GLOBALS['phpgw_info']['server']['webserver_url'] . '/preferences/changepassword.php?cd=1'; |
---|
[2529] | 281 | |
---|
[1247] | 282 | if ($GLOBALS['phpgw_info']['server']['use_https'] > 0) |
---|
| 283 | $changepasswd_url = 'https://' . $changepasswd_url; |
---|
| 284 | else |
---|
| 285 | $changepasswd_url = 'http://' . $changepasswd_url; |
---|
[2529] | 286 | |
---|
[1247] | 287 | echo '<script>' . |
---|
[2529] | 288 | 'if(location.href.indexOf("changepassword.php") == -1){' . |
---|
| 289 | 'location.href = "' . $changepasswd_url . '"' . |
---|
| 290 | '}' . |
---|
| 291 | '</script>'; |
---|
| 292 | |
---|
[1247] | 293 | /* |
---|
[2529] | 294 | $api_messages = lang('You are required to change your password during your first login') |
---|
[2] | 295 | . '<br> Click this image on the navbar: <img src="' |
---|
| 296 | . $GLOBALS['phpgw']->common->image('preferences','navbar.gif').'">'; |
---|
[2529] | 297 | */ |
---|
[1247] | 298 | } |
---|
| 299 | /* |
---|
| 300 | elseif($GLOBALS['phpgw_info']['user']['lastpasswd_change'] < time() - (86400*30)) |
---|
| 301 | { |
---|
| 302 | $api_messages = lang('it has been more then %1 days since you changed your password',30); |
---|
| 303 | } |
---|
[2529] | 304 | */ |
---|
[1247] | 305 | /* |
---|
| 306 | // This is gonna change |
---|
| 307 | if(isset($cd)) |
---|
| 308 | { |
---|
| 309 | $var['messages'] = $api_messages . '<br>' . checkcode($cd); |
---|
| 310 | }*/ |
---|
| 311 | |
---|
| 312 | $var['logo_file'] = $GLOBALS['phpgw']->common->image('phpgwapi',$GLOBALS['phpgw_info']['server']['login_logo_file']?$GLOBALS['phpgw_info']['server']['login_logo_file']:'logo'); |
---|
| 313 | $var['logo_url'] = $GLOBALS['phpgw_info']['server']['login_logo_url']?$GLOBALS['phpgw_info']['server']['login_logo_url']:'http://www.eGroupWare.org'; |
---|
| 314 | $var['logo_title'] = $GLOBALS['phpgw_info']['server']['login_logo_title']?$GLOBALS['phpgw_info']['server']['login_logo_title']:'www.eGroupWare.org'; |
---|
| 315 | $var['hide_bar_txt'] = lang("Hide header and toolbar"); |
---|
| 316 | $var['show_bar_txt'] = lang("Show header and toolbar"); |
---|
| 317 | $GLOBALS['celepar_tpl']->set_var($var); |
---|
| 318 | $GLOBALS['celepar_tpl']->pfp('out','navbar_header'); |
---|
| 319 | |
---|
| 320 | /******************************************************\ |
---|
[2529] | 321 | * The sidebox menu's * |
---|
| 322 | \******************************************************/ |
---|
[1247] | 323 | |
---|
| 324 | $menu_title = lang('General Menu'); |
---|
| 325 | |
---|
| 326 | $file['Home'] = $GLOBALS['phpgw_info']['navbar']['home']['url']; |
---|
| 327 | if($GLOBALS['phpgw_info']['user']['apps']['preferences']) |
---|
| 328 | { |
---|
| 329 | $file['Preferences'] = $GLOBALS['phpgw_info']['navbar']['preferences']['url']; |
---|
| 330 | } |
---|
| 331 | $file += array( |
---|
| 332 | array( |
---|
| 333 | 'text' => lang('About %1',$GLOBALS['phpgw_info']['apps'][$GLOBALS['phpgw_info']['flags']['currentapp']]['title']), |
---|
| 334 | 'no_lang' => True, |
---|
| 335 | 'link' => $GLOBALS['phpgw_info']['navbar']['about']['url'] |
---|
| 336 | ), |
---|
| 337 | 'Logout'=>$GLOBALS['phpgw_info']['navbar']['logout']['url'] |
---|
| 338 | ); |
---|
| 339 | |
---|
| 340 | if($GLOBALS['phpgw_info']['user']['preferences']['common']['auto_hide_sidebox']==1) |
---|
| 341 | { |
---|
| 342 | $GLOBALS['celepar_tpl']->set_var('show_menu_event',$show_menu_event); |
---|
| 343 | $GLOBALS['celepar_tpl']->set_var('lang_show_menu',lang('show menu')); |
---|
| 344 | $GLOBALS['celepar_tpl']->pparse('out','sidebox_hide_header'); |
---|
| 345 | |
---|
| 346 | display_sidebox('',$menu_title,$file); |
---|
| 347 | $GLOBALS['phpgw']->hooks->single('sidebox_menu',$GLOBALS['phpgw_info']['flags']['currentapp']); |
---|
| 348 | |
---|
| 349 | $GLOBALS['celepar_tpl']->pparse('out','sidebox_hide_footer'); |
---|
| 350 | |
---|
| 351 | $var['sideboxcolstart']=''; |
---|
| 352 | |
---|
| 353 | $GLOBALS['celepar_tpl']->set_var($var); |
---|
| 354 | $GLOBALS['celepar_tpl']->pparse('out','appbox'); |
---|
| 355 | $var['remove_padding'] = 'style="padding-left:0px;"'; |
---|
| 356 | $var['sideboxcolend'] = ''; |
---|
| 357 | } |
---|
| 358 | else |
---|
| 359 | { |
---|
| 360 | $var['menu_link'] = ''; |
---|
| 361 | $var['sideboxcolstart'] = '<td id="tdSidebox" valign="top">'; |
---|
| 362 | $var['remove_padding'] = ''; |
---|
| 363 | $GLOBALS['celepar_tpl']->set_var($var); |
---|
| 364 | $GLOBALS['celepar_tpl']->pparse('out','appbox'); |
---|
| 365 | |
---|
| 366 | display_sidebox('',$menu_title,$file); |
---|
| 367 | $GLOBALS['phpgw']->hooks->single('sidebox_menu',$GLOBALS['phpgw_info']['flags']['currentapp']); |
---|
| 368 | |
---|
| 369 | $var['sideboxcolend'] = '</td>'; |
---|
| 370 | } |
---|
| 371 | |
---|
| 372 | $GLOBALS['celepar_tpl']->set_var($var); |
---|
| 373 | $GLOBALS['celepar_tpl']->pparse('out','navbar_footer'); |
---|
| 374 | |
---|
| 375 | // If the application has a header include, we now include it |
---|
| 376 | if(!@$GLOBALS['phpgw_info']['flags']['noappheader'] && @isset($_GET['menuaction'])) |
---|
| 377 | { |
---|
| 378 | list($app,$class,$method) = explode('.',$_GET['menuaction']); |
---|
| 379 | if(is_array($GLOBALS[$class]->public_functions) && $GLOBALS[$class]->public_functions['header']) |
---|
| 380 | { |
---|
| 381 | $GLOBALS[$class]->header(); |
---|
| 382 | } |
---|
| 383 | } |
---|
| 384 | $GLOBALS['phpgw']->hooks->process('after_navbar'); |
---|
| 385 | return; |
---|
[2529] | 386 | } |
---|
[1247] | 387 | |
---|
[2529] | 388 | function display_sidebox($appname,$menu_title,$file) |
---|
| 389 | { |
---|
| 390 | if(!$appname || ($appname==$GLOBALS['phpgw_info']['flags']['currentapp'] && $file)) |
---|
| 391 | { |
---|
| 392 | $var['lang_title']=$menu_title;//$appname.' '.lang('Menu'); |
---|
| 393 | $GLOBALS['celepar_tpl']->set_var($var); |
---|
| 394 | $GLOBALS['celepar_tpl']->pfp('out','extra_blocks_header'); |
---|
| 395 | |
---|
| 396 | foreach($file as $text => $url) |
---|
[2] | 397 | { |
---|
[2529] | 398 | sidebox_menu_item($url,$text); |
---|
| 399 | } |
---|
[2] | 400 | |
---|
[2529] | 401 | $GLOBALS['celepar_tpl']->pparse('out','extra_blocks_footer'); |
---|
| 402 | } |
---|
| 403 | } |
---|
[1247] | 404 | |
---|
[2529] | 405 | function sidebox_menu_item($item_link='',$item_text='') |
---|
| 406 | { |
---|
| 407 | if($item_text === '_NewLine_' || $item_link === '_NewLine_') |
---|
| 408 | { |
---|
| 409 | $GLOBALS['celepar_tpl']->pparse('out','extra_block_spacer'); |
---|
| 410 | } |
---|
| 411 | else |
---|
| 412 | { |
---|
| 413 | $var['icon_or_star']='<img src="'.$GLOBALS['phpgw_info']['server']['webserver_url'] . '/phpgwapi/templates/'.$GLOBALS['phpgw_info']['server']['template_set'].'/images'.'/orange-ball.png" width="9" height="9" alt="ball"/>'; |
---|
| 414 | $var['target'] = ''; |
---|
| 415 | if(is_array($item_link)) |
---|
[2] | 416 | { |
---|
[2529] | 417 | if(isset($item_link['icon'])) |
---|
[2] | 418 | { |
---|
[2529] | 419 | $app = isset($item_link['app']) ? $item_link['app'] : $GLOBALS['phpgw_info']['flags']['currentapp']; |
---|
| 420 | $var['icon_or_star'] = '<img src="'.$GLOBALS['phpgw']->common->image($app,$item_link['icon']).'"/>'; |
---|
[2] | 421 | } |
---|
[2529] | 422 | $var['lang_item'] = isset($item_link['no_lang']) && $item_link['no_lang'] ? $item_link['text'] : lang($item_link['text']); |
---|
| 423 | $var['item_link'] = $item_link['link']; |
---|
| 424 | if ($item_link['target']) |
---|
[1247] | 425 | { |
---|
[2529] | 426 | $var['target'] = ' target="' . $item_link['target'] . '"'; |
---|
[1247] | 427 | } |
---|
[2] | 428 | } |
---|
[2529] | 429 | else |
---|
[2] | 430 | { |
---|
[2529] | 431 | $var['lang_item'] = lang($item_text); |
---|
| 432 | $var['item_link'] = $item_link; |
---|
| 433 | } |
---|
| 434 | $GLOBALS['celepar_tpl']->set_var($var); |
---|
| 435 | $GLOBALS['celepar_tpl']->pparse('out','extra_block_row'); |
---|
| 436 | } |
---|
| 437 | } |
---|
[1247] | 438 | |
---|
[2529] | 439 | function parse_navbar_end() |
---|
| 440 | { |
---|
| 441 | $GLOBALS['celepar_tpl'] = createobject('phpgwapi.Template',PHPGW_TEMPLATE_DIR); |
---|
[1247] | 442 | |
---|
[2529] | 443 | $GLOBALS['celepar_tpl']->set_file( |
---|
| 444 | array( |
---|
| 445 | 'footer' => 'footer.tpl' |
---|
| 446 | ) |
---|
| 447 | ); |
---|
[1247] | 448 | |
---|
[2529] | 449 | $var = Array( |
---|
| 450 | 'img_root' => $GLOBALS['phpgw_info']['server']['webserver_url'] . '/phpgwapi/templates/'.$GLOBALS['phpgw_info']['server']['template_set'].'/images', |
---|
| 451 | 'table_bg_color' => $GLOBALS['phpgw_info']['theme']['navbar_bg'], |
---|
| 452 | 'version' => $GLOBALS['phpgw_info']['server']['versions']['phpgwapi'] |
---|
| 453 | ); |
---|
| 454 | $GLOBALS['phpgw']->hooks->process('navbar_end'); |
---|
[1247] | 455 | |
---|
[2529] | 456 | |
---|
| 457 | if($GLOBALS['phpgw_info']['user']['preferences']['common']['show_generation_time']) |
---|
| 458 | { |
---|
| 459 | $mtime = microtime(); |
---|
| 460 | $mtime = explode(' ',$mtime); |
---|
| 461 | $mtime = $mtime[1] + $mtime[0]; |
---|
| 462 | $tend = $mtime; |
---|
| 463 | $totaltime = ($tend - $GLOBALS['page_start_time']); |
---|
| 464 | |
---|
| 465 | $var['page_generation_time'] = '<div id="divGenTime"><br/><span>'.lang('Page was generated in %1 seconds',$totaltime).'</span></div>'; |
---|
| 466 | } |
---|
| 467 | |
---|
| 468 | $var['powered_by'] = lang('Powered by phpGroupWare version %1',$GLOBALS['phpgw_info']['server']['versions']['phpgwapi']); |
---|
| 469 | $GLOBALS['celepar_tpl']->set_var($var); |
---|
| 470 | $GLOBALS['celepar_tpl']->pfp('out','footer'); |
---|
| 471 | } |
---|