var/cache/dev/twig/9c/9cb6a994f2a560748711dfe58a2fa4e2.php line 35

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. /* @Provider/partials/header/media.html.twig */
  14. class __TwigTemplate_7cc99bd3abe2a35bfdc0a3475f8fa6c3 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""@Provider/partials/header/media.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""@Provider/partials/header/media.html.twig"));
  35.         // line 1
  36.         $macros["__internal_parse_7"] = $this->macros["__internal_parse_7"] = $this->loadTemplate("@Provider/macros/media_edit.html.twig""@Provider/partials/header/media.html.twig"1)->unwrap();
  37.         // line 2
  38.         echo "<div class=\"header-media\">
  39.     ";
  40.         // line 3
  41.         if ((isset($context["editmode"]) || array_key_exists("editmode"$context) ? $context["editmode"] : (function () { throw new RuntimeError('Variable "editmode" does not exist.'3$this->source); })())) {
  42.             // line 4
  43.             echo "        ";
  44.             echo twig_call_macro($macros["__internal_parse_7"], "macro_media_edit", ["header_"19201080], 4$context$this->getSourceContext());
  45.             // line 8
  46.             echo "
  47.     ";
  48.         } else {
  49.             // line 10
  50.             echo "        ";
  51.             $context["headerImage"] = twig_get_attribute($this->env$this->source$this->extensions['Pimcore\Twig\Extension\DocumentEditableExtension']->renderEditable($context"image""header_image"), "getImage", [], "method"falsefalsetrue10);
  52.             // line 11
  53.             echo "        ";
  54.             $context["headerVideo"] = twig_get_attribute($this->env$this->source$this->extensions['Pimcore\Twig\Extension\DocumentEditableExtension']->renderEditable($context"video""header_video"), "getVideoAsset", [], "method"falsefalsetrue11);
  55.             // line 12
  56.             echo "
  57.         ";
  58.             // line 13
  59.             if (( !(isset($context["headerImage"]) || array_key_exists("headerImage"$context) ? $context["headerImage"] : (function () { throw new RuntimeError('Variable "headerImage" does not exist.'13$this->source); })()) &&  !(isset($context["headerVideo"]) || array_key_exists("headerVideo"$context) ? $context["headerVideo"] : (function () { throw new RuntimeError('Variable "headerVideo" does not exist.'13$this->source); })()))) {
  60.                 // line 14
  61.                 echo "            ";
  62.                 // line 15
  63.                 echo "            ";
  64.                 $context["headerImage"] = $this->extensions['CONECTO\ProviderBundle\Twig\Extension\ConectoExtension']->getParentEditable($this->sandbox->ensureToStringAllowed((isset($context["document"]) || array_key_exists("document"$context) ? $context["document"] : (function () { throw new RuntimeError('Variable "document" does not exist.'15$this->source); })()), 15$this->source), "header_image");
  65.                 // line 16
  66.                 echo "            ";
  67.                 $context["headerVideo"] = (((isset($context["headerImage"]) || array_key_exists("headerImage"$context) ? $context["headerImage"] : (function () { throw new RuntimeError('Variable "headerImage" does not exist.'16$this->source); })())) ? (null) : ($this->extensions['CONECTO\ProviderBundle\Twig\Extension\ConectoExtension']->getParentEditable($this->sandbox->ensureToStringAllowed((isset($context["document"]) || array_key_exists("document"$context) ? $context["document"] : (function () { throw new RuntimeError('Variable "document" does not exist.'16$this->source); })()), 16$this->source), "header_video")));
  68.                 // line 17
  69.                 echo "
  70.             ";
  71.                 // line 18
  72.                 if (((isset($context["headerImage"]) || array_key_exists("headerImage"$context) ? $context["headerImage"] : (function () { throw new RuntimeError('Variable "headerImage" does not exist.'18$this->source); })()) || (isset($context["headerVideo"]) || array_key_exists("headerVideo"$context) ? $context["headerVideo"] : (function () { throw new RuntimeError('Variable "headerVideo" does not exist.'18$this->source); })()))) {
  73.                     // line 19
  74.                     echo "                ";
  75.                     $context["parentDocument"] = (((isset($context["headerImage"]) || array_key_exists("headerImage"$context) ? $context["headerImage"] : (function () { throw new RuntimeError('Variable "headerImage" does not exist.'19$this->source); })())) ? (twig_get_attribute($this->env$this->source, (isset($context["headerImage"]) || array_key_exists("headerImage"$context) ? $context["headerImage"] : (function () { throw new RuntimeError('Variable "headerImage" does not exist.'19$this->source); })()), "getDocument", [], "method"falsefalsetrue19)) : ((((isset($context["headerVideo"]) || array_key_exists("headerVideo"$context) ? $context["headerVideo"] : (function () { throw new RuntimeError('Variable "headerVideo" does not exist.'19$this->source); })())) ? (twig_get_attribute($this->env$this->source, (isset($context["headerVideo"]) || array_key_exists("headerVideo"$context) ? $context["headerVideo"] : (function () { throw new RuntimeError('Variable "headerVideo" does not exist.'19$this->source); })()), "getDocument", [], "method"falsefalsetrue19)) : (null))));
  76.                     // line 20
  77.                     echo "                ";
  78.                     $context["headerImage"] = (((isset($context["headerImage"]) || array_key_exists("headerImage"$context) ? $context["headerImage"] : (function () { throw new RuntimeError('Variable "headerImage" does not exist.'20$this->source); })())) ? (twig_get_attribute($this->env$this->source, (isset($context["headerImage"]) || array_key_exists("headerImage"$context) ? $context["headerImage"] : (function () { throw new RuntimeError('Variable "headerImage" does not exist.'20$this->source); })()), "getImage", [], "method"falsefalsetrue20)) : (null));
  79.                     // line 21
  80.                     echo "                ";
  81.                     $context["headerVideo"] = (((isset($context["headerVideo"]) || array_key_exists("headerVideo"$context) ? $context["headerVideo"] : (function () { throw new RuntimeError('Variable "headerVideo" does not exist.'21$this->source); })())) ? (twig_get_attribute($this->env$this->source, (isset($context["headerVideo"]) || array_key_exists("headerVideo"$context) ? $context["headerVideo"] : (function () { throw new RuntimeError('Variable "headerVideo" does not exist.'21$this->source); })()), "getVideoAsset", [], "method"falsefalsetrue21)) : (null));
  82.                     // line 22
  83.                     echo "            ";
  84.                 }
  85.                 // line 23
  86.                 echo "        ";
  87.             }
  88.             // line 24
  89.             echo "    ";
  90.         }
  91.         // line 25
  92.         echo "
  93.     ";
  94.         // line 26
  95.         if ((array_key_exists("headerImage"$context) && $this->env->getTest('instanceof')->getCallable()((isset($context["headerImage"]) || array_key_exists("headerImage"$context) ? $context["headerImage"] : (function () { throw new RuntimeError('Variable "headerImage" does not exist.'26$this->source); })()), "\\Pimcore\\Model\\Asset\\Image"))) {
  96.             // line 27
  97.             echo "        ";
  98.             echo $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, (isset($context["headerImage"]) || array_key_exists("headerImage"$context) ? $context["headerImage"] : (function () { throw new RuntimeError('Variable "headerImage" does not exist.'27$this->source); })()), "getThumbnail", [=> "headerImage"], "method"falsefalsetrue27), "getHTML", [], "method"falsefalsetrue27), 27$this->source);
  99.             echo "
  100.     ";
  101.         }
  102.         // line 29
  103.         echo "
  104.     ";
  105.         // line 30
  106.         if ((array_key_exists("headerVideo"$context) && $this->env->getTest('instanceof')->getCallable()((isset($context["headerVideo"]) || array_key_exists("headerVideo"$context) ? $context["headerVideo"] : (function () { throw new RuntimeError('Variable "headerVideo" does not exist.'30$this->source); })()), "\\Pimcore\\Model\\Asset\\Video"))) {
  107.             // line 31
  108.             echo "        ";
  109.             // line 32
  110.             echo "        <video src=\"";
  111.             echo twig_escape_filter($this->env$this->sandbox->ensureToStringAllowed((isset($context["headerVideo"]) || array_key_exists("headerVideo"$context) ? $context["headerVideo"] : (function () { throw new RuntimeError('Variable "headerVideo" does not exist.'32$this->source); })()), 32$this->source), "html"nulltrue);
  112.             echo "\"";
  113.             if ( !(isset($context["editmode"]) || array_key_exists("editmode"$context) ? $context["editmode"] : (function () { throw new RuntimeError('Variable "editmode" does not exist.'32$this->source); })())) {
  114.                 echo " autoplay loop muted playsinline";
  115.             }
  116.             echo "></video>
  117.     ";
  118.         }
  119.         // line 34
  120.         echo "
  121.     ";
  122.         // line 35
  123.         if (((isset($context["editmode"]) || array_key_exists("editmode"$context) ? $context["editmode"] : (function () { throw new RuntimeError('Variable "editmode" does not exist.'35$this->source); })()) || ($this->extensions['Pimcore\Twig\Extension\DocumentEditableExtension']->renderEditable($context"input""header_title") != ""))) {
  124.             // line 36
  125.             echo "    <div class=\"header-media--content\">
  126.         ";
  127.             // line 37
  128.             if (($this->extensions['Pimcore\Twig\Extension\DocumentEditableExtension']->renderEditable($context"input""header_title") != "")) {
  129.                 // line 38
  130.                 echo "            <h2>";
  131.                 echo $this->extensions['Pimcore\Twig\Extension\DocumentEditableExtension']->renderEditable($context"input""header_title", ["placeholder" => "Titel"]);
  132.                 echo "</h2>
  133.         ";
  134.             }
  135.             // line 40
  136.             echo "        ";
  137.             if (($this->extensions['Pimcore\Twig\Extension\DocumentEditableExtension']->renderEditable($context"input""header_subtitle") != "")) {
  138.                 // line 41
  139.                 echo "            <p>";
  140.                 echo $this->extensions['Pimcore\Twig\Extension\DocumentEditableExtension']->renderEditable($context"input""header_subtitle", ["placeholder" => "Untertitel"]);
  141.                 echo "</p>
  142.         ";
  143.             }
  144.             // line 43
  145.             echo "        ";
  146.             echo $this->extensions['Pimcore\Twig\Extension\DocumentEditableExtension']->renderEditable($context"link""header_link", ["class" => "btn-primary"]);
  147.             // line 45
  148.             echo "
  149.     </div>
  150.     ";
  151.         } elseif ((        // line 47
  152. array_key_exists("parentDocument"$context) && $this->env->getTest('instanceof')->getCallable()((isset($context["parentDocument"]) || array_key_exists("parentDocument"$context) ? $context["parentDocument"] : (function () { throw new RuntimeError('Variable "parentDocument" does not exist.'47$this->source); })()), "\\Pimcore\\Model\\Document"))) {
  153.             // line 48
  154.             echo "    ";
  155.             // line 49
  156.             echo "    <div class=\"header-media--content\">
  157.         ";
  158.             // line 50
  159.             if (($this->extensions['CONECTO\ProviderBundle\Twig\Extension\ConectoExtension']->getEditable((isset($context["parentDocument"]) || array_key_exists("parentDocument"$context) ? $context["parentDocument"] : (function () { throw new RuntimeError('Variable "parentDocument" does not exist.'50$this->source); })()), "header_title") != "")) {
  160.                 // line 51
  161.                 echo "            <h2>";
  162.                 echo twig_escape_filter($this->env$this->extensions['CONECTO\ProviderBundle\Twig\Extension\ConectoExtension']->getEditable($this->sandbox->ensureToStringAllowed((isset($context["parentDocument"]) || array_key_exists("parentDocument"$context) ? $context["parentDocument"] : (function () { throw new RuntimeError('Variable "parentDocument" does not exist.'51$this->source); })()), 51$this->source), "header_title"), "html"nulltrue);
  163.                 echo "</h2>
  164.         ";
  165.             }
  166.             // line 53
  167.             echo "        ";
  168.             if (($this->extensions['CONECTO\ProviderBundle\Twig\Extension\ConectoExtension']->getEditable((isset($context["parentDocument"]) || array_key_exists("parentDocument"$context) ? $context["parentDocument"] : (function () { throw new RuntimeError('Variable "parentDocument" does not exist.'53$this->source); })()), "header_subtitle") != "")) {
  169.                 // line 54
  170.                 echo "            <p>";
  171.                 echo twig_escape_filter($this->env$this->extensions['CONECTO\ProviderBundle\Twig\Extension\ConectoExtension']->getEditable($this->sandbox->ensureToStringAllowed((isset($context["parentDocument"]) || array_key_exists("parentDocument"$context) ? $context["parentDocument"] : (function () { throw new RuntimeError('Variable "parentDocument" does not exist.'54$this->source); })()), 54$this->source), "header_subtitle"), "html"nulltrue);
  172.                 echo "</p>
  173.         ";
  174.             }
  175.             // line 56
  176.             echo "        ";
  177.             if (($this->extensions['CONECTO\ProviderBundle\Twig\Extension\ConectoExtension']->getEditable((isset($context["parentDocument"]) || array_key_exists("parentDocument"$context) ? $context["parentDocument"] : (function () { throw new RuntimeError('Variable "parentDocument" does not exist.'56$this->source); })()), "header_link") != "")) {
  178.                 // line 57
  179.                 echo "            ";
  180.                 echo twig_escape_filter($this->env$this->extensions['CONECTO\ProviderBundle\Twig\Extension\ConectoExtension']->getEditable($this->sandbox->ensureToStringAllowed((isset($context["parentDocument"]) || array_key_exists("parentDocument"$context) ? $context["parentDocument"] : (function () { throw new RuntimeError('Variable "parentDocument" does not exist.'57$this->source); })()), 57$this->source), "header_link"), "html"nulltrue);
  181.                 echo "
  182.         ";
  183.             }
  184.             // line 59
  185.             echo "    </div>
  186.     ";
  187.         }
  188.         // line 61
  189.         echo "</div>";
  190.         
  191.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  192.         
  193.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  194.     }
  195.     public function getTemplateName()
  196.     {
  197.         return "@Provider/partials/header/media.html.twig";
  198.     }
  199.     public function isTraitable()
  200.     {
  201.         return false;
  202.     }
  203.     public function getDebugInfo()
  204.     {
  205.         return array (  198 => 61,  194 => 59,  188 => 57,  185 => 56,  179 => 54,  176 => 53,  170 => 51,  168 => 50,  165 => 49,  163 => 48,  161 => 47,  157 => 45,  154 => 43,  148 => 41,  145 => 40,  139 => 38,  137 => 37,  134 => 36,  132 => 35,  129 => 34,  119 => 32,  117 => 31,  115 => 30,  112 => 29,  106 => 27,  104 => 26,  101 => 25,  98 => 24,  95 => 23,  92 => 22,  89 => 21,  86 => 20,  83 => 19,  81 => 18,  78 => 17,  75 => 16,  72 => 15,  70 => 14,  68 => 13,  65 => 12,  62 => 11,  59 => 10,  55 => 8,  52 => 4,  50 => 3,  47 => 2,  45 => 1,);
  206.     }
  207.     public function getSourceContext()
  208.     {
  209.         return new Source("{% from '@Provider/macros/media_edit.html.twig' import media_edit as conecto_media_edit %}
  210. <div class=\"header-media\">
  211.     {% if editmode %}
  212.         {{ conecto_media_edit(
  213.             'header_',
  214.             1920,
  215.             1080
  216.         ) }}
  217.     {% else %}
  218.         {% set headerImage = pimcore_image('header_image').getImage() %}
  219.         {% set headerVideo = pimcore_video('header_video').getVideoAsset() %}
  220.         {% if not headerImage and not headerVideo %}
  221.             {# Parent Fallback #}
  222.             {% set headerImage = conecto_get_parent_editable(document, 'header_image') %}
  223.             {% set headerVideo = headerImage ? null : conecto_get_parent_editable(document, 'header_video') %}
  224.             {% if headerImage or headerVideo %}
  225.                 {% set parentDocument = (headerImage ? headerImage.getDocument() : (headerVideo ? headerVideo.getDocument() : null) ) %}
  226.                 {% set headerImage = headerImage ? headerImage.getImage() : null %}
  227.                 {% set headerVideo = headerVideo ? headerVideo.getVideoAsset() : null %}
  228.             {% endif %}
  229.         {% endif %}
  230.     {% endif %}
  231.     {% if headerImage is defined and headerImage is instanceof('\\\\Pimcore\\\\Model\\\\Asset\\\\Image') %}
  232.         {{ headerImage.getThumbnail('headerImage').getHTML()|raw }}
  233.     {% endif %}
  234.     {% if headerVideo is defined and headerVideo is instanceof('\\\\Pimcore\\\\Model\\\\Asset\\\\Video') %}
  235.         {# YouTube usw. werden hier bewusst ignoriert, da im Header suboptimal - wenn vom Kunden gewünscht -> individuell umsetzen #}
  236.         <video src=\"{{ headerVideo }}\"{% if not editmode %} autoplay loop muted playsinline{% endif %}></video>
  237.     {% endif %}
  238.     {% if editmode or pimcore_input('header_title') != '' %}
  239.     <div class=\"header-media--content\">
  240.         {% if (pimcore_input('header_title') != \"\") %}
  241.             <h2>{{ pimcore_input('header_title', { \"placeholder\": \"Titel\" }) }}</h2>
  242.         {% endif %}
  243.         {% if (pimcore_input('header_subtitle') != \"\") %}
  244.             <p>{{ pimcore_input('header_subtitle', { \"placeholder\": \"Untertitel\" }) }}</p>
  245.         {% endif %}
  246.         {{ pimcore_link('header_link', {
  247.             \"class\": \"btn-primary\"
  248.         }) }}
  249.     </div>
  250.     {% elseif parentDocument is defined and parentDocument is instanceof('\\\\Pimcore\\\\Model\\\\Document') %}
  251.     {# Parent Fallback #}
  252.     <div class=\"header-media--content\">
  253.         {% if conecto_get_editable(parentDocument, 'header_title') != \"\" %}
  254.             <h2>{{ conecto_get_editable(parentDocument, 'header_title') }}</h2>
  255.         {% endif %}
  256.         {% if conecto_get_editable(parentDocument, 'header_subtitle') != \"\" %}
  257.             <p>{{ conecto_get_editable(parentDocument, 'header_subtitle') }}</p>
  258.         {% endif %}
  259.         {% if conecto_get_editable(parentDocument, 'header_link') != \"\" %}
  260.             {{ conecto_get_editable(parentDocument, 'header_link') }}
  261.         {% endif %}
  262.     </div>
  263.     {% endif %}
  264. </div>""@Provider/partials/header/media.html.twig""/html/pimcore/vendor/conecto/pimcore-provider/src/ProviderBundle/Resources/views/partials/header/media.html.twig");
  265.     }
  266.     
  267.     public function checkSecurity()
  268.     {
  269.         static $tags = array("from" => 1"if" => 3"set" => 10);
  270.         static $filters = array("raw" => 27"escape" => 32);
  271.         static $functions = array("pimcore_image" => 10"pimcore_video" => 11"conecto_get_parent_editable" => 15"pimcore_input" => 35"pimcore_link" => 43"conecto_get_editable" => 50);
  272.         try {
  273.             $this->sandbox->checkSecurity(
  274.                 ['from''if''set'],
  275.                 ['raw''escape'],
  276.                 ['pimcore_image''pimcore_video''conecto_get_parent_editable''pimcore_input''pimcore_link''conecto_get_editable']
  277.             );
  278.         } catch (SecurityError $e) {
  279.             $e->setSourceContext($this->source);
  280.             if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) {
  281.                 $e->setTemplateLine($tags[$e->getTagName()]);
  282.             } elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) {
  283.                 $e->setTemplateLine($filters[$e->getFilterName()]);
  284.             } elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) {
  285.                 $e->setTemplateLine($functions[$e->getFunctionName()]);
  286.             }
  287.             throw $e;
  288.         }
  289.     }
  290. }