Пример #1
0
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));
Пример #2
0
     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>&lt;p&gt;The current temperature in Vancouver is &lt;temperature location=&quot;Vancouver, BC, Canada&quot; title=&quot;Placeholder for temperature.&quot;/&gt;.&lt;/p&gt;</data>";
         echo "<icon>thermometer</icon>";
         echo "</object>";
         echo "<object>";
         echo "<label>Stock Price</label>";
         echo "<data>&lt;p&gt;The current stock price for IBM is &lt;stock symbol=&quot;IBM&quot; exchange=&quot;NYSE&quot; title=&quot;Placeholder for stock price.&quot; /&gt;.&lt;/p&gt;</data>";
         echo "<icon>certificate</icon>";
         echo "</object>";