PageRenderTime 41ms CodeModel.GetById 14ms RepoModel.GetById 0ms app.codeStats 0ms

/lib/eztemplate/classes/eztemplateautoload.php

https://bitbucket.org/crevillo/enetcall
PHP | 183 lines | 147 code | 24 blank | 12 comment | 0 complexity | e0d13a0c97ee256930a898ac4b0fcf3a MD5 | raw file
Possible License(s): GPL-2.0, BSD-3-Clause, LGPL-2.1
  1. <?php
  2. /**
  3. * @copyright Copyright (C) 1999-2012 eZ Systems AS. All rights reserved.
  4. * @license http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License v2
  5. * @version 2012.4
  6. * @package lib
  7. */
  8. // Operator autoloading
  9. $eZTemplateOperatorArray = array();
  10. $eZTemplateOperatorArray[] = array( 'class' => 'eZTemplateArrayOperator',
  11. 'operator_names' => array( 'array',
  12. 'hash',
  13. 'array_prepend', // DEPRECATED/OBSOLETE
  14. 'prepend', // New,replaces array_prepend.
  15. 'array_append', // DEPRECATED/OBSOLETE
  16. 'append', // New,replaces array_append.
  17. 'array_merge', // DEPRECATED/OBSOLETE
  18. 'merge', // New,replaces array_merge.
  19. 'contains',
  20. 'compare',
  21. 'extract',
  22. 'extract_left',
  23. 'extract_right',
  24. 'begins_with',
  25. 'ends_with',
  26. 'implode',
  27. 'explode',
  28. 'repeat',
  29. 'reverse',
  30. 'insert',
  31. 'remove',
  32. 'replace',
  33. 'unique',
  34. 'array_sum'
  35. ) );
  36. $eZTemplateOperatorArray[] = array( 'class' => 'eZTemplateExecuteOperator',
  37. 'operator_names' => array( 'fetch', 'fetch_alias' ) );
  38. $eZTemplateOperatorArray[] = array( 'class' => 'eZTemplateLocaleOperator',
  39. 'operator_names' => array( 'l10n', 'locale', 'datetime', 'currentdate', 'maketime', 'makedate', 'gettime' ) );
  40. $eZTemplateOperatorArray[] = array( 'class' => 'eZTemplateAttributeOperator',
  41. 'operator_names' => array( 'attribute', 'dump' ) );
  42. $eZTemplateOperatorArray[] = array( 'class' => 'eZTemplateNl2BrOperator',
  43. 'operator_names' => array( 'nl2br' ) );
  44. $eZTemplateOperatorArray[] = array( 'class' => 'eZTemplateTextOperator',
  45. 'operator_names' => array( 'concat', 'indent' ) );
  46. $eZTemplateOperatorArray[] = array( 'class' => 'eZTemplateUnitOperator',
  47. 'operator_names' => array( 'si' ) );
  48. $eZTemplateOperatorArray[] = array( 'class' => 'eZTemplateLogicOperator',
  49. 'operator_names' => array( 'lt', 'gt', 'le',
  50. 'ge', 'eq', 'ne', 'null',
  51. 'not', 'true', 'false',
  52. 'or', 'and', 'choose' ) );
  53. $eZTemplateOperatorArray[] = array( 'class' => 'eZTemplateTypeOperator',
  54. 'operator_names' => array( 'is_array', 'is_boolean', 'is_integer',
  55. 'is_float', 'is_numeric', 'is_string',
  56. 'is_object', 'is_class', 'is_null',
  57. 'is_set', 'is_unset', 'get_type', 'get_class' ) );
  58. $eZTemplateOperatorArray[] = array( 'class' => 'eZTemplateControlOperator',
  59. 'operator_names' => array( 'cond', 'first_set' ) );
  60. $eZTemplateOperatorArray[] = array( 'class' => 'eZTemplateArithmeticOperator',
  61. 'operator_names' => array( 'sum', 'sub', 'inc', 'dec',
  62. 'div', 'mod', 'mul',
  63. 'max', 'min',
  64. 'abs', 'ceil', 'floor', 'round',
  65. 'int', 'float',
  66. 'count',
  67. 'roman',
  68. 'rand' ) );
  69. $eZTemplateOperatorArray[] = array( 'class' => 'eZTemplateImageOperator',
  70. 'operator_names' => array( 'texttoimage',
  71. 'image',
  72. 'imagefile' ) );
  73. $eZTemplateOperatorArray[] = array( 'class' => 'eZTemplateStringOperator',
  74. 'operator_names' => array( 'upcase',
  75. 'downcase',
  76. 'count_words',
  77. 'count_chars',
  78. 'trim',
  79. 'break',
  80. 'wrap',
  81. 'upfirst',
  82. 'upword',
  83. 'simplify',
  84. 'trim',
  85. 'wash',
  86. 'chr',
  87. 'ord',
  88. 'shorten',
  89. 'pad') );
  90. $eZTemplateOperatorArray[] = array( 'class' => 'eZTemplateDigestOperator',
  91. 'operator_names' => array( 'crc32',
  92. 'md5',
  93. 'rot13', ) );
  94. // Function autoloading
  95. $eZTemplateFunctionArray = array();
  96. $eZTemplateFunctionArray[] = array( 'class' => 'eZTemplateSectionFunction',
  97. 'function_names' => array( 'section' ),
  98. 'function_attributes' => array( 'delimiter',
  99. 'section-exclude',
  100. 'section-include',
  101. 'section-else' ) );
  102. $eZTemplateFunctionArray[] = array( 'class' => 'eZTemplateDelimitFunction',
  103. 'function_names' => array( 'ldelim', 'rdelim' ) );
  104. $eZTemplateFunctionArray[] = array( 'class' => 'eZTemplateIncludeFunction',
  105. 'function_names' => array( 'include' ) );
  106. $eZTemplateFunctionArray[] = array( 'class' => 'eZTemplateSwitchFunction',
  107. 'function_names' => array( 'switch' ),
  108. 'function_attributes' => array( 'case' ) );
  109. $eZTemplateFunctionArray[] = array( 'class' => 'eZTemplateSequenceFunction',
  110. 'function_names' => array( 'sequence' ) );
  111. $eZTemplateFunctionArray[] = array( 'class' => 'eZTemplateSetFunction',
  112. 'function_names' => array( 'set', 'let', 'default' ) );
  113. $eZTemplateFunctionArray[] = array( 'class' => 'eZTemplateBlockFunction',
  114. 'function_names' => array( 'set-block', 'append-block', 'run-once' ) );
  115. $eZTemplateFunctionArray[] = array( 'class' => 'eZTemplateDebugFunction',
  116. 'function_names' => array( 'debug-timing-point', 'debug-accumulator',
  117. 'debug-log',
  118. 'debug-trace' ) );
  119. $eZTemplateFunctionArray[] = array( 'class' => 'eZTemplateCacheFunction',
  120. 'function_names' => array( 'cache-block' ) );
  121. $eZTemplateFunctionArray[] = array( 'class' => 'eZTemplateToolbarFunction',
  122. 'function_names' => array( 'tool_bar' ) );
  123. $eZTemplateFunctionArray[] = array( 'class' => 'eZTemplateMenuFunction',
  124. 'function_names' => array( 'menu' ) );
  125. // should we add 'break', 'continue' and 'skip' to the {if} attribute list?
  126. $eZTemplateFunctionArray[] = array( 'class' => 'eZTemplateIfFunction',
  127. 'function_names' => array( 'if' ),
  128. 'function_attributes' => array( 'elseif',
  129. 'else' ) );
  130. $eZTemplateFunctionArray[] = array( 'class' => 'eZTemplateWhileFunction',
  131. 'function_names' => array( 'while' ),
  132. 'function_attributes' => array( 'delimiter',
  133. 'break',
  134. 'continue',
  135. 'skip' ) );
  136. $eZTemplateFunctionArray[] = array( 'class' => 'eZTemplateForFunction',
  137. 'function_names' => array( 'for' ),
  138. 'function_attributes' => array( 'delimiter',
  139. 'break',
  140. 'continue',
  141. 'skip' ) );
  142. $eZTemplateFunctionArray[] = array( 'class' => 'eZTemplateForeachFunction',
  143. 'function_names' => array( 'foreach' ),
  144. 'function_attributes' => array( 'delimiter',
  145. 'break',
  146. 'continue',
  147. 'skip' ) );
  148. $eZTemplateFunctionArray[] = array( 'class' => 'eZTemplateDoFunction',
  149. 'function_names' => array( 'do' ),
  150. 'function_attributes' => array( 'delimiter',
  151. 'break',
  152. 'continue',
  153. 'skip' ) );
  154. $eZTemplateFunctionArray[] = array( 'class' => 'eZTemplateDefFunction',
  155. 'function_names' => array( 'def', 'undef' ) );
  156. // eZTemplatePHPOperator is not autoload due to it's generic use
  157. // it's up to the users of eZTemplate to initiate a proper usage
  158. // for this operator class.
  159. ?>