1a075714b0524735995c5a1c05a5d1cc23bb446792abf7269fa0fd2cf16f5e8e.php 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  1. <?php
  2. /* forms/fields/select/select.html.twig */
  3. class __TwigTemplate_9666d45656d36a58607aa0996be7cef8aad06b2b49f2c272e65a0aef0b6be4b8 extends Twig_Template
  4. {
  5. public function __construct(Twig_Environment $env)
  6. {
  7. parent::__construct($env);
  8. // line 1
  9. $this->parent = $this->loadTemplate("forms/field.html.twig", "forms/fields/select/select.html.twig", 1);
  10. $this->blocks = array(
  11. 'global_attributes' => array($this, 'block_global_attributes'),
  12. 'input' => array($this, 'block_input'),
  13. );
  14. }
  15. protected function doGetParent(array $context)
  16. {
  17. return "forms/field.html.twig";
  18. }
  19. protected function doDisplay(array $context, array $blocks = array())
  20. {
  21. $this->parent->display($context, array_merge($this->blocks, $blocks));
  22. }
  23. // line 3
  24. public function block_global_attributes($context, array $blocks = array())
  25. {
  26. // line 4
  27. echo " data-grav-selectize=\"";
  28. echo twig_escape_filter($this->env, twig_jsonencode_filter((($this->getAttribute(($context["field"] ?? null), "selectize", array(), "any", true, true)) ? ($this->getAttribute(($context["field"] ?? null), "selectize", array())) : (array()))), "html_attr");
  29. echo "\"
  30. ";
  31. // line 5
  32. $this->displayParentBlock("global_attributes", $context, $blocks);
  33. echo "
  34. ";
  35. }
  36. // line 8
  37. public function block_input($context, array $blocks = array())
  38. {
  39. // line 9
  40. echo " <div class=\"";
  41. echo twig_escape_filter($this->env, ((($context["form_field_wrapper_classes"] ?? null)) ? (($context["form_field_wrapper_classes"] ?? null)) : ("form-select-wrapper")), "html", null, true);
  42. echo " ";
  43. echo twig_escape_filter($this->env, $this->getAttribute(($context["field"] ?? null), "size", array()), "html", null, true);
  44. echo " ";
  45. echo twig_escape_filter($this->env, $this->getAttribute(($context["field"] ?? null), "wrapper_classes", array()), "html", null, true);
  46. echo "\">
  47. <select name=\"";
  48. // line 10
  49. echo twig_escape_filter($this->env, ($this->env->getExtension('Grav\Common\Twig\TwigExtension')->fieldNameFilter((($context["scope"] ?? null) . $this->getAttribute(($context["field"] ?? null), "name", array()))) . (($this->getAttribute(($context["field"] ?? null), "multiple", array())) ? ("[]") : (""))), "html", null, true);
  50. echo "\"
  51. class=\"";
  52. // line 11
  53. echo twig_escape_filter($this->env, ($context["form_field_select_classes"] ?? null), "html", null, true);
  54. echo " ";
  55. echo twig_escape_filter($this->env, $this->getAttribute(($context["field"] ?? null), "classes", array()), "html", null, true);
  56. echo "\"
  57. ";
  58. // line 12
  59. if ($this->getAttribute(($context["field"] ?? null), "id", array(), "any", true, true)) {
  60. echo "id=\"";
  61. echo twig_escape_filter($this->env, $this->getAttribute(($context["field"] ?? null), "id", array()));
  62. echo "\" ";
  63. }
  64. // line 13
  65. echo " ";
  66. if ($this->getAttribute(($context["field"] ?? null), "style", array(), "any", true, true)) {
  67. echo "style=\"";
  68. echo twig_escape_filter($this->env, $this->getAttribute(($context["field"] ?? null), "style", array()));
  69. echo "\" ";
  70. }
  71. // line 14
  72. echo " ";
  73. if ($this->getAttribute(($context["field"] ?? null), "disabled", array())) {
  74. echo "disabled=\"disabled\"";
  75. }
  76. // line 15
  77. echo " ";
  78. if (twig_in_filter($this->getAttribute(($context["field"] ?? null), "autofocus", array()), array(0 => "on", 1 => "true", 2 => 1))) {
  79. echo "autofocus=\"autofocus\"";
  80. }
  81. // line 16
  82. echo " ";
  83. if (twig_in_filter($this->getAttribute(($context["field"] ?? null), "novalidate", array()), array(0 => "on", 1 => "true", 2 => 1))) {
  84. echo "novalidate=\"novalidate\"";
  85. }
  86. // line 17
  87. echo " ";
  88. if (twig_in_filter($this->getAttribute($this->getAttribute(($context["field"] ?? null), "validate", array()), "required", array()), array(0 => "on", 1 => "true", 2 => 1))) {
  89. echo "required=\"required\"";
  90. }
  91. // line 18
  92. echo " ";
  93. if (twig_in_filter($this->getAttribute(($context["field"] ?? null), "multiple", array()), array(0 => "on", 1 => "true", 2 => 1))) {
  94. echo "multiple=\"multiple\"";
  95. }
  96. // line 19
  97. echo " ";
  98. if (($this->getAttribute(($context["field"] ?? null), "disabled", array()) || ($context["isDisabledToggleable"] ?? null))) {
  99. echo "disabled=\"disabled\"";
  100. }
  101. // line 20
  102. echo " ";
  103. if ($this->getAttribute(($context["field"] ?? null), "form", array())) {
  104. echo "form=\"";
  105. echo twig_escape_filter($this->env, $this->getAttribute(($context["field"] ?? null), "form", array()), "html", null, true);
  106. echo "\"";
  107. }
  108. // line 21
  109. echo " ";
  110. if ($this->getAttribute(($context["field"] ?? null), "key", array())) {
  111. // line 22
  112. echo " data-key-observe=\"";
  113. echo twig_escape_filter($this->env, $this->env->getExtension('Grav\Common\Twig\TwigExtension')->fieldNameFilter((($context["scope"] ?? null) . $this->getAttribute(($context["field"] ?? null), "name", array()))), "html", null, true);
  114. echo "\"
  115. ";
  116. }
  117. // line 24
  118. echo " >
  119. ";
  120. // line 25
  121. if ($this->getAttribute(($context["field"] ?? null), "placeholder", array())) {
  122. echo "<option value=\"\" disabled selected>";
  123. if ($this->getAttribute($this->getAttribute($this->getAttribute($this->getAttribute(($context["grav"] ?? null), "twig", array(), "any", false, true), "twig", array(), "any", false, true), "filters", array(), "any", false, true), "tu", array(), "array", true, true)) {
  124. echo $this->env->getExtension('Grav\Plugin\Admin\AdminTwigExtension')->tuFilter($this->getAttribute(($context["field"] ?? null), "placeholder", array()));
  125. } else {
  126. echo $this->env->getExtension('Grav\Common\Twig\TwigExtension')->translate($this->getAttribute(($context["field"] ?? null), "placeholder", array()));
  127. }
  128. echo "</option>";
  129. }
  130. // line 26
  131. echo "
  132. ";
  133. // line 27
  134. $context['_parent'] = $context;
  135. $context['_seq'] = twig_ensure_traversable($this->getAttribute(($context["field"] ?? null), "options", array()));
  136. foreach ($context['_seq'] as $context["key"] => $context["text"]) {
  137. // line 28
  138. echo " ";
  139. $context["selected"] = (($this->getAttribute(($context["field"] ?? null), "selectize", array())) ? ($context["text"]) : ($context["key"]));
  140. // line 29
  141. echo " ";
  142. $context["item_value"] = ((($this->getAttribute(($context["field"] ?? null), "selectize", array()) && $this->getAttribute(($context["field"] ?? null), "multiple", array()))) ? ($context["text"]) : ($context["key"]));
  143. // line 30
  144. echo " <option ";
  145. if ((($context["key"] == ($context["value"] ?? null)) || ($this->getAttribute(($context["field"] ?? null), "multiple", array()) && twig_in_filter(($context["selected"] ?? null), ($context["value"] ?? null))))) {
  146. echo "selected=\"selected\"";
  147. }
  148. echo " value=\"";
  149. echo twig_escape_filter($this->env, ($context["item_value"] ?? null), "html", null, true);
  150. echo "\">";
  151. if ($this->getAttribute($this->getAttribute($this->getAttribute($this->getAttribute(($context["grav"] ?? null), "twig", array(), "any", false, true), "twig", array(), "any", false, true), "filters", array(), "any", false, true), "tu", array(), "array", true, true)) {
  152. echo $this->env->getExtension('Grav\Plugin\Admin\AdminTwigExtension')->tuFilter($context["text"]);
  153. } else {
  154. echo $this->env->getExtension('Grav\Common\Twig\TwigExtension')->translate($context["text"]);
  155. }
  156. echo "</option>
  157. ";
  158. }
  159. $_parent = $context['_parent'];
  160. unset($context['_seq'], $context['_iterated'], $context['key'], $context['text'], $context['_parent'], $context['loop']);
  161. $context = array_intersect_key($context, $_parent) + $_parent;
  162. // line 32
  163. echo " </select>
  164. </div>
  165. ";
  166. }
  167. public function getTemplateName()
  168. {
  169. return "forms/fields/select/select.html.twig";
  170. }
  171. public function isTraitable()
  172. {
  173. return false;
  174. }
  175. public function getDebugInfo()
  176. {
  177. return array ( 169 => 32, 150 => 30, 147 => 29, 144 => 28, 140 => 27, 137 => 26, 127 => 25, 124 => 24, 118 => 22, 115 => 21, 108 => 20, 103 => 19, 98 => 18, 93 => 17, 88 => 16, 83 => 15, 78 => 14, 71 => 13, 65 => 12, 59 => 11, 55 => 10, 46 => 9, 43 => 8, 37 => 5, 32 => 4, 29 => 3, 11 => 1,);
  178. }
  179. /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */
  180. public function getSource()
  181. {
  182. @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED);
  183. return $this->getSourceContext()->getCode();
  184. }
  185. public function getSourceContext()
  186. {
  187. return new Twig_Source("{% extends \"forms/field.html.twig\" %}
  188. {% block global_attributes %}
  189. data-grav-selectize=\"{{ (field.selectize is defined ? field.selectize : {})|json_encode()|e('html_attr') }}\"
  190. {{ parent() }}
  191. {% endblock %}
  192. {% block input %}
  193. <div class=\"{{ form_field_wrapper_classes ?: 'form-select-wrapper' }} {{ field.size }} {{ field.wrapper_classes }}\">
  194. <select name=\"{{ (scope ~ field.name)|fieldName ~ (field.multiple ? '[]' : '') }}\"
  195. class=\"{{ form_field_select_classes }} {{ field.classes }}\"
  196. {% if field.id is defined %}id=\"{{ field.id|e }}\" {% endif %}
  197. {% if field.style is defined %}style=\"{{ field.style|e }}\" {% endif %}
  198. {% if field.disabled %}disabled=\"disabled\"{% endif %}
  199. {% if field.autofocus in ['on', 'true', 1] %}autofocus=\"autofocus\"{% endif %}
  200. {% if field.novalidate in ['on', 'true', 1] %}novalidate=\"novalidate\"{% endif %}
  201. {% if field.validate.required in ['on', 'true', 1] %}required=\"required\"{% endif %}
  202. {% if field.multiple in ['on', 'true', 1] %}multiple=\"multiple\"{% endif %}
  203. {% if field.disabled or isDisabledToggleable %}disabled=\"disabled\"{% endif %}
  204. {% if field.form %}form=\"{{ field.form }}\"{% endif %}
  205. {% if field.key %}
  206. data-key-observe=\"{{ (scope ~ field.name)|fieldName }}\"
  207. {% endif %}
  208. >
  209. {% if field.placeholder %}<option value=\"\" disabled selected>{% if grav.twig.twig.filters['tu'] is defined %}{{ field.placeholder|tu|raw }}{% else %}{{ field.placeholder|t|raw }}{% endif %}</option>{% endif %}
  210. {% for key, text in field.options %}
  211. {% set selected = field.selectize ? text : key %}
  212. {% set item_value = field.selectize and field.multiple ? text : key %}
  213. <option {% if key == value or (field.multiple and selected in value) %}selected=\"selected\"{% endif %} value=\"{{ item_value }}\">{% if grav.twig.twig.filters['tu'] is defined %}{{ text|tu|raw }}{% else %}{{ text|t|raw }}{% endif %}</option>
  214. {% endfor %}
  215. </select>
  216. </div>
  217. {% endblock %}
  218. ", "forms/fields/select/select.html.twig", "/mnt/data/Sites/static-ethica.net/user/plugins/form/templates/forms/fields/select/select.html.twig");
  219. }
  220. }