omni: online wallpaper scripts

added script "json_wallpapers_xml" that adds info about existing
wallpapers from wallpapers.xml to json

maxwen: Changed json_wallpapers_xml to also inclcude files that have
no entry in wallpapers.xml unless we have some scripting in place
that makes sure we always upload a consistent set

Change-Id: I1e31feaf3d5fdaa24d99b9010746265e6440e7e1
diff --git a/prebuilt/wallpapers/json.php b/prebuilt/wallpapers/json.php
new file mode 100644
index 0000000..1418c78
--- /dev/null
+++ b/prebuilt/wallpapers/json.php
@@ -0,0 +1,30 @@
+<?php
+
+function list_files($path) {
+	$output = array();
+	$files = scandir($path);
+	if ($path == "./_h5ai" || $path == "./.bak") return $output;
+
+	foreach ($files as $file) {
+		if ($file == "." || $file == ".." || strpos($file, '.html')
+			|| $file == ".bak" || $file == "_h5ai") {
+			continue;
+		}
+
+		if (is_dir($path.'/'.$file)) {
+		} else {
+			$output[] = array("filename"=>$file, "timestamp"=>filemtime($path.'/'.$file));
+		}
+	}
+
+	return $output;
+}
+
+//chdir("../");
+echo json_encode(list_files("."));
+
+
+
+
+?>
+