0cb5f91895635a9559b9b709c0df21d522ceaee0b82bc5424bc85fc5e63b79d7.php 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. <?php
  2. /* forms/fields/themeselect/themeselect.html.twig */
  3. class __TwigTemplate_aabc3e9a11eebc37d1ff373413299e24a8ed9ff04f4961893b534b844b5971d9 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/themeselect/themeselect.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["options"] = array();
  23. // line 4
  24. $context['_parent'] = $context;
  25. $context['_seq'] = twig_ensure_traversable($this->getAttribute(($context["admin"] ?? null), "themes", array()));
  26. foreach ($context['_seq'] as $context["slug"] => $context["package"]) {
  27. // line 5
  28. $context["option"] = array($context["slug"] => $this->getAttribute($this->getAttribute($context["package"], "toArray", array(), "method"), "name", array()));
  29. // line 6
  30. $context["options"] = twig_array_merge(($context["options"] ?? null), ($context["option"] ?? null));
  31. }
  32. $_parent = $context['_parent'];
  33. unset($context['_seq'], $context['_iterated'], $context['slug'], $context['package'], $context['_parent'], $context['loop']);
  34. $context = array_intersect_key($context, $_parent) + $_parent;
  35. // line 1
  36. $this->parent->display($context, array_merge($this->blocks, $blocks));
  37. }
  38. // line 9
  39. public function block_global_attributes($context, array $blocks = array())
  40. {
  41. // line 10
  42. echo " data-grav-selectize=\"";
  43. 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");
  44. echo "\"
  45. data-grav-field=\"select\"
  46. data-grav-disabled=\"";
  47. // line 12
  48. echo (((null === ($context["originalValue"] ?? null))) ? ("true") : ("false"));
  49. echo "\"
  50. data-grav-default=\"";
  51. // line 13
  52. echo twig_escape_filter($this->env, twig_jsonencode_filter($this->getAttribute(($context["field"] ?? null), "default", array())), "html_attr");
  53. echo "\"
  54. ";
  55. }
  56. // line 16
  57. public function block_input($context, array $blocks = array())
  58. {
  59. // line 17
  60. echo " <div class=\"form-select-wrapper ";
  61. echo twig_escape_filter($this->env, $this->getAttribute(($context["field"] ?? null), "size", array()), "html", null, true);
  62. echo "\">
  63. <select class=\"";
  64. // line 18
  65. echo twig_escape_filter($this->env, $this->getAttribute(($context["field"] ?? null), "classes", array()), "html", null, true);
  66. echo "\" name=\"";
  67. 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);
  68. echo "\"
  69. ";
  70. // line 19
  71. if (twig_in_filter($this->getAttribute(($context["field"] ?? null), "autofocus", array()), array(0 => "on", 1 => "true", 2 => 1))) {
  72. echo "autofocus=\"autofocus\"";
  73. }
  74. // line 20
  75. echo " ";
  76. if (twig_in_filter($this->getAttribute(($context["field"] ?? null), "novalidate", array()), array(0 => "on", 1 => "true", 2 => 1))) {
  77. echo "novalidate=\"novalidate\"";
  78. }
  79. // line 21
  80. echo " ";
  81. if (twig_in_filter($this->getAttribute($this->getAttribute(($context["field"] ?? null), "validate", array()), "required", array()), array(0 => "on", 1 => "true", 2 => 1))) {
  82. echo "required=\"required\"";
  83. }
  84. // line 22
  85. echo " ";
  86. if (twig_in_filter($this->getAttribute(($context["field"] ?? null), "multiple", array()), array(0 => "on", 1 => "true", 2 => 1))) {
  87. echo "multiple=\"multiple\"";
  88. }
  89. // line 23
  90. echo " ";
  91. if (($this->getAttribute(($context["field"] ?? null), "disabled", array()) || ($context["isDisabledToggleable"] ?? null))) {
  92. echo "disabled=\"disabled\"";
  93. }
  94. echo ">
  95. ";
  96. // line 24
  97. $context['_parent'] = $context;
  98. $context['_seq'] = twig_ensure_traversable(($context["options"] ?? null));
  99. foreach ($context['_seq'] as $context["key"] => $context["text"]) {
  100. // line 25
  101. echo " <option ";
  102. if ((($context["key"] == ($context["value"] ?? null)) || twig_in_filter($context["text"], ($context["value"] ?? null)))) {
  103. echo "selected=\"selected\"";
  104. }
  105. echo " value=\"";
  106. echo twig_escape_filter($this->env, (($this->getAttribute(($context["field"] ?? null), "multiple", array())) ? ($context["text"]) : ($context["key"])), "html", null, true);
  107. echo "\">";
  108. echo twig_escape_filter($this->env, $context["text"], "html", null, true);
  109. echo "</option>
  110. ";
  111. }
  112. $_parent = $context['_parent'];
  113. unset($context['_seq'], $context['_iterated'], $context['key'], $context['text'], $context['_parent'], $context['loop']);
  114. $context = array_intersect_key($context, $_parent) + $_parent;
  115. // line 27
  116. echo " </select>
  117. </div>
  118. ";
  119. }
  120. public function getTemplateName()
  121. {
  122. return "forms/fields/themeselect/themeselect.html.twig";
  123. }
  124. public function isTraitable()
  125. {
  126. return false;
  127. }
  128. public function getDebugInfo()
  129. {
  130. return array ( 122 => 27, 107 => 25, 103 => 24, 96 => 23, 91 => 22, 86 => 21, 81 => 20, 77 => 19, 71 => 18, 66 => 17, 63 => 16, 57 => 13, 53 => 12, 47 => 10, 44 => 9, 40 => 1, 34 => 6, 32 => 5, 28 => 4, 26 => 3, 11 => 1,);
  131. }
  132. /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */
  133. public function getSource()
  134. {
  135. @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED);
  136. return $this->getSourceContext()->getCode();
  137. }
  138. public function getSourceContext()
  139. {
  140. return new Twig_Source("{% extends \"forms/field.html.twig\" %}
  141. {% set options = {} %}
  142. {% for slug, package in admin.themes %}
  143. {% set option = {(slug): package.toArray().name} %}
  144. {% set options = options|merge(option) %}
  145. {% endfor %}
  146. {% block global_attributes %}
  147. data-grav-selectize=\"{{ (field.selectize is defined ? field.selectize : {})|json_encode()|e('html_attr') }}\"
  148. data-grav-field=\"select\"
  149. data-grav-disabled=\"{{ originalValue is null ? 'true' : 'false' }}\"
  150. data-grav-default=\"{{ field.default|json_encode()|e('html_attr') }}\"
  151. {% endblock %}
  152. {% block input %}
  153. <div class=\"form-select-wrapper {{ field.size }}\">
  154. <select class=\"{{ field.classes }}\" name=\"{{ (scope ~ field.name)|fieldName ~ (field.multiple ? '[]' : '') }}\"
  155. {% if field.autofocus in ['on', 'true', 1] %}autofocus=\"autofocus\"{% endif %}
  156. {% if field.novalidate in ['on', 'true', 1] %}novalidate=\"novalidate\"{% endif %}
  157. {% if field.validate.required in ['on', 'true', 1] %}required=\"required\"{% endif %}
  158. {% if field.multiple in ['on', 'true', 1] %}multiple=\"multiple\"{% endif %}
  159. {% if field.disabled or isDisabledToggleable %}disabled=\"disabled\"{% endif %}>
  160. {% for key, text in options %}
  161. <option {% if key == value or text in value %}selected=\"selected\"{% endif %} value=\"{{ field.multiple ? text : key }}\">{{ text }}</option>
  162. {% endfor %}
  163. </select>
  164. </div>
  165. {% endblock %}
  166. ", "forms/fields/themeselect/themeselect.html.twig", "/mnt/data/Sites/static-ethica.net/user/plugins/admin/themes/grav/templates/forms/fields/themeselect/themeselect.html.twig");
  167. }
  168. }