ec0d1e84273aeda9689a24d3595e53120b3099207f72ec026047ab2f0c2bda9b.php 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283
  1. <?php
  2. /* forms/fields/pages/pages.html.twig */
  3. class __TwigTemplate_85318de3e68650a47ddeb863f7ff6f2815fc0b66e23ec6d5ea16e41e35166635 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/pages/pages.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 17
  24. public function block_global_attributes($context, array $blocks = array())
  25. {
  26. // line 18
  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. data-grav-field=\"select\"
  31. data-grav-disabled=\"";
  32. // line 20
  33. echo (((null === ($context["originalValue"] ?? null))) ? ("true") : ("false"));
  34. echo "\"
  35. data-grav-default=\"";
  36. // line 21
  37. echo twig_escape_filter($this->env, twig_jsonencode_filter($this->getAttribute(($context["field"] ?? null), "default", array())), "html_attr");
  38. echo "\"
  39. ";
  40. }
  41. // line 24
  42. public function block_input($context, array $blocks = array())
  43. {
  44. // line 25
  45. echo "
  46. ";
  47. // line 26
  48. $context["start_page"] = (($this->getAttribute(($context["field"] ?? null), "start_route", array())) ? ($this->getAttribute(($context["pages"] ?? null), "find", array(0 => $this->getAttribute(($context["field"] ?? null), "start_route", array())), "method")) : (null));
  49. // line 27
  50. echo " ";
  51. $context["show_all"] = ((($this->getAttribute(($context["field"] ?? null), "show_all", array()) === false)) ? (false) : (true));
  52. // line 28
  53. echo " ";
  54. $context["show_fullpath"] = ((($this->getAttribute(($context["field"] ?? null), "show_fullpath", array()) === true)) ? (true) : (false));
  55. // line 29
  56. echo " ";
  57. $context["show_slug"] = ((($this->getAttribute(($context["field"] ?? null), "show_slug", array()) === true)) ? (true) : (false));
  58. // line 30
  59. echo " ";
  60. $context["show_modular"] = ((($this->getAttribute(($context["field"] ?? null), "show_modular", array()) === true)) ? (true) : (false));
  61. // line 31
  62. echo " ";
  63. $context["limit_levels"] = (($this->getAttribute(($context["field"] ?? null), "limit_levels", array())) ? ($this->getAttribute(($context["field"] ?? null), "limit_levels", array())) : (false));
  64. // line 32
  65. echo "
  66. ";
  67. // line 33
  68. $context["page_list"] = $this->getAttribute($this->getAttribute(($context["grav"] ?? null), "pages", array()), "getList", array(0 => ($context["start_page"] ?? null), 1 => 0, 2 => true, 3 => ($context["show_all"] ?? null), 4 => ($context["show_fullpath"] ?? null), 5 => ($context["show_slug"] ?? null), 6 => ($context["show_modular"] ?? null), 7 => ($context["limit_levels"] ?? null)), "method");
  69. // line 34
  70. echo "
  71. <div class=\"form-select-wrapper ";
  72. // line 35
  73. echo twig_escape_filter($this->env, $this->getAttribute(($context["field"] ?? null), "size", array()), "html", null, true);
  74. echo "\">
  75. <select class=\"";
  76. // line 36
  77. echo twig_escape_filter($this->env, $this->getAttribute(($context["field"] ?? null), "classes", array()), "html", null, true);
  78. echo "\" name=\"";
  79. 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);
  80. echo "\"
  81. ";
  82. // line 37
  83. if (twig_in_filter($this->getAttribute(($context["field"] ?? null), "autofocus", array()), array(0 => "on", 1 => "true", 2 => 1))) {
  84. echo "autofocus=\"autofocus\"";
  85. }
  86. // line 38
  87. echo " ";
  88. if (twig_in_filter($this->getAttribute(($context["field"] ?? null), "novalidate", array()), array(0 => "on", 1 => "true", 2 => 1))) {
  89. echo "novalidate=\"novalidate\"";
  90. }
  91. // line 39
  92. echo " ";
  93. if (twig_in_filter($this->getAttribute($this->getAttribute(($context["field"] ?? null), "validate", array()), "required", array()), array(0 => "on", 1 => "true", 2 => 1))) {
  94. echo "required=\"required\"";
  95. }
  96. // line 40
  97. echo " ";
  98. if (twig_in_filter($this->getAttribute(($context["field"] ?? null), "multiple", array()), array(0 => "on", 1 => "true", 2 => 1))) {
  99. echo "multiple=\"multiple\"";
  100. }
  101. // line 41
  102. echo " ";
  103. if (($this->getAttribute(($context["field"] ?? null), "disabled", array()) || ($context["isDisabledToggleable"] ?? null))) {
  104. echo "disabled=\"disabled\"";
  105. }
  106. // line 42
  107. echo " >
  108. ";
  109. // line 43
  110. if ($this->getAttribute(($context["field"] ?? null), "show_root", array())) {
  111. // line 44
  112. echo " <option value=\"/\">/ (root)</option>
  113. ";
  114. }
  115. // line 46
  116. echo " ";
  117. echo $this->getAttribute($this, "page_options", array(0 => $context, 1 => ($context["page_list"] ?? null)), "method");
  118. echo "
  119. </select>
  120. </div>
  121. ";
  122. }
  123. // line 3
  124. public function getpage_options($__globals__ = null, $__pages_list__ = null, ...$__varargs__)
  125. {
  126. $context = $this->env->mergeGlobals(array(
  127. "globals" => $__globals__,
  128. "pages_list" => $__pages_list__,
  129. "varargs" => $__varargs__,
  130. ));
  131. $blocks = array();
  132. ob_start();
  133. try {
  134. // line 4
  135. echo " ";
  136. $context["field"] = $this->getAttribute(($context["globals"] ?? null), "field", array());
  137. // line 5
  138. echo " ";
  139. $context["value"] = $this->getAttribute(($context["globals"] ?? null), "value", array());
  140. // line 6
  141. echo " ";
  142. if (($this->getAttribute(($context["field"] ?? null), "options", array()) && (($context["depth"] ?? null) == 0))) {
  143. // line 7
  144. echo " ";
  145. $context['_parent'] = $context;
  146. $context['_seq'] = twig_ensure_traversable($this->getAttribute(($context["field"] ?? null), "options", array()));
  147. foreach ($context['_seq'] as $context["key"] => $context["value"]) {
  148. // line 8
  149. echo " <option value=\"";
  150. echo twig_escape_filter($this->env, $context["key"], "html_attr");
  151. echo "\">";
  152. echo twig_escape_filter($this->env, $this->env->getExtension('Grav\Common\Twig\TwigExtension')->translate($context["value"]), "html", null, true);
  153. echo "</option>
  154. ";
  155. }
  156. $_parent = $context['_parent'];
  157. unset($context['_seq'], $context['_iterated'], $context['key'], $context['value'], $context['_parent'], $context['loop']);
  158. $context = array_intersect_key($context, $_parent) + $_parent;
  159. // line 10
  160. echo " ";
  161. }
  162. // line 11
  163. echo "
  164. ";
  165. // line 12
  166. $context['_parent'] = $context;
  167. $context['_seq'] = twig_ensure_traversable(($context["pages_list"] ?? null));
  168. foreach ($context['_seq'] as $context["page_route"] => $context["option"]) {
  169. // line 13
  170. echo " <option ";
  171. if ((($context["page_route"] == ($context["value"] ?? null)) || ($this->getAttribute(($context["field"] ?? null), "multiple", array()) && twig_in_filter($context["page_route"], ($context["value"] ?? null))))) {
  172. echo "selected=\"selected\"";
  173. }
  174. echo " value=\"";
  175. echo twig_escape_filter($this->env, $context["page_route"], "html", null, true);
  176. echo "\">";
  177. echo $context["option"];
  178. echo "</option>
  179. ";
  180. }
  181. $_parent = $context['_parent'];
  182. unset($context['_seq'], $context['_iterated'], $context['page_route'], $context['option'], $context['_parent'], $context['loop']);
  183. $context = array_intersect_key($context, $_parent) + $_parent;
  184. } catch (Exception $e) {
  185. ob_end_clean();
  186. throw $e;
  187. } catch (Throwable $e) {
  188. ob_end_clean();
  189. throw $e;
  190. }
  191. return ('' === $tmp = ob_get_clean()) ? '' : new Twig_Markup($tmp, $this->env->getCharset());
  192. }
  193. public function getTemplateName()
  194. {
  195. return "forms/fields/pages/pages.html.twig";
  196. }
  197. public function isTraitable()
  198. {
  199. return false;
  200. }
  201. public function getDebugInfo()
  202. {
  203. return array ( 179 => 13, 175 => 12, 172 => 11, 169 => 10, 158 => 8, 153 => 7, 150 => 6, 147 => 5, 144 => 4, 131 => 3, 122 => 46, 118 => 44, 116 => 43, 113 => 42, 108 => 41, 103 => 40, 98 => 39, 93 => 38, 89 => 37, 83 => 36, 79 => 35, 76 => 34, 74 => 33, 71 => 32, 68 => 31, 65 => 30, 62 => 29, 59 => 28, 56 => 27, 54 => 26, 51 => 25, 48 => 24, 42 => 21, 38 => 20, 32 => 18, 29 => 17, 11 => 1,);
  204. }
  205. /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */
  206. public function getSource()
  207. {
  208. @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED);
  209. return $this->getSourceContext()->getCode();
  210. }
  211. public function getSourceContext()
  212. {
  213. return new Twig_Source("{% extends \"forms/field.html.twig\" %}
  214. {% macro page_options(globals, pages_list) %}
  215. {% set field = globals.field %}
  216. {% set value = globals.value %}
  217. {% if field.options and depth == 0 %}
  218. {% for key, value in field.options %}
  219. <option value=\"{{ key|e('html_attr') }}\">{{ value|t }}</option>
  220. {% endfor %}
  221. {% endif %}
  222. {% for page_route, option in pages_list %}
  223. <option {% if page_route == value or (field.multiple and page_route in value) %}selected=\"selected\"{% endif %} value=\"{{ page_route }}\">{{ option|raw }}</option>
  224. {% endfor %}
  225. {% endmacro %}
  226. {% block global_attributes %}
  227. data-grav-selectize=\"{{ (field.selectize is defined ? field.selectize : {})|json_encode|e('html_attr') }}\"
  228. data-grav-field=\"select\"
  229. data-grav-disabled=\"{{ originalValue is null ? 'true' : 'false' }}\"
  230. data-grav-default=\"{{ field.default|json_encode|e('html_attr') }}\"
  231. {% endblock %}
  232. {% block input %}
  233. {% set start_page = field.start_route ? pages.find(field.start_route) : null %}
  234. {% set show_all = field.show_all is same as(false) ? false : true %}
  235. {% set show_fullpath = field.show_fullpath is same as(true) ? true : false %}
  236. {% set show_slug = field.show_slug is same as(true) ? true : false %}
  237. {% set show_modular = field.show_modular is same as(true) ? true : false %}
  238. {% set limit_levels = field.limit_levels ?: false %}
  239. {% set page_list = grav.pages.getList(start_page, 0, true, show_all, show_fullpath, show_slug, show_modular, limit_levels) %}
  240. <div class=\"form-select-wrapper {{ field.size }}\">
  241. <select class=\"{{ field.classes }}\" name=\"{{ (scope ~ field.name)|fieldName ~ (field.multiple ? '[]' : '') }}\"
  242. {% if field.autofocus in ['on', 'true', 1] %}autofocus=\"autofocus\"{% endif %}
  243. {% if field.novalidate in ['on', 'true', 1] %}novalidate=\"novalidate\"{% endif %}
  244. {% if field.validate.required in ['on', 'true', 1] %}required=\"required\"{% endif %}
  245. {% if field.multiple in ['on', 'true', 1] %}multiple=\"multiple\"{% endif %}
  246. {% if field.disabled or isDisabledToggleable %}disabled=\"disabled\"{% endif %}
  247. >
  248. {% if field.show_root %}
  249. <option value=\"/\">/ (root)</option>
  250. {% endif %}
  251. {{ _self.page_options(_context, page_list) }}
  252. </select>
  253. </div>
  254. {% endblock %}
  255. ", "forms/fields/pages/pages.html.twig", "/mnt/data/Sites/static-ethica.net/user/plugins/admin/themes/grav/templates/forms/fields/pages/pages.html.twig");
  256. }
  257. }