Ignore:
Timestamp:
Sep 3, 2005, 6:36:05 PM (19 years ago)
Author:
plg
Message:
  • modification : less configuration parameters in administration screen. These parameters are move to include/config_default.inc.php.
  • new : ability to add a single picture to caddie from picture.php
  • new : contextual help, only a few pages are available.
  • new : ability to delete users from admin/user_list
  • modification : reorganization of configuration file
  • new : configuration parameter use_exif_mapping
  • improvement : MOD hidemail added to standard
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/configuration.php

    r849 r858  
    6161    case 'general' :
    6262    {
    63       // thumbnail prefix must only contain simple ASCII characters
    64       if (!preg_match('/^[\w-]*$/', $_POST['prefix_thumbnail']))
    65       {
    66         array_push($page['errors'], $lang['conf_prefix_thumbnail_error']);
    67       }
    68       // mail must be formatted as follows : name@server.com
    69       $pattern = '/^[\w-]+(\.[\w-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)+$/';
    70       if (!preg_match($pattern, $_POST['mail_webmaster']))
    71       {
    72         array_push($page['errors'], $lang['conf_mail_webmaster_error']);
    73       }
    7463      break;
    7564    }
     
    9382      {
    9483        array_push($page['errors'], $lang['periods_error']);
    95       }
    96       break;
    97     }
    98     case 'upload' :
    99     {
    100       // the maximum upload filesize must be an integer between 10 and 1000
    101       if (!preg_match($int_pattern, $_POST['upload_maxfilesize'])
    102           or $_POST['upload_maxfilesize'] < 10
    103           or $_POST['upload_maxfilesize'] > 1000)
    104       {
    105         array_push($page['errors'], $lang['conf_upload_maxfilesize_error']);
    106       }
    107      
    108       foreach (array('upload_maxwidth',
    109                      'upload_maxheight',
    110                      'upload_maxwidth_thumbnail',
    111                      'upload_maxheight_thumbnail')
    112                as $field)
    113       {
    114         if (!preg_match($int_pattern, $_POST[$field])
    115             or $_POST[$field] < 10)
    116         {
    117           array_push($page['errors'], $lang['conf_'.$field.'_error']);
    118         }
    11984      }
    12085      break;
     
    155120    'L_SUBMIT'=>$lang['submit'],
    156121    'L_RESET'=>$lang['reset'],
     122
     123    'U_HELP' => PHPWG_ROOT_PATH.'/popuphelp.php?page=configuration',
    157124   
    158125    'F_ACTION'=>add_session_id($action)
     
    171138      'general',
    172139      array(
    173         'L_CONF_TITLE'=>$lang['conf_general_title'],
    174         'L_CONF_MAIL'=>$lang['conf_mail_webmaster'],
    175         'L_CONF_MAIL_INFO'=>$lang['conf_mail_webmaster_info'],
    176         'L_CONF_TN_PREFIX'=>$lang['conf_prefix'],
    177         'L_CONF_TN_PREFIX_INFO'=>$lang['conf_prefix_info'],
    178         'L_CONF_HISTORY'=>$lang['history'],
    179         'L_CONF_HISTORY_INFO'=>$lang['conf_log_info'],
    180         'L_CONF_GALLERY_LOCKED'=>$lang['conf_gallery_locked'],
    181         'L_CONF_GALLERY_LOCKED_INFO'=>$lang['conf_gallery_locked_info'],
    182          
    183         'ADMIN_MAIL'=>$conf['mail_webmaster'],
    184         'THUMBNAIL_PREFIX'=>$conf['prefix_thumbnail'],
    185140        'HISTORY_YES'=>$history_yes,
    186141        'HISTORY_NO'=>$history_no,
     
    200155      'comments',
    201156      array(
    202         'L_CONF_TITLE'=>$lang['conf_comments_title'],
    203         'L_CONF_COMMENTS_ALL'=>$lang['conf_comments_forall'],
    204         'L_CONF_COMMENTS_ALL_INFO'=>$lang['conf_comments_forall_info'],
    205         'L_CONF_NB_COMMENTS_PAGE'=>$lang['conf_nb_comment_page'],
    206         'L_CONF_NB_COMMENTS_PAGE_INFO'=>$lang['conf_nb_comment_page'],
    207         'L_CONF_VALIDATE'=>$lang['conf_comments_validation'],
    208         'L_CONF_VALIDATE_INFO'=>$lang['conf_comments_validation_info'],
    209          
    210157        'NB_COMMENTS_PAGE'=>$conf['nb_comment_page'],
    211158        'COMMENTS_ALL_YES'=>$all_yes,
     
    226173      'default',
    227174      array(
    228         'L_CONF_TITLE'=>$lang['conf_default_title'],
    229         'L_CONF_LANG'=>$lang['language'],
    230         'L_CONF_LANG_INFO'=>$lang['conf_default_language_info'],
    231         'L_NB_IMAGE_LINE'=>$lang['nb_image_per_row'],
    232         'L_NB_IMAGE_LINE_INFO'=>$lang['conf_nb_image_line_info'],
    233         'L_NB_ROW_PAGE'=>$lang['nb_row_per_page'],
    234         'L_NB_ROW_PAGE_INFO'=>$lang['conf_nb_line_page_info'],
    235         'L_CONF_STYLE'=>$lang['theme'],
    236         'L_CONF_STYLE_INFO'=>$lang['conf_default_theme_info'],
    237         'L_CONF_RECENT'=>$lang['recent_period'],
    238         'L_CONF_RECENT_INFO'=>$lang['conf_recent_period_info'],
    239         'L_CONF_EXPAND'=>$lang['auto_expand'],
    240         'L_CONF_EXPAND_INFO'=>$lang['conf_default_expand_info'],
    241         'L_NB_COMMENTS'=>$lang['show_nb_comments'],
    242         'L_NB_COMMENTS_INFO'=>$lang['conf_show_nb_comments_info'],
    243         'L_MAXWIDTH'=>$lang['maxwidth'],
    244         'L_MAXHEIGHT'=>$lang['maxheight'],
    245  
    246         'CONF_LANG_SELECT'=>language_select($conf['default_language'], 'default_language'),
    247175        'NB_IMAGE_LINE'=>$conf['nb_image_line'],
    248176        'NB_ROW_PAGE'=>$conf['nb_line_page'],
    249         'CONF_STYLE_SELECT'=>style_select($conf['default_template'], 'default_template'),
    250177        'CONF_RECENT'=>$conf['recent_period'],
    251178        'NB_COMMENTS_PAGE'=>$conf['nb_comment_page'],
     
    255182        'SHOW_COMMENTS_NO'=>$show_no
    256183        ));
    257     break;
    258   }
    259   case 'upload' :
    260   {
    261     $template->assign_block_vars(
    262       'upload',
    263       array(
    264         'L_CONF_TITLE'=>$lang['conf_upload_title'],
    265         'L_CONF_MAXSIZE'=>$lang['conf_upload_maxfilesize'],
    266         'L_CONF_MAXSIZE_INFO'=>$lang['conf_upload_maxfilesize_info'],
    267         'L_CONF_MAXWIDTH'=>$lang['conf_upload_maxwidth'],
    268         'L_CONF_MAXWIDTH_INFO'=>$lang['conf_upload_maxwidth_info'],
    269         'L_CONF_MAXHEIGHT'=>$lang['conf_upload_maxheight'],
    270         'L_CONF_MAXHEIGHT_INFO'=>$lang['conf_upload_maxheight_info'],
    271         'L_CONF_TN_MAXWIDTH'=>$lang['conf_upload_tn_maxwidth'],
    272         'L_CONF_TN_MAXWIDTH_INFO'=>$lang['conf_upload_tn_maxwidth_info'],
    273         'L_CONF_TN_MAXHEIGHT'=>$lang['conf_upload_tn_maxheight'],
    274         'L_CONF_TN_MAXHEIGHT_INFO'=>$lang['conf_upload_tn_maxheight_info'],
    275          
    276         'UPLOAD_MAXSIZE'=>$conf['upload_maxfilesize'],
    277         'UPLOAD_MAXWIDTH'=>$conf['upload_maxwidth'],
    278         'UPLOAD_MAXHEIGHT'=>$conf['upload_maxheight'],
    279         'TN_UPLOAD_MAXWIDTH'=>$conf['upload_maxwidth_thumbnail'],
    280         'TN_UPLOAD_MAXHEIGHT'=>$conf['upload_maxheight_thumbnail'],
    281         ));
    282     break;
    283   }
    284   case 'session' :
    285   {
    286     $authorize_remembering_yes =
    287       ($conf['authorize_remembering']=='true')?'checked="checked"':'';
    288     $authorize_remembering_no =
    289       ($conf['authorize_remembering']=='false')?'checked="checked"':'';
    290      
    291     $template->assign_block_vars(
    292       'session',
    293       array(
    294         'L_CONF_TITLE'=>$lang['conf_session_title'],
    295         'L_CONF_AUTHORIZE_REMEMBERING'=>$lang['conf_authorize_remembering'],
    296         'L_CONF_AUTHORIZE_REMEMBERING_INFO' =>
    297         $lang['conf_authorize_remembering_info'],
    298 
    299         'AUTHORIZE_REMEMBERING_YES'=>$authorize_remembering_yes,
    300         'AUTHORIZE_REMEMBERING_NO'=>$authorize_remembering_no
    301         ));
    302     break;
    303   }
    304   case 'metadata' :
    305   {
    306     $exif_yes = ($conf['use_exif']=='true')?'checked="checked"':'';
    307     $exif_no = ($conf['use_exif']=='false')?'checked="checked"':'';
    308     $iptc_yes = ($conf['use_iptc']=='true')?'checked="checked"':'';
    309     $iptc_no = ($conf['use_iptc']=='false')?'checked="checked"':'';
    310     $show_exif_yes = ($conf['show_exif']=='true')?'checked="checked"':'';
    311     $show_exif_no = ($conf['show_exif']=='false')?'checked="checked"':'';
    312     $show_iptc_yes = ($conf['show_iptc']=='true')?'checked="checked"':'';
    313     $show_iptc_no = ($conf['show_iptc']=='false')?'checked="checked"':'';
    314      
    315     $template->assign_block_vars(
    316       'metadata',
    317       array(
    318         'L_CONF_TITLE'=>$lang['conf_metadata_title'],
    319         'L_CONF_EXIF'=>$lang['conf_use_exif'],
    320         'L_CONF_EXIF_INFO'=>$lang['conf_use_exif_info'],
    321         'L_CONF_IPTC'=>$lang['conf_use_iptc'],
    322         'L_CONF_IPTC_INFO'=>$lang['conf_use_iptc_info'],
    323         'L_CONF_SHOW_EXIF'=>$lang['conf_show_exif'],
    324         'L_CONF_SHOW_EXIF_INFO'=>$lang['conf_show_exif_info'],
    325         'L_CONF_SHOW_IPTC'=>$lang['conf_show_iptc'],
    326         'L_CONF_SHOW_IPTC_INFO'=>$lang['conf_show_iptc_info'],
    327          
    328         'USE_EXIF_YES'=>$exif_yes,
    329         'USE_EXIF_NO'=>$exif_no,
    330         'USE_IPTC_YES'=>$iptc_yes,
    331         'USE_IPTC_NO'=>$iptc_no,
    332         'SHOW_EXIF_YES'=>$show_exif_yes,
    333         'SHOW_EXIF_NO'=>$show_exif_no,
    334         'SHOW_IPTC_YES'=>$show_iptc_yes,
    335         'SHOW_IPTC_NO'=>$show_iptc_no
    336         ));
     184   
     185    $blockname = 'default.language_option';
     186   
     187    foreach (get_languages() as $language_code => $language_name)
     188    {
     189      if (isset($_POST['submit']))
     190      {
     191        $selected =
     192          $_POST['default_language'] == $language_code
     193            ? 'selected="selected"' : '';
     194      }
     195      else if ($conf['default_language'] == $language_code)
     196      {
     197        $selected = 'selected="selected"';
     198      }
     199      else
     200      {
     201        $selected = '';
     202      }
     203     
     204      $template->assign_block_vars(
     205        $blockname,
     206        array(
     207          'VALUE'=> $language_code,
     208          'CONTENT' => $language_name,
     209          'SELECTED' => $selected
     210          ));
     211    }
     212
     213    $blockname = 'default.template_option';
     214
     215    foreach (get_templates() as $pwg_template)
     216    {
     217      if (isset($_POST['submit']))
     218      {
     219        $selected =
     220          $_POST['default_template'] == $pwg_template
     221            ? 'selected="selected"' : '';
     222      }
     223      else if ($conf['default_template'] == $pwg_template)
     224      {
     225        $selected = 'selected="selected"';
     226      }
     227      else
     228      {
     229        $selected = '';
     230      }
     231     
     232      $template->assign_block_vars(
     233        $blockname,
     234        array(
     235          'VALUE'=> $pwg_template,
     236          'CONTENT' => $pwg_template,
     237          'SELECTED' => $selected
     238          )
     239        );
     240    }
     241
     242 
    337243    break;
    338244  }
Note: See TracChangeset for help on using the changeset viewer.