UtilExtension.php 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. <?php
  2. /* vim: set expandtab sw=4 ts=4 sts=4: */
  3. /**
  4. * hold PhpMyAdmin\Twig\UtilExtension class
  5. *
  6. * @package PhpMyAdmin\Twig
  7. */
  8. namespace PhpMyAdmin\Twig;
  9. use Twig\Extension\AbstractExtension;
  10. use Twig\TwigFunction;
  11. /**
  12. * Class UtilExtension
  13. *
  14. * @package PhpMyAdmin\Twig
  15. */
  16. class UtilExtension extends AbstractExtension
  17. {
  18. /**
  19. * Returns a list of functions to add to the existing list.
  20. *
  21. * @return TwigFunction[]
  22. */
  23. public function getFunctions()
  24. {
  25. return array(
  26. new TwigFunction(
  27. 'Util_backquote',
  28. 'PhpMyAdmin\Util::backquote'
  29. ),
  30. new TwigFunction(
  31. 'Util_getBrowseUploadFileBlock',
  32. 'PhpMyAdmin\Util::getBrowseUploadFileBlock',
  33. array('is_safe' => array('html'))
  34. ),
  35. new TwigFunction(
  36. 'Util_convertBitDefaultValue',
  37. 'PhpMyAdmin\Util::convertBitDefaultValue'
  38. ),
  39. new TwigFunction(
  40. 'Util_escapeMysqlWildcards',
  41. 'PhpMyAdmin\Util::escapeMysqlWildcards'
  42. ),
  43. new TwigFunction(
  44. 'Util_extractColumnSpec',
  45. 'PhpMyAdmin\Util::extractColumnSpec'
  46. ),
  47. new TwigFunction(
  48. 'Util_formatByteDown',
  49. 'PhpMyAdmin\Util::formatByteDown'
  50. ),
  51. new TwigFunction(
  52. 'Util_formatNumber',
  53. 'PhpMyAdmin\Util::formatNumber'
  54. ),
  55. new TwigFunction(
  56. 'Util_formatSql',
  57. 'PhpMyAdmin\Util::formatSql',
  58. array('is_safe' => array('html'))
  59. ),
  60. new TwigFunction(
  61. 'Util_getButtonOrImage',
  62. 'PhpMyAdmin\Util::getButtonOrImage',
  63. array('is_safe' => array('html'))
  64. ),
  65. new TwigFunction(
  66. 'Util_getClassForType',
  67. 'PhpMyAdmin\Util::getClassForType',
  68. array('is_safe' => array('html'))
  69. ),
  70. new TwigFunction(
  71. 'Util_getDivForSliderEffect',
  72. 'PhpMyAdmin\Util::getDivForSliderEffect',
  73. array('is_safe' => array('html'))
  74. ),
  75. new TwigFunction(
  76. 'Util_getDocuLink',
  77. 'PhpMyAdmin\Util::getDocuLink',
  78. array('is_safe' => array('html'))
  79. ),
  80. new TwigFunction(
  81. 'Util_getListNavigator',
  82. 'PhpMyAdmin\Util::getListNavigator',
  83. array('is_safe' => array('html'))
  84. ),
  85. new TwigFunction(
  86. 'Util_showDocu',
  87. 'PhpMyAdmin\Util::showDocu',
  88. array('is_safe' => array('html'))
  89. ),
  90. new TwigFunction(
  91. 'Util_getDropdown',
  92. 'PhpMyAdmin\Util::getDropdown',
  93. array('is_safe' => array('html'))
  94. ),
  95. new TwigFunction(
  96. 'Util_getFKCheckbox',
  97. 'PhpMyAdmin\Util::getFKCheckbox',
  98. array('is_safe' => array('html'))
  99. ),
  100. new TwigFunction(
  101. 'Util_getGISDatatypes',
  102. 'PhpMyAdmin\Util::getGISDatatypes'
  103. ),
  104. new TwigFunction(
  105. 'Util_getGISFunctions',
  106. 'PhpMyAdmin\Util::getGISFunctions'
  107. ),
  108. new TwigFunction(
  109. 'Util_getHtmlTab',
  110. 'PhpMyAdmin\Util::getHtmlTab',
  111. array('is_safe' => array('html'))
  112. ),
  113. new TwigFunction(
  114. 'Util_getIcon',
  115. 'PhpMyAdmin\Util::getIcon',
  116. array('is_safe' => array('html'))
  117. ),
  118. new TwigFunction(
  119. 'Util_getImage',
  120. 'PhpMyAdmin\Util::getImage',
  121. array('is_safe' => array('html'))
  122. ),
  123. new TwigFunction(
  124. 'Util_getRadioFields',
  125. 'PhpMyAdmin\Util::getRadioFields',
  126. array('is_safe' => array('html'))
  127. ),
  128. new TwigFunction(
  129. 'Util_getSelectUploadFileBlock',
  130. 'PhpMyAdmin\Util::getSelectUploadFileBlock',
  131. array('is_safe' => array('html'))
  132. ),
  133. new TwigFunction(
  134. 'Util_getScriptNameForOption',
  135. 'PhpMyAdmin\Util::getScriptNameForOption',
  136. array('is_safe' => array('html'))
  137. ),
  138. new TwigFunction(
  139. 'Util_getStartAndNumberOfRowsPanel',
  140. 'PhpMyAdmin\Util::getStartAndNumberOfRowsPanel',
  141. array('is_safe' => array('html'))
  142. ),
  143. new TwigFunction(
  144. 'Util_getSupportedDatatypes',
  145. 'PhpMyAdmin\Util::getSupportedDatatypes',
  146. array('is_safe' => array('html'))
  147. ),
  148. new TwigFunction(
  149. 'Util_isForeignKeySupported',
  150. 'PhpMyAdmin\Util::isForeignKeySupported'
  151. ),
  152. new TwigFunction(
  153. 'Util_linkOrButton',
  154. 'PhpMyAdmin\Util::linkOrButton',
  155. array('is_safe' => array('html'))
  156. ),
  157. new TwigFunction(
  158. 'Util_localisedDate',
  159. 'PhpMyAdmin\Util::localisedDate'
  160. ),
  161. new TwigFunction(
  162. 'Util_showHint',
  163. 'PhpMyAdmin\Util::showHint',
  164. array('is_safe' => array('html'))
  165. ),
  166. new TwigFunction(
  167. 'Util_showDocu',
  168. 'PhpMyAdmin\Util::showDocu',
  169. array('is_safe' => array('html'))
  170. ),
  171. new TwigFunction(
  172. 'Util_showIcons',
  173. 'PhpMyAdmin\Util::showIcons'
  174. ),
  175. new TwigFunction(
  176. 'Util_showMySQLDocu',
  177. 'PhpMyAdmin\Util::showMySQLDocu',
  178. array('is_safe' => array('html'))
  179. ),
  180. new TwigFunction(
  181. 'Util_sortableTableHeader',
  182. 'PhpMyAdmin\Util::sortableTableHeader',
  183. array('is_safe' => array('html'))
  184. ),
  185. );
  186. }
  187. }