- renamed view.php to index.php

- renamed exec files from *.exc.php to *.exec.php
- updated simple template
- added local language names caching to cache/local_names.ini, language must be used before it can read the local name from the language file and cache it if not already cached

git-svn-id: file:///Users/jimeh/Desktop/dlist/trunk@16 a5845835-ea0f-0410-a762-dd0bfe9bfde8
This commit is contained in:
jim
2006-04-06 13:09:04 +00:00
parent 57bd80f588
commit ebcb168783
12 changed files with 46 additions and 50 deletions

View File

@@ -15,19 +15,6 @@ Author: Jim Myhrberg
*/
//_SCRIPT;
//==========================
//>STAGE> functions
//==========================
function installed_languages () {
$return = glob('languages/*.lang.php');
foreach( $return as $key => $value ) {
$return[$key] = preg_replace("/languages\/(.*)\.lang\.php/", "$1", $value);
}
return $return;
}
//==========================
//>STAGE> init
@@ -51,6 +38,18 @@ include('languages/'.$language.'.lang.php');
$lang = new lang();
//>Section> local_names:10
$local_names = ( is_readable($config->path_cache.'/local_names.ini') ) ? parse_ini_file($config->path_cache.'/local_names.ini') : array() ;
$language_files = glob('languages/*.lang.php');
$installed_languages = array();
foreach( $language_files as $key => $value ) {
$lang_name = preg_replace("/languages\/(.*)\.lang\.php/", "$1", $value);
$installed_languages[$lang_name] = ( !empty($local_names[$lang_name]) ) ? $local_names[$lang_name] : $lang_name ;
}
if ( !isset($local_names[$language]) ) {
execHandler::write2file($config->path_cache.'/local_names.ini', "\n".$language.'='.$lang->_language, 'at');
}
//>Section> warning:10
if ( $lang->_version < $config->req_lang_ver ) {
echo 'WARNING: '.ucfirst($config->language).' language file is out of date and not fully compatible with this version of dList.';

View File

@@ -114,7 +114,7 @@ if ( !empty($_REQUEST['sort']) && !empty($dlist->sort_order[strtolower($_REQUEST
}
//>Section> set_fields:10
$fields = explode(',', $config->fields);
//foreach( $fields as $key => $value ) $fields[$key] = trim($value);
foreach( $fields as $key => $value ) $fields[$key] = trim($value);
$fields = array_flip(array_filter($fields));