natcasesort($file_list); reset($file_list); foreach ($file_list as $key => $fs_object) { echo "<object>"; //Folder name echo "<objectName>" . xs_xhtml_escape($fs_object) . "</objectName>"; //Path to parent folder echo "<path>"; if (isset($_SERVER["HTTP_X_CMS_LIBRARY_PATH"])) { if ($_SERVER["HTTP_X_CMS_LIBRARY_PATH"] != "") { echo xs_xhtml_escape($_SERVER["HTTP_X_CMS_LIBRARY_PATH"]); } } echo "</path>"; //Display label echo "<label>" . xs_xhtml_escape($fs_object) . "</label>"; //Icon ID defined in icons.xml echo "<icon>document</icon>"; //Reserved for future use echo "<metadata></metadata>"; //Reserved for future use echo "<options>0</options>"; //Attributes echo "<attrs>"; //src attribute echo "<attr>"; echo "<name>href</name>"; echo "<value>"; if (isset($_SERVER["HTTP_X_CMS_LIBRARY_PATH"])) { if ($_SERVER["HTTP_X_CMS_LIBRARY_PATH"] == "") { echo xs_build_path(XS_BASE_URL, xs_urlencode($fs_object));
echo "<data>" . xs_xhtml_escape(read_from_file("cms-directory-example-product-1.txt")) . "</data>"; echo "<icon></icon>"; echo "</object>"; echo "<object>"; echo "<label>Hand Vacuum</label>"; echo "<data>" . xs_xhtml_escape(read_from_file("cms-directory-example-product-2.txt")) . "</data>"; echo "<icon></icon>"; echo "</object>"; echo "<object>"; echo "<label>Toaster</label>"; echo "<data>" . xs_xhtml_escape(read_from_file("cms-directory-example-product-3.txt")) . "</data>"; echo "<icon></icon>"; echo "</object>"; echo "<object>"; echo "<label>Indoor Grill</label>"; echo "<data>" . xs_xhtml_escape(read_from_file("cms-directory-example-product-4.txt")) . "</data>"; echo "<icon></icon>"; echo "</object>"; } else { if ($id == "d") { //This is an example of how create XHTML on the fly. echo "<object>"; echo "<label>Temperature</label>"; echo "<data><p>The current temperature in Vancouver is <temperature location="Vancouver, BC, Canada" title="Placeholder for temperature."/>.</p></data>"; echo "<icon>thermometer</icon>"; echo "</object>"; echo "<object>"; echo "<label>Stock Price</label>"; echo "<data><p>The current stock price for IBM is <stock symbol="IBM" exchange="NYSE" title="Placeholder for stock price." />.</p></data>"; echo "<icon>certificate</icon>"; echo "</object>";