PageRenderTime 51ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/lib/eztemplate/classes/eztemplateautoload.php

https://github.com/Socrattes2099/ezpublish
PHP | 206 lines | 147 code | 25 blank | 34 comment | 0 complexity | 37c67c54a1ec8c86e81d6afe14a36012 MD5 | raw file
  1. <?php
  2. //
  3. // Created on: <05-Oct-2002 20:15:32 amos>
  4. //
  5. // ## BEGIN COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
  6. // SOFTWARE NAME: eZ Publish
  7. // SOFTWARE RELEASE: 4.1.x
  8. // COPYRIGHT NOTICE: Copyright (C) 1999-2010 eZ Systems AS
  9. // SOFTWARE LICENSE: GNU General Public License v2.0
  10. // NOTICE: >
  11. // This program is free software; you can redistribute it and/or
  12. // modify it under the terms of version 2.0 of the GNU General
  13. // Public License as published by the Free Software Foundation.
  14. //
  15. // This program is distributed in the hope that it will be useful,
  16. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. // GNU General Public License for more details.
  19. //
  20. // You should have received a copy of version 2.0 of the GNU General
  21. // Public License along with this program; if not, write to the Free
  22. // Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
  23. // MA 02110-1301, USA.
  24. //
  25. //
  26. // ## END COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
  27. //
  28. /*! \file
  29. */
  30. // Operator autoloading
  31. $eZTemplateOperatorArray = array();
  32. $eZTemplateOperatorArray[] = array( 'class' => 'eZTemplateArrayOperator',
  33. 'operator_names' => array( 'array',
  34. 'hash',
  35. 'array_prepend', // DEPRECATED/OBSOLETE
  36. 'prepend', // New,replaces array_prepend.
  37. 'array_append', // DEPRECATED/OBSOLETE
  38. 'append', // New,replaces array_append.
  39. 'array_merge', // DEPRECATED/OBSOLETE
  40. 'merge', // New,replaces array_merge.
  41. 'contains',
  42. 'compare',
  43. 'extract',
  44. 'extract_left',
  45. 'extract_right',
  46. 'begins_with',
  47. 'ends_with',
  48. 'implode',
  49. 'explode',
  50. 'repeat',
  51. 'reverse',
  52. 'insert',
  53. 'remove',
  54. 'replace',
  55. 'unique',
  56. 'array_sum'
  57. ) );
  58. $eZTemplateOperatorArray[] = array( 'class' => 'eZTemplateExecuteOperator',
  59. 'operator_names' => array( 'fetch', 'fetch_alias' ) );
  60. $eZTemplateOperatorArray[] = array( 'class' => 'eZTemplateLocaleOperator',
  61. 'operator_names' => array( 'l10n', 'locale', 'datetime', 'currentdate', 'maketime', 'makedate', 'gettime' ) );
  62. $eZTemplateOperatorArray[] = array( 'class' => 'eZTemplateAttributeOperator',
  63. 'operator_names' => array( 'attribute' ) );
  64. $eZTemplateOperatorArray[] = array( 'class' => 'eZTemplateNl2BrOperator',
  65. 'operator_names' => array( 'nl2br' ) );
  66. $eZTemplateOperatorArray[] = array( 'class' => 'eZTemplateTextOperator',
  67. 'operator_names' => array( 'concat', 'indent' ) );
  68. $eZTemplateOperatorArray[] = array( 'class' => 'eZTemplateUnitOperator',
  69. 'operator_names' => array( 'si' ) );
  70. $eZTemplateOperatorArray[] = array( 'class' => 'eZTemplateLogicOperator',
  71. 'operator_names' => array( 'lt', 'gt', 'le',
  72. 'ge', 'eq', 'ne', 'null',
  73. 'not', 'true', 'false',
  74. 'or', 'and', 'choose' ) );
  75. $eZTemplateOperatorArray[] = array( 'class' => 'eZTemplateTypeOperator',
  76. 'operator_names' => array( 'is_array', 'is_boolean', 'is_integer',
  77. 'is_float', 'is_numeric', 'is_string',
  78. 'is_object', 'is_class', 'is_null',
  79. 'is_set', 'is_unset', 'get_type', 'get_class' ) );
  80. $eZTemplateOperatorArray[] = array( 'class' => 'eZTemplateControlOperator',
  81. 'operator_names' => array( 'cond', 'first_set' ) );
  82. $eZTemplateOperatorArray[] = array( 'class' => 'eZTemplateArithmeticOperator',
  83. 'operator_names' => array( 'sum', 'sub', 'inc', 'dec',
  84. 'div', 'mod', 'mul',
  85. 'max', 'min',
  86. 'abs', 'ceil', 'floor', 'round',
  87. 'int', 'float',
  88. 'count',
  89. 'roman',
  90. 'rand' ) );
  91. $eZTemplateOperatorArray[] = array( 'class' => 'eZTemplateImageOperator',
  92. 'operator_names' => array( 'texttoimage',
  93. 'image',
  94. 'imagefile' ) );
  95. $eZTemplateOperatorArray[] = array( 'class' => 'eZTemplateStringOperator',
  96. 'operator_names' => array( 'upcase',
  97. 'downcase',
  98. 'count_words',
  99. 'count_chars',
  100. 'trim',
  101. 'break',
  102. 'wrap',
  103. 'upfirst',
  104. 'upword',
  105. 'simplify',
  106. 'trim',
  107. 'wash',
  108. 'chr',
  109. 'ord',
  110. 'shorten',
  111. 'pad') );
  112. $eZTemplateOperatorArray[] = array( 'class' => 'eZTemplateDigestOperator',
  113. 'operator_names' => array( 'crc32',
  114. 'md5',
  115. 'rot13', ) );
  116. // Function autoloading
  117. $eZTemplateFunctionArray = array();
  118. $eZTemplateFunctionArray[] = array( 'class' => 'eZTemplateSectionFunction',
  119. 'function_names' => array( 'section' ),
  120. 'function_attributes' => array( 'delimiter',
  121. 'section-exclude',
  122. 'section-include',
  123. 'section-else' ) );
  124. $eZTemplateFunctionArray[] = array( 'class' => 'eZTemplateDelimitFunction',
  125. 'function_names' => array( 'ldelim', 'rdelim' ) );
  126. $eZTemplateFunctionArray[] = array( 'class' => 'eZTemplateIncludeFunction',
  127. 'function_names' => array( 'include' ) );
  128. $eZTemplateFunctionArray[] = array( 'class' => 'eZTemplateSwitchFunction',
  129. 'function_names' => array( 'switch' ),
  130. 'function_attributes' => array( 'case' ) );
  131. $eZTemplateFunctionArray[] = array( 'class' => 'eZTemplateSequenceFunction',
  132. 'function_names' => array( 'sequence' ) );
  133. $eZTemplateFunctionArray[] = array( 'class' => 'eZTemplateSetFunction',
  134. 'function_names' => array( 'set', 'let', 'default' ) );
  135. $eZTemplateFunctionArray[] = array( 'class' => 'eZTemplateBlockFunction',
  136. 'function_names' => array( 'set-block', 'append-block', 'run-once' ) );
  137. $eZTemplateFunctionArray[] = array( 'class' => 'eZTemplateDebugFunction',
  138. 'function_names' => array( 'debug-timing-point', 'debug-accumulator',
  139. 'debug-log',
  140. 'debug-trace' ) );
  141. $eZTemplateFunctionArray[] = array( 'class' => 'eZTemplateCacheFunction',
  142. 'function_names' => array( 'cache-block' ) );
  143. $eZTemplateFunctionArray[] = array( 'class' => 'eZTemplateToolbarFunction',
  144. 'function_names' => array( 'tool_bar' ) );
  145. $eZTemplateFunctionArray[] = array( 'class' => 'eZTemplateMenuFunction',
  146. 'function_names' => array( 'menu' ) );
  147. // should we add 'break', 'continue' and 'skip' to the {if} attribute list?
  148. $eZTemplateFunctionArray[] = array( 'class' => 'eZTemplateIfFunction',
  149. 'function_names' => array( 'if' ),
  150. 'function_attributes' => array( 'elseif',
  151. 'else' ) );
  152. $eZTemplateFunctionArray[] = array( 'class' => 'eZTemplateWhileFunction',
  153. 'function_names' => array( 'while' ),
  154. 'function_attributes' => array( 'delimiter',
  155. 'break',
  156. 'continue',
  157. 'skip' ) );
  158. $eZTemplateFunctionArray[] = array( 'class' => 'eZTemplateForFunction',
  159. 'function_names' => array( 'for' ),
  160. 'function_attributes' => array( 'delimiter',
  161. 'break',
  162. 'continue',
  163. 'skip' ) );
  164. $eZTemplateFunctionArray[] = array( 'class' => 'eZTemplateForeachFunction',
  165. 'function_names' => array( 'foreach' ),
  166. 'function_attributes' => array( 'delimiter',
  167. 'break',
  168. 'continue',
  169. 'skip' ) );
  170. $eZTemplateFunctionArray[] = array( 'class' => 'eZTemplateDoFunction',
  171. 'function_names' => array( 'do' ),
  172. 'function_attributes' => array( 'delimiter',
  173. 'break',
  174. 'continue',
  175. 'skip' ) );
  176. $eZTemplateFunctionArray[] = array( 'class' => 'eZTemplateDefFunction',
  177. 'function_names' => array( 'def', 'undef' ) );
  178. // eZTemplatePHPOperator is not autoload due to it's generic use
  179. // it's up to the users of eZTemplate to initiate a proper usage
  180. // for this operator class.
  181. ?>