diff options
author | Urban Müller | 2010-03-11 20:09:55 +0000 |
---|---|---|
committer | Urban Müller | 2010-03-11 20:09:55 +0000 |
commit | 0718ca36ffc5764fbe5398a7a541a3740cdd9b0d (patch) | |
tree | e0df592c72636c9c30ed7b7b71b7ec549b1de759 | |
parent | b5d6d94772e97739c0f13aefcb8495fa607e325f (diff) | |
download | itools-0718ca36ffc5764fbe5398a7a541a3740cdd9b0d.tar.gz itools-0718ca36ffc5764fbe5398a7a541a3740cdd9b0d.tar.bz2 itools-0718ca36ffc5764fbe5398a7a541a3740cdd9b0d.zip |
inherit prefix...
-rw-r--r-- | it_xml.class | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/it_xml.class b/it_xml.class index 7dd82c7..bf71031 100644 --- a/it_xml.class +++ b/it_xml.class @@ -332,13 +332,15 @@ function error() * @param values assoc array of key => value pairs. May contain associative or numeric subarrays. */ -function set($vals) +function set($vals, $parentprefix = null) { + $prefix = $parentprefix ? $parentprefix : $this->_p['prefix']; + if (is_array($vals)) { foreach ($vals as $key => $val) { - $classname = $this->_p['prefix'] . $this->_make_identifier($key); + $classname = $prefix . $this->_make_identifier($key); if (!class_exists($classname)) eval("class $classname extends it_xml {}"); @@ -349,7 +351,7 @@ function set($vals) { if (!is_a($arr[$i], "it_xml")) $arr[$i] = new $classname; - $arr[$i]->set($v); + $arr[$i]->set($v, $prefix); } $this->$key = $arr; } @@ -357,7 +359,7 @@ function set($vals) { if (!is_a($this->$key, "it_xml")) $this->$key = new $classname; - $this->$key->set($val); + $this->$key->set($val, $prefix); } } } |