Changeset 862 for trunk/admin


Ignore:
Timestamp:
Sep 14, 2005, 11:57:05 PM (19 years ago)
Author:
plg
Message:
  • improvement: long localized messages are in HTML files instead of $lang array. This is the case of admin/help and about pages.
  • deletion: of unused functions (ts_to_mysqldt, is_image, TN_exists, check_date_format, date_convert, get_category_directories, get_used_metadata_list, array_remove, pwg_write_debug, get_group_restrictions, get_all_group_restrictions, is_group_allowed, style_select, deprecated_getAttribute).
  • new: many new contextual help pages to replace descriptions previously included in pages.
  • modification: reorganisation of language files. Deletion of unused language keys, alphabetical sort. No faq.lang.php anymore (replaced by help.html). Only done for en_UK.iso-8859-1.
Location:
trunk/admin
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/cat_modify.php

    r834 r862  
    158158  'L_REMOTE_SITE'=>$lang['remote_site'],
    159159  'L_EDIT_COMMENT'=>$lang['description'],
    160   'L_EDIT_CAT_OPTIONS'=>$lang['cat_options'],
    161160  'L_EDIT_STATUS'=>$lang['conf_access'],
    162   'L_EDIT_STATUS_INFO'=>$lang['cat_access_info'],
    163161  'L_STATUS_PUBLIC'=>$lang['public'],
    164162  'L_STATUS_PRIVATE'=>$lang['private'],
    165163  'L_EDIT_LOCK'=>$lang['lock'],
    166   'L_EDIT_LOCK_INFO'=>$lang['editcat_lock_info'],
    167164  'L_EDIT_UPLOADABLE'=>$lang['editcat_uploadable'],
    168   'L_EDIT_UPLOADABLE_INFO'=>$lang['editcat_uploadable_info'],
    169165  'L_EDIT_COMMENTABLE'=>$lang['comments'],
    170   'L_EDIT_COMMENTABLE_INFO'=>$lang['editcat_commentable_info'],
    171166  'L_YES'=>$lang['yes'],
    172167  'L_NO'=>$lang['no'],
     
    178173  'U_CHILDREN'=>
    179174    add_session_id($cat_list_url.'&parent_id='.$category['id']),
     175  'U_HELP' => PHPWG_ROOT_PATH.'/popuphelp.php?page=cat_modify',
    180176   
    181177  'F_ACTION'=>add_session_id($form_action)
  • trunk/admin/cat_options.php

    r817 r862  
    151151    'L_SUBMIT'=>$lang['submit'],
    152152    'L_RESET'=>$lang['reset'],
     153
     154    'U_HELP' => PHPWG_ROOT_PATH.'/popuphelp.php?page=cat_options',
    153155   
    154156    'F_ACTION'=>add_session_id($base_url.$page['section'])
     
    194196        'L_CAT_OPTIONS_TRUE' => $lang['authorized'],
    195197        'L_CAT_OPTIONS_FALSE' => $lang['forbidden'],
    196         'L_CAT_OPTIONS_INFO' => $lang['cat_upload_info'],
    197198        )
    198199      );
     
    216217        'L_CAT_OPTIONS_TRUE' => $lang['authorized'],
    217218        'L_CAT_OPTIONS_FALSE' => $lang['forbidden'],
    218         'L_CAT_OPTIONS_INFO' => $lang['cat_comments_info'],
    219219        )
    220220      );
     
    238238        'L_CAT_OPTIONS_TRUE' => $lang['unlocked'],
    239239        'L_CAT_OPTIONS_FALSE' => $lang['locked'],
    240         'L_CAT_OPTIONS_INFO' => $lang['cat_lock_info'],
    241240        )
    242241      );
     
    260259        'L_CAT_OPTIONS_TRUE' => $lang['cat_public'],
    261260        'L_CAT_OPTIONS_FALSE' => $lang['cat_private'],
    262         'L_CAT_OPTIONS_INFO' => $lang['cat_status_info'],
    263261        )
    264262      );
     
    282280        'L_SECTION' => l10n('Representative'),
    283281        'L_CAT_OPTIONS_TRUE' => l10n('singly represented'),
    284         'L_CAT_OPTIONS_FALSE' => l10n('randomly represented'),
    285         'L_CAT_OPTIONS_INFO' => l10n('')
     282        'L_CAT_OPTIONS_FALSE' => l10n('randomly represented')
    286283        )
    287284      );
  • trunk/admin/cat_perm.php

    r825 r862  
    207207        'admin.php?page=cat_modify&cat_id='
    208208        ),
     209    'U_HELP' => PHPWG_ROOT_PATH.'/popuphelp.php?page=cat_perm',
    209210    'F_ACTION' =>
    210211      add_session_id(
  • trunk/admin/help.php

    r675 r862  
    2525// | USA.                                                                  |
    2626// +-----------------------------------------------------------------------+
     27
    2728include_once( PHPWG_ROOT_PATH.'admin/include/isadmin.inc.php' );
    28 //----------------------------------------------------- template initialization
    29 $template->set_filenames( array('help'=>'admin/help.tpl') );
    3029
    31 //----------------------------------------------------- help categories display
    32 $categories = array('images','thumbnails','database','access','groups',
    33                     'remote','upload','virtual','infos');
    34 foreach ($categories as $category)
     30// language files
     31$user_langdir = PHPWG_ROOT_PATH.'language/'.$user['language'];
     32$conf_langdir = PHPWG_ROOT_PATH.'language/'.$conf['default_language'];
     33
     34if (file_exists($user_langdir.'/help.html'))
    3535{
    36   $template->assign_block_vars(
    37     'cat',
    38     array('NAME'=>$lang['help_'.$category.'_title']));
    39  
    40   foreach ($lang['help_'.$category] as $item)
    41   {
    42     $template->assign_block_vars('cat.item', array('CONTENT'=>$item));
    43   }
     36  $html_file = $user_langdir.'/help.html';
    4437}
    45 $template->assign_var_from_handle('ADMIN_CONTENT', 'help');
     38else
     39{
     40  $html_file = $conf_langdir.'/help.html';
     41}
     42
     43$template->set_filenames(array('help_content' => $html_file));
     44$template->assign_var_from_handle('ADMIN_CONTENT', 'help_content');
    4645?>
  • trunk/admin/include/functions.php

    r858 r862  
    2828include(PHPWG_ROOT_PATH.'admin/include/functions_metadata.php');
    2929
    30 $tab_ext_create_TN = array ( 'jpg', 'png', 'JPG', 'PNG' );
    31 
    32 // is_image returns true if the given $filename (including the path) is a
    33 // picture according to its format and its extension.
    34 // As GD library can only generate pictures from jpeg and png files, if you
    35 // ask if the filename is an image for thumbnail creation (second parameter
    36 // set to true), the only authorized formats are jpeg and png.
    37 function is_image( $filename, $create_thumbnail = false )
    38 {
    39   global $conf, $tab_ext_create_TN;
    40 
    41   if (is_file($filename)
    42       and in_array(get_extension($filename), $conf['picture_ext']))
    43   {
    44     $size = getimagesize( $filename );
    45     // $size[2] == 1 means GIF
    46     // $size[2] == 2 means JPG
    47     // $size[2] == 3 means PNG
    48     if ( !$create_thumbnail )
    49     {
    50       if ( in_array( get_extension( $filename ), $conf['picture_ext'] )
    51            and ( $size[2] == 1 or $size[2] == 2 or $size[2] == 3 ) )
    52       {
    53         return true;
    54       }
    55     }
    56     else
    57     {
    58       if ( in_array( get_extension( $filename ), $tab_ext_create_TN )
    59            and ( $size[2] == 2 or $size[2] == 3 ) )
    60       {
    61         return true;
    62       }
    63     }
    64   }
    65   return false;
    66 }
    67 
    6830/**
    6931 * returns an array with all picture files according to $conf['file_ext']
     
    142104  return $pictures;
    143105}
    144 
    145 function TN_exists( $dir, $file )
    146 {
    147   global $conf;
    148 
    149   $filename = get_filename_wo_extension( $file );
    150   foreach ( $conf['picture_ext'] as $ext ) {
    151     $test = $dir.'/thumbnail/'.$conf['prefix_thumbnail'].$filename.'.'.$ext;
    152     if ( is_file ( $test ) )
    153     {
    154       return $ext;
    155     }
    156   }
    157   return false;
    158 }
    159        
    160106
    161107// The function delete_site deletes a site and call the function
     
    553499}
    554500
    555 function check_date_format( $date )
    556 {
    557   // date arrives at this format : DD/MM/YYYY
    558   @list($day,$month,$year) = explode( '/', $date );
    559   return @checkdate( $month, $day, $year );
    560 }
    561 
    562 function date_convert( $date )
    563 {
    564   // date arrives at this format : DD/MM/YYYY
    565   // It must be transformed in YYYY-MM-DD
    566   list($day,$month,$year) = explode( '/', $date );
    567   return $year.'-'.$month.'-'.$day;
    568 }
    569 
    570501function date_convert_back( $date )
    571502{
     
    600531        )
    601532      );
    602 }
    603 
    604 /**
    605  * returns an array containing sub-directories which can be a category
    606  *
    607  * directories nammed "thumbnail", "pwg_high" or "pwg_representative" are
    608  * omitted
    609  *
    610  * @param string $basedir
    611  * @return array
    612  */
    613 function get_category_directories( $basedir )
    614 {
    615   $sub_dirs = array();
    616  
    617   if ( $opendir = opendir( $basedir ) )
    618   {
    619     while ( $file = readdir( $opendir ) )
    620     {
    621       if ($file != '.'
    622           and $file != '..'
    623           and $file != 'thumbnail'
    624           and $file != 'pwg_high'
    625           and $file != 'pwg_representative'
    626           and is_dir($basedir.'/'.$file))
    627       {
    628         array_push( $sub_dirs, $file );
    629       }
    630     }
    631   }
    632   return $sub_dirs;
    633533}
    634534
  • trunk/admin/include/functions_metadata.php

    r858 r862  
    222222  return $files;
    223223}
    224 
    225 // used_metadata string is displayed to inform admin which metadata will be
    226 // used from files for synchronization
    227 function get_used_metadata_list()
    228 {
    229   global $conf;
    230  
    231   $used_metadata = array('filesize', 'width', 'height');
    232 
    233   if ($conf['use_exif'])
    234   {
    235     array_push($used_metadata, 'date_creation');
    236   }
    237 
    238   if ($conf['use_iptc'])
    239   {
    240     foreach (array_keys($conf['use_iptc_mapping']) as $key)
    241     {
    242       array_push($used_metadata, $key);
    243     }
    244   }
    245 
    246   return array_unique($used_metadata);
    247 }
    248224?>
  • trunk/admin/thumbnail.php

    r792 r862  
    170170  'L_PARAMS'=>$lang['tn_params_title'],
    171171  'L_GD'=>$lang['tn_params_GD'],
    172   'L_GD_INFO'=>$lang['tn_params_GD_info'],
    173   'L_WIDTH_INFO'=>$lang['tn_params_width_info'],
    174   'L_HEIGHT_INFO'=>$lang['tn_params_height_info'],
    175172  'L_CREATE'=>$lang['tn_params_create'],
    176   'L_CREATE_INFO'=>$lang['tn_params_create_info'],
    177   'L_FORMAT'=>$lang['tn_params_format'],
    178   'L_FORMAT_INFO'=>$lang['tn_params_format_info'],
    179173  'L_SUBMIT'=>$lang['submit'],
    180174  'L_REMAINING'=>$lang['tn_alone_title'],
     
    186180  'L_TN_AVERAGE'=>$lang['tn_stats_mean'],
    187181  'L_ALL'=>$lang['tn_all'],
     182
     183  'U_HELP' => PHPWG_ROOT_PATH.'/popuphelp.php?page=thumbnail',
    188184 
    189185  'T_STYLE'=>$user['template']
  • trunk/admin/user_list.php

    r858 r862  
    294294    'L_DELETE' => $lang['user_delete'],
    295295    'L_DELETE_HINT' => $lang['user_delete_hint'],
     296
     297    'U_HELP' => PHPWG_ROOT_PATH.'/popuphelp.php?page=user_list',
    296298   
    297299    'F_ADD_ACTION' => $base_url,
Note: See TracChangeset for help on using the changeset viewer.