fc25ce0ab1ad975bce4312799a714263a4444572e16a16395ff6905a210658f9.php 17 KB

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