Ignore:
Timestamp:
08/03/09 09:54:23 (15 years ago)
Author:
fpcorrea
Message:

Ticket #573 - Importação de mensagens é limitado pelo tamanho máximo de anexos

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/phpgwapi/templates/default/navbar.inc.php

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