[ Index ]
 

Code source de eGroupWare 1.2.106-2

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

title

Body

[fermer]

/preferences/inc/ -> hook_settings.inc.php (source)

   1  <?php
   2      /**************************************************************************\
   3      * eGroupWare - Preferences                                                 *
   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: hook_settings.inc.php 19417 2005-10-14 14:31:35Z ralfbecker $ */
  13  
  14      /* Setup some values to fill the array of this app's settings below */
  15      $templates = $GLOBALS['egw']->common->list_templates();
  16      foreach($templates as $var => $value)
  17      {
  18          $_templates[$var] = $templates[$var]['title'];
  19      }
  20  
  21      $themes = $GLOBALS['egw']->common->list_themes();
  22      foreach($themes as $value)
  23      {
  24          $_themes[$value] = $value;
  25      }
  26  
  27      $navbar_format = array(
  28          'icons'          => lang('Icons only'),
  29          'icons_and_text' => lang('Icons and text'),
  30          'text'           => lang('Text only')
  31      );
  32  
  33      $format = $GLOBALS['egw_info']['user']['preferences']['common']['dateformat'];
  34      $format = ($format ? $format : 'Y/m/d') . ', ';
  35      if($GLOBALS['egw_info']['user']['preferences']['common']['timeformat'] == '12')
  36      {
  37          $format .= 'h:i a';
  38      }
  39      else
  40      {
  41          $format .= 'H:i';
  42      }
  43      for($i = -23; $i<24; $i++)
  44      {
  45          $t = time() + $i * 60*60;
  46          $tz_offset[$i] = $i . ' ' . lang('hours').': ' . date($format,$t);
  47      }
  48  
  49      $date_formats = array(
  50          'm/d/Y' => 'm/d/Y',
  51          'm-d-Y' => 'm-d-Y',
  52          'm.d.Y' => 'm.d.Y',
  53          'Y/d/m' => 'Y/d/m',
  54          'Y-d-m' => 'Y-d-m',
  55          'Y.d.m' => 'Y.d.m',
  56          'Y/m/d' => 'Y/m/d',
  57          'Y-m-d' => 'Y-m-d',
  58          'Y.m.d' => 'Y.m.d',
  59          'd/m/Y' => 'd/m/Y',
  60          'd-m-Y' => 'd-m-Y',
  61          'd.m.Y' => 'd.m.Y',
  62          'd-M-Y' => 'd-M-Y'
  63      );
  64  
  65      $time_formats = array(
  66          '12' => lang('12 hour'),
  67          '24' => lang('24 hour')
  68      );
  69  
  70      $sbox =& CreateObject('phpgwapi.sbox');
  71      $langs = $GLOBALS['egw']->translation->get_installed_langs();
  72  
  73      $user_apps = array();
  74      foreach($GLOBALS['egw_info']['user']['apps'] as $app => $data)
  75      {
  76          if($GLOBALS['egw_info']['apps'][$app]['status'] != 2 && $app)
  77          {
  78              $user_apps[$app] = $GLOBALS['egw_info']['apps'][$app]['title'] ? $GLOBALS['egw_info']['apps'][$app]['title'] : lang($app);
  79          }
  80      }
  81  
  82      $account_sels = array(
  83          'selectbox' => lang('Selectbox'),
  84          'primary_group' => lang('Selectbox with primary group and search'),
  85          'popup'     => lang('Popup with search')
  86      );
  87  
  88      $account_display = array(
  89          'firstname' => lang('Firstname'). ' '.lang('Lastname'),
  90          'lastname'  => lang('Lastname').', '.lang('Firstname'),
  91          'username'  => lang('username'),
  92          'firstall'  => lang('Firstname').' '.lang('Lastname').' ['.lang('username').']',
  93          'lastall'   => lang('Lastname').', '.lang('Firstname').' ['.lang('username').']',
  94          'all'       => '['.lang('username').'] '.lang('Lastname').', '.lang('Firstname')
  95      );
  96  
  97      /* Settings array for this app */
  98      $GLOBALS['settings'] = array(
  99          'maxmatchs' => array(
 100              'type'  => 'input',
 101              'label' => 'Max matches per page',
 102              'name'  => 'maxmatchs',
 103              'help'  => 'Any listing in eGW will show you this number of entries or lines per page.<br>To many slow down the page display, to less will cost you the overview.',
 104              'size'  => 3,
 105              'xmlrpc' => True,
 106              'admin'  => False
 107          ),
 108          'template_set' => array(
 109              'type'   => 'select',
 110              'label'  => 'Interface/Template Selection',
 111              'name'   => 'template_set',
 112              'values' => $_templates,
 113              'help'   => 'A template defines the layout of eGroupWare and it contains icons for each application.',
 114              'xmlrpc' => True,
 115              'admin'  => False
 116          ),
 117          'theme' => array(
 118              'type'   => 'select',
 119              'label'  => 'Theme (colors/fonts) Selection',
 120              'name'   => 'theme',
 121              'values' => $_themes,
 122              'help'   => 'A theme defines the colors and fonts used by the template.',
 123              'xmlrpc' => True,
 124              'admin'  => False
 125          ),
 126          'navbar_format' => array(
 127              'type'   => 'select',
 128              'label'  => 'Show navigation bar as',
 129              'name'   => 'navbar_format',
 130              'values' => $navbar_format,
 131              'help'   => 'You can show the applications as icons only, icons with app-name or both.',
 132              'xmlrpc' => True,
 133              'admin'  => False
 134          ),
 135          'tz_offset' => array(
 136              'type'   => 'select',
 137              'label'  => 'Time zone offset',
 138              'name'   => 'tz_offset',
 139              'values' => $tz_offset,
 140              'help'   => 'How many hours are you in front or after the timezone of the server.<br>If you are in the same time zone as the server select 0 hours, else select your locale date and time.',
 141              'xmlrpc' => True,
 142              'admin'  => False
 143          ),
 144          'dateformat' => array(
 145              'type'   => 'select',
 146              'label'  => 'Date format',
 147              'name'   => 'dateformat',
 148              'values' => $date_formats,
 149              'help'   => 'How should eGroupWare display dates for you.',
 150              'xmlrpc' => True,
 151              'admin'  => False
 152          ),
 153          'timeformat' => array(
 154              'type'   => 'select',
 155              'label'  => 'Time format',
 156              'name'   => 'timeformat',
 157              'values' => $time_formats,
 158              'help'   => 'Do you prefer a 24 hour time format, or a 12 hour one with am/pm attached.',
 159              'xmlrpc' => True,
 160              'admin'  => False
 161          ),
 162          'country' => array(
 163              'type'   => 'select',
 164              'label'  => 'Country',
 165              'name'   => 'country',
 166              'values' => $sbox->country_array,
 167              'help'   => 'In which country are you. This is used to set certain defaults for you.',
 168              'xmlrpc' => True,
 169              'admin'  => False
 170          ),
 171          'lang' => array(
 172              'type'   => 'select',
 173              'label'  => 'Language',
 174              'name'   => 'lang',
 175              'values' => $langs,
 176              'help'   => 'Select the language of texts and messages within eGroupWare.<br>Some languages may not contain all messages, in that case you will see an english message.',
 177              'xmlrpc' => True,
 178              'admin'  => False
 179          ),
 180          'show_currentusers' => array(
 181              'type'  => 'check',
 182              'label' => 'Show number of current users',
 183              'name'  => 'show_currentusers',
 184              'help'  => 'Should the number of active sessions be displayed for you all the time.',
 185              'xmlrpc' => False,
 186              'admin'  => True
 187          ),
 188          'default_app' => array(
 189              'type'   => 'select',
 190              'label'  => 'Default application',
 191              'name'   => 'default_app',
 192              'values' => $user_apps,
 193              'help'   => "The default application will be started when you enter eGroupWare or click on the homepage icon.<br>You can also have more than one application showing up on the homepage, if you don't choose a specific application here (has to be configured in the preferences of each application).",
 194              'xmlrpc' => False,
 195              'admin'  => False
 196          ),
 197          'currency' => array(
 198              'type'  => 'input',
 199              'label' => 'Currency',
 200              'name'  => 'currency',
 201              'help'  => 'Which currency symbol or name should be used in eGroupWare.',
 202              'xmlrpc' => True,
 203              'admin'  => False
 204          ),
 205          'account_selection' => array(
 206              'type'   => 'select',
 207              'label'  => 'How do you like to select accounts',
 208              'name'   => 'account_selection',
 209              'values' => $account_sels,
 210              'help'   => 'The selectbox shows all available users (can be very slow on big installs with many users). The popup can search users by name or group.',
 211              'xmlrpc' => True,
 212              'admin'  => False
 213          ),
 214          'account_display' => array(
 215              'type'   => 'select',
 216              'label'  => 'How do you like to display accounts',
 217              'name'   => 'account_display',
 218              'values' => $account_display,
 219              'help'   => 'Set this to your convenience. For security reasons, you might not want to show your Loginname in public.',
 220              'xmlrpc' => True,
 221              'admin'  => False
 222          ),
 223          'show_help' => array(
 224              'type'   => 'check',
 225              'label'  => 'Show helpmessages by default',
 226              'name'   => 'show_help',
 227              'help'   => 'Should this help messages shown up always, when you enter the preferences or only on request.',
 228              'xmlrpc' => False,
 229              'admin'  => False
 230          )
 231      );


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