3f02bffbe0d04cc8674a4a78e61517740973a56763fc0f0eb9c090db33182ee6.php 7.4 KB

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