<?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;
/* areas/popper/view.html.twig */
class __TwigTemplate_0beb118d74edef19f66e1480cf21d09a 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", "areas/popper/view.html.twig"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "areas/popper/view.html.twig"));
// line 1
if ((isset($context["editmode"]) || array_key_exists("editmode", $context) ? $context["editmode"] : (function () { throw new RuntimeError('Variable "editmode" does not exist.', 1, $this->source); })())) {
// line 2
echo " ";
$context["message"] = "Popup maker";
// line 3
echo " ";
$context["type"] = "info";
// line 4
echo " ";
$this->loadTemplate("includes/basicBlocks/admin/message/tip.html.twig", "areas/popper/view.html.twig", 4)->display(twig_array_merge($context, ["message" => (isset($context["message"]) || array_key_exists("message", $context) ? $context["message"] : (function () { throw new RuntimeError('Variable "message" does not exist.', 4, $this->source); })()), "type" => (isset($context["type"]) || array_key_exists("type", $context) ? $context["type"] : (function () { throw new RuntimeError('Variable "type" does not exist.', 4, $this->source); })())]));
// line 5
echo "
<p><strong>";
// line 6
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Popup fixed.", [], "admin"), "html", null, true);
echo "</strong>: ";
echo $this->extensions['Pimcore\Twig\Extension\DocumentEditableExtension']->renderEditable($context, "checkbox", "persistentModalPopperOff");
echo "</p>
<p><strong>";
// line 7
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Title Box", [], "admin"), "html", null, true);
echo "</strong>: ";
echo $this->extensions['Pimcore\Twig\Extension\DocumentEditableExtension']->renderEditable($context, "input", "modalTitlePopper");
echo "</p>
<p><strong>";
// line 8
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Content Box", [], "admin"), "html", null, true);
echo "</strong>: ";
echo $this->extensions['Pimcore\Twig\Extension\DocumentEditableExtension']->renderEditable($context, "wysiwyg", "modalContentPopper");
echo "</p>
<br>
";
// line 11
$context["messageTwo"] = "If no date is filled in, popup is always activated.";
// line 12
echo " ";
$context["typeTwo"] = "primary";
// line 13
echo " ";
$this->loadTemplate("includes/basicBlocks/admin/message/tip.html.twig", "areas/popper/view.html.twig", 13)->display(twig_array_merge($context, ["message" => (isset($context["messageTwo"]) || array_key_exists("messageTwo", $context) ? $context["messageTwo"] : (function () { throw new RuntimeError('Variable "messageTwo" does not exist.', 13, $this->source); })()), "type" => (isset($context["typeTwo"]) || array_key_exists("typeTwo", $context) ? $context["typeTwo"] : (function () { throw new RuntimeError('Variable "typeTwo" does not exist.', 13, $this->source); })())]));
// line 14
echo "
";
// line 15
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Start date", [], "admin"), "html", null, true);
echo "
";
// line 16
echo $this->extensions['Pimcore\Twig\Extension\DocumentEditableExtension']->renderEditable($context, "date", "modalStartDate", ["outputFormat" => "%d.%m.%Y", "format" => "d.m.Y"]);
// line 20
echo "
";
// line 22
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("End date", [], "admin"), "html", null, true);
echo "
";
// line 23
echo $this->extensions['Pimcore\Twig\Extension\DocumentEditableExtension']->renderEditable($context, "date", "modalEndDate", ["outputFormat" => "%d.%m.%Y", "format" => "d.m.Y"]);
// line 27
echo "
";
}
// line 29
echo "
";
// line 30
if ( !(isset($context["editmode"]) || array_key_exists("editmode", $context) ? $context["editmode"] : (function () { throw new RuntimeError('Variable "editmode" does not exist.', 30, $this->source); })())) {
// line 31
echo " ";
$context["currentDate"] = twig_date_format_filter($this->env, "now", "Ymd");
// line 32
echo " ";
$context["startDate"] = $this->extensions['Pimcore\Twig\Extension\DocumentEditableExtension']->renderEditable($context, "date", "modalStartDate", ["outputFormat" => "%Y%m%d"]);
// line 33
echo " ";
$context["endDate"] = $this->extensions['Pimcore\Twig\Extension\DocumentEditableExtension']->renderEditable($context, "date", "modalEndDate", ["outputFormat" => "%Y%m%d"]);
// line 34
echo " ";
$context["popperIdName"] = $this->env->getFunction('uniqid')->getCallable()("popper-");
// line 35
echo "
";
// line 36
if (((((isset($context["startDate"]) || array_key_exists("startDate", $context) ? $context["startDate"] : (function () { throw new RuntimeError('Variable "startDate" does not exist.', 36, $this->source); })()) == "") && ((isset($context["endDate"]) || array_key_exists("endDate", $context) ? $context["endDate"] : (function () { throw new RuntimeError('Variable "endDate" does not exist.', 36, $this->source); })()) == "")) || (((isset($context["currentDate"]) || array_key_exists("currentDate", $context) ? $context["currentDate"] : (function () { throw new RuntimeError('Variable "currentDate" does not exist.', 36, $this->source); })()) >= (isset($context["startDate"]) || array_key_exists("startDate", $context) ? $context["startDate"] : (function () { throw new RuntimeError('Variable "startDate" does not exist.', 36, $this->source); })())) && ((isset($context["currentDate"]) || array_key_exists("currentDate", $context) ? $context["currentDate"] : (function () { throw new RuntimeError('Variable "currentDate" does not exist.', 36, $this->source); })()) <= (isset($context["endDate"]) || array_key_exists("endDate", $context) ? $context["endDate"] : (function () { throw new RuntimeError('Variable "endDate" does not exist.', 36, $this->source); })()))))) {
// line 37
echo " <div class=\"modal\" tabindex=\"-1\" id=\"modalPopper";
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed((isset($context["popperIdName"]) || array_key_exists("popperIdName", $context) ? $context["popperIdName"] : (function () { throw new RuntimeError('Variable "popperIdName" does not exist.', 37, $this->source); })()), 37, $this->source), "html", null, true);
echo "\">
<div class=\"modal-dialog\">
<div class=\"modal-content\">
<div class=\"modal-header\">
<h5 class=\"modal-title\">";
// line 41
echo $this->extensions['Pimcore\Twig\Extension\DocumentEditableExtension']->renderEditable($context, "input", "modalTitlePopper");
echo "</h5>
<button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"modal\" aria-label=\"";
// line 42
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Close"), "html", null, true);
echo "\"></button>
</div>
<div class=\"modal-body\">
";
// line 45
echo $this->extensions['Pimcore\Twig\Extension\DocumentEditableExtension']->renderEditable($context, "wysiwyg", "modalContentPopper");
echo "
</div>
<div class=\"modal-footer\">
<button type=\"button\" class=\"btn btn-primary\" data-bs-dismiss=\"modal\">";
// line 48
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Close"), "html", null, true);
echo "</button>
</div>
</div>
</div>
</div>
<script>
\$(document).ready(function() {
";
// line 56
if (twig_get_attribute($this->env, $this->source, $this->extensions['Pimcore\Twig\Extension\DocumentEditableExtension']->renderEditable($context, "checkbox", "persistentModalPopperOff"), "isChecked", [], "method", false, false, true, 56)) {
// line 57
echo " localStorage['popupModalPopper";
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed((isset($context["popperIdName"]) || array_key_exists("popperIdName", $context) ? $context["popperIdName"] : (function () { throw new RuntimeError('Variable "popperIdName" does not exist.', 57, $this->source); })()), 57, $this->source), "html", null, true);
echo "'] = \"showalways\";
";
}
// line 59
echo "
if(localStorage.getItem(\"popupModalPopper";
// line 60
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed((isset($context["popperIdName"]) || array_key_exists("popperIdName", $context) ? $context["popperIdName"] : (function () { throw new RuntimeError('Variable "popperIdName" does not exist.', 60, $this->source); })()), 60, $this->source), "html", null, true);
echo "\") && localStorage.getItem(\"popupModalPopper";
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed((isset($context["popperIdName"]) || array_key_exists("popperIdName", $context) ? $context["popperIdName"] : (function () { throw new RuntimeError('Variable "popperIdName" does not exist.', 60, $this->source); })()), 60, $this->source), "html", null, true);
echo "\") != \"showonetime\"){
\$('#modalPopper";
// line 61
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed((isset($context["popperIdName"]) || array_key_exists("popperIdName", $context) ? $context["popperIdName"] : (function () { throw new RuntimeError('Variable "popperIdName" does not exist.', 61, $this->source); })()), 61, $this->source), "html", null, true);
echo "').modal('show');
}
";
// line 64
if ( !twig_get_attribute($this->env, $this->source, $this->extensions['Pimcore\Twig\Extension\DocumentEditableExtension']->renderEditable($context, "checkbox", "persistentModalPopperOff"), "isChecked", [], "method", false, false, true, 64)) {
// line 65
echo " localStorage['popupModalPopper";
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed((isset($context["popperIdName"]) || array_key_exists("popperIdName", $context) ? $context["popperIdName"] : (function () { throw new RuntimeError('Variable "popperIdName" does not exist.', 65, $this->source); })()), 65, $this->source), "html", null, true);
echo "'] = \"showonetime\";
";
}
// line 67
echo " });
</script>
";
}
}
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
}
public function getTemplateName()
{
return "areas/popper/view.html.twig";
}
public function isTraitable()
{
return false;
}
public function getDebugInfo()
{
return array ( 198 => 67, 192 => 65, 190 => 64, 184 => 61, 178 => 60, 175 => 59, 169 => 57, 167 => 56, 156 => 48, 150 => 45, 144 => 42, 140 => 41, 132 => 37, 130 => 36, 127 => 35, 124 => 34, 121 => 33, 118 => 32, 115 => 31, 113 => 30, 110 => 29, 106 => 27, 104 => 23, 100 => 22, 96 => 20, 94 => 16, 90 => 15, 87 => 14, 84 => 13, 81 => 12, 79 => 11, 71 => 8, 65 => 7, 59 => 6, 56 => 5, 53 => 4, 50 => 3, 47 => 2, 45 => 1,);
}
public function getSourceContext()
{
return new Source("{% if editmode %}
{% set message = 'Popup maker' %}
{% set type = 'info' %}
{% include 'includes/basicBlocks/admin/message/tip.html.twig' with {'message': message, 'type' : type} %}
<p><strong>{{ 'Popup fixed.'|trans({}, 'admin') }}</strong>: {{ pimcore_checkbox('persistentModalPopperOff') }}</p>
<p><strong>{{ 'Title Box'|trans({}, 'admin') }}</strong>: {{ pimcore_input('modalTitlePopper') }}</p>
<p><strong>{{ 'Content Box'|trans({}, 'admin') }}</strong>: {{ pimcore_wysiwyg('modalContentPopper') }}</p>
<br>
{% set messageTwo = 'If no date is filled in, popup is always activated.' %}
{% set typeTwo = 'primary' %}
{% include 'includes/basicBlocks/admin/message/tip.html.twig' with {'message': messageTwo, 'type' : typeTwo} %}
{{ 'Start date'|trans({}, 'admin') }}
{{ pimcore_date('modalStartDate', {
'outputFormat': '%d.%m.%Y',
'format': 'd.m.Y'
})
}}
{{ 'End date'|trans({}, 'admin') }}
{{ pimcore_date('modalEndDate', {
'outputFormat': '%d.%m.%Y',
'format': 'd.m.Y'
})
}}
{% endif %}
{% if not editmode %}
{% set currentDate = 'now'|date('Ymd') %}
{% set startDate = pimcore_date('modalStartDate', {'outputFormat': '%Y%m%d'}) %}
{% set endDate = pimcore_date('modalEndDate', {'outputFormat': '%Y%m%d'}) %}
{% set popperIdName = uniqid('popper-') %}
{% if (startDate == '' and endDate == '') or (currentDate >= startDate and currentDate <= endDate )%}
<div class=\"modal\" tabindex=\"-1\" id=\"modalPopper{{ popperIdName }}\">
<div class=\"modal-dialog\">
<div class=\"modal-content\">
<div class=\"modal-header\">
<h5 class=\"modal-title\">{{ pimcore_input('modalTitlePopper') }}</h5>
<button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"modal\" aria-label=\"{{ 'Close'|trans }}\"></button>
</div>
<div class=\"modal-body\">
{{ pimcore_wysiwyg('modalContentPopper') }}
</div>
<div class=\"modal-footer\">
<button type=\"button\" class=\"btn btn-primary\" data-bs-dismiss=\"modal\">{{ 'Close'|trans }}</button>
</div>
</div>
</div>
</div>
<script>
\$(document).ready(function() {
{% if pimcore_checkbox(\"persistentModalPopperOff\").isChecked() %}
localStorage['popupModalPopper{{ popperIdName }}'] = \"showalways\";
{% endif %}
if(localStorage.getItem(\"popupModalPopper{{ popperIdName }}\") && localStorage.getItem(\"popupModalPopper{{ popperIdName }}\") != \"showonetime\"){
\$('#modalPopper{{ popperIdName }}').modal('show');
}
{% if not pimcore_checkbox(\"persistentModalPopperOff\").isChecked() %}
localStorage['popupModalPopper{{ popperIdName }}'] = \"showonetime\";
{% endif %}
});
</script>
{% endif %}
{% endif %}", "areas/popper/view.html.twig", "/var/www/clients/client2/web45/web/pc/templates/areas/popper/view.html.twig");
}
public function checkSecurity()
{
static $tags = array("if" => 1, "set" => 2, "include" => 4);
static $filters = array("escape" => 6, "trans" => 6, "date" => 31);
static $functions = array("pimcore_checkbox" => 6, "pimcore_input" => 7, "pimcore_wysiwyg" => 8, "pimcore_date" => 16, "uniqid" => 34);
try {
$this->sandbox->checkSecurity(
['if', 'set', 'include'],
['escape', 'trans', 'date'],
['pimcore_checkbox', 'pimcore_input', 'pimcore_wysiwyg', 'pimcore_date', 'uniqid']
);
} 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;
}
}
}