8d3a5b5346442d7676dfda9ff45d4ef62ebd3763b0bf2ef2b32adba37b7510db.php 10 KB

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