- added language selection support to simple template, and the backend for it in language.exc.php

only need to get thumbnails working, and make a fully featured web 2.0/6.3/whatever template and dList should be ready for its initial public release.

git-svn-id: file:///Users/jimeh/Desktop/dlist/trunk@14 a5845835-ea0f-0410-a762-dd0bfe9bfde8
This commit is contained in:
jim
2006-04-05 18:24:54 +00:00
parent 7762f5f5a6
commit 8a5565c990
14 changed files with 154 additions and 41 deletions

View File

@@ -24,6 +24,7 @@ class Icon {
//>Section> get_url
function get_url ($ext, $size, $type) {
//TODO enable thumbnail support using phpThumbs
global $config;
if ( $size == 'large' || $size == 'big' ) {
$size = $config->icons_large;

View File

@@ -15,20 +15,36 @@ 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
//==========================
//>Section> init:10
if ( empty($config->language) ) $config->language = 'english';
if ( is_readable('languages/'.$config->language.'.lang.php') ) {
include('languages/'.$config->language.'.lang.php');
if ( !empty($_REQUEST[$config->lang_cookie]) && is_readable('languages/'.$_REQUEST[$config->lang_cookie].'.lang.php')) {
$language = $_REQUEST[$config->lang_cookie];
} elseif ( is_readable('languages/'.$config->language.'.lang.php') ) {
$language = $config->language;
} elseif ( is_readable('languages/'.$config->default_lang.'.lang.php') ) {
include('languages/'.$config->default_lang.'.lang.php');
$language = $config->default_lang;
} else {
die("ERROR: Can't open language file.");
}
include('languages/'.$language.'.lang.php');
//>Section> create_object:10
@@ -58,7 +74,6 @@ setlocale(LC_ALL, array_merge($lang->_locale, $config->default_locale));
define('LANG', $lang->_language);
define('LANG_VER', $lang->_version);
//==========================
//>STAGE> main
//==========================

View File

@@ -19,11 +19,32 @@ Author: Jim Myhrberg
//>STAGE> functions
//==========================
//>Section> class_path.start
class Path {
//>Section> path.url2links
function url2links ($path, $root='') {
if ( !empty($path) ) {
$return = '';
$previous = '';
$path = str_replace("\\", '/', $path);
$path = explode('/', rtrim($path, '/'));
$last = count($path)-1;
foreach( $path as $key => $value ) {
$return .= ($key != $last) ? '<a href="'.$root.$previous.$value.'/">'.$value.'/</a>' : $value.'/';
$previous .= $value.'/';
}
return $return;
} else return false;
}
//>Section> path_class.end
}
//>Section> sort_class.start
//>Section> class_sort.start
class Sort {
//>Section> get_url
//>Section> sort.get_url
function get_url ($sortby) {
global $config;
$return = array();
@@ -84,11 +105,22 @@ $is_root = ( DIR_URL != '' && DIR_URL != '/' ) ? false : true;
//>Section> do_render:5
if ( $do_render ) {
//>Section> set_parent:10
//>Section> set_vars:10
$parent = $dlist->parent;
if ( !empty($_REQUEST['sort']) && !empty($dlist->sort_order[strtolower($_REQUEST['sort'])]) ) {
$current_sort = $_REQUEST['sort'];
} else {
$current_sort = $config->default_sort;
}
//>Section> set_fields:10
$fields = explode(',', $config->fields);
//foreach( $fields as $key => $value ) $fields[$key] = trim($value);
$fields = array_flip(array_filter($fields));
//>Section> do_render.end:95
}
//_END;
?>