", "\""), array("&", "<", ">", """), $text); } function read_from_file($path) { return @file_get_contents($path); } //Process request $id = ""; $metadata = ""; if (isset($_SERVER["HTTP_X_CMS_DIRECTORY_ID"])) { $id = $_SERVER["HTTP_X_CMS_DIRECTORY_ID"]; } if (isset($_SERVER["HTTP_X_CMS_DIRECTORY_METADATA"])) { $metadata = $_SERVER["HTTP_X_CMS_DIRECTORY_METADATA"]; } // Respond if (get_magic_quotes_runtime() != 0) { set_magic_quotes_runtime(0); } header("Content-Type: text/xml"); echo ""; echo ""; echo ""; // Process folders if ($id == "") { echo (""); echo (""); echo ("a"); echo (""); echo (""); echo (""); echo (""); echo (""); echo (""); echo ("c"); echo (""); echo ("cms-directory-xhtml-entities.xml"); echo (""); echo (""); /*echo (""); echo (""); echo ("d"); echo (""); echo (""); echo ("flag"); echo ("");*/ } /*echo (""); echo (""); echo ("".xs_xhtml_escape('
')."
"); echo ("pagebreak"); echo ("
"); echo (""); echo (""); echo ("".xs_xhtml_escape('
')."
"); echo ("readmore"); echo ("
");*/ echo ("
"); echo (""); // Process items if ($id == "a") { echo (""); echo (""); echo ("test"); echo ("test"); echo (""); } else if ($id == "b") { //This is an example of how to read XHTML from a file. echo (""); echo (""); echo ("" . xs_xhtml_escape(read_from_file("cms-directory-example-product-1.txt")) . ""); echo (""); echo (""); echo (""); echo (""); echo ("" . xs_xhtml_escape(read_from_file("cms-directory-example-product-2.txt")) . ""); echo (""); echo (""); echo (""); echo (""); echo ("" . xs_xhtml_escape(read_from_file("cms-directory-example-product-3.txt")) . ""); echo (""); echo (""); echo (""); echo (""); echo ("" . xs_xhtml_escape(read_from_file("cms-directory-example-product-4.txt")) . ""); echo (""); echo (""); } else if ($id == "d") { //This is an example of how create XHTML on the fly. echo (""); echo (""); echo ("<p>The current temperature in Vancouver is <temperature location="Vancouver, BC, Canada" title="Placeholder for temperature."/>.</p>"); echo ("thermometer"); echo (""); echo (""); echo (""); echo ("<p>The current stock price for IBM is <stock symbol="IBM" exchange="NYSE" title="Placeholder for stock price." />.</p>"); echo ("certificate"); echo (""); } echo ""; echo "
"; ?>