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_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}
Note: See TracChangeset for help on using the changeset viewer.