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