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
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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?>
Note: See TracChangeset for help on using the changeset viewer.