249075002a9f60ec52754438c718b55a97075d0f2e30662dfdb5c9eccafafc9c.php 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. <?php
  2. /* forms/fields/conditional/conditional.html.twig */
  3. class __TwigTemplate_6297e3b5aa0dc00c5fde31002077683424eb01fe6636c27c77aa41e882e1cecf 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"] = $this->env->getExtension('Grav\Common\Twig\TwigExtension')->evaluateStringFunc($this->env, $context, $this->getAttribute(($context["field"] ?? null), "condition", array()));
  16. // line 2
  17. $context["value"] = (((($context["value"] ?? null) == "true")) ? (1) : (($context["value"] ?? null)));
  18. // line 3
  19. $context["value"] = (((($context["value"] ?? null) == "false")) ? (0) : (($context["value"] ?? null)));
  20. // line 4
  21. echo "
  22. ";
  23. // line 5
  24. if (($context["value"] ?? null)) {
  25. // line 6
  26. echo " ";
  27. if ($this->getAttribute(($context["field"] ?? null), "classes", array())) {
  28. // line 7
  29. echo " <div class=\"";
  30. echo twig_escape_filter($this->env, $this->getAttribute(($context["field"] ?? null), "classes", array()), "html", null, true);
  31. echo "\">
  32. ";
  33. }
  34. // line 9
  35. echo "
  36. ";
  37. // line 10
  38. if ($this->getAttribute(($context["field"] ?? null), "fields", array())) {
  39. // line 11
  40. echo " ";
  41. $context['_parent'] = $context;
  42. $context['_seq'] = twig_ensure_traversable($this->getAttribute($context["field"], "fields", array()));
  43. $context['loop'] = array(
  44. 'parent' => $context['_parent'],
  45. 'index0' => 0,
  46. 'index' => 1,
  47. 'first' => true,
  48. );
  49. if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof Countable)) {
  50. $length = count($context['_seq']);
  51. $context['loop']['revindex0'] = $length - 1;
  52. $context['loop']['revindex'] = $length;
  53. $context['loop']['length'] = $length;
  54. $context['loop']['last'] = 1 === $length;
  55. }
  56. foreach ($context['_seq'] as $context["_key"] => $context["field"]) {
  57. // line 12
  58. echo " ";
  59. if ($this->getAttribute($context["field"], "type", array())) {
  60. // line 13
  61. echo " ";
  62. $context["value"] = $this->getAttribute(($context["data"] ?? null), "value", array(0 => $this->getAttribute($context["field"], "name", array())), "method");
  63. // line 14
  64. echo " ";
  65. $this->loadTemplate(array(0 => (((("forms/fields/" . $this->getAttribute($context["field"], "type", array())) . "/") . $this->getAttribute($context["field"], "type", array())) . ".html.twig"), 1 => "forms/fields/text/text.html.twig"), "forms/fields/conditional/conditional.html.twig", 14)->display($context);
  66. // line 15
  67. echo " ";
  68. }
  69. // line 16
  70. echo " ";
  71. ++$context['loop']['index0'];
  72. ++$context['loop']['index'];
  73. $context['loop']['first'] = false;
  74. if (isset($context['loop']['length'])) {
  75. --$context['loop']['revindex0'];
  76. --$context['loop']['revindex'];
  77. $context['loop']['last'] = 0 === $context['loop']['revindex0'];
  78. }
  79. }
  80. $_parent = $context['_parent'];
  81. unset($context['_seq'], $context['_iterated'], $context['_key'], $context['field'], $context['_parent'], $context['loop']);
  82. $context = array_intersect_key($context, $_parent) + $_parent;
  83. // line 17
  84. echo " ";
  85. }
  86. // line 18
  87. echo "
  88. ";
  89. // line 19
  90. if ($this->getAttribute(($context["field"] ?? null), "classes", array())) {
  91. // line 20
  92. echo " </div>
  93. ";
  94. }
  95. }
  96. }
  97. public function getTemplateName()
  98. {
  99. return "forms/fields/conditional/conditional.html.twig";
  100. }
  101. public function isTraitable()
  102. {
  103. return false;
  104. }
  105. public function getDebugInfo()
  106. {
  107. return array ( 96 => 20, 94 => 19, 91 => 18, 88 => 17, 74 => 16, 71 => 15, 68 => 14, 65 => 13, 62 => 12, 44 => 11, 42 => 10, 39 => 9, 33 => 7, 30 => 6, 28 => 5, 25 => 4, 23 => 3, 21 => 2, 19 => 1,);
  108. }
  109. /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */
  110. public function getSource()
  111. {
  112. @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED);
  113. return $this->getSourceContext()->getCode();
  114. }
  115. public function getSourceContext()
  116. {
  117. return new Twig_Source("{% set value = evaluate(field.condition) %}
  118. {% set value = value == 'true' ? 1 : value %}
  119. {% set value = value == 'false' ? 0 : value %}
  120. {% if value %}
  121. {% if field.classes %}
  122. <div class=\"{{ field.classes }}\">
  123. {% endif %}
  124. {% if field.fields %}
  125. {% for field in field.fields %}
  126. {% if field.type %}
  127. {% set value = data.value(field.name) %}
  128. {% include [\"forms/fields/#{field.type}/#{field.type}.html.twig\", 'forms/fields/text/text.html.twig'] %}
  129. {% endif %}
  130. {% endfor %}
  131. {% endif %}
  132. {% if field.classes %}
  133. </div>
  134. {% endif %}
  135. {% endif %}
  136. ", "forms/fields/conditional/conditional.html.twig", "/home/kevin/Sites/static-ethica.net/user/plugins/form/templates/forms/fields/conditional/conditional.html.twig");
  137. }
  138. }