719efc56339fcc27c1a6b85ed9f811ea6fc8e966735807b7f684cbfb1b42e76c.php 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364
  1. <?php
  2. /* forms/fields/array/array.html.twig */
  3. class __TwigTemplate_32e69c4df61021f3e9e03fd0b52ffc366d3247dadcfb862824cf77392f26277c 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/array/array.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-array-name=\"";
  28. 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);
  29. echo "\"
  30. data-grav-array-keyname=\"";
  31. // line 5
  32. echo twig_escape_filter($this->env, $this->env->getExtension('Grav\Plugin\Admin\AdminTwigExtension')->tuFilter(twig_escape_filter($this->env, $this->getAttribute(($context["field"] ?? null), "placeholder_key", array()))), "html", null, true);
  33. echo "\"
  34. data-grav-array-valuename=\"";
  35. // line 6
  36. echo twig_escape_filter($this->env, $this->env->getExtension('Grav\Plugin\Admin\AdminTwigExtension')->tuFilter(twig_escape_filter($this->env, $this->getAttribute(($context["field"] ?? null), "placeholder_value", array()))), "html", null, true);
  37. echo "\"
  38. ";
  39. // line 7
  40. $this->displayParentBlock("global_attributes", $context, $blocks);
  41. echo "
  42. ";
  43. }
  44. // line 42
  45. public function block_input($context, array $blocks = array())
  46. {
  47. // line 43
  48. echo " ";
  49. $context["array_field"] = $this;
  50. // line 44
  51. echo " <div data-grav-array-type=\"container\"";
  52. if ($this->getAttribute(($context["field"] ?? null), "value_only", array())) {
  53. echo " data-grav-array-mode=\"value_only\"";
  54. }
  55. echo (((twig_length_filter($this->env, ($context["value"] ?? null)) <= 1)) ? (" class=\"one-child\"") : (""));
  56. echo ">
  57. ";
  58. // line 45
  59. if (twig_length_filter($this->env, ($context["value"] ?? null))) {
  60. // line 46
  61. echo " ";
  62. $context['_parent'] = $context;
  63. $context['_seq'] = twig_ensure_traversable(($context["value"] ?? null));
  64. foreach ($context['_seq'] as $context["key"] => $context["text"]) {
  65. // line 47
  66. if ( !twig_test_iterable($context["text"])) {
  67. // line 48
  68. echo " ";
  69. echo $context["array_field"]->getrenderer($context["key"], $context["text"], ($context["field"] ?? null), ($context["scope"] ?? null));
  70. echo "
  71. ";
  72. } else {
  73. // line 50
  74. echo " ";
  75. // line 51
  76. echo " ";
  77. $context['_parent'] = $context;
  78. $context['_seq'] = twig_ensure_traversable($context["text"]);
  79. foreach ($context['_seq'] as $context["subkey"] => $context["subtext"]) {
  80. // line 52
  81. echo $context["array_field"]->getrenderer(((($context["key"] . "[") . $context["subkey"]) . "]"), $context["subtext"], ($context["field"] ?? null), ($context["scope"] ?? null));
  82. echo "
  83. ";
  84. }
  85. $_parent = $context['_parent'];
  86. unset($context['_seq'], $context['_iterated'], $context['subkey'], $context['subtext'], $context['_parent'], $context['loop']);
  87. $context = array_intersect_key($context, $_parent) + $_parent;
  88. // line 54
  89. echo " ";
  90. }
  91. // line 55
  92. echo " ";
  93. }
  94. $_parent = $context['_parent'];
  95. unset($context['_seq'], $context['_iterated'], $context['key'], $context['text'], $context['_parent'], $context['loop']);
  96. $context = array_intersect_key($context, $_parent) + $_parent;
  97. } else {
  98. // line 58
  99. echo " <div class=\"form-row\" data-grav-array-type=\"row\">
  100. <span data-grav-array-action=\"sort\" class=\"fa fa-bars\"></span>
  101. ";
  102. // line 60
  103. if (($this->getAttribute(($context["field"] ?? null), "value_only", array()) != true)) {
  104. // line 61
  105. echo " <input
  106. data-grav-array-type=\"key\"
  107. type=\"text\"
  108. ";
  109. // line 64
  110. if (($this->getAttribute(($context["field"] ?? null), "disabled", array()) || ($context["isDisabledToggleable"] ?? null))) {
  111. echo "disabled=\"disabled\"";
  112. }
  113. // line 65
  114. echo " placeholder=\"";
  115. echo twig_escape_filter($this->env, $this->env->getExtension('Grav\Plugin\Admin\AdminTwigExtension')->tuFilter(twig_escape_filter($this->env, $this->getAttribute(($context["field"] ?? null), "placeholder_key", array()))), "html", null, true);
  116. echo "\" />
  117. ";
  118. }
  119. // line 67
  120. echo " <input
  121. data-grav-array-type=\"value\"
  122. type=\"text\"
  123. name=\"";
  124. // line 70
  125. 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);
  126. echo "\"
  127. ";
  128. // line 71
  129. if (($this->getAttribute(($context["field"] ?? null), "disabled", array()) || ($context["isDisabledToggleable"] ?? null))) {
  130. echo "disabled=\"disabled\"";
  131. }
  132. // line 72
  133. echo " placeholder=\"";
  134. echo twig_escape_filter($this->env, $this->env->getExtension('Grav\Plugin\Admin\AdminTwigExtension')->tuFilter(twig_escape_filter($this->env, $this->getAttribute(($context["field"] ?? null), "placeholder_value", array()))), "html", null, true);
  135. echo "\" />
  136. <span data-grav-array-action=\"rem\" class=\"fa fa-minus\"></span>
  137. <span data-grav-array-action=\"add\" class=\"fa fa-plus\"></span>
  138. </div>";
  139. }
  140. // line 77
  141. echo " </div>
  142. ";
  143. }
  144. // line 10
  145. public function getrenderer($__key__ = null, $__text__ = null, $__field__ = null, $__scope__ = null, ...$__varargs__)
  146. {
  147. $context = $this->env->mergeGlobals(array(
  148. "key" => $__key__,
  149. "text" => $__text__,
  150. "field" => $__field__,
  151. "scope" => $__scope__,
  152. "varargs" => $__varargs__,
  153. ));
  154. $blocks = array();
  155. ob_start();
  156. try {
  157. // line 11
  158. echo "
  159. ";
  160. // line 12
  161. if ( !twig_test_iterable(($context["text"] ?? null))) {
  162. // line 13
  163. echo " <div class=\"form-row";
  164. if ($this->getAttribute(($context["field"] ?? null), "value_only", array())) {
  165. echo " array-field-value_only";
  166. }
  167. echo "\"
  168. data-grav-array-type=\"row\">
  169. <span data-grav-array-action=\"sort\" class=\"fa fa-bars\"></span>
  170. ";
  171. // line 16
  172. if (($this->getAttribute(($context["field"] ?? null), "value_only", array()) != true)) {
  173. // line 17
  174. echo " ";
  175. if (((($context["key"] ?? null) == "0") && (($context["text"] ?? null) == ""))) {
  176. // line 18
  177. echo " ";
  178. $context["key"] = "";
  179. // line 19
  180. echo " ";
  181. }
  182. // line 20
  183. echo "
  184. <input
  185. data-grav-array-type=\"key\"
  186. type=\"text\" value=\"";
  187. // line 23
  188. echo twig_escape_filter($this->env, ($context["key"] ?? null), "html", null, true);
  189. echo "\"
  190. ";
  191. // line 24
  192. if (($this->getAttribute(($context["field"] ?? null), "disabled", array()) || ($context["isDisabledToggleable"] ?? null))) {
  193. echo "disabled=\"disabled\"";
  194. }
  195. // line 25
  196. echo " placeholder=\"";
  197. echo twig_escape_filter($this->env, $this->env->getExtension('Grav\Plugin\Admin\AdminTwigExtension')->tuFilter(twig_escape_filter($this->env, $this->getAttribute(($context["field"] ?? null), "placeholder_key", array()))), "html", null, true);
  198. echo "\" />
  199. ";
  200. }
  201. // line 27
  202. echo "
  203. <input
  204. data-grav-array-type=\"value\"
  205. type=\"text\"
  206. name=\"";
  207. // line 31
  208. 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["key"] ?? null)) . "]"), "html", null, true);
  209. echo "\"
  210. placeholder=\"";
  211. // line 32
  212. echo twig_escape_filter($this->env, $this->env->getExtension('Grav\Plugin\Admin\AdminTwigExtension')->tuFilter(twig_escape_filter($this->env, $this->getAttribute(($context["field"] ?? null), "placeholder_value", array()))), "html", null, true);
  213. echo "\"
  214. ";
  215. // line 33
  216. if (($this->getAttribute(($context["field"] ?? null), "disabled", array()) || ($context["isDisabledToggleable"] ?? null))) {
  217. echo "disabled=\"disabled\"";
  218. }
  219. // line 34
  220. echo " value=";
  221. if ((($context["text"] ?? null) == "true")) {
  222. echo "true";
  223. } elseif ((($context["text"] ?? null) == "false")) {
  224. echo "false";
  225. } else {
  226. echo "\"";
  227. echo twig_escape_filter($this->env, twig_join_filter(($context["text"] ?? null), ", "));
  228. echo "\"";
  229. }
  230. echo " />
  231. <span data-grav-array-action=\"rem\" class=\"fa fa-minus\"></span>
  232. <span data-grav-array-action=\"add\" class=\"fa fa-plus\"></span>
  233. </div>
  234. ";
  235. }
  236. } catch (Exception $e) {
  237. ob_end_clean();
  238. throw $e;
  239. } catch (Throwable $e) {
  240. ob_end_clean();
  241. throw $e;
  242. }
  243. return ('' === $tmp = ob_get_clean()) ? '' : new Twig_Markup($tmp, $this->env->getCharset());
  244. }
  245. public function getTemplateName()
  246. {
  247. return "forms/fields/array/array.html.twig";
  248. }
  249. public function isTraitable()
  250. {
  251. return false;
  252. }
  253. public function getDebugInfo()
  254. {
  255. return array ( 229 => 34, 225 => 33, 221 => 32, 217 => 31, 211 => 27, 205 => 25, 201 => 24, 197 => 23, 192 => 20, 189 => 19, 186 => 18, 183 => 17, 181 => 16, 172 => 13, 170 => 12, 167 => 11, 152 => 10, 147 => 77, 139 => 72, 135 => 71, 131 => 70, 126 => 67, 120 => 65, 116 => 64, 111 => 61, 109 => 60, 105 => 58, 98 => 55, 95 => 54, 87 => 52, 82 => 51, 80 => 50, 74 => 48, 72 => 47, 67 => 46, 65 => 45, 57 => 44, 54 => 43, 51 => 42, 45 => 7, 41 => 6, 37 => 5, 32 => 4, 29 => 3, 11 => 1,);
  256. }
  257. /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */
  258. public function getSource()
  259. {
  260. @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED);
  261. return $this->getSourceContext()->getCode();
  262. }
  263. public function getSourceContext()
  264. {
  265. return new Twig_Source("{% extends \"forms/field.html.twig\" %}
  266. {% block global_attributes %}
  267. data-grav-array-name=\"{{ (scope ~ field.name)|fieldName }}\"
  268. data-grav-array-keyname=\"{{ field.placeholder_key|e|tu }}\"
  269. data-grav-array-valuename=\"{{ field.placeholder_value|e|tu }}\"
  270. {{ parent() }}
  271. {% endblock %}
  272. {% macro renderer(key, text, field, scope) %}
  273. {% if text is not iterable %}
  274. <div class=\"form-row{% if field.value_only %} array-field-value_only{% endif %}\"
  275. data-grav-array-type=\"row\">
  276. <span data-grav-array-action=\"sort\" class=\"fa fa-bars\"></span>
  277. {% if field.value_only != true %}
  278. {% if key == '0' and text == '' %}
  279. {% set key = '' %}
  280. {% endif %}
  281. <input
  282. data-grav-array-type=\"key\"
  283. type=\"text\" value=\"{{ key }}\"
  284. {% if field.disabled or isDisabledToggleable %}disabled=\"disabled\"{% endif %}
  285. placeholder=\"{{ field.placeholder_key|e|tu }}\" />
  286. {% endif %}
  287. <input
  288. data-grav-array-type=\"value\"
  289. type=\"text\"
  290. name=\"{{ ((scope ~ field.name)|fieldName) ~ '[' ~ key ~ ']' }}\"
  291. placeholder=\"{{ field.placeholder_value|e|tu }}\"
  292. {% if field.disabled or isDisabledToggleable %}disabled=\"disabled\"{% endif %}
  293. value={% if text == 'true' %}true{% elseif text == 'false' %}false{% else %}\"{{ text|join(', ')|e }}\"{% endif %} />
  294. <span data-grav-array-action=\"rem\" class=\"fa fa-minus\"></span>
  295. <span data-grav-array-action=\"add\" class=\"fa fa-plus\"></span>
  296. </div>
  297. {% endif %}
  298. {% endmacro %}
  299. {% block input %}
  300. {% import _self as array_field %}
  301. <div data-grav-array-type=\"container\"{% if field.value_only %} data-grav-array-mode=\"value_only\"{% endif %}{{ value|length <= 1 ? ' class=\"one-child\"' : '' }}>
  302. {% if value|length %}
  303. {% for key, text in value -%}
  304. {% if text is not iterable %}
  305. {{ array_field.renderer(key, text, field, scope) }}
  306. {% else %}
  307. {# Backward compatibility for nested arrays (metas) which are not supported anymore #}
  308. {% for subkey, subtext in text -%}
  309. {{ array_field.renderer(key ~ '[' ~ subkey ~ ']', subtext, field, scope) }}
  310. {% endfor %}
  311. {% endif %}
  312. {% endfor %}
  313. {%- else -%}
  314. {# Empty value, mock the entry field#}
  315. <div class=\"form-row\" data-grav-array-type=\"row\">
  316. <span data-grav-array-action=\"sort\" class=\"fa fa-bars\"></span>
  317. {% if field.value_only != true %}
  318. <input
  319. data-grav-array-type=\"key\"
  320. type=\"text\"
  321. {% if field.disabled or isDisabledToggleable %}disabled=\"disabled\"{% endif %}
  322. placeholder=\"{{ field.placeholder_key|e|tu }}\" />
  323. {% endif %}
  324. <input
  325. data-grav-array-type=\"value\"
  326. type=\"text\"
  327. name=\"{{ (scope ~ field.name)|fieldName }}\"
  328. {% if field.disabled or isDisabledToggleable %}disabled=\"disabled\"{% endif %}
  329. placeholder=\"{{ field.placeholder_value|e|tu }}\" />
  330. <span data-grav-array-action=\"rem\" class=\"fa fa-minus\"></span>
  331. <span data-grav-array-action=\"add\" class=\"fa fa-plus\"></span>
  332. </div>
  333. {%- endif %}
  334. </div>
  335. {% endblock %}
  336. ", "forms/fields/array/array.html.twig", "/mnt/data/Sites/static-ethica.net/user/plugins/admin/themes/grav/templates/forms/fields/array/array.html.twig");
  337. }
  338. }