diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2006-10-09 09:00:47 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2006-10-09 09:00:47 +0000 |
commit | f79a2489c1f18f2bf1436fa5ec4c8fd9c903fd61 (patch) | |
tree | 97952ac522a9f0376623e5aa868141e5d9b3a821 /lib/ui.lib.php | |
parent | 78590d7d512ada604987fdcc9c31a8c74591f64b (diff) | |
download | ampache-f79a2489c1f18f2bf1436fa5ec4c8fd9c903fd61.tar.gz ampache-f79a2489c1f18f2bf1436fa5ec4c8fd9c903fd61.tar.bz2 ampache-f79a2489c1f18f2bf1436fa5ec4c8fd9c903fd61.zip |
updates, ajax kind of broken right now its late
Diffstat (limited to 'lib/ui.lib.php')
-rw-r--r-- | lib/ui.lib.php | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/ui.lib.php b/lib/ui.lib.php index e30db5ec..7b93b37e 100644 --- a/lib/ui.lib.php +++ b/lib/ui.lib.php @@ -1334,5 +1334,29 @@ function get_user_icon($name) { } // show_icon +/** + * xml_from_array + * This takes a one dimensional array and + * creates a XML document form it for use + * primarly by the ajax mojo + */ +function xml_from_array($array) { + + $escape_array = array ('<','&'); + $replace_array = array('<','&'); + + $string = "<root>\n"; + foreach ($array as $key=>$value) { + /* We need to escape the value */ + $value = str_replace($escape_array,$replace_array,$value); + $string .= "\t<$key>$value</$key>\n"; + } + $string .= "</root>\n"; + + return $string; + +} // xml_from_array + + ?> |