mirror of
https://github.com/jimeh/dlist.git
synced 2026-02-19 07:56:41 +00:00
- 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:
@@ -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.';
|
||||
@@ -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));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user