Changeset 512


Ignore:
Timestamp:
Sep 3, 2004, 5:01:05 PM (20 years ago)
Author:
z0rglub
Message:
  • in admin/configuration, add new step with "sections" (general, comments, default, upload, metadata, sessions)
  • admin/configuration.php and its template have been higly simplificated by making things more generic : for example, for each configuration parameter, its name must correspond to the name we find in the config table and belongs to a section, in the lang array we find :
  • more described message when connection to database server is impossible
  • redefinitions of get_languages and get_templates functions
  • deletion of configuration parameters : webmaster, session_keyword
  • rename of configuration parameters :
  • default_lang => default_language
  • default_style => default_template
Location:
trunk
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/configuration.php

    r493 r512  
    2626// +-----------------------------------------------------------------------+
    2727
    28 if( !defined("PHPWG_ROOT_PATH") )
    29 {
    30         die ("Hacking attempt!");
    31 }
    32 
    33 include_once( PHPWG_ROOT_PATH.'admin/include/isadmin.inc.php' );
    34        
    35 $Caracs = array("¥" => "Y", "µ" => "u", "À" => "A", "Á" => "A",
    36                 "Â" => "A", "Ã" => "A", "Ä" => "A", "Å" => "A",
    37                 "Æ" => "A", "Ç" => "C", "È" => "E", "É" => "E",
    38                 "Ê" => "E", "Ë" => "E", "Ì" => "I", "Í" => "I",
    39                 "Î" => "I", "Ï" => "I", "Ð" => "D", "Ñ" => "N",
    40                 "Ò" => "O", "Ó" => "O", "Ô" => "O", "Õ" => "O",
    41                 "Ö" => "O", "Ø" => "O", "Ù" => "U", "Ú" => "U",
    42                 "Û" => "U", "Ü" => "U", "Ý" => "Y", "ß" => "s",
    43                 "à" => "a", "á" => "a", "â" => "a", "ã" => "a",
    44                 "ä" => "a", "å" => "a", "æ" => "a", "ç" => "c",
    45                 "è" => "e", "é" => "e", "ê" => "e", "ë" => "e",
    46                 "ì" => "i", "í" => "i", "î" => "i", "ï" => "i",
    47                 "ð" => "o", "ñ" => "n", "ò" => "o", "ó" => "o",
    48                 "ô" => "o", "õ" => "o", "ö" => "o", "ø" => "o",
    49                 "ù" => "u", "ú" => "u", "û" => "u", "ü" => "u",
    50                 "ý" => "y", "ÿ" => "y");
     28if (!defined('PHPWG_ROOT_PATH'))
     29{
     30  die ("Hacking attempt!");
     31}
     32include_once(PHPWG_ROOT_PATH.'admin/include/isadmin.inc.php');
     33//-------------------------------------------------------- sections definitions
     34if (!isset($_GET['section']))
     35{
     36  $page['section'] = 'general';
     37}
     38else
     39{
     40  $page['section'] = $_GET['section'];
     41}
     42
     43// templates for fields definitions
     44$true_false = array('type' => 'radio',
     45                    'options' => array('true' => $lang['yes'],
     46                                       'false' => $lang['no']));
     47$textfield = array('type' => 'textfield');
     48
     49$sections = array(
     50  'general' => array(
     51    'mail_webmaster' => $textfield,
     52    'prefix_thumbnail' => $textfield,
     53    'access' => array('type' => 'radio',
     54                      'options' => array(
     55                        'free' => $lang['conf_general_access_1'],
     56                        'restricted' => $lang['conf_general_access_2'])),
     57    'log' => $true_false,
     58    'mail_notification' => $true_false,
     59   ),
     60  'comments' => array(
     61    'show_comments' => $true_false,
     62    'comments_forall' => $true_false,
     63    'nb_comment_page' => $textfield,
     64    'comments_validation' => $true_false
     65   ),
     66  'default' => array(
     67    'default_language' => array('type' => 'select',
     68                                'options' => get_languages()),
     69    'nb_image_line' => $textfield,
     70    'nb_line_page' => $textfield,
     71    'default_template' => array('type' => 'select',
     72                                'options' => get_templates()),
     73    'recent_period' => $textfield,
     74    'auto_expand' => $true_false,
     75    'show_nb_comments' => $true_false
     76   ),
     77  'upload' => array(
     78    'upload_available' => $true_false,
     79    'upload_maxfilesize' => $textfield,
     80    'upload_maxwidth' => $textfield,
     81    'upload_maxheight' => $textfield,
     82    'upload_maxwidth_thumbnail' => $textfield,
     83    'upload_maxheight_thumbnail' => $textfield
     84   ),
     85  'session' => array(
     86    'authorize_cookies' => $true_false,
     87    'session_time' => $textfield,
     88    'session_id_size' => $textfield
     89   ),
     90  'metadata' => array(
     91    'use_exif' => $true_false,
     92    'use_iptc' => $true_false,
     93    'show_exif' => $true_false,
     94    'show_iptc' => $true_false
     95   )
     96 );
     97//------------------------------------------------------ $conf reinitialization
     98$result = mysql_query('SELECT param,value FROM '.CONFIG_TABLE);
     99while ($row = mysql_fetch_array($result))
     100{
     101  $conf[$row['param']] = $row['value'];
     102
     103  if (isset($_POST[$row['param']]))
     104  {
     105    $conf[$row['param']] = $_POST[$row['param']];
     106  }
     107}
    51108//------------------------------ verification and registration of modifications
    52 $error = array();
    53 if ( isset( $_POST['submit'] ) )
    54 {
     109$errors = array();
     110if (isset($_POST['submit']))
     111{
     112//   echo '<pre>';
     113//   print_r($_POST);
     114//   echo '</pre>';
     115 
    55116  $int_pattern = '/^\d+$/';
    56   // deletion of site as asked
    57   $site_deleted = false;
    58   $query = 'SELECT id';
    59   $query.= ' FROM '.SITES_TABLE;
    60   $query.= " WHERE galleries_url <> './galleries/';";
    61   $result = mysql_query( $query );
    62   while ( $row = mysql_fetch_array( $result ) )
    63   {
    64     $site = 'delete_site_'.$row['id'];
    65     if ( $_POST[$site] == 1 )
    66     {
    67       delete_site( $row['id'] );
    68       $site_deleted = true;
    69     }
    70   }
    71   // if any picture of this site were linked to another categories, we have
    72   // to update the informations of those categories. To make it simple, we
    73   // just update all the categories
    74   if ( $site_deleted )
    75   {
    76     update_category( 'all' );
    77     synchronize_all_users();
    78   }
    79   // thumbnail prefix must not contain accentuated characters
    80   $old_prefix = $_POST['prefix_thumbnail'];
    81   $prefix = strtr( $_POST['prefix_thumbnail'], $Caracs );
    82   if ( $old_prefix != $prefix )
    83   {
    84     array_push( $error, $lang['conf_err_prefixe'] );
    85   }
    86   // mail must be formatted as follows : name@server.com
    87   $pattern = '/^[\w-]+(\.[\w-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)+$/';
    88   if ( !preg_match( $pattern, $_POST['mail_webmaster'] ) )
    89   {
    90     array_push( $error, $lang['conf_err_mail'] );
    91   }
    92   // periods must be integer values, they represents number of days
    93   if (!preg_match($int_pattern, $_POST['recent_period'])
    94       or $_POST['recent_period'] <= 0)
    95   {
    96     array_push( $error, $lang['err_periods'] );
    97   }
    98   // session_id size must be an integer between 4 and 50
    99   if ( !preg_match( $int_pattern, $_POST['session_id_size'] )
    100        or $_POST['session_id_size'] < 4
    101        or $_POST['session_id_size'] > 50 )
    102   {
    103     array_push( $error, $lang['conf_err_sid_size'] );
    104   }
    105   // session_time must be an integer between 5 and 60, in minutes
    106   if ( !preg_match( $int_pattern, $_POST['session_time'] )
    107        or $_POST['session_time'] < 5
    108        or $_POST['session_time'] > 60 )
    109   {
    110     array_push( $error, $lang['conf_err_sid_time'] );
    111   }
    112   // the number of comments per page must be an integer between 5 and 50
    113   // included
    114   if ( !preg_match( $int_pattern, $_POST['nb_comment_page'] )
    115        or $_POST['nb_comment_page'] < 5
    116        or $_POST['nb_comment_page'] > 50 )
    117   {
    118     array_push( $error, $lang['conf_err_comment_number'] );
    119   }
    120   // the maximum upload filesize must be an integer between 10 and 1000
    121   if ( !preg_match( $int_pattern, $_POST['upload_maxfilesize'] )
    122        or $_POST['upload_maxfilesize'] < 10
    123        or $_POST['upload_maxfilesize'] > 1000 )
    124   {
    125     array_push( $error, $lang['conf_err_upload_maxfilesize'] );
    126   }
    127   // the maximum width of uploaded pictures must be an integer superior to
    128   // 10
    129   if ( !preg_match( $int_pattern, $_POST['upload_maxwidth'] )
    130        or $_POST['upload_maxwidth'] < 10 )
    131   {
    132     array_push( $error, $lang['conf_err_upload_maxwidth'] );
    133   }
    134   // the maximum height  of uploaded pictures must be an integer superior to
    135   // 10
    136   if ( !preg_match( $int_pattern, $_POST['upload_maxheight'] )
    137        or $_POST['upload_maxheight'] < 10 )
    138   {
    139     array_push( $error, $lang['conf_err_upload_maxheight'] );
    140   }
    141   // the maximum width of uploaded thumbnails must be an integer superior to
    142   // 10
    143   if ( !preg_match( $int_pattern, $_POST['upload_maxwidth_thumbnail'] )
    144        or $_POST['upload_maxwidth_thumbnail'] < 10 )
    145   {
    146     array_push( $error, $lang['conf_err_upload_maxwidth_thumbnail'] );
    147   }
    148   // the maximum width of uploaded thumbnails must be an integer superior to
    149   // 10
    150   if ( !preg_match( $int_pattern, $_POST['upload_maxheight_thumbnail'] )
    151        or $_POST['upload_maxheight_thumbnail'] < 10 )
    152   {
    153     array_push( $error, $lang['conf_err_upload_maxheight_thumbnail'] );
    154   }
    155 
    156 /*  if ( $_POST['maxwidth'] != ''
    157        and ( !preg_match( $int_pattern, $_POST['maxwidth'] )
    158              or $_POST['maxwidth'] < 50 ) )
    159   {
    160     array_push( $error, $lang['err_maxwidth'] );
    161   }
    162   if ( $_POST['maxheight']
    163        and ( !preg_match( $int_pattern, $_POST['maxheight'] )
    164              or $_POST['maxheight'] < 50 ) )
    165   {
    166     array_push( $error, $lang['err_maxheight'] );
    167   }*/
     117  switch ($page['section'])
     118  {
     119    case 'general' :
     120    {
     121      // thumbnail prefix must only contain simple ASCII characters
     122      if (!preg_match('/^[\w-]*$/', $_POST['prefix_thumbnail']))
     123      {
     124        array_push($errors, $lang['conf_general_prefix_thumbnail_error']);
     125      }
     126      // mail must be formatted as follows : name@server.com
     127      $pattern = '/^[\w-]+(\.[\w-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)+$/';
     128      if (!preg_match($pattern, $_POST['mail_webmaster']))
     129      {
     130        array_push($errors, $lang['conf_general_mail_webmaster_error']);
     131      }
     132      break;
     133    }
     134    case 'comments' :
     135    {
     136      // the number of comments per page must be an integer between 5 and 50
     137      // included
     138      if (!preg_match($int_pattern, $_POST['nb_comment_page'])
     139           or $_POST['nb_comment_page'] < 5
     140           or $_POST['nb_comment_page'] > 50)
     141      {
     142        array_push($errors, $lang['conf_comments_nb_comment_page_error']);
     143      }
     144      break;
     145    }
     146    case 'default' :
     147    {
     148      // periods must be integer values, they represents number of days
     149      if (!preg_match($int_pattern, $_POST['recent_period'])
     150          or $_POST['recent_period'] <= 0)
     151      {
     152        array_push($errors, $lang['conf_default_recent_period_error']);
     153      }
     154      break;
     155    }
     156    case 'upload' :
     157    {
     158      // the maximum upload filesize must be an integer between 10 and 1000
     159      if (!preg_match($int_pattern, $_POST['upload_maxfilesize'])
     160          or $_POST['upload_maxfilesize'] < 10
     161          or $_POST['upload_maxfilesize'] > 1000)
     162      {
     163        array_push($errors, $lang['conf_upload_upload_maxfilesize_error']);
     164      }
     165     
     166      foreach (array('upload_maxwidth',
     167                     'upload_maxheight',
     168                     'upload_maxwidth_thumbnail',
     169                     'upload_maxheight_thumbnail')
     170               as $field)
     171      {
     172        if (!preg_match($int_pattern, $_POST[$field])
     173          or $_POST[$field] < 10)
     174        {
     175          array_push($errors, $lang['conf_upload_'.$field.'_error']);
     176        }
     177      }
     178      break;
     179    }
     180    case 'session' :
     181    {
     182      // session_id size must be an integer between 4 and 50
     183      if (!preg_match($int_pattern, $_POST['session_id_size'])
     184          or $_POST['session_id_size'] < 4
     185          or $_POST['session_id_size'] > 50)
     186      {
     187        array_push($errors, $lang['conf_session_session_id_size_error']);
     188      }
     189      // session_time must be an integer between 5 and 60, in minutes
     190      if (!preg_match($int_pattern, $_POST['session_time'])
     191          or $_POST['session_time'] < 5
     192          or $_POST['session_time'] > 60)
     193      {
     194        array_push($errors, $lang['conf_session_session_time_error']);
     195      }
     196      break;
     197    }
     198  }
     199 
    168200  // updating configuraiton if no error found
    169   if (count($error) == 0)
     201  if (count($errors) == 0)
    170202  {
    171203    $result = mysql_query('SELECT * FROM '.CONFIG_TABLE);
    172204    while ($row = mysql_fetch_array($result))
    173205    {
    174       $config_name = $row['param'];
    175       if (isset($_POST[$config_name]))
    176       {
    177         $conf[$config_name] = $_POST[$config_name];
    178       }
    179       else
    180       {
    181         $conf[$config_name] = $row['value'];
    182       }
    183 
    184       if (isset($_POST[$config_name]))
     206      if (isset($_POST[$row['param']]))
    185207      {
    186208        $query = '
    187209UPDATE '.CONFIG_TABLE.'
    188   SET value = \''. str_replace("\'", "''", $conf[$config_name]).'\'
    189   WHERE param = \''.$config_name.'\'
     210  SET value = \''. str_replace("\'", "''", $_POST[$row['param']]).'\'
     211  WHERE param = \''.$row['param'].'\'
    190212;';
    191213        mysql_query($query);
     
    194216  }
    195217}
    196 
    197 // echo '<pre>';
    198 // print_r($conf);
    199 // echo '</pre>';
    200 
    201 $access = ($conf['access']=='free')?'ACCESS_FREE':'ACCESS_RESTRICTED';
    202 $log = ($conf['log']=='true')?'HISTORY_YES':'HISTORY_NO';
    203 $mail_notif = ($conf['mail_notification']=='true')?'MAIL_NOTIFICATION_YES':'MAIL_NOTIFICATION_NO';
    204 $show_comments = ($conf['show_comments']=='true')?'SHOW_COMMENTS_YES':'SHOW_COMMENTS_NO';
    205 $comments_all = ($conf['comments_forall']=='true')?'COMMENTS_ALL_YES':'COMMENTS_ALL_NO';
    206 $comments_validation = ($conf['comments_validation']=='true')?'VALIDATE_COMMENTS_YES':'VALIDATE_COMMENTS_NO';
    207 $expand = ($conf['auto_expand']=='true')?'EXPAND_TREE_YES':'EXPAND_TREE_NO';
    208 $nb_comments = ($conf['show_nb_comments']=='true')?'NB_COMMENTS_YES':'NB_COMMENTS_NO';
    209 $upload = ($conf['upload_available']=='true')?'UPLOAD_YES':'UPLOAD_NO';
    210 $cookie = ($conf['authorize_cookies']=='true')?'COOKIE_YES':'COOKIE_NO';
    211 $use_exif = ($conf['use_exif']=='true')?'USE_EXIF_YES':'USE_EXIF_NO';
    212 $use_iptc = ($conf['use_iptc']=='true')?'USE_IPTC_YES':'USE_IPTC_NO';
    213 $show_exif = ($conf['show_exif']=='true')?'SHOW_EXIF_YES':'SHOW_EXIF_NO';
    214 $show_iptc = ($conf['show_iptc']=='true')?'SHOW_IPTC_YES':'SHOW_IPTC_NO';
    215 
    216218//----------------------------------------------------- template initialization
    217 $template->set_filenames( array('config'=>'admin/configuration.tpl') );
    218 
    219 $template->assign_vars(array(
    220   'ADMIN_NAME'=>$conf['webmaster'],
    221   'ADMIN_MAIL'=>$conf['mail_webmaster'],
    222   'THUMBNAIL_PREFIX'=>$conf['prefix_thumbnail'],
    223   'NB_COMMENTS_PAGE'=>$conf['nb_comment_page'],
    224   'LANG_SELECT'=>language_select($conf['default_lang'], 'default_lang'),
    225   'NB_IMAGE_LINE'=>$conf['nb_image_line'],
    226   'NB_ROW_PAGE'=>$conf['nb_line_page'],
    227   'STYLE_SELECT'=>style_select($conf['default_style'], 'default_style'),
    228   'RECENT_PERIOD'=>$conf['recent_period'],
    229   'UPLOAD_MAXSIZE'=>$conf['upload_maxfilesize'],
    230   'UPLOAD_MAXWIDTH'=>$conf['upload_maxwidth'],
    231   'UPLOAD_MAXHEIGHT'=>$conf['upload_maxheight'],
    232   'TN_UPLOAD_MAXWIDTH'=>$conf['upload_maxwidth_thumbnail'],
    233   'TN_UPLOAD_MAXHEIGHT'=>$conf['upload_maxheight_thumbnail'],
    234   'SESSION_LENGTH'=>$conf['session_time'],
    235   'SESSION_ID_SIZE'=>$conf['session_id_size'],
     219$template->set_filenames(array('config'=>'admin/configuration.tpl'));
     220
     221$action = PHPWG_ROOT_PATH.'admin.php?page=configuration';
     222$action.= '&amp;section='.$page['section'];
     223
     224$template->assign_vars(
     225  array(
     226    'L_CONFIRM'=>$lang['conf_confirmation'],
     227    'L_SUBMIT'=>$lang['submit'],
     228    'F_ACTION'=>add_session_id($action)
     229   )
     230 );
     231
     232$base_url = PHPWG_ROOT_PATH.'admin.php?page=configuration&amp;section=';
     233foreach (array_keys($sections) as $section)
     234{
     235  if (isset($_GET['section']) and $_GET['section'] == $section)
     236  {
     237    $class = 'opened';
     238  }
     239  else
     240  {
     241    $class = '';
     242  }
    236243 
    237   $access=>'checked="checked"',
    238   $log=>'checked="checked"',
    239   $mail_notif=>'checked="checked"',
    240   $show_comments=>'checked="checked"',
    241   $comments_all=>'checked="checked"',
    242   $comments_validation=>'checked="checked"',
    243   $expand=>'checked="checked"',
    244   $nb_comments=>'checked="checked"',
    245   $upload=>'checked="checked"',
    246   $cookie=>'checked="checked"',
    247   $use_exif=>'checked="checked"',
    248   $use_iptc=>'checked="checked"',
    249   $show_exif=>'checked="checked"',
    250   $show_iptc=>'checked="checked"',
    251  
    252   'L_CONFIRM'=>$lang['conf_confirmation'],
    253   'L_CONF_GENERAL'=>$lang['conf_general_title'],
    254   'L_ADMIN_NAME'=>$lang['conf_general_webmaster'],
    255   'L_ADMIN_NAME_INFO'=>$lang['conf_general_webmaster_info'],
    256   'L_ADMIN_MAIL'=>$lang['conf_general_mail'],
    257   'L_ADMIN_MAIL_INFO'=>$lang['conf_general_mail_info'],
    258   'L_THUMBNAIL_PREFIX'=>$lang['conf_general_prefix'],
    259   'L_THUMBNAIL_PREFIX_INFO'=>$lang['conf_general_prefix_info'],
    260   'L_ACCESS'=>$lang['conf_general_access'],
    261   'L_ACCESS_INFO'=>$lang['conf_general_access_info'],
    262   'L_ACCESS_FREE'=>$lang['conf_general_access_1'],
    263   'L_ACCESS_RESTRICTED'=>$lang['conf_general_access_2'],
    264   'L_CONF_HISTORY'=>$lang['history'],
    265   'L_CONF_HISTORY_INFO'=>$lang['conf_general_log_info'],
    266   'L_MAIL_NOTIFICATION'=>$lang['conf_general_mail_notification'],
    267   'L_MAIL_NOTIFICATION_INFO'=>$lang['conf_general_mail_notification_info'],
    268   'L_CONF_COMMENTS'=>$lang['conf_comments_title'],
    269   'L_SHOW_COMMENTS'=>$lang['conf_comments_show_comments'],
    270   'L_SHOW_COMMENTS_INFO'=>$lang['conf_comments_show_comments_info'],
    271   'L_COMMENTS_ALL'=>$lang['conf_comments_forall'],
    272   'L_COMMENTS_ALL_INFO'=>$lang['conf_comments_forall_info'],
    273   'L_NB_COMMENTS_PAGE'=>$lang['conf_comments_comments_number'],
    274   'L_NB_COMMENTS_PAGE_INFO'=>$lang['conf_comments_comments_number_info'],
    275   'L_VALIDATE_COMMENTS'=>$lang['conf_comments_validation'],
    276   'L_VALIDATE_COMMENTS_INFO'=>$lang['conf_comments_validation_info'],
    277   'L_ABILITIES_SETTINGS'=>$lang['conf_default_title'],
    278   'L_LANG_SELECT'=>$lang['customize_language'],
    279   'L_LANG_SELECT_INFO'=>$lang['conf_default_language_info'],
    280   'L_NB_IMAGE_LINE'=>$lang['customize_nb_image_per_row'],
    281   'L_NB_IMAGE_LINE_INFO'=>$lang['conf_default_nb_image_per_row_info'],
    282   'L_NB_ROW_PAGE'=>$lang['customize_nb_row_per_page'],
    283   'L_NB_ROW_PAGE_INFO'=>$lang['conf_default_nb_row_per_page_info'],
    284   'L_STYLE_SELECT'=>$lang['customize_theme'],
    285   'L_STYLE_SELECT_INFO'=>$lang['conf_default_theme_info'],
    286   'L_RECENT_PERIOD'=>$lang['customize_recent_period'],
    287   'L_RECENT_PERIOD_INFO'=>$lang['conf_default_recent_period_info'],
    288   'L_EXPAND_TREE'=>$lang['customize_expand'],
    289   'L_EXPAND_TREE_INFO'=>$lang['conf_default_expand_info'],
    290   'L_NB_COMMENTS'=>$lang['customize_show_nb_comments'],
    291   'L_NB_COMMENTS_INFO'=>$lang['conf_default_show_nb_comments_info'],
    292   'L_AUTH_UPLOAD'=>$lang['conf_upload_available'],
    293   'L_AUTH_UPLOAD_INFO'=>$lang['conf_upload_available_info'],
    294   'L_CONF_UPLOAD'=>$lang['conf_upload_title'],
    295   'L_UPLOAD_MAXSIZE'=>$lang['conf_upload_maxfilesize'],
    296   'L_UPLOAD_MAXSIZE_INFO'=>$lang['conf_upload_maxfilesize_info'],
    297   'L_UPLOAD_MAXWIDTH'=>$lang['conf_upload_maxwidth'],
    298   'L_UPLOAD_MAXWIDTH_INFO'=>$lang['conf_upload_maxwidth_info'],
    299   'L_UPLOAD_MAXHEIGHT'=>$lang['conf_upload_maxheight'],
    300   'L_UPLOAD_MAXHEIGHT_INFO'=>$lang['conf_upload_maxheight_info'],
    301   'L_TN_UPLOAD_MAXWIDTH'=>$lang['conf_upload_maxwidth_thumbnail'],
    302   'L_TN_UPLOAD_MAXWIDTH_INFO'=>$lang['conf_upload_maxwidth_thumbnail_info'],
    303   'L_TN_UPLOAD_MAXHEIGHT'=>$lang['conf_upload_maxheight_thumbnail'],
    304   'L_TN_UPLOAD_MAXHEIGHT_INFO'=>$lang['conf_upload_maxheight_thumbnail'],
    305   'L_CONF_SESSION'=>$lang['conf_session_title'],
    306   'L_COOKIE'=>$lang['conf_session_cookie'],
    307   'L_COOKIE_INFO'=>$lang['conf_session_cookie_info'],
    308   'L_SESSION_LENGTH'=>$lang['conf_session_time'],
    309   'L_SESSION_LENGTH_INFO'=>$lang['conf_session_time_info'],
    310   'L_SESSION_ID_SIZE'=>$lang['conf_session_size'],
    311   'L_SESSION_ID_SIZE_INFO'=>$lang['conf_session_size_info'],
    312   'L_YES'=>$lang['yes'],
    313   'L_NO'=>$lang['no'],
    314   'L_SUBMIT'=>$lang['submit'],
    315   'L_CONF_METADATA'=>$lang['conf_metadata_title'],
    316   'L_USE_EXIF'=>$lang['conf_use_exif'],
    317   'L_USE_EXIF_INFO'=>$lang['conf_use_exif_info'],
    318   'L_USE_IPTC'=>$lang['conf_use_iptc'],
    319   'L_USE_IPTC_INFO'=>$lang['conf_use_iptc_info'],
    320   'L_SHOW_EXIF'=>$lang['conf_show_exif'],
    321   'L_SHOW_EXIF_INFO'=>$lang['conf_show_exif_info'],
    322   'L_SHOW_IPTC'=>$lang['conf_show_iptc'],
    323   'L_SHOW_IPTC_INFO'=>$lang['conf_show_iptc_info'],
    324  
    325   'F_ACTION'=>add_session_id(PHPWG_ROOT_PATH.'admin.php?page=configuration')
    326                          ));
    327 
     244  $template->assign_block_vars(
     245    'confmenu_item',
     246    array(
     247      'CLASS' => $class,
     248      'URL' => add_session_id($base_url.$section),
     249      'NAME' => $lang['conf_'.$section.'_title']
     250     ));
     251}
     252
     253$fields = $sections[$page['section']];
     254foreach ($fields as $field_name => $field)
     255{
     256  $template->assign_block_vars(
     257    'line',
     258    array(
     259      'NAME' => $lang['conf_'.$page['section'].'_'.$field_name],
     260      'INFO' => $lang['conf_'.$page['section'].'_'.$field_name.'_info']
     261     ));
     262  if ($field['type'] == 'textfield')
     263  {
     264    $template->assign_block_vars(
     265      'line.textfield',
     266      array(
     267        'NAME' => $field_name,
     268        'VALUE' => $conf[$field_name]
     269       ));
     270  }
     271  else if ($field['type'] == 'radio')
     272  {
     273    foreach ($field['options'] as $option_value => $option)
     274    {
     275      if ($conf[$field_name] == $option_value)
     276      {
     277        $checked = 'checked="checked"';
     278      }
     279      else
     280      {
     281        $checked = '';
     282      }
     283     
     284      $template->assign_block_vars(
     285        'line.radio',
     286        array(
     287          'NAME' => $field_name,
     288          'VALUE' => $option_value,
     289          'CHECKED' => $checked,
     290          'OPTION' => $option
     291         ));
     292    }
     293  }
     294  else if ($field['type'] == 'select')
     295  {
     296    $template->assign_block_vars(
     297      'line.select',
     298      array(
     299        'NAME' => $field_name
     300       ));
     301    foreach ($field['options'] as $option_value => $option)
     302    {
     303      if ($conf[$field_name] == $option_value)
     304      {
     305        $selected = 'selected="selected"';
     306      }
     307      else
     308      {
     309        $selected = '';
     310      }
     311     
     312      $template->assign_block_vars(
     313        'line.select.select_option',
     314        array(
     315          'VALUE' => $option_value,
     316          'SELECTED' => $selected,
     317          'OPTION' => $option
     318         ));
     319    }
     320  }
     321}
    328322//-------------------------------------------------------------- errors display
    329 if ( sizeof( $error ) != 0 )
     323if (count($errors) != 0)
    330324{
    331325  $template->assign_block_vars('errors',array());
    332   for ( $i = 0; $i < sizeof( $error ); $i++ )
    333   {
    334     $template->assign_block_vars('errors.error',array('ERROR'=>$error[$i]));
    335   }
    336 }
    337 elseif ( isset( $_POST['submit'] ) )
     326  foreach ($errors as $error)
     327  {
     328    $template->assign_block_vars('errors.error',array('ERROR'=>$error));
     329  }
     330}
     331else if (isset($_POST['submit']))
    338332{
    339333  $template->assign_block_vars('confirmation' ,array());
    340 }
    341 //------------------------------------------------ remote sites administration
    342 $query = 'select id,galleries_url';
    343 $query.= ' from '.SITES_TABLE;
    344 $query.= " where galleries_url <> './galleries/';";
    345 $result = mysql_query( $query );
    346 if ( mysql_num_rows( $result ) > 0 )
    347 {
    348   $vtp->addSession( $sub, 'remote_sites' );
    349   $i = 0;
    350   while ( $row = mysql_fetch_array( $result ) )
    351   {
    352     $vtp->addSession( $sub, 'site' );
    353     $vtp->setVar( $sub, 'site.url', $row['galleries_url'] );
    354     $vtp->setVar( $sub, 'site.id', $row['id'] );
    355     if ( $i == 0 )
    356     {
    357       $vtp->addSession( $sub, 'rowspan' );
    358       $vtp->setVar( $sub, 'rowspan.nb_sites', mysql_num_rows( $result ) );
    359       $vtp->closeSession( $sub, 'rowspan' );
    360     }
    361     $vtp->closeSession( $sub, 'site' );
    362     $i++;
    363   }
    364   $vtp->closeSession( $sub, 'remote_sites' );
    365334}
    366335//----------------------------------------------------------- sending html code
  • trunk/include/common.inc.php

    r394 r512  
    131131
    132132mysql_connect( $dbhost, $dbuser, $dbpasswd )
    133 or die ( "Could not connect to server" );
     133or die ( "Could not connect to database server" );
    134134mysql_select_db( $dbname )
    135135or die ( "Could not connect to database" );
  • trunk/include/functions.inc.php

    r507 r512  
    180180
    181181/**
    182  * returns an array contening sub-directories
     182 * returns an array contening sub-directories, excluding "CVS"
    183183 *
    184184 * @param string $dir
    185185 * @return array
    186186 */
    187 function get_dirs( $directory )
     187function get_dirs($directory)
    188188{
    189189  $sub_dirs = array();
    190190
    191   if ( $opendir = opendir( $directory ) )
    192   {
    193     while ( $file = readdir ( $opendir ) )
    194     {
    195       if ( $file != '.' and $file != '..' and is_dir ( $directory.'/'.$file ) )
     191  if ($opendir = opendir($directory))
     192  {
     193    while ($file = readdir($opendir))
     194    {
     195      if ($file != '.'
     196          and $file != '..'
     197          and is_dir($directory.'/'.$file)
     198          and $file != 'CVS')
    196199      {
    197         array_push( $sub_dirs, $file );
     200        array_push($sub_dirs, $file);
    198201      }
    199202    }
     
    259262//-------------------------------------------- PhpWebGallery specific functions
    260263
    261 // get_languages retourne un tableau contenant tous les languages
    262 // disponibles pour PhpWebGallery
    263 function get_languages( $rep_language )
    264 {
    265   global $lang;
     264/**
     265 * returns an array with a list of {language_code => language_name}
     266 *
     267 * @returns array
     268 */
     269function get_languages()
     270{
     271  $dir = opendir(PHPWG_ROOT_PATH.'language');
    266272  $languages = array();
    267   $i = 0;
    268   if ( $opendir = opendir ( $rep_language ) )
    269   {
    270     while ( $file = readdir ( $opendir ) )
    271     {
    272       if ( is_dir ( $rep_language.$file )&& !substr_count($file,'.') && isset($lang['lang'][$file]))
    273       {
    274         $languages[$i++] =$lang['lang'][$file];
    275       }
    276     }
    277   }
     273
     274  while ($file = readdir($dir))
     275  {
     276    $path = realpath(PHPWG_ROOT_PATH.'language/'.$file);
     277    if (is_dir($path) and !is_link($path) and file_exists($path.'/iso.txt'))
     278    {
     279      list($language_name) = @file($path.'/iso.txt');
     280      $languages[$file] = $language_name;
     281    }
     282  }
     283  closedir($dir);
     284  @asort($languages);
     285  @reset($languages);
     286
    278287  return $languages;
    279288}
     
    540549  return $query_string;
    541550}
     551
     552/**
     553 * returns available templates
     554 */
     555function get_templates()
     556{
     557  return get_dirs(PHPWG_ROOT_PATH.'template');
     558}
    542559?>
  • trunk/include/functions_html.inc.php

    r496 r512  
    114114function language_select($default, $select_name = "language")
    115115{
    116 
    117   $dir = opendir(PHPWG_ROOT_PATH . 'language');
    118   $available_lang= array();
    119 
    120   while ( $file = readdir($dir) )
    121   {
    122     $path= realpath(PHPWG_ROOT_PATH . 'language/'.$file);
    123     if (is_dir ($path) && !is_link($path) && file_exists($path . '/iso.txt'))
    124     {
    125           list($displayname) = @file($path . '/iso.txt');
    126           $available_lang[$displayname] = $file;
    127     }
    128   }
    129   closedir($dir);
    130   @asort($available_lang);
    131   @reset($available_lang);
     116  $available_lang = get_languages();
    132117
    133118  $lang_select = '<select name="' . $select_name . '" onchange="this.form.submit()">';
     
    147132function style_select($default_style, $select_name = "style")
    148133{
    149   $dir = opendir(PHPWG_ROOT_PATH . 'template');
    150   $style_select = '<select name="' . $select_name . '">';
    151   while ( $file = readdir($dir) )
    152   {
    153     if (is_dir ( realpath(PHPWG_ROOT_PATH.'template/'.$file) )
    154           && !is_link(realpath(PHPWG_ROOT_PATH  . 'template/' . $file))
    155           && !strstr($file,'.'))
    156     {
    157       $selected = ( $file == $default_style ) ? ' selected="selected"' : '';
    158           $style_select .= '<option value="' . $file . '"' . $selected . '>' . $file . '</option>';
    159     }
    160   }
    161   closedir($dir);
     134  $templates = get_templates();
     135
     136  foreach ($templates as $template)
     137  {
     138    $selected = ( $template == $default_style ) ? ' selected="selected"' : '';
     139    $style_select.= '<option value="'.$template.'"'.$selected.'>';
     140    $style_select.= $template.'</option>';
     141  }
    162142  return $style_select;
    163143}
  • trunk/include/page_tail.php

    r469 r512  
    3535    'TIME' =>  $time,
    3636    'VERSION' => $conf['version'],
    37     'WEBMASTER'=>$conf['webmaster'],
    3837    'MAIL'=>$conf['mail_webmaster'],
    3938   
     
    4140    'L_SEND_MAIL' => $lang['send_mail'],
    4241    'L_TITLE_MAIL' => $lang['title_send_mail'],
     42    'L_WEBMASTER'=>$lang['webmaster'],
    4343   
    4444    'U_SITE' => $conf['site_url']
  • trunk/install/config.sql

    r493 r512  
    22
    33INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('prefix_thumbnail','TN-','thumbnails filename prefix');
    4 INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('webmaster','','webmaster login');
    54INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('mail_webmaster','','webmaster mail');
    6 INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('default_lang','en_UK.iso-8859-1','Default gallery language');
    7 INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('default_style','default','Default gallery style');
     5INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('default_language','en_UK.iso-8859-1','Default gallery language');
     6INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('default_template','default','Default gallery style');
    87INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('access','free','access type to your gallery (free|restricted)');
    98INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('session_id_size','4','length of session identifiers');
    10 INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('session_keyword','','improves the encoding of the session identifier');
    119INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('session_time','30','number of minutes for validity of sessions');
    1210INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('show_comments','true','display the users comments');
  • trunk/language/en_UK.iso-8859-1/admin.lang.php

    r506 r512  
    8383
    8484//Error messages
    85 $lang['conf_err_prefixe'] = 'thumbnail\'s prefix mustn\'t contain any accentued character';
    86 $lang['conf_err_mail'] = 'e-mail address refused, it must be like name@server.com';
    87 $lang['conf_err_sid_size'] = 'the session identifier size must be an integer value between 4 and 50';
    88 $lang['conf_err_sid_time'] = 'the session time must be an integer value between 5 and 60';
    89 $lang['conf_err_max_user_listbox'] = 'the max user listbox number must be an integer value between 0 and 255';
    9085$lang['cat_error_name'] = 'The name of a category mustn\'t be empty';
    9186
    9287//Configuration
    9388$lang['conf_confirmation'] = 'Information data registered in database';
    94 $lang['conf_general_title'] = 'Main configuration';
    95 $lang['conf_general_webmaster'] = 'Webmaster login';
    96 $lang['conf_general_webmaster_info'] = 'It will be shown to the visitors. It is necessary for website administration';
    97 $lang['conf_general_mail'] = 'Webmaster mail adress';
    98 $lang['conf_general_mail_info'] = 'Visitors will be able to contact by this mail';
    99 $lang['conf_general_prefix'] = 'Thumbnail prefix';
    100 $lang['conf_general_prefix_info'] = 'Thumbnails use this prefix. Do not fill if your not sure.';
     89
     90// Configuration -> general
     91$lang['conf_general_title'] = 'Main';
     92
     93$lang['conf_general_mail_webmaster'] = 'Webmaster mail adress';
     94$lang['conf_general_mail_webmaster_info'] = 'Visitors will be able to contact site administrator with this mail';
     95$lang['conf_general_mail_webmaster_error'] = 'e-mail address refused, it must be like name@server.com';
     96
     97$lang['conf_general_prefix_thumbnail'] = 'Thumbnail prefix';
     98$lang['conf_general_prefix_thumbnail_info'] = 'Thumbnails use this prefix. Do not fill if your not sure.';
     99$lang['conf_general_prefix_thumbnail_error'] = 'thumbnail\'s prefix must only contain characters among : a to z (case insensitive), "-" or "_"';
     100
    101101$lang['conf_general_access'] = 'Access type';
     102$lang['conf_general_access_info'] = '- free : anyone can enter the site, any visitor can create an account in order to customize the appareance of the website<br />- restricted : the webmaster create accounts. Only registered users can enter the site';
    102103$lang['conf_general_access_1'] = 'Free';
    103104$lang['conf_general_access_2'] = 'Restricted';
    104 $lang['conf_general_access_info'] = '- free : anyone can enter the site, any visitor can create an account in order to customize the appareance of the website<br />- restricted : the webmaster create accounts. Only registered users can enter the site';
    105 $lang['conf_comments'] = 'Users comments';
    106 $lang['conf_comments_title'] = 'Configuration of users comments';
    107 $lang['conf_comments_show_comments'] = $lang['conf_comments'];
    108 $lang['conf_comments_show_comments_info'] = 'display the users comments under each picture ?';
    109 $lang['conf_comments_comments_number'] = 'Number of comments per page';
    110 $lang['conf_comments_comments_number_info'] = 'number of comments to display on each page. This number is unlimited for a picture. Enter a number between 5 and 50.';
    111 $lang['conf_err_comment_number'] = 'The number of comments a page must be between 5 and 50 included.';
    112 $lang['conf_remote_site_delete_info'] = 'Deleting a remote server will delete all the image and the categories in relation with this server.';
    113 $lang['conf_upload_title'] = 'Configuration of the users upload';
    114 $lang['conf_upload_available'] = 'authorized the upload of pictures';
    115 $lang['conf_upload_available_info'] = '';
    116 $lang['conf_upload_maxfilesize'] = 'maximum filesize';
    117 $lang['conf_upload_maxfilesize_info'] = 'Maximum filesize for the uploaded pictures. Must be a number between 10 and 1000 KB.';
    118 $lang['conf_err_upload_maxfilesize'] = 'Maximum filesize for the uploaded pictures must be a number between 10 and 1000 KB.';
    119 $lang['conf_upload_maxwidth'] = 'maximum width';
    120 $lang['conf_upload_maxwidth_info'] = 'Maximum width authorized for the uploaded images. Must be a number superior to 10 pixels';
    121 $lang['conf_err_upload_maxwidth'] = 'maximum width authorized for the uploaded images must be a number superior to 10 pixels.';
    122 $lang['conf_upload_maxheight'] = 'maximum height';
    123 $lang['conf_upload_maxheight_info'] = 'Maximum height authorized for the uploaded images. Must be a number superior to 10 pixels';
    124 $lang['conf_err_upload_maxwidth'] = 'maximum height authorized for the uploaded images must be a number superior to 10 pixels.';
    125 $lang['conf_upload_maxwidth_thumbnail'] = 'thumbnails maximum width';
    126 $lang['conf_upload_maxwidth_thumbnail_info'] = 'Maximum width authorized for the uploaded thumbnails. Must be a number superior to 10 pixels';
    127 $lang['conf_err_upload_maxwidth_thumbnail'] = 'Maximum width authorized for the uploaded thumbnails must be a number superior to 10 pixels.';
    128 $lang['conf_upload_maxheight_thumbnail'] = 'thumbnails maximum height';
    129 $lang['conf_upload_maxheight_thumbnail_info'] = 'Maximum height authorized for the uploaded thumbnails. Must be a number superior to 10 pixels';
    130 $lang['conf_err_upload_maxheight_thumbnail'] = 'Maximum height authorized for the uploaded thumbnails must be a number superior to 10 pixels.';
    131 $lang['conf_default_title'] = 'Default display properties for unregistered visitors and new accounts';
    132 $lang['conf_default_language_info'] = 'Default language';
    133 $lang['conf_default_theme_info'] = 'Default theme';
    134 $lang['conf_session_title'] = 'Sessions configuration';
    135 $lang['conf_session_size'] = 'identifier size';
    136 $lang['conf_session_size_info'] = '- the longer your identifier is, the more secure your site is<br />- enter a number between 4 and 50';
    137 $lang['conf_session_time'] = 'validity period';
    138 $lang['conf_session_time_info'] = '- the shorter the validity period is, the more secure your site is<br />- enter a number between 5 and 60, in minutes';
    139 $lang['conf_session_key'] = 'keyword';
    140 $lang['conf_session_key_info'] = '- the session keyword improve the encoding of the session identifier<br />- enter any sentence shorter than 255 caracters';
     105
     106$lang['conf_general_log'] = $lang['history'];
    141107$lang['conf_general_log_info'] = 'Keep an history of visits on your website ? Visits will be shown in the history section of the administration panel';
     108
    142109$lang['conf_general_mail_notification'] = 'Mail notification';
    143110$lang['conf_general_mail_notification_info'] = 'Automated mail notification for adminsitrators (and only for them) when a user add a comment or upload a picture.';
    144 $lang['conf_comments_validation'] = 'validation';
    145 $lang['conf_comments_validation_info'] = 'An administrator validate users posted comments before the becom visible on the site';
    146 $lang['conf_comments_forall'] = 'for all ?';
    147 $lang['conf_comments_forall_info'] = 'Even guest not registered can post comments';
    148 $lang['conf_default_nb_image_per_row_info'] = 'number of pictures for each row by default';
    149 $lang['conf_default_nb_row_per_page_info'] = 'number of rows by page by default';
    150 $lang['conf_default_recent_period_info'] = 'By days. Period within a picture is shown as new. The short period must be superior to 1 day.';
    151 $lang['conf_default_expand_info'] = 'expand all categories by default in the menu ?';
     111
     112// Configuration -> comments
     113$lang['conf_comments_title'] = 'Users comments';
     114
     115$lang['conf_comments_show_comments'] = 'Show users comments';
     116$lang['conf_comments_show_comments_info'] = 'display the users comments under each picture ?';
     117
     118$lang['conf_comments_nb_comment_page'] = 'Number of comments per page';
     119$lang['conf_comments_nb_comment_page_info'] = 'number of comments to display on each page. This number is unlimited for a picture. Enter a number between 5 and 50.';
     120$lang['conf_comments_nb_comment_page_error'] = 'The number of comments a page must be between 5 and 50 included.';
     121
     122$lang['conf_comments_comments_validation'] = 'validation';
     123$lang['conf_comments_comments_validation_info'] = 'An administrator validate users posted comments before the becom visible on the site';
     124
     125$lang['conf_comments_comments_forall'] = 'for all ?';
     126$lang['conf_comments_comments_forall_info'] = 'Even guest not registered can post comments';
     127
     128// Configuration -> upload
     129$lang['conf_upload_title'] = 'Users upload';
     130
     131$lang['conf_upload_upload_available'] = 'authorized the upload of pictures';
     132$lang['conf_upload_upload_available_info'] = '';
     133
     134$lang['conf_upload_upload_maxfilesize'] = 'maximum filesize';
     135$lang['conf_upload_upload_maxfilesize_info'] = 'Maximum filesize for the uploaded pictures. Must be a number between 10 and 1000 KB.';
     136$lang['conf_upload_upload_maxfilesize_error'] = 'Maximum filesize for the uploaded pictures must be a number between 10 and 1000 KB.';
     137
     138$lang['conf_upload_upload_maxwidth'] = 'maximum width';
     139$lang['conf_upload_upload_maxwidth_info'] = 'Maximum width authorized for the uploaded images. Must be a number superior to 10 pixels';
     140$lang['conf_upload_upload_maxwidth_error'] = 'maximum width authorized for the uploaded images must be a number superior to 10 pixels.';
     141
     142$lang['conf_upload_upload_maxheight'] = 'maximum height';
     143$lang['conf_upload_upload_maxheight_info'] = 'Maximum height authorized for the uploaded images. Must be a number superior to 10 pixels';
     144$lang['conf_upload_upload_maxheight_error'] = 'maximum height authorized for the uploaded images must be a number superior to 10 pixels.';
     145
     146$lang['conf_upload_upload_maxwidth_thumbnail'] = 'thumbnails maximum width';
     147$lang['conf_upload_upload_maxwidth_thumbnail_info'] = 'Maximum width authorized for the uploaded thumbnails. Must be a number superior to 10 pixels';
     148$lang['conf_upload_upload_maxwidth_thumbnail_error'] = 'Maximum width authorized for the uploaded thumbnails must be a number superior to 10 pixels.';
     149
     150$lang['conf_upload_upload_maxheight_thumbnail'] = 'thumbnails maximum height';
     151$lang['conf_upload_upload_maxheight_thumbnail_info'] = 'Maximum height authorized for the uploaded thumbnails. Must be a number superior to 10 pixels';
     152$lang['conf_upload_upload_maxheight_thumbnail_error'] = 'Maximum height authorized for the uploaded thumbnails must be a number superior to 10 pixels.';
     153
     154// Configuration -> default
     155$lang['conf_default_title'] = 'Default display';
     156
     157$lang['conf_default_default_language'] = $lang['customize_language'];
     158$lang['conf_default_default_language_info'] = 'Default language';
     159
     160$lang['conf_default_default_template'] = $lang['customize_theme'];
     161$lang['conf_default_default_template_info'] = 'Default theme';
     162
     163$lang['conf_default_nb_image_line'] = $lang['customize_nb_image_per_row'];
     164$lang['conf_default_nb_image_line_info'] = 'number of pictures for each row by default';
     165
     166$lang['conf_default_nb_line_page'] = $lang['customize_nb_row_per_page'];
     167$lang['conf_default_nb_line_page_info'] = 'number of rows by page by default';
     168
     169$lang['conf_default_recent_period'] = $lang['customize_recent_period'];
     170$lang['conf_default_recent_period_info'] = 'By days. Period within a picture is shown as new. Must be superior to 1 day.';
     171$lang['conf_default_recent_period_error'] = 'The recent period must be an integer value, superior to 1.';
     172
     173$lang['conf_default_auto_expand'] = $lang['customize_expand'];
     174$lang['conf_default_auto_expand_info'] = 'expand all categories by default in the menu ?';
     175
     176$lang['conf_default_show_nb_comments'] = $lang['customize_show_nb_comments'];
    152177$lang['conf_default_show_nb_comments_info'] = 'show the number of comments for each picture on the thumbnails page';
    153 $lang['conf_default_maxwidth_info'] = 'Maximum width for display pictures : picture will have a new width only for display, picture files won\'t be changed. Let empty if you don\'t wish to have a limit.';
    154 $lang['conf_default_maxheight_info'] = 'Just as the maximum width, but for the height';
    155 $lang['conf_session_cookie'] = 'Authorize cookies';
    156 $lang['conf_session_cookie_info'] = 'users won\'t have to log on each visit any more. Less secure.';
    157 $lang['conf_metadata_title'] = 'Files metadata';
    158 $lang['conf_use_exif'] = 'Use EXIF';
    159 $lang['conf_use_exif_info'] = 'Use EXIF data during metadata synchronization into PhpWebGallery database';
    160 $lang['conf_use_iptc'] = 'Use IPTC';
    161 $lang['conf_use_iptc_info'] = 'Use IPTC data during metadata synchronization into PhpWebGallery database';
    162 $lang['conf_show_exif'] = 'Show EXIF';
    163 $lang['conf_show_exif_info'] = 'Give the possibility to show EXIF metadata on visualisation page. See include/config.inc.php for available EXIF fields';
    164 $lang['conf_show_iptc'] = 'Show IPTC';
    165 $lang['conf_show_iptc_info'] = 'Give the possibility to show IPTC metadata on visualisation page. See include/config.inc.php for available IPTC fields';
     178
     179// Configuration -> session
     180$lang['conf_session_title'] = 'Sessions';
     181
     182$lang['conf_session_session_id_size'] = 'identifier size';
     183$lang['conf_session_session_id_size_info'] = '- the longer your identifier is, the more secure your site is<br />- enter a number between 4 and 50';
     184$lang['conf_session_session_id_size_error'] = 'the session identifier size must be an integer value between 4 and 50';
     185
     186$lang['conf_session_session_time'] = 'validity period';
     187$lang['conf_session_session_time_info'] = '- the shorter the validity period is, the more secure your site is<br />- enter a number between 5 and 60, in minutes';
     188$lang['conf_session_session_time_error'] = 'the session time must be an integer value between 5 and 60';
     189
     190$lang['conf_session_authorize_cookies'] = 'Authorize cookies';
     191$lang['conf_session_authorize_cookies_info'] = 'users won\'t have to log on each visit any more. Less secure.';
     192
     193// Configuration -> metadata
     194$lang['conf_metadata_title'] = 'Metadata';
     195
     196$lang['conf_metadata_use_exif'] = 'Use EXIF';
     197$lang['conf_metadata_use_exif_info'] = 'Use EXIF data during metadata synchronization into PhpWebGallery database';
     198
     199$lang['conf_metadata_use_iptc'] = 'Use IPTC';
     200$lang['conf_metadata_use_iptc_info'] = 'Use IPTC data during metadata synchronization into PhpWebGallery database';
     201
     202$lang['conf_metadata_show_exif'] = 'Show EXIF';
     203$lang['conf_metadata_show_exif_info'] = 'Give the possibility to show EXIF metadata on visualisation page. See include/config.inc.php for available EXIF fields';
     204
     205$lang['conf_metadata_show_iptc'] = 'Show IPTC';
     206$lang['conf_metadata_show_iptc_info'] = 'Give the possibility to show IPTC metadata on visualisation page. See include/config.inc.php for available IPTC fields';
     207
     208// Configuration -> remote
     209$lang['conf_remote_site_delete_info'] = 'Deleting a remote server will delete all the image and the categories in relation with this server.';
    166210
    167211//FAQ
  • trunk/language/en_UK.iso-8859-1/common.lang.php

    r510 r512  
    145145$lang['recent_image'] = 'Image within the';
    146146$lang['days'] = 'days';
    147 $lang['send_mail'] = 'Contact the webmaster';
     147$lang['send_mail'] = 'Contact';
     148$lang['webmaster'] = 'webmaster';
    148149$lang['title_send_mail'] = 'A comment on your site';
    149150$lang['sub-cat'] = 'subcategories';
  • trunk/template/default/admin/configuration.tpl

    r493 r512  
    1111<div class="info">{L_CONFIRM}</div>
    1212<!-- END confirmation -->
     13
    1314<form method="post" action="{F_ACTION}">
     15
     16<p class="confMenu">
     17  <!-- BEGIN confmenu_item -->
     18  <a class="{confmenu_item.CLASS}" href="{confmenu_item.URL}">{confmenu_item.NAME}</a>
     19  <!-- END confmenu_item -->
     20</p>
     21
    1422<table width="100%" align="center">
    15   <tr class="admin">
    16     <th colspan="2">{L_CONF_GENERAL}</th>
    17   </tr>
     23  <!-- BEGIN line -->
    1824  <tr>
    19     <td colspan="2">&nbsp;</td>
    20   </tr>
    21   <tr>
    22     <td width="50%" ><strong>{L_ADMIN_NAME} &nbsp;:</strong><br /><span class="small">{L_ADMIN_NAME_INFO}</span></td>
    23         <td class="row1"><input type="text" size="25" name="webmaster" value="{ADMIN_NAME}" /></td>
    24   </tr>
    25   <tr>
    26     <td><strong>{L_ADMIN_MAIL}&nbsp;:</strong><br /><span class="small">{L_ADMIN_MAIL_INFO}</span></td>
    27         <td class="row1"><input type="text" size="25" maxlength="100" name="mail_webmaster" value="{ADMIN_MAIL}" /></td>
    28   </tr>
    29   <tr>
    30     <td><strong>{L_THUMBNAIL_PREFIX}&nbsp;:</strong><br /><span class="small">{L_THUMBNAIL_PREFIX_INFO}</span></td>
    31         <td class="row1"><input type="text" size="3" maxlength="4" name="prefix_thumbnail" value="{THUMBNAIL_PREFIX}" /></td>
    32   </tr>
    33   <tr>
    34   <td><strong>{L_ACCESS}&nbsp;:</strong><br /><span class="small">{L_ACCESS_INFO}</span></td>
    35         <td class="row1"><input type="radio" class="radio" name="access" value="free" {ACCESS_FREE} />{L_ACCESS_FREE}&nbsp;&nbsp;
    36         <input type="radio" class="radio" name="access" value="restricted" {ACCESS_RESTRICTED} />{L_ACCESS_RESTRICTED}</td>
    37   </tr>
    38   <tr>
    39     <td><strong>{L_CONF_HISTORY}&nbsp;:</strong><br /><span class="small">{L_CONF_HISTORY_INFO}</span></td>
    40         <td class="row1"><input type="radio" class="radio" name="log" value="true" {HISTORY_YES} />{L_YES}&nbsp;&nbsp;
    41         <input type="radio" class="radio" name="log" value="false" {HISTORY_NO} />{L_NO}</td>
    42   </tr>
    43   <tr>
    44     <td><strong>{L_MAIL_NOTIFICATION}&nbsp;:</strong><br /><span class="small">{L_MAIL_NOTIFICATION_INFO}</span></td>
    45         <td class="row1"><input type="radio" class="radio" name="mail_notification" value="true" {MAIL_NOTIFICATION_YES} />{L_YES}&nbsp;&nbsp;
    46         <input type="radio" class="radio" name="mail_notification" value="false" {MAIL_NOTIFICATION_NO} />{L_NO}</td>
    47   </tr>
    48     <tr>
    49     <td colspan="2">&nbsp;</td>
    50   </tr>
    51   <tr class="admin">
    52     <th colspan="2">{L_CONF_COMMENTS}</th>
    53   </tr>
    54     <tr>
    55     <td colspan="2">&nbsp;</td>
    56   </tr>
    57   <tr>
    58     <td><strong>{L_SHOW_COMMENTS}&nbsp;:</strong><br /><span class="small">{L_SHOW_COMMENTS_INFO}</span></td>
    59         <td class="row1"><input type="radio" class="radio" name="show_comments" value="true" {SHOW_COMMENTS_YES} />{L_YES}&nbsp;&nbsp;
    60         <input type="radio" class="radio" name="show_comments" value="false" {SHOW_COMMENTS_NO} />{L_NO}</td>
    61   </tr>
    62   <tr>
    63     <td><strong>{L_COMMENTS_ALL}&nbsp;:</strong><br /><span class="small">{L_NB_COMMENTS_PAGE_INFO}</span></td>
    64         <td class="row1"><input type="radio" class="radio" name="comments_forall" value="true" {COMMENTS_ALL_YES} />{L_YES}&nbsp;&nbsp;
    65         <input type="radio" class="radio" name="comments_forall" value="false" {COMMENTS_ALL_NO} />{L_NO}</td>
    66   </tr>
    67   <tr>
    68     <td><strong>{L_NB_COMMENTS_PAGE}&nbsp;:</strong><br /><span class="small">{L_NB_COMMENTS_PAGE_INFO}</span></td>
    69         <td class="row1"><input type="text" size="3" maxlength="4" name="nb_comment_page" value="{NB_COMMENTS_PAGE}" /></td>
    70   </tr>
    71   <tr>
    72     <td><strong>{L_VALIDATE_COMMENTS}&nbsp;:</strong><br /><span class="small">{L_VALIDATE_COMMENTS_INFO}</span></td>
    73         <td class="row1"><input type="radio" class="radio" name="comments_validation" value="true" {VALIDATE_COMMENTS_YES} />{L_YES}&nbsp;&nbsp;
    74         <input type="radio" class="radio" name="comments_validation" value="false" {VALIDATE_COMMENTS_NO} />{L_NO}</td>
    75   </tr>
    76     <tr>
    77     <td colspan="2">&nbsp;</td>
    78   </tr>
    79   <tr class="admin">
    80     <th colspan="2">{L_ABILITIES_SETTINGS}</th>
    81   </tr>
    82     <tr>
    83     <td colspan="2">&nbsp;</td>
    84   </tr>
    85   <tr>
    86     <td><strong>{L_LANG_SELECT}&nbsp;:</strong><br /><span class="small">{L_LANG_SELECT_INFO}</span></td>
    87         <td class="row1">{LANG_SELECT}</td>
    88   </tr>
    89   <tr>
    90     <td><strong>{L_NB_IMAGE_LINE}&nbsp;:</strong><br /><span class="small">{L_NB_IMAGE_LINE_INFO}</span></td>
    91         <td class="row1"><input type="text" size="3" maxlength="2" name="nb_image_line" value="{NB_IMAGE_LINE}" /></td>
    92   </tr>
    93   <tr>
    94     <td><strong>{L_NB_ROW_PAGE}&nbsp;:</strong><br /><span class="small">{L_NB_ROW_PAGE_INFO}</span></td>
    95         <td class="row1"><input type="text" size="3" maxlength="2" name="nb_line_page" value="{NB_ROW_PAGE}" /></td>
    96   </tr>
    97   <tr>
    98     <td><strong>{L_STYLE_SELECT}&nbsp;:</strong><br /><span class="small">{L_STYLE_SELECT_INFO}</span></td>
    99         <td class="row1">{STYLE_SELECT}</td>
    100   </tr>
    101   <tr>
    102     <td><strong>{L_RECENT_PERIOD}&nbsp;:</strong><br /><span class="small">{L_RECENT_PERIOD_INFO}</span></td>
    103         <td class="row1"><input type="text" size="3" maxlength="2" name="recent_period" value="{RECENT_PERIOD}" /></td>
    104   </tr>
    105   <tr>
    106     <td><strong>{L_EXPAND_TREE}&nbsp;:</strong><br /><span class="small">{L_EXPAND_TREE_INFO}</span></td>
    107         <td class="row1"><input type="radio" class="radio" name="auto_expand" value="true" {EXPAND_TREE_YES} />{L_YES}&nbsp;&nbsp;
    108         <input type="radio" class="radio" name="auto_expand" value="false" {EXPAND_TREE_NO} />{L_NO}</td>
    109   </tr>
    110   <tr>
    111     <td><strong>{L_NB_COMMENTS}&nbsp;:</strong><br /><span class="small">{L_NB_COMMENTS_INFO}</span></td>
    112         <td class="row1"><input type="radio" class="radio" name="show_nb_comments" value="true" {NB_COMMENTS_YES} />{L_YES}&nbsp;&nbsp;
    113         <input type="radio" class="radio" name="show_nb_comments" value="false" {NB_COMMENTS_NO} />{L_NO}</td>
    114   </tr>
    115   <tr>
    116     <td colspan="2">&nbsp;</td>
    117   </tr>
    118   <tr class="admin">
    119     <th colspan="2">{L_CONF_UPLOAD}</th>
    120   </tr>
    121   <tr>
    122     <td colspan="2">&nbsp;</td>
    123   </tr>
    124   <tr>
    125     <td><strong>{L_AUTH_UPLOAD}&nbsp;:</strong><br /><span class="small">{L_AUTH_UPLOAD_INFO}</span></td>
    126         <td class="row1"><input type="radio" class="radio" name="upload_available" value="true" {UPLOAD_YES} />{L_YES}&nbsp;&nbsp;
    127         <input type="radio" class="radio" name="upload_available" value="false" {UPLOAD_NO} />{L_NO}</td>
    128   </tr>
    129   <tr>
    130     <td><strong>{L_UPLOAD_MAXSIZE}&nbsp;:</strong><br /><span class="small">{L_UPLOAD_MAXSIZE_INFO}</span></td>
    131         <td class="row1"><input type="text" size="4" maxlength="4" name="upload_maxfilesize" value="{UPLOAD_MAXSIZE}" /></td>
    132   </tr>
    133   <tr>
    134     <td><strong>{L_UPLOAD_MAXWIDTH}&nbsp;:</strong><br /><span class="small">{L_UPLOAD_MAXWIDTH_INFO}</span></td>
    135         <td class="row1"><input type="text" size="4" maxlength="4" name="upload_maxwidth" value="{UPLOAD_MAXWIDTH}" /></td>
    136   </tr>
    137   <tr>
    138     <td><strong>{L_UPLOAD_MAXHEIGHT}&nbsp;:</strong><br /><span class="small">{L_UPLOAD_MAXHEIGHT_INFO}</span></td>
    139         <td class="row1"><input type="text" size="4" maxlength="4" name="upload_maxheight" value="{UPLOAD_MAXHEIGHT}" /></td>
    140   </tr>
    141     <tr>
    142     <td><strong>{L_TN_UPLOAD_MAXWIDTH}&nbsp;:</strong><br /><span class="small">{L_TN_UPLOAD_MAXWIDTH_INFO}</span></td>
    143         <td class="row1"><input type="text" size="4" maxlength="4" name="upload_maxwidth_thumbnail" value="{TN_UPLOAD_MAXWIDTH}" /></td>
    144   </tr>
    145   <tr>
    146     <td><strong>{L_TN_UPLOAD_MAXHEIGHT}&nbsp;:</strong><br /><span class="small">{L_TN_UPLOAD_MAXHEIGHT_INFO}</span></td>
    147         <td class="row1"><input type="text" size="4" maxlength="4" name="upload_maxheight_thumbnail" value="{TN_UPLOAD_MAXHEIGHT}" /></td>
    148   </tr>
    149   <tr>
    150     <td colspan="2">&nbsp;</td>
    151   </tr>
    152   <tr class="admin">
    153     <th colspan="2">{L_CONF_SESSION}</th>
    154   </tr>
    155   <tr>
    156     <td colspan="2">&nbsp;</td>
    157   </tr>
    158     <tr>
    159     <td><strong>{L_COOKIE}&nbsp;:</strong><br /><span class="small">{L_COOKIE_INFO}</span></td>
    160         <td class="row1"><input type="radio" class="radio" name="authorize_cookies" value="true" {COOKIE_YES} />{L_YES}&nbsp;&nbsp;
    161         <input type="radio" class="radio" name="authorize_cookies" value="false" {COOKIE_NO} />{L_NO}</td>
    162   </tr>
    163   <tr>
    164     <td><strong>{L_SESSION_LENGTH}&nbsp;:</strong><br /><span class="small">{L_SESSION_LENGTH_INFO}</span></td>
    165         <td class="row1"><input type="text" size="4" maxlength="6" name="session_time" value="{SESSION_LENGTH}" /></td>
    166   </tr>
    167     <tr>
    168     <td><strong>{L_SESSION_ID_SIZE}&nbsp;:</strong><br /><span class="small">{L_SESSION_ID_SIZE_INFO}</span></td>
    169         <td class="row1"><input type="text" size="2" maxlength="3" name="session_id_size" value="{SESSION_ID_SIZE}" /></td>
    170   </tr>
    171   <tr>
    172     <td colspan="2">&nbsp;</td>
    173   </tr>
    174   <tr class="admin">
    175     <th colspan="2">{L_CONF_METADATA}</th>
    176   </tr>
    177   <tr>
    178     <td colspan="2">&nbsp;</td>
    179   </tr>
    180   <tr>
    181     <td>
    182       <strong>{L_USE_EXIF}&nbsp;:</strong>
    183       <br /><span class="small">{L_USE_EXIF_INFO}</span>
     25    <td width="50%">
     26      <span class="confLineName">{line.NAME} :</span>
     27      <br />
     28      <span class="confLineInfo">{line.INFO}</span>
    18429    </td>
    185     <td class="row1">
    186       <input type="radio" class="radio" name="use_exif" value="true" {USE_EXIF_YES} />{L_YES}&nbsp;&nbsp;
    187       <input type="radio" class="radio" name="use_exif" value="false" {USE_EXIF_NO} />{L_NO}
     30    <td class="confLineField">
     31
     32      <!-- BEGIN textfield -->
     33      <input type="text" size="{line.textfield.SIZE}" name="{line.textfield.NAME}" value="{line.textfield.VALUE}" />
     34      <!-- END textfield -->
     35
     36      <!-- BEGIN radio -->
     37      <input type="radio" class="radio" name="{line.radio.NAME}" value="{line.radio.VALUE}" {line.radio.CHECKED} />{line.radio.OPTION}
     38      <!-- END radio -->
     39
     40      <!-- BEGIN select -->
     41      <select name="{line.select.NAME}">
     42        <!-- BEGIN select_option -->
     43        <option value="{line.select.select_option.VALUE}" {line.select.select_option.SELECTED}>{line.select.select_option.OPTION}</option>
     44        <!-- END select_option -->
     45      </select>
     46      <!-- END select -->
     47
    18848    </td>
    18949  </tr>
     50  <!-- END line -->
    19051  <tr>
    191     <td>
    192       <strong>{L_USE_IPTC}&nbsp;:</strong>
    193       <br /><span class="small">{L_USE_IPTC_INFO}</span>
    194     </td>
    195     <td class="row1">
    196       <input type="radio" class="radio" name="use_iptc" value="true" {USE_IPTC_YES} />{L_YES}&nbsp;&nbsp;
    197       <input type="radio" class="radio" name="use_iptc" value="false" {USE_IPTC_NO} />{L_NO}
     52    <td colspan="2" align="center">
     53      <input type="submit" name="submit" class="bouton" value="{L_SUBMIT}" />
    19854    </td>
    19955  </tr>
    200   <tr>
    201     <td>
    202       <strong>{L_SHOW_EXIF}&nbsp;:</strong>
    203       <br /><span class="small">{L_SHOW_EXIF_INFO}</span>
    204     </td>
    205     <td class="row1">
    206       <input type="radio" class="radio" name="show_exif" value="true" {SHOW_EXIF_YES} />{L_YES}&nbsp;&nbsp;
    207       <input type="radio" class="radio" name="show_exif" value="false" {SHOW_EXIF_NO} />{L_NO}
    208     </td>
    209   </tr>
    210   <tr>
    211     <td>
    212       <strong>{L_SHOW_IPTC}&nbsp;:</strong>
    213       <br /><span class="small">{L_SHOW_IPTC_INFO}</span>
    214     </td>
    215     <td class="row1">
    216       <input type="radio" class="radio" name="show_iptc" value="true" {SHOW_IPTC_YES} />{L_YES}&nbsp;&nbsp;
    217       <input type="radio" class="radio" name="show_iptc" value="false" {SHOW_IPTC_NO} />{L_NO}
    218     </td>
    219   </tr>
    220     <!-- BEGIN remote_sites -->
    221     <tr>
    222       <th colspan="2" align="center">{#remote_site}</th>
    223     </tr>
    224     <tr>
    225       <td colspan=3><div style='margin-bottom:0px'>&nbsp;</div></td>
    226     </tr>
    227     <tr>
    228       <td>&nbsp;</td>
    229       <td align="center">{#delete}</td>
    230       <td>&nbsp;</td>
    231     </tr>
    232     <!-- BEGIN site -->
    233     <tr>
    234       <td>{#url}</td>
    235       <td align="center"><input type="checkbox" name="delete_site_{#id}" value="1" /></td>
    236       <!-- BEGIN rowspan -->
    237           <td class="row2" rowspan="{#nb_sites}">{#conf_remote_site_delete_INFO}</span></td>
    238           <!-- END rowspan -->
    239     </tr>
    240     <!-- END site -->
    241     <tr>
    242       <td colspan=3><div style='margin-bottom:0px'>&nbsp;</div></td>
    243     </tr>
    244     <!-- END remote_sites -->
    245     <tr>
    246       <td colspan="2" align="center">
    247         <input type="submit" name="submit" class="bouton" value="{L_SUBMIT}">
    248       </td>
    249     </tr>
    250   </table>
     56</table>
     57
    25158</form>
  • trunk/template/default/default.css

    r498 r512  
    1919        line-height:    120%;
    2020}
    21 
    22 .small{ font-size:80%;}
    2321
    2422/* ANCHORS */
     
    147145}
    148146
    149 .row1,.row2 {
    150   text-align:left;
    151   padding:5px 0px 5px 0px;
    152   height:20px;
    153 }
    154 
    155 .row1 {
    156   background-color:#505050;
    157 }
    158 
    159147.throw {
    160148  color:#FFFFCC;
     
    258246text-align: center;
    259247padding:0px;
    260 color : #FFF48E; 
     248color : #FFF48E;
    261249}
    262250
     
    340328  color:#ffe1e1;
    341329}
     330
     331.confMenu {
     332  background-color:#444444;
     333  text-align:center;
     334}
     335
     336.confMenu a {
     337  padding:2px;
     338  border:1px solid gray;
     339  background-color:#505050;
     340  color:#fff48e;
     341  color:lightgray;
     342}
     343
     344.confMenu a:hover {
     345  color:orange;
     346  text-decoration:none;
     347}
     348
     349.confMenu a.opened {
     350  background-color:gray;
     351  color:white;
     352  text-decoration:none;
     353}
     354
     355span.confLineName {
     356  font-weight:bold;
     357}
     358
     359span.confLineInfo {
     360  font-size:80%;
     361}
     362
     363td.confLineField {
     364  text-align:left;
     365  padding:5px 0px 5px 0px;
     366  height:20px;
     367  background-color:#505050;
     368}
  • trunk/template/default/footer.tpl

    r471 r512  
    1313      {L_SEND_MAIL}
    1414      <a href="mailto:{MAIL}?subject={L_TITLE_MAIL}">
    15        <span style="font-weight:bold;">{WEBMASTER}</span>
     15       <span style="font-weight:bold;">{L_WEBMASTER}</span>
    1616      </a>
    1717
Note: See TracChangeset for help on using the changeset viewer.