| [ Index ] |
PHP Cross Reference of Joomla 1.5.26 DE |
[Summary view] [Print] [Text view]
1 <?php 2 /************************************************************************************* 3 ** - Copyright (c) 2006 Belus Technology Inc. 4 ** - 5 ** - By using the software and documentation, the user expressly agrees that 6 ** - the use of the software documentation is at its sole risk. The software 7 ** - and documentation is made available on an "as is" basis. Copyright owner 8 ** - does not warrant that the software and documentation will meet the user's 9 ** - requirements, or that the operation of the software will be uninterrupted 10 ** - or error-free and does not make any warranty whatsoever regarding the 11 ** - software and documentation, any information, services or products provided 12 ** - through or in connection with the software and documentation, or any 13 ** - results to be obtained through the use thereof, and hereby expressly 14 ** - disclaims on behalf of itself and all suppliers any and all warranties, 15 ** - including without limitation: any express or implied warranties of: 16 ** - 1) merchantability; 2) fitness for a particular purpose; 3) effort to 17 ** - achieve purpose; 4) quality; 5) accuracy; 6) non-infringement. Copyright 18 ** - owner shall not be liable to the user, or to any third party, for any loss 19 ** - of data, profits, loss of use, interruption of business, error, omission, 20 ** - deletion, defect, delay in operation or transmission, computer virus, 21 ** - communications line failure, theft or destruction or unauthorized access to, 22 ** - alteration of, or use of records, whether for breach of contract, tortious 23 ** - behavior, negligence, or under any other cause of action. 24 ** - 25 ** - All right, title and interest including, but not limited to, copyright and 26 ** - other intellectual property rights in and to the software and documentation 27 ** - are owned by Copyright owner and the use of or modification to the software 28 ** - and documentation does not pass to the user any title to or any proprietary 29 ** - rights in the software and documentation. 30 ** - 31 ** - Permission is granted to copy, modify and distribute the software and 32 ** - documentation for any purpose and royalty-free, subject to the following: 33 ** - copyright and other intellectual property rights in and to the software and 34 ** - documentation must not be misrepresented and this notice may not be removed 35 ** - from any source distribution of the software or documentation. 36 *************************************************************************************/ 37 38 /**************************************************************************************** 39 ** - Purpose: Directory 40 ** - Version: 1.00 41 ** - Date: 2006-01-30 42 ** - Documentation: http://xstandard.com/xstandard-lite-for-partner-cms/ 43 ****************************************************************************************/ 44 45 // Do not allow direct access 46 defined( '_JEXEC' ) or die( 'Restricted access' ); 47 48 function xs_xhtml_escape($text) { 49 return str_replace(array("&", "<", ">", "\""), array("&", "<", ">", """), $text); 50 } 51 52 function read_from_file($path) { 53 return @file_get_contents($path); 54 } 55 56 57 58 //Process request 59 $id = ""; 60 $metadata = ""; 61 62 if (isset($_SERVER["HTTP_X_CMS_DIRECTORY_ID"])) { 63 $id = $_SERVER["HTTP_X_CMS_DIRECTORY_ID"]; 64 } 65 66 if (isset($_SERVER["HTTP_X_CMS_DIRECTORY_METADATA"])) { 67 $metadata = $_SERVER["HTTP_X_CMS_DIRECTORY_METADATA"]; 68 } 69 70 71 // Respond 72 if (get_magic_quotes_runtime() != 0) { 73 set_magic_quotes_runtime(0); 74 } 75 76 header("Content-Type: text/xml"); 77 echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>"; 78 echo "<library>"; 79 echo "<containers>"; 80 // Process folders 81 if ($id == "") { 82 echo ("<container>"); 83 echo ("<label>Articles</label>"); 84 echo ("<id>a</id>"); 85 echo ("<metadata></metadata>"); 86 echo ("<location></location>"); 87 echo ("<icon></icon>"); 88 echo ("</container>"); 89 echo ("<container>"); 90 echo ("<label>Special Characters & Symbols</label>"); 91 echo ("<id>c</id>"); 92 echo ("<metadata></metadata>"); 93 echo ("<location>cms-directory-xhtml-entities.xml</location>"); 94 echo ("<icon></icon>"); 95 echo ("</container>"); 96 /*echo ("<container>"); 97 echo ("<label>Placeholders</label>"); 98 echo ("<id>d</id>"); 99 echo ("<metadata></metadata>"); 100 echo ("<location></location>"); 101 echo ("<icon>flag</icon>"); 102 echo ("</container>");*/ 103 } 104 /*echo ("<object>"); 105 echo ("<label>Page break placeholder</label>"); 106 echo ("<data>".xs_xhtml_escape('<hr id="system-pagebreak" />')."</data>"); 107 echo ("<icon>pagebreak</icon>"); 108 echo ("</object>"); 109 echo ("<object>"); 110 echo ("<label>Read more placeholder</label>"); 111 echo ("<data>".xs_xhtml_escape('<hr id="system-readmore" />')."</data>"); 112 echo ("<icon>readmore</icon>"); 113 echo ("</object>");*/ 114 echo ("</containers>"); 115 echo ("<objects>"); 116 117 // Process items 118 if ($id == "a") 119 { 120 echo ("<object>"); 121 echo ("<label>test</label>"); 122 echo ("<data>test</data>"); 123 echo ("<icon>test</icon>"); 124 echo ("</object>"); 125 } 126 else if ($id == "b") 127 { 128 //This is an example of how to read XHTML from a file. 129 echo ("<object>"); 130 echo ("<label>Cordless Phone</label>"); 131 echo ("<data>" . xs_xhtml_escape(read_from_file("cms-directory-example-product-1.txt")) . "</data>"); 132 echo ("<icon></icon>"); 133 echo ("</object>"); 134 135 echo ("<object>"); 136 echo ("<label>Hand Vacuum</label>"); 137 echo ("<data>" . xs_xhtml_escape(read_from_file("cms-directory-example-product-2.txt")) . "</data>"); 138 echo ("<icon></icon>"); 139 echo ("</object>"); 140 141 echo ("<object>"); 142 echo ("<label>Toaster</label>"); 143 echo ("<data>" . xs_xhtml_escape(read_from_file("cms-directory-example-product-3.txt")) . "</data>"); 144 echo ("<icon></icon>"); 145 echo ("</object>"); 146 147 echo ("<object>"); 148 echo ("<label>Indoor Grill</label>"); 149 echo ("<data>" . xs_xhtml_escape(read_from_file("cms-directory-example-product-4.txt")) . "</data>"); 150 echo ("<icon></icon>"); 151 echo ("</object>"); 152 } 153 else if ($id == "d") 154 { 155 //This is an example of how create XHTML on the fly. 156 echo ("<object>"); 157 echo ("<label>Temperature</label>"); 158 echo ("<data><p>The current temperature in Vancouver is <temperature location="Vancouver, BC, Canada" title="Placeholder for temperature."/>.</p></data>"); 159 echo ("<icon>thermometer</icon>"); 160 echo ("</object>"); 161 echo ("<object>"); 162 echo ("<label>Stock Price</label>"); 163 echo ("<data><p>The current stock price for IBM is <stock symbol="IBM" exchange="NYSE" title="Placeholder for stock price." />.</p></data>"); 164 echo ("<icon>certificate</icon>"); 165 echo ("</object>"); 166 } 167 echo "</objects>"; 168 echo "</library>"; 169 ?>
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated: Wed Mar 28 15:54:07 2012 | Cross-referenced by PHPXref 0.7.1 |