var/cache/dev/twig/09/09ea5ad9cfa27856867661eeadeaed0e.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/main-nav.html.twig */
  14. class __TwigTemplate_a7ac00eee3d02cd38a3e2fde6d7fa3e8 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/main-nav.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/main-nav.html.twig"));
  35.         // line 1
  36.         echo "<label for=\"toggleMobileNav\" class=\"main-nav--toggle\">
  37.     <span></span>
  38. </label>
  39. <nav class=\"main-nav\" id=\"main-nav\" role=\"navigation\">
  40.     ";
  41.         // line 6
  42.         $context["navigationRoot"] = twig_get_attribute($this->env$this->source, (isset($context["document"]) || array_key_exists("document"$context) ? $context["document"] : (function () { throw new RuntimeError('Variable "document" does not exist.'6$this->source); })()), "getProperty", [=> "navigation_root"], "method"falsefalsetrue6);
  43.         // line 7
  44.         echo "    ";
  45.         if ( !$this->env->getTest('instanceof')->getCallable()((isset($context["navigationRoot"]) || array_key_exists("navigationRoot"$context) ? $context["navigationRoot"] : (function () { throw new RuntimeError('Variable "navigationRoot" does not exist.'7$this->source); })()), "\\Pimcore\\Model\\Document")) {
  46.             // line 8
  47.             echo "        ";
  48.             $context["navigationRoot"] = Pimcore\Model\Document::getById(1);
  49.             // line 9
  50.             echo "    ";
  51.         }
  52.         // line 10
  53.         echo "    ";
  54.         $context["mainNav"] = $this->extensions['CONECTO\ProviderBundle\Twig\Extension\ConectoExtension']->buildMainNavigation($this->sandbox->ensureToStringAllowed((isset($context["document"]) || array_key_exists("document"$context) ? $context["document"] : (function () { throw new RuntimeError('Variable "document" does not exist.'10$this->source); })()), 10$this->source), $this->sandbox->ensureToStringAllowed((isset($context["navigationRoot"]) || array_key_exists("navigationRoot"$context) ? $context["navigationRoot"] : (function () { throw new RuntimeError('Variable "navigationRoot" does not exist.'10$this->source); })()), 10$this->source));
  55.         // line 11
  56.         echo "    ";
  57.         $context["renderer"] = $this->env->getFunction('pimcore_nav_renderer')->getCallable()("menu");
  58.         // line 12
  59.         echo "    <ul class=\"main-nav--list\" role=\"menubar\">
  60.     ";
  61.         // line 13
  62.         if (array_key_exists("mainNav"$context)) {
  63.             // line 14
  64.             echo "        ";
  65.             $context['_parent'] = $context;
  66.             $context['_seq'] = twig_ensure_traversable((isset($context["mainNav"]) || array_key_exists("mainNav"$context) ? $context["mainNav"] : (function () { throw new RuntimeError('Variable "mainNav" does not exist.'14$this->source); })()));
  67.             foreach ($context['_seq'] as $context["key"] => $context["page"]) {
  68.                 // line 15
  69.                 echo "            ";
  70.                 if ((twig_get_attribute($this->env$this->source$context["page"], "isVisible", [], "method"falsefalsetrue15) && twig_get_attribute($this->env$this->source, (isset($context["renderer"]) || array_key_exists("renderer"$context) ? $context["renderer"] : (function () { throw new RuntimeError('Variable "renderer" does not exist.'15$this->source); })()), "accept", [=> $context["page"]], "method"falsefalsetrue15))) {
  71.                     // line 16
  72.                     echo "                ";
  73.                     ob_start();
  74.                     // line 17
  75.                     echo "                    ";
  76.                     $context["activeClass"] = "";
  77.                     // line 18
  78.                     echo "                    ";
  79.                     $context["hiddenClass"] = "";
  80.                     // line 19
  81.                     echo "                    ";
  82.                     $context["additionalClass"] = "";
  83.                     // line 20
  84.                     echo "                    ";
  85.                     if (twig_get_attribute($this->env$this->source$context["page"], "getActive", [=> true], "method"falsefalsetrue20)) {
  86.                         // line 21
  87.                         echo "                        ";
  88.                         $context["activeClass"] = "is-active";
  89.                         // line 22
  90.                         echo "                    ";
  91.                     }
  92.                     // line 23
  93.                     echo "                    ";
  94.                     if (($this->env->getTest('instanceof')->getCallable()(twig_get_attribute($this->env$this->source$context["page"], "getCustomSetting", [=> "document"], "method"falsefalsetrue23), "\\Pimcore\\Model\\Document") && twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source$context["page"], "getCustomSetting", [=> "document"], "method"falsefalsetrue23), "getProperty", [=> "menuAsButton"], "method"falsefalsetrue23))) {
  95.                         // line 24
  96.                         echo "                        ";
  97.                         $context["additionalClass"] = "btn btn-primary";
  98.                         // line 25
  99.                         echo "                    ";
  100.                     }
  101.                     // line 26
  102.                     echo "                ";
  103.                     $___internal_parse_6_ = ('' === $tmp ob_get_clean()) ? '' : new Markup($tmp$this->env->getCharset());
  104.                     // line 16
  105.                     echo twig_spaceless($___internal_parse_6_);
  106.                     // line 27
  107.                     echo "                <li class=\"main-nav--item";
  108.                     if (twig_get_attribute($this->env$this->source$context["page"], "hasPages", [], "any"falsefalsetrue27)) {
  109.                         echo " has-dropdown";
  110.                     }
  111.                     echo " ";
  112.                     echo twig_escape_filter($this->env$this->sandbox->ensureToStringAllowed((isset($context["activeClass"]) || array_key_exists("activeClass"$context) ? $context["activeClass"] : (function () { throw new RuntimeError('Variable "activeClass" does not exist.'27$this->source); })()), 27$this->source), "html"nulltrue);
  113.                     echo " ";
  114.                     echo twig_escape_filter($this->env$this->sandbox->ensureToStringAllowed((isset($context["hiddenClass"]) || array_key_exists("hiddenClass"$context) ? $context["hiddenClass"] : (function () { throw new RuntimeError('Variable "hiddenClass" does not exist.'27$this->source); })()), 27$this->source), "html"nulltrue);
  115.                     echo "\" role=\"none\">
  116.                     ";
  117.                     // line 28
  118.                     if (twig_get_attribute($this->env$this->source$context["page"], "hasVisiblePages", [], "any"falsefalsetrue28)) {
  119.                         // line 29
  120.                         echo "                        <input type=\"checkbox\" name=\"toggleSubNav\" id=\"navbarDropdown";
  121.                         echo twig_escape_filter($this->env$this->sandbox->ensureToStringAllowed($context["key"], 29$this->source), "html"nulltrue);
  122.                         echo "\" aria-hidden=\"true\" value=\"1\" />
  123.                         <label for=\"navbarDropdown";
  124.                         // line 30
  125.                         echo twig_escape_filter($this->env$this->sandbox->ensureToStringAllowed($context["key"], 30$this->source), "html"nulltrue);
  126.                         echo "\" aria-hidden=\"true\"></label>
  127.                     ";
  128.                     }
  129.                     // line 32
  130.                     echo "                    <a role=\"menuitem\" href=\"";
  131.                     echo twig_escape_filter($this->env$this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env$this->source$context["page"], "href", [], "any"falsefalsetrue32), 32$this->source), "html"nulltrue);
  132.                     echo "\" class=\"";
  133.                     echo twig_escape_filter($this->env$this->sandbox->ensureToStringAllowed((isset($context["additionalClass"]) || array_key_exists("additionalClass"$context) ? $context["additionalClass"] : (function () { throw new RuntimeError('Variable "additionalClass" does not exist.'32$this->source); })()), 32$this->source), "html"nulltrue);
  134.                     echo "\">
  135.                         ";
  136.                     // line 33
  137.                     echo twig_escape_filter($this->env$this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env$this->source$context["page"], "label", [], "any"falsefalsetrue33), 33$this->source), "html"nulltrue);
  138.                     echo "
  139.                     </a>
  140.                     ";
  141.                     // line 35
  142.                     if (twig_get_attribute($this->env$this->source$context["page"], "hasVisiblePages", [], "any"falsefalsetrue35)) {
  143.                         // line 36
  144.                         echo "                        <ul role=\"menu\" aria-label=\"";
  145.                         echo twig_escape_filter($this->env$this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env$this->source$context["page"], "label", [], "any"falsefalsetrue36), 36$this->source), "html"nulltrue);
  146.                         echo "\">
  147.                             ";
  148.                         // line 37
  149.                         $context['_parent'] = $context;
  150.                         $context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env$this->source$context["page"], "pages", [], "any"falsefalsetrue37));
  151.                         foreach ($context['_seq'] as $context["_key"] => $context["child"]) {
  152.                             // line 38
  153.                             echo "                                ";
  154.                             if ((twig_get_attribute($this->env$this->source$context["child"], "isVisible", [], "method"falsefalsetrue38) && twig_get_attribute($this->env$this->source, (isset($context["renderer"]) || array_key_exists("renderer"$context) ? $context["renderer"] : (function () { throw new RuntimeError('Variable "renderer" does not exist.'38$this->source); })()), "accept", [=> $context["child"]], "method"falsefalsetrue38))) {
  155.                                 // line 39
  156.                                 echo "                                    <li role=\"none\"";
  157.                                 if (twig_get_attribute($this->env$this->source$context["child"], "getActive", [=> true], "method"falsefalsetrue39)) {
  158.                                     echo " class=\"is-active\"";
  159.                                 }
  160.                                 echo ">
  161.                                         <a role=\"menuitem\" href=\"";
  162.                                 // line 40
  163.                                 echo twig_escape_filter($this->env$this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env$this->source$context["child"], "href", [], "any"falsefalsetrue40), 40$this->source), "html"nulltrue);
  164.                                 echo "\">";
  165.                                 echo twig_escape_filter($this->env$this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env$this->source$context["child"], "label", [], "any"falsefalsetrue40), 40$this->source), "html"nulltrue);
  166.                                 echo "</a>
  167.                                     </li>
  168.                                 ";
  169.                             }
  170.                             // line 43
  171.                             echo "                            ";
  172.                         }
  173.                         $_parent $context['_parent'];
  174.                         unset($context['_seq'], $context['_iterated'], $context['_key'], $context['child'], $context['_parent'], $context['loop']);
  175.                         $context array_intersect_key($context$_parent) + $_parent;
  176.                         // line 44
  177.                         echo "                        </ul>
  178.                     ";
  179.                     }
  180.                     // line 46
  181.                     echo "                </li>
  182.             ";
  183.                 }
  184.                 // line 48
  185.                 echo "        ";
  186.             }
  187.             $_parent $context['_parent'];
  188.             unset($context['_seq'], $context['_iterated'], $context['key'], $context['page'], $context['_parent'], $context['loop']);
  189.             $context array_intersect_key($context$_parent) + $_parent;
  190.             // line 49
  191.             echo "    ";
  192.         }
  193.         // line 50
  194.         echo "    </ul>
  195. </nav>";
  196.         
  197.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  198.         
  199.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  200.     }
  201.     public function getTemplateName()
  202.     {
  203.         return "@Provider/partials/header/main-nav.html.twig";
  204.     }
  205.     public function isTraitable()
  206.     {
  207.         return false;
  208.     }
  209.     public function getDebugInfo()
  210.     {
  211.         return array (  204 => 50,  201 => 49,  195 => 48,  191 => 46,  187 => 44,  181 => 43,  173 => 40,  166 => 39,  163 => 38,  159 => 37,  154 => 36,  152 => 35,  147 => 33,  140 => 32,  135 => 30,  130 => 29,  128 => 28,  117 => 27,  115 => 16,  112 => 26,  109 => 25,  106 => 24,  103 => 23,  100 => 22,  97 => 21,  94 => 20,  91 => 19,  88 => 18,  85 => 17,  82 => 16,  79 => 15,  74 => 14,  72 => 13,  69 => 12,  66 => 11,  63 => 10,  60 => 9,  57 => 8,  54 => 7,  52 => 6,  45 => 1,);
  212.     }
  213.     public function getSourceContext()
  214.     {
  215.         return new Source("<label for=\"toggleMobileNav\" class=\"main-nav--toggle\">
  216.     <span></span>
  217. </label>
  218. <nav class=\"main-nav\" id=\"main-nav\" role=\"navigation\">
  219.     {% set navigationRoot = document.getProperty('navigation_root') %}
  220.     {% if not navigationRoot is instanceof('\\\\Pimcore\\\\Model\\\\Document') %}
  221.         {% set navigationRoot = pimcore_document(1) %}
  222.     {% endif %}
  223.     {% set mainNav = conecto_build_nav(document, navigationRoot) %}
  224.     {% set renderer = pimcore_nav_renderer('menu') %}
  225.     <ul class=\"main-nav--list\" role=\"menubar\">
  226.     {% if mainNav is defined %}
  227.         {% for key, page in mainNav %}
  228.             {% if page.isVisible() and renderer.accept(page) %}
  229.                 {% apply spaceless %}
  230.                     {% set activeClass = '' %}
  231.                     {% set hiddenClass = '' %}
  232.                     {% set additionalClass = '' %}
  233.                     {% if page.getActive(true) %}
  234.                         {% set activeClass = 'is-active' %}
  235.                     {% endif %}
  236.                     {% if page.getCustomSetting('document') is instanceof('\\\\Pimcore\\\\Model\\\\Document') and page.getCustomSetting('document').getProperty('menuAsButton') %}
  237.                         {% set additionalClass = 'btn btn-primary' %}
  238.                     {% endif %}
  239.                 {% endapply %}
  240.                 <li class=\"main-nav--item{% if page.hasPages %} has-dropdown{% endif%} {{ activeClass }} {{ hiddenClass }}\" role=\"none\">
  241.                     {% if page.hasVisiblePages %}
  242.                         <input type=\"checkbox\" name=\"toggleSubNav\" id=\"navbarDropdown{{ key }}\" aria-hidden=\"true\" value=\"1\" />
  243.                         <label for=\"navbarDropdown{{ key }}\" aria-hidden=\"true\"></label>
  244.                     {% endif %}
  245.                     <a role=\"menuitem\" href=\"{{ page.href }}\" class=\"{{ additionalClass }}\">
  246.                         {{ page.label }}
  247.                     </a>
  248.                     {% if page.hasVisiblePages %}
  249.                         <ul role=\"menu\" aria-label=\"{{ page.label }}\">
  250.                             {% for child in page.pages %}
  251.                                 {% if child.isVisible() and renderer.accept(child) %}
  252.                                     <li role=\"none\"{% if child.getActive(true) %} class=\"is-active\"{% endif %}>
  253.                                         <a role=\"menuitem\" href=\"{{ child.href }}\">{{ child.label }}</a>
  254.                                     </li>
  255.                                 {% endif %}
  256.                             {% endfor %}
  257.                         </ul>
  258.                     {% endif %}
  259.                 </li>
  260.             {% endif %}
  261.         {% endfor %}
  262.     {% endif %}
  263.     </ul>
  264. </nav>""@Provider/partials/header/main-nav.html.twig""/html/pimcore/vendor/conecto/pimcore-provider/src/ProviderBundle/Resources/views/partials/header/main-nav.html.twig");
  265.     }
  266.     
  267.     public function checkSecurity()
  268.     {
  269.         static $tags = array("set" => 6"if" => 7"for" => 14"apply" => 16);
  270.         static $filters = array("spaceless" => 16"escape" => 27);
  271.         static $functions = array("pimcore_document" => 8"conecto_build_nav" => 10"pimcore_nav_renderer" => 11);
  272.         try {
  273.             $this->sandbox->checkSecurity(
  274.                 ['set''if''for''apply'],
  275.                 ['spaceless''escape'],
  276.                 ['pimcore_document''conecto_build_nav''pimcore_nav_renderer']
  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. }