var/cache/dev/twig/60/609974ef60e78338668b9d0f67f5e456.php line 40

Open in your IDE?
  1. <?php
  2. use Twig\Environment;
  3. use Twig\Error\LoaderError;
  4. use Twig\Error\RuntimeError;
  5. use Twig\Extension\CoreExtension;
  6. use Twig\Extension\SandboxExtension;
  7. use Twig\Markup;
  8. use Twig\Sandbox\SecurityError;
  9. use Twig\Sandbox\SecurityNotAllowedTagError;
  10. use Twig\Sandbox\SecurityNotAllowedFilterError;
  11. use Twig\Sandbox\SecurityNotAllowedFunctionError;
  12. use Twig\Source;
  13. use Twig\Template;
  14. use Twig\TemplateWrapper;
  15. /* content/image/view.html.twig */
  16. class __TwigTemplate_b83923bd8b10efd578da69181016101a extends Template
  17. {
  18. private Source $source;
  19. /**
  20. * @var array<string, Template>
  21. */
  22. private array $macros = [];
  23. public function __construct(Environment $env)
  24. {
  25. parent::__construct($env);
  26. $this->source = $this->getSourceContext();
  27. $this->parent = false;
  28. $this->blocks = [
  29. ];
  30. $this->sandbox = $this->extensions[SandboxExtension::class];
  31. $this->checkSecurity();
  32. }
  33. protected function doDisplay(array $context, array $blocks = []): iterable
  34. {
  35. $macros = $this->macros;
  36. $__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  37. $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "content/image/view.html.twig"));
  38. $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  39. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "content/image/view.html.twig"));
  40. // line 1
  41. $context["thumbnaileName"] = $this->extensions['Pimcore\Twig\Extension\DocumentEditableExtension']->renderEditable($context, "select", "thumbnaileName");
  42. // line 2
  43. $context["contentImage"] = CoreExtension::getAttribute($this->env, $this->source, $this->extensions['Pimcore\Twig\Extension\DocumentEditableExtension']->renderEditable($context, "image", "contentImage", ["thumbnail" => $this->sandbox->ensureToStringAllowed(CoreExtension::getAttribute($this->env, $this->source, (isset($context["thumbnaileName"]) || array_key_exists("thumbnaileName", $context) ? $context["thumbnaileName"] : (function () { throw new RuntimeError('Variable "thumbnaileName" does not exist.', 2, $this->source); })()), "text", [], "any", false, false, true, 2), 2, $this->source)]), "getThumbnail", [CoreExtension::getAttribute($this->env, $this->source, (isset($context["thumbnaileName"]) || array_key_exists("thumbnaileName", $context) ? $context["thumbnaileName"] : (function () { throw new RuntimeError('Variable "thumbnaileName" does not exist.', 2, $this->source); })()), "text", [], "any", false, false, true, 2)], "method", false, false, true, 2);
  44. // line 3
  45. $context["caption"] = $this->extensions['Pimcore\Twig\Extension\DocumentEditableExtension']->renderEditable($context, "input", "caption");
  46. // line 4
  47. $context["imageLink"] = $this->extensions['Pimcore\Twig\Extension\DocumentEditableExtension']->renderEditable($context, "link", "imageLink");
  48. // line 5
  49. yield "
  50. ";
  51. // line 6
  52. if ((array_key_exists("container", $context) && ((isset($context["container"]) || array_key_exists("container", $context) ? $context["container"] : (function () { throw new RuntimeError('Variable "container" does not exist.', 6, $this->source); })()) == false))) {
  53. // line 7
  54. yield " ";
  55. $context["containerClass"] = "";
  56. }
  57. // line 9
  58. yield "
  59. ";
  60. // line 11
  61. if ((isset($context["contentImage"]) || array_key_exists("contentImage", $context) ? $context["contentImage"] : (function () { throw new RuntimeError('Variable "contentImage" does not exist.', 11, $this->source); })())) {
  62. // line 12
  63. yield " ";
  64. $context["imageRendered"] = ('' === $tmp = \Twig\Extension\CoreExtension::captureOutput((function () use (&$context, $macros, $blocks) {
  65. // line 13
  66. yield " <figure class=\"";
  67. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->sandbox->ensureToStringAllowed(CoreExtension::getAttribute($this->env, $this->source, (isset($context["align"]) || array_key_exists("align", $context) ? $context["align"] : (function () { throw new RuntimeError('Variable "align" does not exist.', 13, $this->source); })()), "getData", [], "method", false, false, true, 13), 13, $this->source), "html", null, true);
  68. yield " ";
  69. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->sandbox->ensureToStringAllowed((isset($context["containerClass"]) || array_key_exists("containerClass", $context) ? $context["containerClass"] : (function () { throw new RuntimeError('Variable "containerClass" does not exist.', 13, $this->source); })()), 13, $this->source), "html", null, true);
  70. yield " ";
  71. yield ((CoreExtension::getAttribute($this->env, $this->source, (isset($context["lightbox"]) || array_key_exists("lightbox", $context) ? $context["lightbox"] : (function () { throw new RuntimeError('Variable "lightbox" does not exist.', 13, $this->source); })()), "getData", [], "method", false, false, true, 13)) ? ("lightbox") : (""));
  72. yield "\" data-src=\"";
  73. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->sandbox->ensureToStringAllowed(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["contentImage"]) || array_key_exists("contentImage", $context) ? $context["contentImage"] : (function () { throw new RuntimeError('Variable "contentImage" does not exist.', 13, $this->source); })()), "asset", [], "any", false, false, true, 13), "path", [], "any", false, false, true, 13), 13, $this->source), "html", null, true);
  74. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->sandbox->ensureToStringAllowed(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["contentImage"]) || array_key_exists("contentImage", $context) ? $context["contentImage"] : (function () { throw new RuntimeError('Variable "contentImage" does not exist.', 13, $this->source); })()), "asset", [], "any", false, false, true, 13), "filename", [], "any", false, false, true, 13), 13, $this->source), "html", null, true);
  75. yield "\">
  76. ";
  77. // line 14
  78. yield $this->sandbox->ensureToStringAllowed(CoreExtension::getAttribute($this->env, $this->source, (isset($context["contentImage"]) || array_key_exists("contentImage", $context) ? $context["contentImage"] : (function () { throw new RuntimeError('Variable "contentImage" does not exist.', 14, $this->source); })()), "getHtml", [["alt" => CoreExtension::getAttribute($this->env, $this->source, // line 15
  79. (isset($context["altText"]) || array_key_exists("altText", $context) ? $context["altText"] : (function () { throw new RuntimeError('Variable "altText" does not exist.', 15, $this->source); })()), "getData", [], "method", false, false, true, 15), "title" => CoreExtension::getAttribute($this->env, $this->source, // line 16
  80. (isset($context["title"]) || array_key_exists("title", $context) ? $context["title"] : (function () { throw new RuntimeError('Variable "title" does not exist.', 16, $this->source); })()), "getData", [], "method", false, false, true, 16)]], "method", false, false, true, 14), 14, $this->source);
  81. // line 17
  82. yield "
  83. ";
  84. // line 18
  85. if ((CoreExtension::getAttribute($this->env, $this->source, (isset($context["caption"]) || array_key_exists("caption", $context) ? $context["caption"] : (function () { throw new RuntimeError('Variable "caption" does not exist.', 18, $this->source); })()), "getData", [], "method", false, false, true, 18) != "")) {
  86. // line 19
  87. yield " <figcaption>";
  88. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->sandbox->ensureToStringAllowed(CoreExtension::getAttribute($this->env, $this->source, (isset($context["caption"]) || array_key_exists("caption", $context) ? $context["caption"] : (function () { throw new RuntimeError('Variable "caption" does not exist.', 19, $this->source); })()), "getData", [], "method", false, false, true, 19), 19, $this->source), "html", null, true);
  89. yield "</figcaption>
  90. ";
  91. }
  92. // line 21
  93. yield " </figure>
  94. ";
  95. yield from [];
  96. })())) ? '' : new Markup($tmp, $this->env->getCharset());
  97. // line 23
  98. yield "
  99. ";
  100. // line 24
  101. if ((isset($context["imageLink"]) || array_key_exists("imageLink", $context) ? $context["imageLink"] : (function () { throw new RuntimeError('Variable "imageLink" does not exist.', 24, $this->source); })())) {
  102. // line 25
  103. yield " <a href=\"";
  104. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->sandbox->ensureToStringAllowed(CoreExtension::getAttribute($this->env, $this->source, (isset($context["imageLink"]) || array_key_exists("imageLink", $context) ? $context["imageLink"] : (function () { throw new RuntimeError('Variable "imageLink" does not exist.', 25, $this->source); })()), "getHref", [], "method", false, false, true, 25), 25, $this->source), "html", null, true);
  105. yield "\" target=\"";
  106. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->sandbox->ensureToStringAllowed(CoreExtension::getAttribute($this->env, $this->source, (isset($context["imageLink"]) || array_key_exists("imageLink", $context) ? $context["imageLink"] : (function () { throw new RuntimeError('Variable "imageLink" does not exist.', 25, $this->source); })()), "getTarget", [], "method", false, false, true, 25), 25, $this->source), "html", null, true);
  107. yield "\" title=\"";
  108. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->sandbox->ensureToStringAllowed(CoreExtension::getAttribute($this->env, $this->source, (isset($context["imageLink"]) || array_key_exists("imageLink", $context) ? $context["imageLink"] : (function () { throw new RuntimeError('Variable "imageLink" does not exist.', 25, $this->source); })()), "getTitle", [], "any", false, false, true, 25), 25, $this->source), "html", null, true);
  109. yield "\">
  110. ";
  111. // line 26
  112. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->sandbox->ensureToStringAllowed((isset($context["imageRendered"]) || array_key_exists("imageRendered", $context) ? $context["imageRendered"] : (function () { throw new RuntimeError('Variable "imageRendered" does not exist.', 26, $this->source); })()), 26, $this->source), "html", null, true);
  113. yield "
  114. </a>
  115. ";
  116. } else {
  117. // line 29
  118. yield " ";
  119. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->sandbox->ensureToStringAllowed((isset($context["imageRendered"]) || array_key_exists("imageRendered", $context) ? $context["imageRendered"] : (function () { throw new RuntimeError('Variable "imageRendered" does not exist.', 29, $this->source); })()), 29, $this->source), "html", null, true);
  120. yield "
  121. ";
  122. }
  123. // line 31
  124. yield "
  125. ";
  126. }
  127. // line 33
  128. yield "
  129. ";
  130. $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  131. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  132. yield from [];
  133. }
  134. /**
  135. * @codeCoverageIgnore
  136. */
  137. public function getTemplateName(): string
  138. {
  139. return "content/image/view.html.twig";
  140. }
  141. /**
  142. * @codeCoverageIgnore
  143. */
  144. public function isTraitable(): bool
  145. {
  146. return false;
  147. }
  148. /**
  149. * @codeCoverageIgnore
  150. */
  151. public function getDebugInfo(): array
  152. {
  153. return array ( 138 => 33, 134 => 31, 128 => 29, 122 => 26, 113 => 25, 111 => 24, 108 => 23, 103 => 21, 97 => 19, 95 => 18, 92 => 17, 90 => 16, 89 => 15, 88 => 14, 76 => 13, 73 => 12, 71 => 11, 67 => 9, 63 => 7, 61 => 6, 58 => 5, 56 => 4, 54 => 3, 52 => 2, 50 => 1,);
  154. }
  155. public function getSourceContext(): Source
  156. {
  157. return new Source("{% set thumbnaileName = pimcore_select(\"thumbnaileName\") %}
  158. {% set contentImage = pimcore_image(\"contentImage\", {\"thumbnail\": thumbnaileName.text}).getThumbnail(thumbnaileName.text) %}
  159. {% set caption = pimcore_input(\"caption\") %}
  160. {% set imageLink = pimcore_link('imageLink') %}
  161. {% if container is defined and container == false %}
  162. {% set containerClass = '' %}
  163. {% endif %}
  164. {% if contentImage %}
  165. {% set imageRendered %}
  166. <figure class=\"{{ align.getData() }} {{ containerClass }} {{ lightbox.getData()?'lightbox':'' }}\" data-src=\"{{ contentImage.asset.path }}{{ contentImage.asset.filename }}\">
  167. {{ contentImage.getHtml({
  168. 'alt' : altText.getData(),
  169. 'title' : title.getData()
  170. }) |raw }}
  171. {% if caption.getData() != '' %}
  172. <figcaption>{{ caption.getData() }}</figcaption>
  173. {% endif %}
  174. </figure>
  175. {% endset %}
  176. {% if imageLink %}
  177. <a href=\"{{ imageLink.getHref() }}\" target=\"{{ imageLink.getTarget() }}\" title=\"{{ imageLink.getTitle }}\">
  178. {{ imageRendered }}
  179. </a>
  180. {% else %}
  181. {{ imageRendered }}
  182. {% endif %}
  183. {% endif %}
  184. ", "content/image/view.html.twig", "/var/www/vhosts/mensa-fasching.de/uat/releases/20250218080531/templates/content/image/view.html.twig");
  185. }
  186. public function checkSecurity()
  187. {
  188. static $tags = ["set" => 1, "if" => 6];
  189. static $filters = ["escape" => 13, "raw" => 17];
  190. static $functions = ["pimcore_select" => 1, "pimcore_image" => 2, "pimcore_input" => 3, "pimcore_link" => 4];
  191. try {
  192. $this->sandbox->checkSecurity(
  193. ['set', 'if'],
  194. ['escape', 'raw'],
  195. ['pimcore_select', 'pimcore_image', 'pimcore_input', 'pimcore_link'],
  196. $this->source
  197. );
  198. } catch (SecurityError $e) {
  199. $e->setSourceContext($this->source);
  200. if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) {
  201. $e->setTemplateLine($tags[$e->getTagName()]);
  202. } elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) {
  203. $e->setTemplateLine($filters[$e->getFilterName()]);
  204. } elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) {
  205. $e->setTemplateLine($functions[$e->getFunctionName()]);
  206. }
  207. throw $e;
  208. }
  209. }
  210. }