mirror of
https://github.com/jimeh/dlist.git
synced 2026-02-19 07:56:41 +00:00
- added full icon support (still needs tweaking)
- very simple but powerful template system working (also needs tweaking, a fair amount of it) - other fixes to both dirlist.lib.php, exechandler.lib.php, config.lib.php and more... git-svn-id: file:///Users/jimeh/Desktop/dlist/trunk@9 a5845835-ea0f-0410-a762-dd0bfe9bfde8
This commit is contained in:
@@ -4,7 +4,7 @@ class config {
|
||||
|
||||
/*
|
||||
|
||||
Class: config v0.1 beta
|
||||
Class: config v0.2 beta
|
||||
|
||||
Copyright © 2006 Jim Myhrberg. All rights reserved.
|
||||
zynode@gmail.com
|
||||
@@ -17,7 +17,8 @@ class config {
|
||||
}
|
||||
|
||||
// Main function
|
||||
function parse ($input, $overwrite=true) {
|
||||
function parse ($input, $overwrite=true, $pad=false) {
|
||||
if ( !empty($pad) ) $this->_config_pad = $pad;
|
||||
if ( is_array($input) ) {
|
||||
$this->parse_array($input, $overwrite);
|
||||
} elseif ( is_string($input) ) {
|
||||
@@ -27,6 +28,7 @@ class config {
|
||||
$this->parse_ini_file($input);
|
||||
}
|
||||
}
|
||||
unset($this->_config_pad);
|
||||
}
|
||||
|
||||
// Parse settings from an array
|
||||
@@ -36,10 +38,12 @@ class config {
|
||||
if ( is_array($value) ) {
|
||||
foreach( $value as $k => $v ) {
|
||||
if ( ($empty = empty($this->$key)) || $overwrite ) {
|
||||
if ( !empty($this->_config_pad) ) $k = $this->_config_pad.$k;
|
||||
$this->$key = ( $empty ) ? array($k=>$v) : array_merge($this->$key, array($k=>$v)) ;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
} else {
|
||||
if ( !empty($this->_config_pad) ) $key = $this->_config_pad.$key;
|
||||
if ( $overwrite || empty($this->$key) ) $this->$key = $value;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user