implemented a functional template system, and a simple WORKING template, and other smaller things and fixes...

git-svn-id: file:///Users/jimeh/Desktop/dlist/trunk@10 a5845835-ea0f-0410-a762-dd0bfe9bfde8
This commit is contained in:
jim
2006-03-31 22:53:26 +00:00
parent f3a2a9e5b9
commit 05fc88b1d9
11 changed files with 178 additions and 89 deletions

View File

@@ -15,6 +15,52 @@ Author: Jim Myhrberg
*/
//_SCRIPT;
//==========================
//>STAGE> functions
//==========================
//>Section> class.start
class Icon {
//>Section> get_url
function get_url ($ext, $size, $type) {
global $config;
if ( $size == 'large' || $size == 'big' ) {
$size = $config->icons_large;
} else {
$size = $config->icons_small;
}
$icons_path = ICONS_PATH.$size.'/';
$icons_url = ICONS_URL.$size.'/';
if ( $type == 'file' ) {
if ( file_exists($icons_path.$ext.$config->icons_ext) ) {
return $icons_url.$ext.$config->icons_ext;
} else {
return $icons_url.'_file'.$config->icons_ext;
}
} elseif ( $type == 'dir' || $type == 'folder' ) {
if ( file_exists($icons_path.'_folder.'.$ext.$config->icons_ext) ) {
return $icons_url.'_folder.'.$ext.$config->icons_ext;
} else {
return $icons_url.'_folder'.$config->icons_ext;
}
}
}
//>Section> get_parent
function get_parent ($size) {
global $config;
if ( $size == 'large' || $size == 'big' ) {
$size = $config->icons_large;
} else {
$size = $config->icons_small;
}
return ICONS_URL.$size.'/_parent'.$config->icons_ext;
}
//> class.end
}
//==========================
//>STAGE> init
//==========================
@@ -27,40 +73,6 @@ define('ICONS_URL', DLIST_URL.ICONS_PATH);
//>Section> load_config:35
$config->parse(ICONS_PATH.'config.ini', true, 'icons_');
//>Section> functions
function icons_get_url ($ext, $size, $type) {
global $config;
if ( $size == 'large' || $size == 'big' ) {
$size = $config->icons_large;
} else {
$size = $config->icons_small;
}
$icons_path = ICONS_PATH.$size.'/';
$icons_url = ICONS_URL.$size.'/';
if ( $type == 'file' ) {
if ( file_exists($icons_path.$ext.$config->icons_ext) ) {
return $icons_url.$ext.$config->icons_ext;
} else {
return $icons_url.'_file'.$config->icons_ext;
}
} elseif ( $type == 'dir' || $type == 'folder' ) {
if ( file_exists($icons_path.'_folder.'.$ext.$config->icons_ext) ) {
return $icons_url.'_folder.'.$ext.$config->icons_ext;
} else {
return $icons_url.'_folder'.$config->icons_ext;
}
}
}
function icons_get_parent ($size) {
global $config;
if ( $size == 'large' || $size == 'big' ) {
$size = $config->icons_large;
} else {
$size = $config->icons_small;
}
return ICONS_URL.$size.'/_parent'.$config->icons_ext;
}
//_END;
?>

View File

@@ -26,6 +26,10 @@ Author: Jim Myhrberg
//>Section> do_render:5
if ( $do_render ) {
//>Section> set_parent:10
$parent = $dlist->parent;
//>Section> do_render.end:95
}