diff --git a/config.php b/config.php index 48dde7d..f211e9d 100644 --- a/config.php +++ b/config.php @@ -29,7 +29,7 @@ $config = array( // dList internal path settings - 'path_plugins' => array('plugins/*'), + 'path_plugins' => array('plugins'), 'path_cache' => 'cache', diff --git a/exec/icons.exc.php b/exec/icons.exc.php index 03b6814..674f99f 100644 --- a/exec/icons.exc.php +++ b/exec/icons.exc.php @@ -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; ?> \ No newline at end of file diff --git a/exec/output.exc.php b/exec/output.exc.php index 282f8ba..64d0f5e 100644 --- a/exec/output.exc.php +++ b/exec/output.exc.php @@ -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 } diff --git a/libs/dirlist.lib.php b/libs/dirlist.lib.php index c3e4961..e54ac3a 100644 --- a/libs/dirlist.lib.php +++ b/libs/dirlist.lib.php @@ -89,7 +89,6 @@ class dirList { } - // ============================================== // ----- [ Internal Functions ] ----------------- // ============================================== @@ -150,10 +149,9 @@ class dirList { $types = array('bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'); for($n = 0; $bytes >= 1024; $n++) $bytes = $bytes / 1024; $bytes = number_format($bytes, 2); - if ( !empty($bytes[1]) ) { - $bytes = explode('.', $bytes); - $bytes[1] = rtrim($bytes[1], '0'); - $bytes = ( $bytes[1] != '' ) ? $bytes[0].'.'.$bytes[1] : $bytes[0] ; + if ( preg_match("/([0-9]+)\.([0-9]+)/", $bytes, $bytes) ) { + $bytes[2] = rtrim($bytes[2], '0'); + $bytes = ( !empty($bytes[2]) ) ? $bytes[1].'.'.$bytes[2] : $bytes[1] ; } return $bytes.' '.$types[$n]; } diff --git a/libs/exechandler.lib.php b/libs/exechandler.lib.php index 657ddf5..facb3d8 100644 --- a/libs/exechandler.lib.php +++ b/libs/exechandler.lib.php @@ -4,7 +4,7 @@ class execHandler { /* - Class: execHandler v0.7.3 beta + Class: execHandler v0.7.4 beta Copyright © 2006 Jim Myhrberg. All rights reserved. zynode@gmail.com @@ -31,17 +31,19 @@ class execHandler { // Execution Stage Priority var $default_stages = array( - 'init' => 10, - 'query' => 20, - 'main' => 50, - 'render' => 80, - 'term' => 90, + 'functions' => 5, + 'init' => 10, + 'query' => 20, + 'main' => 50, + 'render' => 80, + 'term' => 90, ); // Debug? - var $debug = false; + var $debug = false; + var $show_debug_msg = true; // Misc. Settings @@ -110,7 +112,7 @@ class execHandler { function cache ($force=false) { if ( $force || $this->debug || !$this->check_cache() ) { - if ( $this->debug ) echo "reloading\n"; + if ( $this->debug && $this->show_debug_msg ) echo "reloading\n"; $this->loadFile($this->files_to_load); $this->compile(); $this->save_cache(); @@ -124,9 +126,11 @@ class execHandler { } elseif( is_string($input) ) { $result = glob($input); } - $result = array_filter($result); - if ( is_array($result) ) $result = array_unique($result); - $this->files_to_load = array_merge($this->files_to_load, $result); + if ( !empty($result) ) { + $result = array_filter($result); + if ( is_array($result) ) $result = array_unique($result); + $this->files_to_load = array_merge($this->files_to_load, $result); + } } function loadFile ($input) { diff --git a/templates/simple/index.phtml b/templates/simple/index.phtml index a80a9c9..8d7a596 100644 --- a/templates/simple/index.phtml +++ b/templates/simple/index.phtml @@ -3,44 +3,48 @@
-| - | Name | -Size | -Date Modified | -Permissions | -Owner | ++ | Name | +Size | +Date Modified | +Permissions | +Owner |
|---|---|---|---|---|---|---|---|---|---|---|---|
| =$parent['name']?> | -=$parent['size']?> | -=$parent['mtime']?> | -=$parent['perms']?> | -=$parent['owner']?> | +.. | +=$parent['size']?> | +=$parent['mtime']?> | +=$parent['perms']?> | +=$parent['owner']?> | ||
| =$item['name']?> | -=$item['size']?> | -=$item['mtime']?> | -=$item['perms']?> | -=$item['owner']?> | +
+
+ |
+ =$item['name']?> | +=$item['size']?> | +=$item['mtime']?> | +=$item['perms']?> | +=$item['owner']?> |