aef6fb2127795c7010db5033b32f378aa015920bc09f1e816cf537ea4d8d1173.php 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. <?php
  2. /* forms/fields/editor/editor.html.twig */
  3. class __TwigTemplate_fdd1d27a4ac3b42b16936e89aedd93d1949d8333e3d3b6a7d016bfc7248c7ce5 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. 'label' => array($this, 'block_label'),
  11. 'field' => array($this, 'block_field'),
  12. );
  13. }
  14. protected function doDisplay(array $context, array $blocks = array())
  15. {
  16. // line 1
  17. $context["value"] = (((null === ($context["value"] ?? null))) ? ($this->env->getExtension('Grav\Plugin\Admin\AdminTwigExtension')->tuFilter($this->getAttribute(($context["field"] ?? null), "default", array()))) : (($context["value"] ?? null)));
  18. // line 2
  19. if ( !($context["codemirrorOptions"] ?? null)) {
  20. // line 3
  21. echo " ";
  22. $context["codemirrorOptions"] = twig_array_merge(array("mode" => "gfm", "ignore" => array(0 => "code", 1 => "preview")), (($this->getAttribute(($context["field"] ?? null), "codemirror", array(), "any", true, true)) ? (_twig_default_filter($this->getAttribute(($context["field"] ?? null), "codemirror", array()), array())) : (array())));
  23. }
  24. // line 5
  25. echo "
  26. ";
  27. // line 6
  28. $this->displayBlock('label', $context, $blocks);
  29. // line 12
  30. $this->displayBlock('field', $context, $blocks);
  31. }
  32. // line 6
  33. public function block_label($context, array $blocks = array())
  34. {
  35. // line 7
  36. echo " ";
  37. if ($this->getAttribute(($context["field"] ?? null), "label", array())) {
  38. // line 8
  39. echo " ";
  40. $context["hint"] = (($this->getAttribute(($context["field"] ?? null), "help", array())) ? ((("data-hint=\"" . $this->env->getExtension('Grav\Plugin\Admin\AdminTwigExtension')->tuFilter($this->getAttribute(($context["field"] ?? null), "help", array()))) . "\"")) : (""));
  41. // line 9
  42. echo " <div class=\"form-label form-field hint--bottom\" ";
  43. echo twig_escape_filter($this->env, ($context["hint"] ?? null), "html", null, true);
  44. echo ">";
  45. echo $this->env->getExtension('Grav\Plugin\Admin\AdminTwigExtension')->tuFilter($this->getAttribute(($context["field"] ?? null), "label", array()));
  46. echo "</div>
  47. ";
  48. }
  49. }
  50. // line 12
  51. public function block_field($context, array $blocks = array())
  52. {
  53. // line 13
  54. echo " <div class=\"form-field ";
  55. echo twig_escape_filter($this->env, (($this->getAttribute(($context["field"] ?? null), "classes", array(), "any", true, true)) ? (_twig_default_filter($this->getAttribute(($context["field"] ?? null), "classes", array()), "")) : ("")), "html", null, true);
  56. echo "\">
  57. <div class=\"form-data grav-editor\">
  58. <div class=\"grav-editor-content is-active\">
  59. <textarea
  60. data-grav-editor=\"";
  61. // line 17
  62. echo twig_escape_filter($this->env, twig_jsonencode_filter(array("codemirror" => ($context["codemirrorOptions"] ?? null))), "html_attr");
  63. echo "\"
  64. data-grav-editor-mode=\"editor\"
  65. name=\"";
  66. // line 19
  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()))), "html", null, true);
  68. echo "\"
  69. ";
  70. // line 20
  71. if ($this->getAttribute(($context["field"] ?? null), "classes", array(), "any", true, true)) {
  72. echo "class=\"";
  73. echo twig_escape_filter($this->env, $this->getAttribute(($context["field"] ?? null), "classes", array()), "html", null, true);
  74. echo "\" ";
  75. }
  76. // line 21
  77. echo " ";
  78. if ($this->getAttribute(($context["field"] ?? null), "id", array(), "any", true, true)) {
  79. echo "id=\"";
  80. echo twig_escape_filter($this->env, $this->getAttribute(($context["field"] ?? null), "id", array()));
  81. echo "\" ";
  82. }
  83. // line 22
  84. echo " ";
  85. if ($this->getAttribute(($context["field"] ?? null), "style", array(), "any", true, true)) {
  86. echo "style=\"";
  87. echo twig_escape_filter($this->env, $this->getAttribute(($context["field"] ?? null), "style", array()));
  88. echo "\" ";
  89. }
  90. // line 23
  91. echo " ";
  92. if (($this->getAttribute(($context["field"] ?? null), "disabled", array()) || ($context["isDisabledToggleable"] ?? null))) {
  93. echo "disabled=\"disabled\"";
  94. }
  95. // line 24
  96. echo " ";
  97. if ($this->getAttribute(($context["field"] ?? null), "placeholder", array())) {
  98. echo "placeholder=\"";
  99. echo twig_escape_filter($this->env, $this->env->getExtension('Grav\Plugin\Admin\AdminTwigExtension')->tuFilter($this->getAttribute(($context["field"] ?? null), "placeholder", array())), "html", null, true);
  100. echo "\"";
  101. }
  102. // line 25
  103. echo " ";
  104. if (twig_in_filter($this->getAttribute(($context["field"] ?? null), "autofocus", array()), array(0 => "on", 1 => "true", 2 => 1))) {
  105. echo "autofocus=\"autofocus\"";
  106. }
  107. // line 26
  108. echo " ";
  109. if (twig_in_filter($this->getAttribute(($context["field"] ?? null), "novalidate", array()), array(0 => "on", 1 => "true", 2 => 1))) {
  110. echo "novalidate=\"novalidate\"";
  111. }
  112. // line 27
  113. echo " ";
  114. if (twig_in_filter($this->getAttribute(($context["field"] ?? null), "readonly", array()), array(0 => "on", 1 => "true", 2 => 1))) {
  115. echo "readonly=\"readonly\"";
  116. }
  117. // line 28
  118. echo " ";
  119. if (twig_in_filter($this->getAttribute($this->getAttribute(($context["field"] ?? null), "validate", array()), "required", array()), array(0 => "on", 1 => "true", 2 => 1))) {
  120. echo "required=\"required\"";
  121. }
  122. // line 29
  123. echo " ";
  124. if (!twig_in_filter("preview", $this->getAttribute(($context["codemirrorOptions"] ?? null), "ignore", array()))) {
  125. echo "data-grav-urlpreview=\"";
  126. echo twig_escape_filter($this->env, ($context["base_url"] ?? null), "html", null, true);
  127. echo "/media/";
  128. echo twig_escape_filter($this->env, twig_trim_filter($this->getAttribute(($context["admin"] ?? null), "route", array()), "/"), "html", null, true);
  129. echo ".json\"";
  130. }
  131. // line 30
  132. echo " >";
  133. echo twig_escape_filter($this->env, twig_join_filter(($context["value"] ?? null), "
  134. "), "html");
  135. echo "</textarea>
  136. </div>
  137. ";
  138. // line 32
  139. if (( !$this->getAttribute(($context["field"] ?? null), "resizer", array(), "any", true, true) || !twig_in_filter($this->getAttribute(($context["field"] ?? null), "resizer", array()), array(0 => "off", 1 => "false", 2 => 0)))) {
  140. echo "<div class=\"grav-editor-resizer\"></div>";
  141. }
  142. // line 33
  143. echo " </div>
  144. </div>
  145. ";
  146. }
  147. public function getTemplateName()
  148. {
  149. return "forms/fields/editor/editor.html.twig";
  150. }
  151. public function isTraitable()
  152. {
  153. return false;
  154. }
  155. public function getDebugInfo()
  156. {
  157. return array ( 149 => 33, 145 => 32, 138 => 30, 129 => 29, 124 => 28, 119 => 27, 114 => 26, 109 => 25, 102 => 24, 97 => 23, 90 => 22, 83 => 21, 77 => 20, 73 => 19, 68 => 17, 60 => 13, 57 => 12, 47 => 9, 44 => 8, 41 => 7, 38 => 6, 34 => 12, 32 => 6, 29 => 5, 25 => 3, 23 => 2, 21 => 1,);
  158. }
  159. /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */
  160. public function getSource()
  161. {
  162. @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED);
  163. return $this->getSourceContext()->getCode();
  164. }
  165. public function getSourceContext()
  166. {
  167. return new Twig_Source("{% set value = (value is null ? field.default|tu : value) %}
  168. {% if not codemirrorOptions %}
  169. {% set codemirrorOptions = {'mode': 'gfm', 'ignore': ['code', 'preview']}|merge(field.codemirror|default({})) %}
  170. {% endif %}
  171. {% block label %}
  172. {% if field.label %}
  173. {% set hint = field.help ? 'data-hint=\"' ~ field.help|tu|raw ~ '\"': '' %}
  174. <div class=\"form-label form-field hint--bottom\" {{ hint }}>{{ field.label|tu|raw }}</div>
  175. {% endif %}
  176. {% endblock %}
  177. {% block field %}
  178. <div class=\"form-field {{ field.classes|default('') }}\">
  179. <div class=\"form-data grav-editor\">
  180. <div class=\"grav-editor-content is-active\">
  181. <textarea
  182. data-grav-editor=\"{{ {'codemirror': codemirrorOptions} | json_encode|e('html_attr') }}\"
  183. data-grav-editor-mode=\"editor\"
  184. name=\"{{ (scope ~ field.name)|fieldName }}\"
  185. {% if field.classes is defined %}class=\"{{ field.classes }}\" {% endif %}
  186. {% if field.id is defined %}id=\"{{ field.id|e }}\" {% endif %}
  187. {% if field.style is defined %}style=\"{{ field.style|e }}\" {% endif %}
  188. {% if field.disabled or isDisabledToggleable %}disabled=\"disabled\"{% endif %}
  189. {% if field.placeholder %}placeholder=\"{{ field.placeholder|tu }}\"{% endif %}
  190. {% if field.autofocus in ['on', 'true', 1] %}autofocus=\"autofocus\"{% endif %}
  191. {% if field.novalidate in ['on', 'true', 1] %}novalidate=\"novalidate\"{% endif %}
  192. {% if field.readonly in ['on', 'true', 1] %}readonly=\"readonly\"{% endif %}
  193. {% if field.validate.required in ['on', 'true', 1] %}required=\"required\"{% endif %}
  194. {% if 'preview' not in codemirrorOptions.ignore %}data-grav-urlpreview=\"{{ base_url }}/media/{{ admin.route|trim('/') }}.json\"{% endif %}
  195. >{{ value|join(\"\\n\")|e('html') }}</textarea>
  196. </div>
  197. {% if field.resizer is not defined or field.resizer not in ['off', 'false', 0] %}<div class=\"grav-editor-resizer\"></div>{% endif %}
  198. </div>
  199. </div>
  200. {% endblock %}
  201. ", "forms/fields/editor/editor.html.twig", "/mnt/data/Sites/static-ethica.net/user/plugins/admin/themes/grav/templates/forms/fields/editor/editor.html.twig");
  202. }
  203. }