A Qcodo based CMS/ecommerce framework
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

245 lines
14 KiB

13 years ago
  1. <?php
  2. /* Unless otherwise specified, all files in the Qcodo Development Framework
  3. * are under the following copyright and licensing policies:
  4. *
  5. * Qcodo Development Framework for PHP
  6. * http://www.qcodo.com/
  7. *
  8. * The Qcodo Development Framework is distributed by Quasidea Development, LLC
  9. * under the terms of The MIT License. More information can be found at
  10. * http://www.opensource.org/licenses/mit-license.php
  11. *
  12. * Copyright (c) 2001 - 2007, Quasidea Development, LLC
  13. *
  14. * Permission is hereby granted, free of charge, to any person obtaining a copy of
  15. * this software and associated documentation files (the "Software"), to deal in
  16. * the Software without restriction, including without limitation the rights to
  17. * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
  18. * of the Software, and to permit persons to whom the Software is furnished to do
  19. * so, subject to the following conditions:
  20. *
  21. * The above copyright notice and this permission notice shall be included in all
  22. * copies or substantial portions of the Software.
  23. *
  24. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  25. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  26. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  27. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  28. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  29. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  30. * SOFTWARE.
  31. */
  32. // Versioning Information
  33. define('QCODO_VERSION', '0.3.43 (Qcodo Beta 3)');
  34. // Preload Required Framework Classes
  35. require(__QCODO_CORE__ . '/framework/QBaseClass.class.php');
  36. require(__QCODO_CORE__ . '/framework/QExceptions.class.php');
  37. require(__QCODO_CORE__ . '/framework/QType.class.php');
  38. require(__QCODO_CORE__ . '/framework/QApplicationBase.class.php');
  39. // Setup the Error Handler
  40. require(__QCODO_CORE__ . '/error.inc.php');
  41. // Setup the Autoloader
  42. if (!defined("QUASICMS")){
  43. function __autoload($strClassName) {
  44. QApplication::Autoload($strClassName);
  45. }
  46. }
  47. // Start Output Buffering
  48. function __ob_callback($strBuffer) {
  49. return QApplication::OutputPage($strBuffer);
  50. }
  51. ob_start('__ob_callback');
  52. // Qcodo Signature
  53. header(sprintf('X-Powered-By: PHP/%s; Qcodo/%s', PHP_VERSION, QCODO_VERSION));
  54. // Preload Other Framework Classes
  55. require(__QCODO_CORE__ . '/framework/QDatabaseBase.class.php');
  56. if (version_compare(PHP_VERSION, '5.2.0', '<'))
  57. // Use the Legacy (Pre-5.2.0) QDateTime class
  58. require(__QCODO_CORE__ . '/framework/QDateTime.legacy.class.php');
  59. else
  60. // Use the New QDateTime class (which extends PHP DateTime)
  61. require(__QCODO_CORE__ . '/framework/QDateTime.class.php');
  62. // Define Classes to be Preloaded on QApplication::Initialize()
  63. QApplicationBase::$PreloadedClassFile['_enumerations'] = __QCODO_CORE__ . '/qform/_enumerations.inc.php';
  64. QApplicationBase::$PreloadedClassFile['qcontrolbase'] = __QCODO_CORE__ . '/qform/QControlBase.class.php';
  65. QApplicationBase::$PreloadedClassFile['qcontrol'] = __QCODO__ . '/qform/QControl.class.php';
  66. QApplicationBase::$PreloadedClassFile['qformbase'] = __QCODO_CORE__ . '/qform/QFormBase.class.php';
  67. QApplicationBase::$PreloadedClassFile['qform'] = __QCODO__ . '/qform/QForm.class.php';
  68. QApplicationBase::$PreloadedClassFile['_actions'] = __QCODO_CORE__ . '/qform/_actions.inc.php';
  69. QApplicationBase::$PreloadedClassFile['_events'] = __QCODO_CORE__ . '/qform/_events.inc.php';
  70. QApplicationBase::$PreloadedClassFile['qq'] = __QCODO_CORE__ . '/framework/QQuery.class.php';
  71. // Define ClassFile Locations for FormState Handlers
  72. QApplicationBase::$ClassFile['qformstatehandler'] = __QCODO_CORE__ . '/qform_state_handlers/QFormStateHandler.class.php';
  73. QApplicationBase::$ClassFile['qsessionformstatehandler'] = __QCODO_CORE__ . '/qform_state_handlers/QSessionFormStateHandler.class.php';
  74. QApplicationBase::$ClassFile['qfileformstatehandler'] = __QCODO_CORE__ . '/qform_state_handlers/QFileFormStateHandler.class.php';
  75. // Define ClassFile Locations for Framework Classes
  76. QApplicationBase::$ClassFile['qrssfeed'] = __QCODO_CORE__ . '/framework/QRssFeed.class.php';
  77. QApplicationBase::$ClassFile['qrssimage'] = __QCODO_CORE__ . '/framework/QRssFeed.class.php';
  78. QApplicationBase::$ClassFile['qrsscategory'] = __QCODO_CORE__ . '/framework/QRssFeed.class.php';
  79. QApplicationBase::$ClassFile['qrssitem'] = __QCODO_CORE__ . '/framework/QRssFeed.class.php';
  80. QApplicationBase::$ClassFile['qemailserver'] = __QCODO_CORE__ . '/framework/QEmailServer.class.php';
  81. QApplicationBase::$ClassFile['qemailmessage'] = __QCODO_CORE__ . '/framework/QEmailServer.class.php';
  82. QApplicationBase::$ClassFile['qmimetype'] = __QCODO_CORE__ . '/framework/QMimeType.class.php';
  83. QApplicationBase::$ClassFile['qdatetime'] = __QCODO_CORE__ . '/framework/QDateTime.class.php';
  84. QApplicationBase::$ClassFile['qstring'] = __QCODO_CORE__ . '/framework/QString.class.php';
  85. QApplicationBase::$ClassFile['qstack'] = __QCODO_CORE__ . '/framework/QStack.class.php';
  86. QApplicationBase::$ClassFile['qcryptography'] = __QCODO_CORE__ . '/framework/QCryptography.class.php';
  87. QApplicationBase::$ClassFile['qsoapservice'] = __QCODO_CORE__ . '/framework/QSoapService.class.php';
  88. QApplicationBase::$ClassFile['qi18n'] = __QCODO_CORE__ . '/framework/QI18n.class.php';
  89. QApplicationBase::$ClassFile['qqn'] = __DATAGEN_CLASSES__ . '/QQN.class.php';
  90. QApplicationBase::$ClassFile['qqueryexpansion'] = __QCODO_CORE__ . '/framework/QQueryExpansion.class.php';
  91. QApplicationBase::$ClassFile['qconvertnotation'] = __QCODO__ . '/codegen/QConvertNotation.class.php';
  92. QApplicationBase::$ClassFile['qlexer'] = __QCODO_CORE__ . '/framework/QLexer.class.php';
  93. QApplicationBase::$ClassFile['qregex'] = __QCODO_CORE__ . '/framework/QRegex.class.php';
  94. QApplicationBase::$ClassFile['qcache'] = __QCODO_CORE__ . '/framework/QCache.class.php';
  95. QApplicationBase::$ClassFile['qdatetimespan'] = __QCODO_CORE__ . '/framework/QDateTimeSpan.class.php';
  96. // Define ClassFile Locations for Qform Classes
  97. QApplicationBase::$ClassFile['qfontfamily'] = __QCODO_CORE__ . '/qform/QFontFamily.class.php';
  98. QApplicationBase::$ClassFile['qcalendar'] = __QCODO_CORE__ . '/qform/QCalendar.class.php';
  99. QApplicationBase::$ClassFile['qcalendarpopup'] = __QCODO_CORE__ . '/qform/QCalendarPopup.class.php';
  100. QApplicationBase::$ClassFile['qdatetimepicker'] = __QCODO_CORE__ . '/qform/QDateTimePicker.class.php';
  101. QApplicationBase::$ClassFile['qdatetimetextbox'] = __QCODO_CORE__ . '/qform/QDateTimeTextBox.class.php';
  102. QApplicationBase::$ClassFile['qcheckbox'] = __QCODO_CORE__ . '/qform/QCheckBox.class.php';
  103. QApplicationBase::$ClassFile['qfilecontrol'] = __QCODO_CORE__ . '/qform/QFileControl.class.php';
  104. QApplicationBase::$ClassFile['qradiobutton'] = __QCODO_CORE__ . '/qform/QRadioButton.class.php';
  105. QApplicationBase::$ClassFile['qblockcontrol'] = __QCODO_CORE__ . '/qform/QBlockControl.class.php';
  106. QApplicationBase::$ClassFile['qlabel'] = __QCODO_CORE__ . '/qform/QLabel.class.php';
  107. QApplicationBase::$ClassFile['qpanel'] = __QCODO_CORE__ . '/qform/QPanel.class.php';
  108. QApplicationBase::$ClassFile['qcontrolproxy'] = __QCODO_CORE__ . '/qform/QControlProxy.class.php';
  109. QApplicationBase::$ClassFile['qdialogbox'] = __QCODO_CORE__ . '/qform/QDialogBox.class.php';
  110. QApplicationBase::$ClassFile['qimagebase'] = __QCODO_CORE__ . '/qform/QImageBase.class.php';
  111. QApplicationBase::$ClassFile['qimagelabelbase'] = __QCODO_CORE__ . '/qform/QImageLabelBase.class.php';
  112. QApplicationBase::$ClassFile['qimagelabel'] = __QCODO__ . '/qform/QImageLabel.class.php';
  113. QApplicationBase::$ClassFile['qimagecontrolbase'] = __QCODO_CORE__ . '/qform/QImageControlBase.class.php';
  114. QApplicationBase::$ClassFile['qimagecontrol'] = __QCODO__ . '/qform/QImageControl.class.php';
  115. QApplicationBase::$ClassFile['qimagerollover'] = __QCODO_CORE__ . '/qform/QImageRollover.class.php';
  116. QApplicationBase::$ClassFile['qfileasset'] = __QCODO__ . '/qform/QFileAsset.class.php';
  117. QApplicationBase::$ClassFile['qfileassetbase'] = __QCODO_CORE__ . '/qform/QFileAssetBase.class.php';
  118. QApplicationBase::$ClassFile['qfileassetdialog'] = __QCODO_CORE__ . '/qform/QFileAssetDialog.class.php';
  119. QApplicationBase::$ClassFile['qcontrollabel'] = __QCODO_CORE__ . '/qform/QControlLabel.class.php';
  120. QApplicationBase::$ClassFile['qactioncontrol'] = __QCODO_CORE__ . '/qform/QActionControl.class.php';
  121. QApplicationBase::$ClassFile['qbuttonbase'] = __QCODO_CORE__ . '/qform/QButtonBase.class.php';
  122. QApplicationBase::$ClassFile['qbutton'] = __QCODO__ . '/qform/QButton.class.php';
  123. QApplicationBase::$ClassFile['qimagebutton'] = __QCODO_CORE__ . '/qform/QImageButton.class.php';
  124. QApplicationBase::$ClassFile['qlinkbutton'] = __QCODO_CORE__ . '/qform/QLinkButton.class.php';
  125. QApplicationBase::$ClassFile['qlistcontrol'] = __QCODO_CORE__ . '/qform/QListControl.class.php';
  126. QApplicationBase::$ClassFile['qlistitem'] = __QCODO_CORE__ . '/qform/QListItem.class.php';
  127. QApplicationBase::$ClassFile['qlistboxbase'] = __QCODO_CORE__ . '/qform/QListBoxBase.class.php';
  128. QApplicationBase::$ClassFile['qlistbox'] = __QCODO__ . '/qform/QListBox.class.php';
  129. QApplicationBase::$ClassFile['qlistitemstyle'] = __QCODO_CORE__ . '/qform/QListItemStyle.class.php';
  130. QApplicationBase::$ClassFile['qcheckboxlist'] = __QCODO_CORE__ . '/qform/QCheckBoxList.class.php';
  131. QApplicationBase::$ClassFile['qradiobuttonlist'] = __QCODO_CORE__ . '/qform/QRadioButtonList.class.php';
  132. QApplicationBase::$ClassFile['qtreenav'] = __QCODO_CORE__ . '/qform/QTreeNav.class.php';
  133. QApplicationBase::$ClassFile['qtreenavitem'] = __QCODO_CORE__ . '/qform/QTreeNavItem.class.php';
  134. QApplicationBase::$ClassFile['qtextboxbase'] = __QCODO_CORE__ . '/qform/QTextBoxBase.class.php';
  135. QApplicationBase::$ClassFile['qtextbox'] = __QCODO__ . '/qform/QTextBox.class.php';
  136. QApplicationBase::$ClassFile['qfloattextbox'] = __QCODO_CORE__ . '/qform/QFloatTextBox.class.php';
  137. QApplicationBase::$ClassFile['qintegertextbox'] = __QCODO_CORE__ . '/qform/QIntegerTextBox.class.php';
  138. QApplicationBase::$ClassFile['qwritebox'] = __QCODO_CORE__ . '/qform/QWriteBox.class.php';
  139. QApplicationBase::$ClassFile['qpaginatedcontrol'] = __QCODO_CORE__ . '/qform/QPaginatedControl.class.php';
  140. QApplicationBase::$ClassFile['qpaginatorbase'] = __QCODO_CORE__ . '/qform/QPaginatorBase.class.php';
  141. QApplicationBase::$ClassFile['qpaginator'] = __QCODO__ . '/qform/QPaginator.class.php';
  142. QApplicationBase::$ClassFile['qdatagridbase'] = __QCODO_CORE__ . '/qform/QDataGridBase.class.php';
  143. QApplicationBase::$ClassFile['qdatagridcolumn'] = __QCODO_CORE__ . '/qform/QDataGridColumn.class.php';
  144. QApplicationBase::$ClassFile['qdatagridrowstyle'] = __QCODO_CORE__ . '/qform/QDataGridRowStyle.class.php';
  145. QApplicationBase::$ClassFile['qdatagrid'] = __QCODO__ . '/qform/QDataGrid.class.php';
  146. QApplicationBase::$ClassFile['qdatarepeater'] = __QCODO_CORE__ . '/qform/QDataRepeater.class.php';
  147. QApplicationBase::$ClassFile['qwaiticon'] = __QCODO_CORE__ . '/qform/QWaitIcon.class.php';
  148. QApplicationBase::$ClassFile['qcontrolgrouping'] = __QCODO_CORE__ . '/qform/QControlGrouping.class.php';
  149. QApplicationBase::$ClassFile['qdropzonegrouping'] = __QCODO_CORE__ . '/qform/QDropZoneGrouping.class.php';
  150. if (__DATAGEN_CLASSES__) {
  151. @include(__DATAGEN_CLASSES__ . '/_class_paths.inc.php');
  152. @include(__DATAGEN_CLASSES__ . '/_type_class_paths.inc.php');
  153. }
  154. // Special Print Functions / Shortcuts
  155. // NOTE: These are simply meant to be shortcuts to actual Qcodo functional
  156. // calls to make your templates a little easier to read. By no means do you have to
  157. // use them. Your templates can just as easily make the fully-named method/function calls.
  158. /**
  159. * Standard Print function. To aid with possible cross-scripting vulnerabilities,
  160. * this will automatically perform QApplication::HtmlEntities() unless otherwise specified.
  161. *
  162. * @param string $strString string value to print
  163. * @param boolean $blnHtmlEntities perform HTML escaping on the string first
  164. */
  165. function _p($strString, $blnHtmlEntities = true) {
  166. // Standard Print
  167. if ($blnHtmlEntities && (gettype($strString) != 'object'))
  168. print(QApplication::HtmlEntities($strString));
  169. else
  170. print($strString);
  171. }
  172. /**
  173. * Standard Print as Block function. To aid with possible cross-scripting vulnerabilities,
  174. * this will automatically perform QApplication::HtmlEntities() unless otherwise specified.
  175. *
  176. * Difference between _b() and _p() is that _b() will convert any linebreaks to <br/> tags.
  177. * This allows _b() to print any "block" of text that will have linebreaks in standard HTML.
  178. *
  179. * @param string $strString
  180. * @param boolean $blnHtmlEntities
  181. */
  182. function _b($strString, $blnHtmlEntities = true) {
  183. // Text Block Print
  184. if ($blnHtmlEntities && (gettype($strString) != 'object'))
  185. print(nl2br(QApplication::HtmlEntities($strString)));
  186. else
  187. print(nl2br($strString));
  188. }
  189. /**
  190. * Standard Print-Translated function. Note: Because translation typically
  191. * occurs on coded text strings, NO HTML ESCAPING will be performed on the string.
  192. *
  193. * Uses QApplication::Translate() to perform the translation (if applicable)
  194. *
  195. * @param string $strString string value to print via translation
  196. */
  197. function _t($strString) {
  198. // Print, via Translation (if applicable)
  199. print(QApplication::Translate($strString));
  200. }
  201. function _i($intNumber) {
  202. // Not Yet Implemented
  203. // Print Integer with Localized Formatting
  204. }
  205. function _f($intNumber) {
  206. // Not Yet Implemented
  207. // Print Float with Localized Formatting
  208. }
  209. function _c($strString) {
  210. // Not Yet Implemented
  211. // Print Currency with Localized Formatting
  212. }
  213. //////////////////////////////////////
  214. ?>