4ae11d91a5860b6b34b6957dad97b293177e356e99b37d4c9dd3f701d3fcc1a9.php 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  1. <?php
  2. /* forms/fields/order/order.html.twig */
  3. class __TwigTemplate_9e9d1b57d128a064b4334edcbe2560064b5b53138be5dd0842c615cfbe981ff2 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["value"] = (((null === ($context["value"] ?? null))) ? ($this->getAttribute(($context["field"] ?? null), "default", array())) : (($context["value"] ?? null)));
  16. // line 2
  17. $context["siblings"] = $this->getAttribute($this->getAttribute(($context["data"] ?? null), "parent", array()), "children", array());
  18. // line 3
  19. $context["canOrder"] = $this->getAttribute(($context["data"] ?? null), "order", array());
  20. // line 4
  21. $context["vertical"] = ($this->getAttribute(($context["field"] ?? null), "style", array()) == "vertical");
  22. // line 5
  23. echo "
  24. <div class=\"form-field grid pure-g";
  25. // line 6
  26. if (($context["vertical"] ?? null)) {
  27. echo " vertical";
  28. }
  29. echo "\">
  30. <div class=\"form-label";
  31. // line 7
  32. if ( !($context["vertical"] ?? null)) {
  33. echo " block size-1-3 pure-u-1-3";
  34. }
  35. echo "\">
  36. <label>
  37. ";
  38. // line 9
  39. if ($this->getAttribute(($context["field"] ?? null), "help", array())) {
  40. // line 10
  41. echo " <span class=\"tooltip\" data-asTooltip-position=\"w\" title=\"";
  42. echo twig_escape_filter($this->env, $this->env->getExtension('Grav\Plugin\Admin\Twig\AdminTwigExtension')->tuFilter(twig_escape_filter($this->env, $this->getAttribute(($context["field"] ?? null), "help", array()))), "html", null, true);
  43. echo "\">";
  44. echo twig_escape_filter($this->env, $this->env->getExtension('Grav\Plugin\Admin\Twig\AdminTwigExtension')->tuFilter($this->getAttribute(($context["field"] ?? null), "label", array())), "html", null, true);
  45. echo "</span>
  46. ";
  47. } else {
  48. // line 12
  49. echo " ";
  50. echo twig_escape_filter($this->env, $this->env->getExtension('Grav\Plugin\Admin\Twig\AdminTwigExtension')->tuFilter($this->getAttribute(($context["field"] ?? null), "label", array())), "html", null, true);
  51. echo "
  52. ";
  53. }
  54. // line 14
  55. echo " ";
  56. echo ((twig_in_filter($this->getAttribute($this->getAttribute(($context["field"] ?? null), "validate", array()), "required", array()), array(0 => "on", 1 => "true", 2 => 1))) ? ("<span class=\"required\">*</span>") : (""));
  57. echo "
  58. </label>
  59. </div>
  60. <div class=\"form-data";
  61. // line 17
  62. if ( !($context["vertical"] ?? null)) {
  63. echo " block size-2-3 pure-u-2-3";
  64. }
  65. echo "\">
  66. <div class=\"form-order-wrapper ";
  67. // line 18
  68. echo twig_escape_filter($this->env, $this->getAttribute(($context["field"] ?? null), "size", array()), "html", null, true);
  69. echo "\">
  70. <input
  71. type=\"hidden\"
  72. data-order
  73. ";
  74. // line 23
  75. if (($this->getAttribute(($context["field"] ?? null), "disabled", array()) || ($context["isDisabledToggleable"] ?? null))) {
  76. echo "disabled=\"disabled\"";
  77. }
  78. // line 24
  79. echo " name=\"";
  80. 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);
  81. echo "\"
  82. value=\"\" />
  83. ";
  84. // line 26
  85. if ( !($context["canOrder"] ?? null)) {
  86. // line 27
  87. echo " <div class=\"notice\">";
  88. echo $this->env->getExtension('Grav\Plugin\Admin\Twig\AdminTwigExtension')->tuFilter("PLUGIN_ADMIN.ORDERING_DISABLED_BECAUSE_PAGE_NO_PREFIX");
  89. echo "</div>
  90. ";
  91. }
  92. // line 29
  93. echo "
  94. ";
  95. // line 30
  96. if ((twig_length_filter($this->env, ($context["siblings"] ?? null)) < 200)) {
  97. // line 31
  98. echo " ";
  99. $context["sortable_count"] = 0;
  100. // line 32
  101. echo "\t\t\t\t<ul id=\"ordering\" class=\"orderable ";
  102. echo twig_escape_filter($this->env, $this->getAttribute(($context["field"] ?? null), "classes", array()), "html", null, true);
  103. echo "\">
  104. \t\t\t ";
  105. // line 33
  106. $context['_parent'] = $context;
  107. $context['_seq'] = twig_ensure_traversable(($context["siblings"] ?? null));
  108. $context['loop'] = array(
  109. 'parent' => $context['_parent'],
  110. 'index0' => 0,
  111. 'index' => 1,
  112. 'first' => true,
  113. );
  114. foreach ($context['_seq'] as $context["_key"] => $context["page"]) {
  115. if ($this->getAttribute($context["page"], "order", array())) {
  116. // line 34
  117. echo "\t\t\t\t\t<li class=\"drag-handle\" data-id=\"";
  118. echo twig_escape_filter($this->env, $this->getAttribute($context["page"], "slug", array()), "html", null, true);
  119. echo "\" ";
  120. echo ((($this->getAttribute($context["page"], "slug", array()) == $this->getAttribute(($context["data"] ?? null), "slug", array()))) ? ("data-active-id") : (""));
  121. echo "><span class=\"page-order\">";
  122. echo twig_escape_filter($this->env, $this->getAttribute($context["page"], "order", array()), "html", null, true);
  123. echo "</span> ";
  124. echo twig_escape_filter($this->env, $this->getAttribute($context["page"], "title", array()));
  125. echo " <a href=\"";
  126. echo twig_escape_filter($this->env, $this->env->getExtension('Grav\Plugin\Admin\Twig\AdminTwigExtension')->getPageUrl($context, $context["page"]), "html", null, true);
  127. echo "\"><i class=\"fa fa-external-link\"></i></a></li>
  128. ";
  129. // line 35
  130. $context["sortable_count"] = $this->getAttribute($context["loop"], "index", array());
  131. // line 36
  132. echo " ";
  133. ++$context['loop']['index0'];
  134. ++$context['loop']['index'];
  135. $context['loop']['first'] = false;
  136. }
  137. }
  138. $_parent = $context['_parent'];
  139. unset($context['_seq'], $context['_iterated'], $context['_key'], $context['page'], $context['_parent'], $context['loop']);
  140. $context = array_intersect_key($context, $_parent) + $_parent;
  141. // line 37
  142. echo "\t\t\t\t</ul>
  143. ";
  144. // line 38
  145. if ((($context["sortable_count"] ?? null) < twig_length_filter($this->env, ($context["siblings"] ?? null)))) {
  146. // line 39
  147. echo " <label>";
  148. echo twig_escape_filter($this->env, $this->env->getExtension('Grav\Plugin\Admin\Twig\AdminTwigExtension')->tuFilter("PLUGIN_ADMIN.UNSORTABLE_PAGES"), "html", null, true);
  149. echo "</label>
  150. <ul class=\"orderable disabled\">
  151. ";
  152. // line 41
  153. $context['_parent'] = $context;
  154. $context['_seq'] = twig_ensure_traversable(($context["siblings"] ?? null));
  155. foreach ($context['_seq'] as $context["_key"] => $context["page"]) {
  156. if ( !$this->getAttribute($context["page"], "order", array())) {
  157. // line 42
  158. echo " <li ";
  159. echo ((($this->getAttribute($context["page"], "slug", array()) == $this->getAttribute(($context["data"] ?? null), "slug", array()))) ? ("data-active-id") : (""));
  160. echo ">";
  161. echo twig_escape_filter($this->env, $this->getAttribute($context["page"], "title", array()));
  162. echo " <a href=\"";
  163. echo twig_escape_filter($this->env, $this->env->getExtension('Grav\Plugin\Admin\Twig\AdminTwigExtension')->getPageUrl($context, $context["page"]), "html", null, true);
  164. echo "\"><i class=\"fa fa-external-link\"></i></a></li>
  165. ";
  166. }
  167. }
  168. $_parent = $context['_parent'];
  169. unset($context['_seq'], $context['_iterated'], $context['_key'], $context['page'], $context['_parent'], $context['loop']);
  170. $context = array_intersect_key($context, $_parent) + $_parent;
  171. // line 44
  172. echo " </ul>
  173. ";
  174. }
  175. // line 46
  176. echo "\t\t\t";
  177. } else {
  178. // line 47
  179. echo " <div class=\"notice\">";
  180. echo twig_escape_filter($this->env, $this->env->getExtension('Grav\Plugin\Admin\Twig\AdminTwigExtension')->tuFilter("PLUGIN_ADMIN.ORDERING_DISABLED_BECAUSE_TOO_MANY_SIBLINGS"), "html", null, true);
  181. echo "</div>
  182. \t\t\t";
  183. }
  184. // line 49
  185. echo " </div>
  186. </div>
  187. </div>
  188. ";
  189. }
  190. public function getTemplateName()
  191. {
  192. return "forms/fields/order/order.html.twig";
  193. }
  194. public function isTraitable()
  195. {
  196. return false;
  197. }
  198. public function getDebugInfo()
  199. {
  200. return array ( 190 => 49, 184 => 47, 181 => 46, 177 => 44, 163 => 42, 158 => 41, 152 => 39, 150 => 38, 147 => 37, 137 => 36, 135 => 35, 122 => 34, 111 => 33, 106 => 32, 103 => 31, 101 => 30, 98 => 29, 92 => 27, 90 => 26, 84 => 24, 80 => 23, 72 => 18, 66 => 17, 59 => 14, 53 => 12, 45 => 10, 43 => 9, 36 => 7, 30 => 6, 27 => 5, 25 => 4, 23 => 3, 21 => 2, 19 => 1,);
  201. }
  202. /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */
  203. public function getSource()
  204. {
  205. @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED);
  206. return $this->getSourceContext()->getCode();
  207. }
  208. public function getSourceContext()
  209. {
  210. return new Twig_Source("{% set value = (value is null ? field.default : value) %}
  211. {% set siblings = data.parent.children %}
  212. {% set canOrder = data.order %}
  213. {% set vertical = field.style == 'vertical' %}
  214. <div class=\"form-field grid pure-g{% if vertical %} vertical{% endif %}\">
  215. <div class=\"form-label{% if not vertical %} block size-1-3 pure-u-1-3{% endif %}\">
  216. <label>
  217. {% if field.help %}
  218. <span class=\"tooltip\" data-asTooltip-position=\"w\" title=\"{{ field.help|e|tu }}\">{{ field.label|tu }}</span>
  219. {% else %}
  220. {{ field.label|tu }}
  221. {% endif %}
  222. {{ field.validate.required in ['on', 'true', 1] ? '<span class=\"required\">*</span>' }}
  223. </label>
  224. </div>
  225. <div class=\"form-data{% if not vertical %} block size-2-3 pure-u-2-3{% endif %}\">
  226. <div class=\"form-order-wrapper {{ field.size }}\">
  227. <input
  228. type=\"hidden\"
  229. data-order
  230. {% if field.disabled or isDisabledToggleable %}disabled=\"disabled\"{% endif %}
  231. name=\"{{ (scope ~ field.name)|fieldName }}\"
  232. value=\"\" />
  233. {% if not canOrder %}
  234. <div class=\"notice\">{{ \"PLUGIN_ADMIN.ORDERING_DISABLED_BECAUSE_PAGE_NO_PREFIX\"|tu|raw }}</div>
  235. {% endif %}
  236. {% if siblings|length < 200 %}
  237. {% set sortable_count = 0 %}
  238. \t\t\t\t<ul id=\"ordering\" class=\"orderable {{ field.classes }}\">
  239. \t\t\t {% for page in siblings if page.order %}
  240. \t\t\t\t\t<li class=\"drag-handle\" data-id=\"{{ page.slug }}\" {{ page.slug == data.slug ? 'data-active-id' : ''}}><span class=\"page-order\">{{ page.order }}</span> {{ page.title|e }} <a href=\"{{ getPageUrl(page) }}\"><i class=\"fa fa-external-link\"></i></a></li>
  241. {% set sortable_count = loop.index %}
  242. {% endfor %}
  243. \t\t\t\t</ul>
  244. {% if sortable_count < siblings|length %}
  245. <label>{{ \"PLUGIN_ADMIN.UNSORTABLE_PAGES\"|tu }}</label>
  246. <ul class=\"orderable disabled\">
  247. {% for page in siblings if not page.order %}
  248. <li {{ page.slug == data.slug ? 'data-active-id' : ''}}>{{ page.title|e }} <a href=\"{{ getPageUrl(page) }}\"><i class=\"fa fa-external-link\"></i></a></li>
  249. {% endfor %}
  250. </ul>
  251. {% endif %}
  252. \t\t\t{% else %}
  253. <div class=\"notice\">{{ \"PLUGIN_ADMIN.ORDERING_DISABLED_BECAUSE_TOO_MANY_SIBLINGS\"|tu }}</div>
  254. \t\t\t{% endif %}
  255. </div>
  256. </div>
  257. </div>
  258. ", "forms/fields/order/order.html.twig", "/mnt/data/Sites/r2c.net/user/plugins/admin/themes/grav/templates/forms/fields/order/order.html.twig");
  259. }
  260. }