<?php
use Twig\Environment;
use Twig\Error\LoaderError;
use Twig\Error\RuntimeError;
use Twig\Extension\SandboxExtension;
use Twig\Markup;
use Twig\Sandbox\SecurityError;
use Twig\Sandbox\SecurityNotAllowedTagError;
use Twig\Sandbox\SecurityNotAllowedFilterError;
use Twig\Sandbox\SecurityNotAllowedFunctionError;
use Twig\Source;
use Twig\Template;
/* @Provider/partials/header/media.html.twig */
class __TwigTemplate_7cc99bd3abe2a35bfdc0a3475f8fa6c3 extends Template
{
private $source;
private $macros = [];
public function __construct(Environment $env)
{
parent::__construct($env);
$this->source = $this->getSourceContext();
$this->parent = false;
$this->blocks = [
];
$this->sandbox = $this->env->getExtension('\Twig\Extension\SandboxExtension');
$this->checkSecurity();
}
protected function doDisplay(array $context, array $blocks = [])
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "@Provider/partials/header/media.html.twig"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "@Provider/partials/header/media.html.twig"));
// line 1
$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();
// line 2
echo "<div class=\"header-media\">
";
// line 3
if ((isset($context["editmode"]) || array_key_exists("editmode", $context) ? $context["editmode"] : (function () { throw new RuntimeError('Variable "editmode" does not exist.', 3, $this->source); })())) {
// line 4
echo " ";
echo twig_call_macro($macros["__internal_parse_7"], "macro_media_edit", ["header_", 1920, 1080], 4, $context, $this->getSourceContext());
// line 8
echo "
";
} else {
// line 10
echo " ";
$context["headerImage"] = twig_get_attribute($this->env, $this->source, $this->extensions['Pimcore\Twig\Extension\DocumentEditableExtension']->renderEditable($context, "image", "header_image"), "getImage", [], "method", false, false, true, 10);
// line 11
echo " ";
$context["headerVideo"] = twig_get_attribute($this->env, $this->source, $this->extensions['Pimcore\Twig\Extension\DocumentEditableExtension']->renderEditable($context, "video", "header_video"), "getVideoAsset", [], "method", false, false, true, 11);
// line 12
echo "
";
// line 13
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); })()))) {
// line 14
echo " ";
// line 15
echo " ";
$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");
// line 16
echo " ";
$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")));
// line 17
echo "
";
// line 18
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); })()))) {
// line 19
echo " ";
$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", false, false, true, 19)) : ((((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", false, false, true, 19)) : (null))));
// line 20
echo " ";
$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", false, false, true, 20)) : (null));
// line 21
echo " ";
$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", false, false, true, 21)) : (null));
// line 22
echo " ";
}
// line 23
echo " ";
}
// line 24
echo " ";
}
// line 25
echo "
";
// line 26
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"))) {
// line 27
echo " ";
echo $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $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.', 27, $this->source); })()), "getThumbnail", [0 => "headerImage"], "method", false, false, true, 27), "getHTML", [], "method", false, false, true, 27), 27, $this->source);
echo "
";
}
// line 29
echo "
";
// line 30
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"))) {
// line 31
echo " ";
// line 32
echo " <video src=\"";
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", null, true);
echo "\"";
if ( !(isset($context["editmode"]) || array_key_exists("editmode", $context) ? $context["editmode"] : (function () { throw new RuntimeError('Variable "editmode" does not exist.', 32, $this->source); })())) {
echo " autoplay loop muted playsinline";
}
echo "></video>
";
}
// line 34
echo "
";
// line 35
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") != ""))) {
// line 36
echo " <div class=\"header-media--content\">
";
// line 37
if (($this->extensions['Pimcore\Twig\Extension\DocumentEditableExtension']->renderEditable($context, "input", "header_title") != "")) {
// line 38
echo " <h2>";
echo $this->extensions['Pimcore\Twig\Extension\DocumentEditableExtension']->renderEditable($context, "input", "header_title", ["placeholder" => "Titel"]);
echo "</h2>
";
}
// line 40
echo " ";
if (($this->extensions['Pimcore\Twig\Extension\DocumentEditableExtension']->renderEditable($context, "input", "header_subtitle") != "")) {
// line 41
echo " <p>";
echo $this->extensions['Pimcore\Twig\Extension\DocumentEditableExtension']->renderEditable($context, "input", "header_subtitle", ["placeholder" => "Untertitel"]);
echo "</p>
";
}
// line 43
echo " ";
echo $this->extensions['Pimcore\Twig\Extension\DocumentEditableExtension']->renderEditable($context, "link", "header_link", ["class" => "btn-primary"]);
// line 45
echo "
</div>
";
} elseif (( // line 47
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"))) {
// line 48
echo " ";
// line 49
echo " <div class=\"header-media--content\">
";
// line 50
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") != "")) {
// line 51
echo " <h2>";
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", null, true);
echo "</h2>
";
}
// line 53
echo " ";
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") != "")) {
// line 54
echo " <p>";
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", null, true);
echo "</p>
";
}
// line 56
echo " ";
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") != "")) {
// line 57
echo " ";
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", null, true);
echo "
";
}
// line 59
echo " </div>
";
}
// line 61
echo "</div>";
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
}
public function getTemplateName()
{
return "@Provider/partials/header/media.html.twig";
}
public function isTraitable()
{
return false;
}
public function getDebugInfo()
{
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,);
}
public function getSourceContext()
{
return new Source("{% from '@Provider/macros/media_edit.html.twig' import media_edit as conecto_media_edit %}
<div class=\"header-media\">
{% if editmode %}
{{ conecto_media_edit(
'header_',
1920,
1080
) }}
{% else %}
{% set headerImage = pimcore_image('header_image').getImage() %}
{% set headerVideo = pimcore_video('header_video').getVideoAsset() %}
{% if not headerImage and not headerVideo %}
{# Parent Fallback #}
{% set headerImage = conecto_get_parent_editable(document, 'header_image') %}
{% set headerVideo = headerImage ? null : conecto_get_parent_editable(document, 'header_video') %}
{% if headerImage or headerVideo %}
{% set parentDocument = (headerImage ? headerImage.getDocument() : (headerVideo ? headerVideo.getDocument() : null) ) %}
{% set headerImage = headerImage ? headerImage.getImage() : null %}
{% set headerVideo = headerVideo ? headerVideo.getVideoAsset() : null %}
{% endif %}
{% endif %}
{% endif %}
{% if headerImage is defined and headerImage is instanceof('\\\\Pimcore\\\\Model\\\\Asset\\\\Image') %}
{{ headerImage.getThumbnail('headerImage').getHTML()|raw }}
{% endif %}
{% if headerVideo is defined and headerVideo is instanceof('\\\\Pimcore\\\\Model\\\\Asset\\\\Video') %}
{# YouTube usw. werden hier bewusst ignoriert, da im Header suboptimal - wenn vom Kunden gewünscht -> individuell umsetzen #}
<video src=\"{{ headerVideo }}\"{% if not editmode %} autoplay loop muted playsinline{% endif %}></video>
{% endif %}
{% if editmode or pimcore_input('header_title') != '' %}
<div class=\"header-media--content\">
{% if (pimcore_input('header_title') != \"\") %}
<h2>{{ pimcore_input('header_title', { \"placeholder\": \"Titel\" }) }}</h2>
{% endif %}
{% if (pimcore_input('header_subtitle') != \"\") %}
<p>{{ pimcore_input('header_subtitle', { \"placeholder\": \"Untertitel\" }) }}</p>
{% endif %}
{{ pimcore_link('header_link', {
\"class\": \"btn-primary\"
}) }}
</div>
{% elseif parentDocument is defined and parentDocument is instanceof('\\\\Pimcore\\\\Model\\\\Document') %}
{# Parent Fallback #}
<div class=\"header-media--content\">
{% if conecto_get_editable(parentDocument, 'header_title') != \"\" %}
<h2>{{ conecto_get_editable(parentDocument, 'header_title') }}</h2>
{% endif %}
{% if conecto_get_editable(parentDocument, 'header_subtitle') != \"\" %}
<p>{{ conecto_get_editable(parentDocument, 'header_subtitle') }}</p>
{% endif %}
{% if conecto_get_editable(parentDocument, 'header_link') != \"\" %}
{{ conecto_get_editable(parentDocument, 'header_link') }}
{% endif %}
</div>
{% endif %}
</div>", "@Provider/partials/header/media.html.twig", "/html/pimcore/vendor/conecto/pimcore-provider/src/ProviderBundle/Resources/views/partials/header/media.html.twig");
}
public function checkSecurity()
{
static $tags = array("from" => 1, "if" => 3, "set" => 10);
static $filters = array("raw" => 27, "escape" => 32);
static $functions = array("pimcore_image" => 10, "pimcore_video" => 11, "conecto_get_parent_editable" => 15, "pimcore_input" => 35, "pimcore_link" => 43, "conecto_get_editable" => 50);
try {
$this->sandbox->checkSecurity(
['from', 'if', 'set'],
['raw', 'escape'],
['pimcore_image', 'pimcore_video', 'conecto_get_parent_editable', 'pimcore_input', 'pimcore_link', 'conecto_get_editable']
);
} catch (SecurityError $e) {
$e->setSourceContext($this->source);
if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) {
$e->setTemplateLine($tags[$e->getTagName()]);
} elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) {
$e->setTemplateLine($filters[$e->getFilterName()]);
} elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) {
$e->setTemplateLine($functions[$e->getFunctionName()]);
}
throw $e;
}
}
}