From e3300cc53b9d8cbe096f9847b826ed440c8f1fac Mon Sep 17 00:00:00 2001 From: Karl 'vollmerk' Vollmer Date: Sun, 21 Mar 2010 13:07:00 +0000 Subject: Resolved #39 - slightly differently then provided patch - Adds attribute hack to keyd_array in xmlclass and video xspf support --- lib/class/xmldata.class.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'lib/class/xmldata.class.php') 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[''])) { + $attribute = ' ' . $value['']; + $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\n"; + $string .= "<$key$attribute>\n$value\n\n"; } else { - $string .= "\t<$key>\n"; + $string .= "\t<$key$attribute>\n"; } } // end foreach -- cgit