643db05024d01591ea436850a24957db0f6bdb695d7633a6c9aa508503b2ecff.php 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. <?php
  2. /* forms/fields/taxonomy/taxonomy.html.twig */
  3. class __TwigTemplate_35c5a720e1eb58f7619cabaced877bec74f1b2fa57d990907652ecfcdf871581 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["taxonomies"] = (((null === ($context["taxonomies"] ?? null))) ? ((($this->getAttribute(($context["field"] ?? null), "taxonomies", array())) ? ($this->getAttribute(($context["field"] ?? null), "taxonomies", array())) : ($this->getAttribute($this->getAttribute(($context["admin"] ?? null), "data", array(0 => "config/site"), "method"), "taxonomies", array())))) : (($context["taxonomies"] ?? null)));
  16. // line 2
  17. $context["parentname"] = $this->getAttribute(($context["field"] ?? null), "name", array());
  18. // line 3
  19. echo "
  20. ";
  21. // line 4
  22. $context['_parent'] = $context;
  23. $context['_seq'] = twig_ensure_traversable(($context["taxonomies"] ?? null));
  24. $context['loop'] = array(
  25. 'parent' => $context['_parent'],
  26. 'index0' => 0,
  27. 'index' => 1,
  28. 'first' => true,
  29. );
  30. if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof Countable)) {
  31. $length = count($context['_seq']);
  32. $context['loop']['revindex0'] = $length - 1;
  33. $context['loop']['revindex'] = $length;
  34. $context['loop']['length'] = $length;
  35. $context['loop']['last'] = 1 === $length;
  36. }
  37. foreach ($context['_seq'] as $context["_key"] => $context["name"]) {
  38. // line 5
  39. echo "
  40. ";
  41. // line 6
  42. $context["value"] = $this->env->getExtension('Grav\Common\Twig\TwigExtension')->arrayFunc((($this->getAttribute(($context["data"] ?? null), "value", array(0 => ("header.taxonomy." . $context["name"])), "method", true, true)) ? (_twig_default_filter($this->getAttribute(($context["data"] ?? null), "value", array(0 => ("header.taxonomy." . $context["name"])), "method"), array())) : (array())));
  43. // line 7
  44. echo " ";
  45. $context["sub_taxonomies"] = twig_get_array_keys_filter((($this->getAttribute($this->getAttribute($this->getAttribute(($context["grav"] ?? null), "taxonomy", array(), "any", false, true), "taxonomy", array(), "any", false, true), $context["name"], array(), "any", true, true)) ? (_twig_default_filter($this->getAttribute($this->getAttribute($this->getAttribute(($context["grav"] ?? null), "taxonomy", array(), "any", false, true), "taxonomy", array(), "any", false, true), $context["name"]), array())) : (array())));
  46. // line 8
  47. echo " ";
  48. $context["list"] = array_unique(twig_array_merge(twig_array_merge(array(), ($context["sub_taxonomies"] ?? null)), ($context["value"] ?? null)));
  49. // line 9
  50. echo "
  51. ";
  52. // line 10
  53. $context["field"] = array("type" => "select", "classes" => "fancy create", "label" => twig_capitalize_string_filter($this->env, // line 13
  54. $context["name"]), "name" => (( // line 14
  55. ($context["parentname"] ?? null) . ".") . $context["name"]), "multiple" => true, "options" => // line 16
  56. ($context["list"] ?? null), "style" => $this->getAttribute( // line 17
  57. ($context["field"] ?? null), "style", array()), "selectize" => array("create" => true));
  58. // line 22
  59. echo "
  60. ";
  61. // line 23
  62. $this->loadTemplate(array(0 => "forms/fields/select/select.html.twig"), "forms/fields/taxonomy/taxonomy.html.twig", 23)->display($context);
  63. ++$context['loop']['index0'];
  64. ++$context['loop']['index'];
  65. $context['loop']['first'] = false;
  66. if (isset($context['loop']['length'])) {
  67. --$context['loop']['revindex0'];
  68. --$context['loop']['revindex'];
  69. $context['loop']['last'] = 0 === $context['loop']['revindex0'];
  70. }
  71. }
  72. $_parent = $context['_parent'];
  73. unset($context['_seq'], $context['_iterated'], $context['_key'], $context['name'], $context['_parent'], $context['loop']);
  74. $context = array_intersect_key($context, $_parent) + $_parent;
  75. }
  76. public function getTemplateName()
  77. {
  78. return "forms/fields/taxonomy/taxonomy.html.twig";
  79. }
  80. public function isTraitable()
  81. {
  82. return false;
  83. }
  84. public function getDebugInfo()
  85. {
  86. return array ( 66 => 23, 63 => 22, 61 => 17, 60 => 16, 59 => 14, 58 => 13, 57 => 10, 54 => 9, 51 => 8, 48 => 7, 46 => 6, 43 => 5, 26 => 4, 23 => 3, 21 => 2, 19 => 1,);
  87. }
  88. /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */
  89. public function getSource()
  90. {
  91. @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED);
  92. return $this->getSourceContext()->getCode();
  93. }
  94. public function getSourceContext()
  95. {
  96. return new Twig_Source("{% set taxonomies = (taxonomies is null ? (field.taxonomies ? field.taxonomies : admin.data('config/site').taxonomies) : taxonomies) %}
  97. {% set parentname = field.name %}
  98. {% for name in taxonomies %}
  99. {% set value = array(data.value('header.taxonomy.' ~ name)|default([])) %}
  100. {% set sub_taxonomies = attribute(grav.taxonomy.taxonomy, name)|default([])|keys %}
  101. {% set list = []|merge(sub_taxonomies)|merge(value)|array_unique %}
  102. {% set field = {
  103. type: 'select',
  104. classes: 'fancy create',
  105. label: name|capitalize,
  106. name: parentname ~ '.' ~ name,
  107. multiple: true,
  108. options: list,
  109. style: field.style,
  110. selectize: {
  111. create: true
  112. }
  113. } %}
  114. {% include ['forms/fields/select/select.html.twig'] %}
  115. {% endfor %}
  116. ", "forms/fields/taxonomy/taxonomy.html.twig", "/mnt/data/Sites/static-ethica.net/user/plugins/admin/themes/grav/templates/forms/fields/taxonomy/taxonomy.html.twig");
  117. }
  118. }