var/cache/dev/twig/71/71334b862850399daf99cc11e62bb2bc.php line 53

Open in your IDE?
  1. <?php
  2. use Twig\Environment;
  3. use Twig\Error\LoaderError;
  4. use Twig\Error\RuntimeError;
  5. use Twig\Extension\SandboxExtension;
  6. use Twig\Markup;
  7. use Twig\Sandbox\SecurityError;
  8. use Twig\Sandbox\SecurityNotAllowedTagError;
  9. use Twig\Sandbox\SecurityNotAllowedFilterError;
  10. use Twig\Sandbox\SecurityNotAllowedFunctionError;
  11. use Twig\Source;
  12. use Twig\Template;
  13. /* includes/macros.html.twig */
  14. class __TwigTemplate_cadaf598a0d0c51601837f701249f6c0 extends Template
  15. {
  16.     private $source;
  17.     private $macros = [];
  18.     public function __construct(Environment $env)
  19.     {
  20.         parent::__construct($env);
  21.         $this->source $this->getSourceContext();
  22.         $this->parent false;
  23.         $this->blocks = [
  24.         ];
  25.         $this->sandbox $this->env->getExtension('\Twig\Extension\SandboxExtension');
  26.         $this->checkSecurity();
  27.     }
  28.     protected function doDisplay(array $context, array $blocks = [])
  29.     {
  30.         $macros $this->macros;
  31.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  32.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""includes/macros.html.twig"));
  33.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  34.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""includes/macros.html.twig"));
  35.         
  36.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  37.         
  38.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  39.     }
  40.     // line 1
  41.     public function macro_image_link($__image__ null$__editmode__ false$__linkThumbnail__ "galleryLightbox", ...$__varargs__)
  42.     {
  43.         $macros $this->macros;
  44.         $context $this->env->mergeGlobals([
  45.             "image" => $__image__,
  46.             "editmode" => $__editmode__,
  47.             "linkThumbnail" => $__linkThumbnail__,
  48.             "varargs" => $__varargs__,
  49.         ]);
  50.         $blocks = [];
  51.         ob_start();
  52.         try {
  53.             $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  54.             $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "macro""image_link"));
  55.             $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  56.             $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "macro""image_link"));
  57.             // line 2
  58.             echo "
  59.     ";
  60.             // line 4
  61.             echo "    ";
  62.             $context["hasLink"] = ( !(isset($context["editmode"]) || array_key_exists("editmode"$context) ? $context["editmode"] : (function () { throw new RuntimeError('Variable "editmode" does not exist.'4$this->source); })()) &&  !twig_test_empty((isset($context["linkThumbnail"]) || array_key_exists("linkThumbnail"$context) ? $context["linkThumbnail"] : (function () { throw new RuntimeError('Variable "linkThumbnail" does not exist.'4$this->source); })())));
  63.             // line 5
  64.             echo "
  65.     ";
  66.             // line 6
  67.             if ((isset($context["hasLink"]) || array_key_exists("hasLink"$context) ? $context["hasLink"] : (function () { throw new RuntimeError('Variable "hasLink" does not exist.'6$this->source); })())) {
  68.                 // line 7
  69.                 echo "        <a href=\"";
  70.                 echo twig_escape_filter($this->env$this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env$this->source, (isset($context["image"]) || array_key_exists("image"$context) ? $context["image"] : (function () { throw new RuntimeError('Variable "image" does not exist.'7$this->source); })()), "getThumbnail", [(isset($context["linkThumbnail"]) || array_key_exists("linkThumbnail"$context) ? $context["linkThumbnail"] : (function () { throw new RuntimeError('Variable "linkThumbnail" does not exist.'7$this->source); })())], "method"falsefalsetrue7), 7$this->source), "html"nulltrue);
  71.                 echo "\" class=\"thumbnail\">
  72.     ";
  73.             }
  74.             // line 9
  75.             echo "
  76.     ";
  77.             // line 10
  78.             echo $this->sandbox->ensureToStringAllowed((isset($context["image"]) || array_key_exists("image"$context) ? $context["image"] : (function () { throw new RuntimeError('Variable "image" does not exist.'10$this->source); })()), 10$this->source);
  79.             echo "
  80.     ";
  81.             // line 12
  82.             if ((isset($context["hasLink"]) || array_key_exists("hasLink"$context) ? $context["hasLink"] : (function () { throw new RuntimeError('Variable "hasLink" does not exist.'12$this->source); })())) {
  83.                 // line 13
  84.                 echo "        </a>
  85.     ";
  86.             }
  87.             // line 15
  88.             echo "
  89. ";
  90.             
  91.             $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  92.             
  93.             $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  94.             return ('' === $tmp ob_get_contents()) ? '' : new Markup($tmp$this->env->getCharset());
  95.         } finally {
  96.             ob_end_clean();
  97.         }
  98.     }
  99.     /**
  100.      * @codeCoverageIgnore
  101.      */
  102.     public function getTemplateName()
  103.     {
  104.         return "includes/macros.html.twig";
  105.     }
  106.     /**
  107.      * @codeCoverageIgnore
  108.      */
  109.     public function isTraitable()
  110.     {
  111.         return false;
  112.     }
  113.     /**
  114.      * @codeCoverageIgnore
  115.      */
  116.     public function getDebugInfo()
  117.     {
  118.         return array (  105 => 15,  101 => 13,  99 => 12,  94 => 10,  91 => 9,  85 => 7,  83 => 6,  80 => 5,  77 => 4,  74 => 2,  53 => 1,);
  119.     }
  120.     public function getSourceContext()
  121.     {
  122.         return new Source("{% macro image_link(image, editmode = false, linkThumbnail = 'galleryLightbox') %}
  123.     {# @var image \\Pimcore\\Model\\Document\\Tag\\Image #}
  124.     {% set hasLink = not editmode and linkThumbnail is not empty %}
  125.     {% if hasLink %}
  126.         <a href=\"{{ image.getThumbnail(linkThumbnail) }}\" class=\"thumbnail\">
  127.     {% endif %}
  128.     {{ image|raw }}
  129.     {% if hasLink %}
  130.         </a>
  131.     {% endif %}
  132. {% endmacro %}
  133. ""includes/macros.html.twig""/var/www/dev-10/templates/includes/macros.html.twig");
  134.     }
  135.     
  136.     public function checkSecurity()
  137.     {
  138.         static $tags = array("macro" => 1"set" => 4"if" => 6);
  139.         static $filters = array("escape" => 7"raw" => 10);
  140.         static $functions = array();
  141.         try {
  142.             $this->sandbox->checkSecurity(
  143.                 ['macro''set''if'],
  144.                 ['escape''raw'],
  145.                 []
  146.             );
  147.         } catch (SecurityError $e) {
  148.             $e->setSourceContext($this->source);
  149.             if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) {
  150.                 $e->setTemplateLine($tags[$e->getTagName()]);
  151.             } elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) {
  152.                 $e->setTemplateLine($filters[$e->getFilterName()]);
  153.             } elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) {
  154.                 $e->setTemplateLine($functions[$e->getFunctionName()]);
  155.             }
  156.             throw $e;
  157.         }
  158.     }
  159. }