var/cache/dev/twig/16/16c36717fe77d18a29c8073da07a91af.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. /* areas/popper/view.html.twig */
  14. class __TwigTemplate_0beb118d74edef19f66e1480cf21d09a 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""areas/popper/view.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""areas/popper/view.html.twig"));
  35.         // line 1
  36.         if ((isset($context["editmode"]) || array_key_exists("editmode"$context) ? $context["editmode"] : (function () { throw new RuntimeError('Variable "editmode" does not exist.'1$this->source); })())) {
  37.             // line 2
  38.             echo "    ";
  39.             $context["message"] = "Popup maker";
  40.             // line 3
  41.             echo "    ";
  42.             $context["type"] = "info";
  43.             // line 4
  44.             echo "    ";
  45.             $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); })())]));
  46.             // line 5
  47.             echo "
  48.     <p><strong>";
  49.             // line 6
  50.             echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Popup fixed.", [], "admin"), "html"nulltrue);
  51.             echo "</strong>: ";
  52.             echo $this->extensions['Pimcore\Twig\Extension\DocumentEditableExtension']->renderEditable($context"checkbox""persistentModalPopperOff");
  53.             echo "</p>
  54.     <p><strong>";
  55.             // line 7
  56.             echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Title Box", [], "admin"), "html"nulltrue);
  57.             echo "</strong>: ";
  58.             echo $this->extensions['Pimcore\Twig\Extension\DocumentEditableExtension']->renderEditable($context"input""modalTitlePopper");
  59.             echo "</p>
  60.     <p><strong>";
  61.             // line 8
  62.             echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Content Box", [], "admin"), "html"nulltrue);
  63.             echo "</strong>: ";
  64.             echo $this->extensions['Pimcore\Twig\Extension\DocumentEditableExtension']->renderEditable($context"wysiwyg""modalContentPopper");
  65.             echo "</p>
  66.     <br>
  67.     ";
  68.             // line 11
  69.             $context["messageTwo"] = "If no date is filled in, popup is always activated.";
  70.             // line 12
  71.             echo "    ";
  72.             $context["typeTwo"] = "primary";
  73.             // line 13
  74.             echo "    ";
  75.             $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); })())]));
  76.             // line 14
  77.             echo "
  78.     ";
  79.             // line 15
  80.             echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Start date", [], "admin"), "html"nulltrue);
  81.             echo "
  82.     ";
  83.             // line 16
  84.             echo $this->extensions['Pimcore\Twig\Extension\DocumentEditableExtension']->renderEditable($context"date""modalStartDate", ["outputFormat" => "%d.%m.%Y""format" => "d.m.Y"]);
  85.             // line 20
  86.             echo "
  87.     ";
  88.             // line 22
  89.             echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("End date", [], "admin"), "html"nulltrue);
  90.             echo "
  91.     ";
  92.             // line 23
  93.             echo $this->extensions['Pimcore\Twig\Extension\DocumentEditableExtension']->renderEditable($context"date""modalEndDate", ["outputFormat" => "%d.%m.%Y""format" => "d.m.Y"]);
  94.             // line 27
  95.             echo "
  96. ";
  97.         }
  98.         // line 29
  99.         echo "
  100. ";
  101.         // line 30
  102.         if ( !(isset($context["editmode"]) || array_key_exists("editmode"$context) ? $context["editmode"] : (function () { throw new RuntimeError('Variable "editmode" does not exist.'30$this->source); })())) {
  103.             // line 31
  104.             echo "    ";
  105.             $context["currentDate"] = twig_date_format_filter($this->env"now""Ymd");
  106.             // line 32
  107.             echo "    ";
  108.             $context["startDate"] = $this->extensions['Pimcore\Twig\Extension\DocumentEditableExtension']->renderEditable($context"date""modalStartDate", ["outputFormat" => "%Y%m%d"]);
  109.             // line 33
  110.             echo "    ";
  111.             $context["endDate"] = $this->extensions['Pimcore\Twig\Extension\DocumentEditableExtension']->renderEditable($context"date""modalEndDate", ["outputFormat" => "%Y%m%d"]);
  112.             // line 34
  113.             echo "    ";
  114.             $context["popperIdName"] = $this->env->getFunction('uniqid')->getCallable()("popper-");
  115.             // line 35
  116.             echo "
  117.     ";
  118.             // line 36
  119.             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); })()))))) {
  120.                 // line 37
  121.                 echo "        <div class=\"modal\" tabindex=\"-1\" id=\"modalPopper";
  122.                 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"nulltrue);
  123.                 echo "\">
  124.             <div class=\"modal-dialog\">
  125.                 <div class=\"modal-content\">
  126.                     <div class=\"modal-header\">
  127.                         <h5 class=\"modal-title\">";
  128.                 // line 41
  129.                 echo $this->extensions['Pimcore\Twig\Extension\DocumentEditableExtension']->renderEditable($context"input""modalTitlePopper");
  130.                 echo "</h5>
  131.                         <button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"modal\" aria-label=\"";
  132.                 // line 42
  133.                 echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Close"), "html"nulltrue);
  134.                 echo "\"></button>
  135.                     </div>
  136.                     <div class=\"modal-body\">
  137.                         ";
  138.                 // line 45
  139.                 echo $this->extensions['Pimcore\Twig\Extension\DocumentEditableExtension']->renderEditable($context"wysiwyg""modalContentPopper");
  140.                 echo "
  141.                     </div>
  142.                     <div class=\"modal-footer\">
  143.                         <button type=\"button\" class=\"btn btn-primary\" data-bs-dismiss=\"modal\">";
  144.                 // line 48
  145.                 echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Close"), "html"nulltrue);
  146.                 echo "</button>
  147.                     </div>
  148.                 </div>
  149.             </div>
  150.         </div>
  151.         <script>
  152.             \$(document).ready(function() {
  153.                 ";
  154.                 // line 56
  155.                 if (twig_get_attribute($this->env$this->source$this->extensions['Pimcore\Twig\Extension\DocumentEditableExtension']->renderEditable($context"checkbox""persistentModalPopperOff"), "isChecked", [], "method"falsefalsetrue56)) {
  156.                     // line 57
  157.                     echo "                localStorage['popupModalPopper";
  158.                     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"nulltrue);
  159.                     echo "'] = \"showalways\";
  160.                 ";
  161.                 }
  162.                 // line 59
  163.                 echo "
  164.                 if(localStorage.getItem(\"popupModalPopper";
  165.                 // line 60
  166.                 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"nulltrue);
  167.                 echo "\") && localStorage.getItem(\"popupModalPopper";
  168.                 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"nulltrue);
  169.                 echo "\") != \"showonetime\"){
  170.                     \$('#modalPopper";
  171.                 // line 61
  172.                 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"nulltrue);
  173.                 echo "').modal('show');
  174.                 }
  175.                 ";
  176.                 // line 64
  177.                 if ( !twig_get_attribute($this->env$this->source$this->extensions['Pimcore\Twig\Extension\DocumentEditableExtension']->renderEditable($context"checkbox""persistentModalPopperOff"), "isChecked", [], "method"falsefalsetrue64)) {
  178.                     // line 65
  179.                     echo "                localStorage['popupModalPopper";
  180.                     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"nulltrue);
  181.                     echo "'] = \"showonetime\";
  182.                 ";
  183.                 }
  184.                 // line 67
  185.                 echo "            });
  186.         </script>
  187.     ";
  188.             }
  189.         }
  190.         
  191.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  192.         
  193.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  194.     }
  195.     public function getTemplateName()
  196.     {
  197.         return "areas/popper/view.html.twig";
  198.     }
  199.     public function isTraitable()
  200.     {
  201.         return false;
  202.     }
  203.     public function getDebugInfo()
  204.     {
  205.         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,);
  206.     }
  207.     public function getSourceContext()
  208.     {
  209.         return new Source("{% if editmode %}
  210.     {% set message = 'Popup maker' %}
  211.     {% set type = 'info' %}
  212.     {% include 'includes/basicBlocks/admin/message/tip.html.twig' with {'message': message, 'type' : type} %}
  213.     <p><strong>{{ 'Popup fixed.'|trans({}, 'admin') }}</strong>: {{ pimcore_checkbox('persistentModalPopperOff') }}</p>
  214.     <p><strong>{{ 'Title Box'|trans({}, 'admin') }}</strong>: {{ pimcore_input('modalTitlePopper') }}</p>
  215.     <p><strong>{{ 'Content Box'|trans({}, 'admin') }}</strong>: {{ pimcore_wysiwyg('modalContentPopper') }}</p>
  216.     <br>
  217.     {% set messageTwo = 'If no date is filled in, popup is always activated.' %}
  218.     {% set typeTwo = 'primary' %}
  219.     {% include 'includes/basicBlocks/admin/message/tip.html.twig' with {'message': messageTwo, 'type' : typeTwo} %}
  220.     {{ 'Start date'|trans({}, 'admin') }}
  221.     {{ pimcore_date('modalStartDate', {
  222.         'outputFormat': '%d.%m.%Y',
  223.         'format': 'd.m.Y'
  224.     })
  225.     }}
  226.     {{ 'End date'|trans({}, 'admin') }}
  227.     {{ pimcore_date('modalEndDate', {
  228.         'outputFormat': '%d.%m.%Y',
  229.         'format': 'd.m.Y'
  230.     })
  231.     }}
  232. {% endif %}
  233. {% if not editmode %}
  234.     {% set currentDate = 'now'|date('Ymd') %}
  235.     {% set startDate = pimcore_date('modalStartDate', {'outputFormat': '%Y%m%d'}) %}
  236.     {% set endDate = pimcore_date('modalEndDate', {'outputFormat': '%Y%m%d'}) %}
  237.     {% set popperIdName = uniqid('popper-') %}
  238.     {% if (startDate == '' and endDate == '') or (currentDate >= startDate and currentDate <= endDate )%}
  239.         <div class=\"modal\" tabindex=\"-1\" id=\"modalPopper{{ popperIdName }}\">
  240.             <div class=\"modal-dialog\">
  241.                 <div class=\"modal-content\">
  242.                     <div class=\"modal-header\">
  243.                         <h5 class=\"modal-title\">{{ pimcore_input('modalTitlePopper') }}</h5>
  244.                         <button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"modal\" aria-label=\"{{ 'Close'|trans }}\"></button>
  245.                     </div>
  246.                     <div class=\"modal-body\">
  247.                         {{ pimcore_wysiwyg('modalContentPopper') }}
  248.                     </div>
  249.                     <div class=\"modal-footer\">
  250.                         <button type=\"button\" class=\"btn btn-primary\" data-bs-dismiss=\"modal\">{{ 'Close'|trans }}</button>
  251.                     </div>
  252.                 </div>
  253.             </div>
  254.         </div>
  255.         <script>
  256.             \$(document).ready(function() {
  257.                 {% if pimcore_checkbox(\"persistentModalPopperOff\").isChecked() %}
  258.                 localStorage['popupModalPopper{{ popperIdName }}'] = \"showalways\";
  259.                 {% endif %}
  260.                 if(localStorage.getItem(\"popupModalPopper{{ popperIdName }}\") && localStorage.getItem(\"popupModalPopper{{ popperIdName }}\") != \"showonetime\"){
  261.                     \$('#modalPopper{{ popperIdName }}').modal('show');
  262.                 }
  263.                 {% if not pimcore_checkbox(\"persistentModalPopperOff\").isChecked() %}
  264.                 localStorage['popupModalPopper{{ popperIdName }}'] = \"showonetime\";
  265.                 {% endif %}
  266.             });
  267.         </script>
  268.     {% endif %}
  269. {% endif %}""areas/popper/view.html.twig""/var/www/clients/client2/web45/web/pc/templates/areas/popper/view.html.twig");
  270.     }
  271.     
  272.     public function checkSecurity()
  273.     {
  274.         static $tags = array("if" => 1"set" => 2"include" => 4);
  275.         static $filters = array("escape" => 6"trans" => 6"date" => 31);
  276.         static $functions = array("pimcore_checkbox" => 6"pimcore_input" => 7"pimcore_wysiwyg" => 8"pimcore_date" => 16"uniqid" => 34);
  277.         try {
  278.             $this->sandbox->checkSecurity(
  279.                 ['if''set''include'],
  280.                 ['escape''trans''date'],
  281.                 ['pimcore_checkbox''pimcore_input''pimcore_wysiwyg''pimcore_date''uniqid']
  282.             );
  283.         } catch (SecurityError $e) {
  284.             $e->setSourceContext($this->source);
  285.             if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) {
  286.                 $e->setTemplateLine($tags[$e->getTagName()]);
  287.             } elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) {
  288.                 $e->setTemplateLine($filters[$e->getFilterName()]);
  289.             } elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) {
  290.                 $e->setTemplateLine($functions[$e->getFunctionName()]);
  291.             }
  292.             throw $e;
  293.         }
  294.     }
  295. }