654ab5d63cb06d78d96dd05f667cd17631eeeeb935b913c995f482043c31c0af.php 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. <?php
  2. /* partials/blueprints.html.twig */
  3. class __TwigTemplate_2b6e03b3761a66a2a4a501d59a9d1b361b85cd2c0d046072ff76b7cbe351248d extends Twig_Template
  4. {
  5. public function __construct(Twig_Environment $env)
  6. {
  7. parent::__construct($env);
  8. $this->parent = false;
  9. $this->blocks = array(
  10. );
  11. }
  12. protected function doDisplay(array $context, array $blocks = array())
  13. {
  14. // line 1
  15. $context["form_id"] = ((($context["form_id"] ?? null)) ? (($context["form_id"] ?? null)) : ("blueprints"));
  16. // line 2
  17. $context["scope"] = ((($context["scope"] ?? null)) ? (($context["scope"] ?? null)) : ("data."));
  18. // line 3
  19. echo "
  20. ";
  21. // line 4
  22. if ($this->getAttribute(($context["admin"] ?? null), "findFormFields", array(0 => "file", 1 => $this->getAttribute(($context["blueprints"] ?? null), "fields", array())), "method")) {
  23. // line 5
  24. echo " ";
  25. $context["multipart"] = " enctype=\"multipart/form-data\"";
  26. }
  27. // line 7
  28. echo "
  29. <form id=\"";
  30. // line 8
  31. echo twig_escape_filter($this->env, ($context["form_id"] ?? null), "html", null, true);
  32. echo "\" method=\"post\" data-grav-form=\"";
  33. echo twig_escape_filter($this->env, ($context["form_id"] ?? null), "html", null, true);
  34. echo "\" data-grav-keepalive=\"true\"";
  35. echo ($context["multipart"] ?? null);
  36. echo ">
  37. ";
  38. // line 9
  39. $context['_parent'] = $context;
  40. $context['_seq'] = twig_ensure_traversable($this->getAttribute(($context["blueprints"] ?? null), "fields", array()));
  41. $context['loop'] = array(
  42. 'parent' => $context['_parent'],
  43. 'index0' => 0,
  44. 'index' => 1,
  45. 'first' => true,
  46. );
  47. if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof Countable)) {
  48. $length = count($context['_seq']);
  49. $context['loop']['revindex0'] = $length - 1;
  50. $context['loop']['revindex'] = $length;
  51. $context['loop']['length'] = $length;
  52. $context['loop']['last'] = 1 === $length;
  53. }
  54. foreach ($context['_seq'] as $context["_key"] => $context["field"]) {
  55. // line 10
  56. echo " ";
  57. if ($this->getAttribute($context["field"], "type", array())) {
  58. // line 11
  59. echo " ";
  60. $context["value"] = (($this->getAttribute($context["field"], "name", array())) ? ($this->getAttribute(($context["data"] ?? null), "value", array(0 => $this->getAttribute($context["field"], "name", array())), "method")) : ($this->getAttribute(($context["data"] ?? null), "toArray", array())));
  61. // line 12
  62. echo " <div class=\"block block-";
  63. echo twig_escape_filter($this->env, $this->getAttribute($context["field"], "type", array()), "html", null, true);
  64. echo "\">
  65. ";
  66. // line 13
  67. $this->loadTemplate(array(0 => (((("forms/fields/" . $this->getAttribute($context["field"], "type", array())) . "/") . $this->getAttribute($context["field"], "type", array())) . ".html.twig"), 1 => "forms/fields/text/text.html.twig"), "partials/blueprints.html.twig", 13)->display($context);
  68. // line 14
  69. echo " </div>
  70. ";
  71. }
  72. // line 16
  73. echo " ";
  74. ++$context['loop']['index0'];
  75. ++$context['loop']['index'];
  76. $context['loop']['first'] = false;
  77. if (isset($context['loop']['length'])) {
  78. --$context['loop']['revindex0'];
  79. --$context['loop']['revindex'];
  80. $context['loop']['last'] = 0 === $context['loop']['revindex0'];
  81. }
  82. }
  83. $_parent = $context['_parent'];
  84. unset($context['_seq'], $context['_iterated'], $context['_key'], $context['field'], $context['_parent'], $context['loop']);
  85. $context = array_intersect_key($context, $_parent) + $_parent;
  86. // line 17
  87. echo "
  88. ";
  89. // line 18
  90. if ($this->getAttribute(($context["data"] ?? null), "extra", array())) {
  91. // line 19
  92. echo " ";
  93. $context['_parent'] = $context;
  94. $context['_seq'] = twig_ensure_traversable($this->getAttribute(($context["data"] ?? null), "extra", array()));
  95. $context['loop'] = array(
  96. 'parent' => $context['_parent'],
  97. 'index0' => 0,
  98. 'index' => 1,
  99. 'first' => true,
  100. );
  101. if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof Countable)) {
  102. $length = count($context['_seq']);
  103. $context['loop']['revindex0'] = $length - 1;
  104. $context['loop']['revindex'] = $length;
  105. $context['loop']['length'] = $length;
  106. $context['loop']['last'] = 1 === $length;
  107. }
  108. foreach ($context['_seq'] as $context["name"] => $context["value"]) {
  109. // line 20
  110. echo " ";
  111. if (!twig_in_filter($context["name"], array(0 => "_json", 1 => "task", 2 => "admin-nonce"))) {
  112. // line 21
  113. echo " ";
  114. $context["field"] = array("name" => ("_json." . $context["name"]));
  115. // line 22
  116. echo " ";
  117. $context["value"] = twig_jsonencode_filter($context["value"]);
  118. // line 23
  119. echo " ";
  120. $this->loadTemplate("forms/fields/hidden/hidden.html.twig", "partials/blueprints.html.twig", 23)->display($context);
  121. // line 24
  122. echo " ";
  123. }
  124. // line 25
  125. echo " ";
  126. ++$context['loop']['index0'];
  127. ++$context['loop']['index'];
  128. $context['loop']['first'] = false;
  129. if (isset($context['loop']['length'])) {
  130. --$context['loop']['revindex0'];
  131. --$context['loop']['revindex'];
  132. $context['loop']['last'] = 0 === $context['loop']['revindex0'];
  133. }
  134. }
  135. $_parent = $context['_parent'];
  136. unset($context['_seq'], $context['_iterated'], $context['name'], $context['value'], $context['_parent'], $context['loop']);
  137. $context = array_intersect_key($context, $_parent) + $_parent;
  138. // line 26
  139. echo " ";
  140. }
  141. // line 27
  142. echo "
  143. ";
  144. // line 28
  145. echo $this->env->getExtension('Grav\Common\Twig\TwigExtension')->nonceFieldFunc("admin-form", "admin-nonce");
  146. echo "
  147. </form>
  148. ";
  149. }
  150. public function getTemplateName()
  151. {
  152. return "partials/blueprints.html.twig";
  153. }
  154. public function isTraitable()
  155. {
  156. return false;
  157. }
  158. public function getDebugInfo()
  159. {
  160. return array ( 149 => 28, 146 => 27, 143 => 26, 129 => 25, 126 => 24, 123 => 23, 120 => 22, 117 => 21, 114 => 20, 96 => 19, 94 => 18, 91 => 17, 77 => 16, 73 => 14, 71 => 13, 66 => 12, 63 => 11, 60 => 10, 43 => 9, 35 => 8, 32 => 7, 28 => 5, 26 => 4, 23 => 3, 21 => 2, 19 => 1,);
  161. }
  162. /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */
  163. public function getSource()
  164. {
  165. @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED);
  166. return $this->getSourceContext()->getCode();
  167. }
  168. public function getSourceContext()
  169. {
  170. return new Twig_Source("{% set form_id = form_id ? form_id : 'blueprints' %}
  171. {% set scope = scope ?: 'data.' %}
  172. {% if admin.findFormFields('file', blueprints.fields) %}
  173. {% set multipart = ' enctype=\"multipart/form-data\"' %}
  174. {% endif %}
  175. <form id=\"{{ form_id }}\" method=\"post\" data-grav-form=\"{{ form_id }}\" data-grav-keepalive=\"true\"{{ multipart|raw }}>
  176. {% for field in blueprints.fields %}
  177. {% if field.type %}
  178. {% set value = field.name ? data.value(field.name) : data.toArray %}
  179. <div class=\"block block-{{ field.type }}\">
  180. {% include [\"forms/fields/#{field.type}/#{field.type}.html.twig\", 'forms/fields/text/text.html.twig'] %}
  181. </div>
  182. {% endif %}
  183. {% endfor %}
  184. {% if data.extra %}
  185. {% for name, value in data.extra %}
  186. {% if name not in ['_json','task','admin-nonce'] %}
  187. {% set field = {name: '_json.' ~ name} %}
  188. {% set value = value|raw|json_encode %}
  189. {% include 'forms/fields/hidden/hidden.html.twig' %}
  190. {% endif %}
  191. {% endfor %}
  192. {% endif %}
  193. {{ nonce_field('admin-form', 'admin-nonce')|raw }}
  194. </form>
  195. ", "partials/blueprints.html.twig", "/mnt/data/Sites/static-ethica.net/user/plugins/admin/themes/grav/templates/partials/blueprints.html.twig");
  196. }
  197. }