diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2010-03-21 13:07:00 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2010-03-21 13:07:00 +0000 |
commit | e3300cc53b9d8cbe096f9847b826ed440c8f1fac (patch) | |
tree | 56063c27ba22012eb6008304b4a56929333acd1c /lib/class/xmldata.class.php | |
parent | 81b874d4066e69dd246a01044e911a15fa10e335 (diff) | |
download | ampache-e3300cc53b9d8cbe096f9847b826ed440c8f1fac.tar.gz ampache-e3300cc53b9d8cbe096f9847b826ed440c8f1fac.tar.bz2 ampache-e3300cc53b9d8cbe096f9847b826ed440c8f1fac.zip |
Resolved #39 - slightly differently then provided patch - Adds attribute hack to keyd_array in xmlclass and video xspf support
Diffstat (limited to 'lib/class/xmldata.class.php')
-rw-r--r-- | lib/class/xmldata.class.php | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/class/xmldata.class.php b/lib/class/xmldata.class.php index 10690670..26015f1f 100644 --- a/lib/class/xmldata.class.php +++ b/lib/class/xmldata.class.php @@ -151,13 +151,20 @@ class xmlData { // Foreach it foreach ($array as $key=>$value) { + + // See if the key has attributes + if (is_array($value) AND isset($value['<attributes>'])) { + $attribute = ' ' . $value['<attributes>']; + $key = $value['value']; + } + // If it's an array, run again if (is_array($value)) { $value = self::keyed_array($value,1); - $string .= "<$key>\n$value\n</$key>\n"; + $string .= "<$key$attribute>\n$value\n</$key>\n"; } else { - $string .= "\t<$key><![CDATA[$value]]></$key>\n"; + $string .= "\t<$key$attribute><![CDATA[$value]]></$key>\n"; } } // end foreach |