7653f7bbe5e01ad21833dc4cca69f7520c4df5eeee41f283b892730dc602b10b.php 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  1. <?php
  2. /* forms/fields/iconpicker/iconpicker.html.twig */
  3. class __TwigTemplate_e83861a9e85ee644597ae592da70c7ccf8834f4098a3046400a6187092ea9f4e 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/iconpicker/iconpicker.html.twig", 1);
  10. $this->blocks = array(
  11. 'global_attributes' => array($this, 'block_global_attributes'),
  12. 'input' => array($this, 'block_input'),
  13. 'input_attributes' => array($this, 'block_input_attributes'),
  14. );
  15. }
  16. protected function doGetParent(array $context)
  17. {
  18. return "forms/field.html.twig";
  19. }
  20. protected function doDisplay(array $context, array $blocks = array())
  21. {
  22. // line 2
  23. $context["originalValue"] = ((array_key_exists("originalValue", $context)) ? (($context["originalValue"] ?? null)) : (($context["value"] ?? null)));
  24. // line 3
  25. $context["value"] = (((null === ($context["value"] ?? null))) ? ($this->getAttribute(($context["field"] ?? null), "default", array())) : (($context["value"] ?? null)));
  26. // line 1
  27. $this->parent->display($context, array_merge($this->blocks, $blocks));
  28. }
  29. // line 5
  30. public function block_global_attributes($context, array $blocks = array())
  31. {
  32. // line 6
  33. echo " data-grav-iconpicker
  34. data-name=\"";
  35. // line 7
  36. echo twig_escape_filter($this->env, $this->getAttribute(($context["field"] ?? null), "name", array()), "html", null, true);
  37. echo "\"
  38. data-value=\"";
  39. // line 8
  40. echo twig_escape_filter($this->env, ($context["value"] ?? null), "html", null, true);
  41. echo "\"
  42. ";
  43. // line 9
  44. $this->displayParentBlock("global_attributes", $context, $blocks);
  45. echo "
  46. ";
  47. }
  48. // line 12
  49. public function block_input($context, array $blocks = array())
  50. {
  51. // line 13
  52. echo " <div class=\"form-list-wrapper ";
  53. echo twig_escape_filter($this->env, $this->getAttribute(($context["field"] ?? null), "size", array()), "html", null, true);
  54. echo "\" data-type=\"collection\">
  55. <div class=\"icon-picker\" data-pickerid=\"fa\" data-iconsets='{\"fa\":\"FontAwesome Icons\"}'>
  56. <input
  57. ";
  58. // line 17
  59. echo " name=\"";
  60. 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);
  61. echo "\"
  62. data-format=\"";
  63. // line 18
  64. echo ((($this->getAttribute(($context["field"] ?? null), "format", array()) == "short")) ? ("short") : ("long"));
  65. echo "\"
  66. value=\"";
  67. // line 19
  68. echo twig_escape_filter($this->env, twig_join_filter(($context["value"] ?? null), ", "), "html", null, true);
  69. echo "\"
  70. type=\"text\"
  71. ";
  72. // line 22
  73. echo " ";
  74. $this->displayBlock('input_attributes', $context, $blocks);
  75. // line 34
  76. echo " />
  77. </div>
  78. <div class=\"fa-set icon-set\">
  79. <ul>
  80. ";
  81. // line 39
  82. $context['_parent'] = $context;
  83. $context['_seq'] = twig_ensure_traversable(($context["fa_icons"] ?? null));
  84. foreach ($context['_seq'] as $context["_key"] => $context["icon"]) {
  85. // line 40
  86. echo " <li data-code=\"";
  87. echo twig_escape_filter($this->env, $this->getAttribute($context["icon"], "unicode", array()), "html", null, true);
  88. echo "\" data-class=\"fa fa-";
  89. echo twig_escape_filter($this->env, $this->getAttribute($context["icon"], "id", array()), "html", null, true);
  90. echo "\" class=\"fa fa-";
  91. echo twig_escape_filter($this->env, $this->getAttribute($context["icon"], "id", array()), "html", null, true);
  92. echo "\"></li>
  93. ";
  94. }
  95. $_parent = $context['_parent'];
  96. unset($context['_seq'], $context['_iterated'], $context['_key'], $context['icon'], $context['_parent'], $context['loop']);
  97. $context = array_intersect_key($context, $_parent) + $_parent;
  98. // line 42
  99. echo " </ul>
  100. </div>
  101. </div>
  102. ";
  103. }
  104. // line 22
  105. public function block_input_attributes($context, array $blocks = array())
  106. {
  107. // line 23
  108. echo " ";
  109. if ($this->getAttribute(($context["field"] ?? null), "classes", array(), "any", true, true)) {
  110. echo "class=\"";
  111. echo twig_escape_filter($this->env, $this->getAttribute(($context["field"] ?? null), "classes", array()), "html", null, true);
  112. echo "\" ";
  113. }
  114. // line 24
  115. echo " ";
  116. if ($this->getAttribute(($context["field"] ?? null), "id", array(), "any", true, true)) {
  117. echo "id=\"";
  118. echo twig_escape_filter($this->env, $this->getAttribute(($context["field"] ?? null), "id", array()));
  119. echo "\" ";
  120. }
  121. // line 25
  122. echo " ";
  123. if ($this->getAttribute(($context["field"] ?? null), "style", array(), "any", true, true)) {
  124. echo "style=\"";
  125. echo twig_escape_filter($this->env, $this->getAttribute(($context["field"] ?? null), "style", array()));
  126. echo "\" ";
  127. }
  128. // line 26
  129. echo " ";
  130. if ($this->getAttribute(($context["field"] ?? null), "disabled", array())) {
  131. echo "disabled=\"disabled\"";
  132. }
  133. // line 27
  134. echo " ";
  135. if ($this->getAttribute(($context["field"] ?? null), "placeholder", array())) {
  136. echo "placeholder=\"";
  137. echo twig_escape_filter($this->env, $this->getAttribute(($context["field"] ?? null), "placeholder", array()), "html", null, true);
  138. echo "\"";
  139. }
  140. // line 28
  141. echo " ";
  142. if (twig_in_filter($this->getAttribute(($context["field"] ?? null), "autofocus", array()), array(0 => "on", 1 => "true", 2 => 1))) {
  143. echo "autofocus=\"autofocus\"";
  144. }
  145. // line 29
  146. echo " ";
  147. if (twig_in_filter($this->getAttribute(($context["field"] ?? null), "novalidate", array()), array(0 => "on", 1 => "true", 2 => 1))) {
  148. echo "novalidate=\"novalidate\"";
  149. }
  150. // line 30
  151. echo " ";
  152. if (twig_in_filter($this->getAttribute(($context["field"] ?? null), "readonly", array()), array(0 => "on", 1 => "true", 2 => 1))) {
  153. echo "readonly=\"readonly\"";
  154. }
  155. // line 31
  156. echo " ";
  157. if (twig_in_filter($this->getAttribute(($context["field"] ?? null), "autocomplete", array()), array(0 => "on", 1 => "off"))) {
  158. echo "autocomplete=\"";
  159. echo twig_escape_filter($this->env, $this->getAttribute(($context["field"] ?? null), "autocomplete", array()), "html", null, true);
  160. echo "\"";
  161. }
  162. // line 32
  163. echo " ";
  164. if (twig_in_filter($this->getAttribute($this->getAttribute(($context["field"] ?? null), "validate", array()), "required", array()), array(0 => "on", 1 => "true", 2 => 1))) {
  165. echo "required=\"required\"";
  166. }
  167. // line 33
  168. echo " ";
  169. }
  170. public function getTemplateName()
  171. {
  172. return "forms/fields/iconpicker/iconpicker.html.twig";
  173. }
  174. public function isTraitable()
  175. {
  176. return false;
  177. }
  178. public function getDebugInfo()
  179. {
  180. return array ( 176 => 33, 171 => 32, 164 => 31, 159 => 30, 154 => 29, 149 => 28, 142 => 27, 137 => 26, 130 => 25, 123 => 24, 116 => 23, 113 => 22, 106 => 42, 93 => 40, 89 => 39, 82 => 34, 79 => 22, 74 => 19, 70 => 18, 65 => 17, 58 => 13, 55 => 12, 49 => 9, 45 => 8, 41 => 7, 38 => 6, 35 => 5, 31 => 1, 29 => 3, 27 => 2, 11 => 1,);
  181. }
  182. /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */
  183. public function getSource()
  184. {
  185. @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED);
  186. return $this->getSourceContext()->getCode();
  187. }
  188. public function getSourceContext()
  189. {
  190. return new Twig_Source("{% extends \"forms/field.html.twig\" %}
  191. {% set originalValue = originalValue is defined ? originalValue : value %}
  192. {% set value = (value is null ? field.default : value) %}
  193. {% block global_attributes %}
  194. data-grav-iconpicker
  195. data-name=\"{{field.name}}\"
  196. data-value=\"{{value}}\"
  197. {{ parent() }}
  198. {% endblock %}
  199. {% block input %}
  200. <div class=\"form-list-wrapper {{ field.size }}\" data-type=\"collection\">
  201. <div class=\"icon-picker\" data-pickerid=\"fa\" data-iconsets='{\"fa\":\"FontAwesome Icons\"}'>
  202. <input
  203. {# required attribute structures #}
  204. name=\"{{ (scope ~ field.name)|fieldName }}\"
  205. data-format=\"{{ field.format == 'short' ? 'short' : 'long' }}\"
  206. value=\"{{ value|raw|join(', ') }}\"
  207. type=\"text\"
  208. {# input attribute structures #}
  209. {% block input_attributes %}
  210. {% if field.classes is defined %}class=\"{{ field.classes }}\" {% endif %}
  211. {% if field.id is defined %}id=\"{{ field.id|e }}\" {% endif %}
  212. {% if field.style is defined %}style=\"{{ field.style|e }}\" {% endif %}
  213. {% if field.disabled %}disabled=\"disabled\"{% endif %}
  214. {% if field.placeholder %}placeholder=\"{{ field.placeholder }}\"{% endif %}
  215. {% if field.autofocus in ['on', 'true', 1] %}autofocus=\"autofocus\"{% endif %}
  216. {% if field.novalidate in ['on', 'true', 1] %}novalidate=\"novalidate\"{% endif %}
  217. {% if field.readonly in ['on', 'true', 1] %}readonly=\"readonly\"{% endif %}
  218. {% if field.autocomplete in ['on', 'off'] %}autocomplete=\"{{ field.autocomplete }}\"{% endif %}
  219. {% if field.validate.required in ['on', 'true', 1] %}required=\"required\"{% endif %}
  220. {% endblock %}
  221. />
  222. </div>
  223. <div class=\"fa-set icon-set\">
  224. <ul>
  225. {% for icon in fa_icons %}
  226. <li data-code=\"{{icon.unicode}}\" data-class=\"fa fa-{{icon.id}}\" class=\"fa fa-{{icon.id}}\"></li>
  227. {% endfor %}
  228. </ul>
  229. </div>
  230. </div>
  231. {% endblock %}
  232. ", "forms/fields/iconpicker/iconpicker.html.twig", "/mnt/data/Sites/r2c.net/user/plugins/admin/themes/grav/templates/forms/fields/iconpicker/iconpicker.html.twig");
  233. }
  234. }