[ Index ]
 

Code source de eGroupWare 1.2.106-2

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/phpgwapi/templates/default/ -> navbar.inc.php (source)

   1  <?php
   2    /**************************************************************************\
   3    * eGroupWare                                                               *
   4    * http://www.egroupware.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    /* $Id: navbar.inc.php 16305 2004-08-09 12:32:46Z reinerj $ */
  13  
  14  	function parse_navbar($force = False)
  15      {
  16          $tpl = createobject('phpgwapi.Template',PHPGW_TEMPLATE_DIR);
  17          $tpl->set_unknowns('remove');
  18  
  19          $tpl->set_file(
  20              array(
  21                  'navbar'     => 'navbar.tpl',
  22                  'navbar_app' => 'navbar_app.tpl'
  23              )
  24          );
  25  
  26          $var['navbar_color'] = $GLOBALS['phpgw_info']['theme']['navbar_bg'];
  27  
  28          if ($GLOBALS['phpgw_info']['flags']['navbar_target'])
  29          {
  30              $target = ' target="' . $GLOBALS['phpgw_info']['flags']['navbar_target'] . '"';
  31          }
  32  
  33          $i = 1;
  34          foreach($GLOBALS['phpgw_info']['navbar'] as $app => $app_data)
  35          {
  36              if ($GLOBALS['phpgw_info']['user']['preferences']['common']['navbar_format'] == 'text')
  37              {
  38                  $tabs[$i]['label'] = $app_data['title'];
  39                  $tabs[$i]['link']  = $app_data['url'];
  40                  if (!empty($app_data['target']))
  41                  {
  42                      $tabs[$i]['target'] = $app_data['target'];
  43                  }
  44                  elseif (!empty($target))
  45                  {
  46                      $tabs[$i]['target'] = $target;
  47                  }
  48                  if (ereg($GLOBALS['phpgw_info']['navbar'][$app],$_SERVER['PHP_SELF']))
  49                  {
  50                      $selected = $i;
  51                  }
  52                  $i++;
  53              }
  54              else
  55              {
  56                  $title = '<img src="' . $app_data['icon'] . '" alt="' . $app_data['title'] . '" title="'
  57                      . $app_data['title'] . '" border="0">';
  58                  if ($GLOBALS['phpgw_info']['user']['preferences']['common']['navbar_format'] == 'icons_and_text')
  59                  {
  60                      $title .= "<br>" . $app_data['title'];
  61                      $var['width'] = '7%';
  62                  }
  63                  else
  64                  {
  65                      $var['width']  = '3%';
  66                  }
  67  
  68                  $var['value'] = '<a href="' . $app_data['url'] . '"' . ($app_data['target'] ? $app_data['target'] : $target) . '>' . $title . '</a>';
  69                  $var['align'] = 'center';
  70                  $tpl->set_var($var);
  71                  $tpl->parse('applications','navbar_app',True);
  72              }
  73          }
  74          if ($GLOBALS['phpgw_info']['user']['preferences']['common']['navbar_format'] == 'text')
  75          {
  76              $var['navbar_color'] = $GLOBALS['phpgw_info']['theme']['bg_color'];
  77              $var['align'] = 'right';
  78              $var['value'] = $GLOBALS['phpgw']->common->create_tabs($tabs,$selected,-1);
  79              $tpl->set_var($var);
  80              $tpl->parse('applications','navbar_app',True);
  81          }
  82  
  83          if ($GLOBALS['phpgw_info']['server']['showpoweredbyon'] == 'top')
  84          {
  85              $var['powered_by'] = lang('Powered by eGroupWare version %1',$GLOBALS['phpgw_info']['server']['versions']['phpgwapi']);
  86          }
  87          if (isset($GLOBALS['phpgw_info']['navbar']['admin']) && $GLOBALS['phpgw_info']['user']['preferences']['common']['show_currentusers'])
  88          {
  89              $var['current_users'] = '<a href="' . $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uicurrentsessions.list_sessions')
  90                  . '">&nbsp;' . lang('Current users') . ': ' . $GLOBALS['phpgw']->session->total() . '</a>';
  91          }
  92          $now = time();
  93          $var['user_info'] = $GLOBALS['phpgw']->common->display_fullname() . ' - '
  94                  . lang($GLOBALS['phpgw']->common->show_date($now,'l')) . ' '
  95                  . $GLOBALS['phpgw']->common->show_date($now,$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
  96  //                . lang($GLOBALS['phpgw']->common->show_date($now,'F')) . ' '
  97  //                . $GLOBALS['phpgw']->common->show_date($now,'d, Y');
  98  
  99          // Maybe we should create a common function in the phpgw_accounts_shared.inc.php file
 100          // to get rid of duplicate code.
 101          if ($GLOBALS['phpgw_info']['user']['lastpasswd_change'] == 0)
 102          {
 103              $api_messages = lang('You are required to change your password during your first login')
 104                  . '<br> Click this image on the navbar: <img src="'
 105                  . $GLOBALS['phpgw']->common->image('preferences','navbar.gif').'">';
 106          }
 107          elseif ($GLOBALS['phpgw_info']['user']['lastpasswd_change'] < time() - (86400*30))
 108          {
 109              $api_messages = lang('it has been more then %1 days since you changed your password',30);
 110          }
 111   
 112          // This is gonna change
 113          if (isset($cd))
 114          {
 115              $var['messages'] = $api_messages . '<br>' . checkcode($cd);
 116          }
 117  
 118          if (isset($GLOBALS['phpgw_info']['flags']['app_header']))
 119          {
 120              $var['current_app_header'] = $GLOBALS['phpgw_info']['flags']['app_header'];
 121              $var['th_bg'] = $GLOBALS['phpgw_info']['theme']['th_bg'];
 122          }
 123          else
 124          {
 125              $tpl->set_block('navbar','app_header','app_header');
 126              $var['app_header'] = '';
 127          }
 128  
 129          $tpl->set_var($var);
 130          $tpl->pfp('out','navbar');
 131          // If the application has a header include, we now include it
 132          if (!@$GLOBALS['phpgw_info']['flags']['noappheader'] && @isset($_GET['menuaction']))
 133          {
 134              list($app,$class,$method) = explode('.',$_GET['menuaction']);
 135              if (is_array($GLOBALS[$class]->public_functions) && $GLOBALS[$class]->public_functions['header'])
 136              {
 137                  $GLOBALS[$class]->header();
 138              }
 139          }
 140          $GLOBALS['phpgw']->hooks->process('after_navbar');
 141          return;
 142      }
 143  
 144  	function parse_navbar_end()
 145      {
 146          if ($GLOBALS['phpgw_info']['server']['showpoweredbyon'] == 'bottom')
 147          {
 148              $tpl = createobject('phpgwapi.Template',PHPGW_TEMPLATE_DIR);
 149              $tpl->set_unknowns('remove');
 150     
 151              $tpl->set_file(
 152                  array(
 153                      'footer' => 'footer.tpl'
 154                  )
 155              );
 156              $var = Array(
 157                  'table_bg_color' => $GLOBALS['phpgw_info']['theme']['navbar_bg'],
 158              );
 159              $var['powered_by'] = lang('Powered by eGroupWare version %1',$GLOBALS['phpgw_info']['server']['versions']['phpgwapi']);
 160              if (isset($GLOBALS['phpgw_info']['navbar']['admin']) && $GLOBALS['phpgw_info']['user']['preferences']['common']['show_currentusers'])
 161              {
 162                  $var['current_users'] = '<a href="' . $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uicurrentsessions.list_sessions')
 163                      . '">&nbsp;' . lang('Current users') . ': ' . $GLOBALS['phpgw']->session->total() . '</a>';
 164              }
 165              $now = time();
 166              $var['user_info'] = $GLOBALS['phpgw']->common->display_fullname() . ' - '
 167                  . lang($GLOBALS['phpgw']->common->show_date($now,'l')) . ' '
 168                  . $GLOBALS['phpgw']->common->show_date($now,$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
 169              $tpl->set_var($var);
 170              $GLOBALS['phpgw']->hooks->process('navbar_end');
 171              $tpl->pfp('out','footer');
 172          }
 173      }


Généré le : Sun Feb 25 17:20:01 2007 par Balluche grâce à PHPXref 0.7