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