var/cache/dev/twig/71/7197f67a61fe4575e288ab5a9d01d60e.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. /* navigation/primary.html.twig */
  14. class __TwigTemplate_0d4f14fe555b4271897912dad89f6223 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""navigation/primary.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""navigation/primary.html.twig"));
  35.         // line 7
  36.         $context["navStartNode"] = 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.'7$this->source); })()), "getProperty", [=> "navigation-root-primary"], "method"falsefalsetrue7);
  37.         // line 8
  38.         echo "
  39. ";
  40.         // line 9
  41.         if (( !$this->env->getTest('instanceof')->getCallable()((isset($context["navStartNode"]) || array_key_exists("navStartNode"$context) ? $context["navStartNode"] : (function () { throw new RuntimeError('Variable "navStartNode" does not exist.'9$this->source); })()), "\\Pimcore\\Model\\Document\\Link") &&  !$this->env->getTest('instanceof')->getCallable()((isset($context["navStartNode"]) || array_key_exists("navStartNode"$context) ? $context["navStartNode"] : (function () { throw new RuntimeError('Variable "navStartNode" does not exist.'9$this->source); })()), "\\Pimcore\\Model\\Document\\Page"))) {
  42.             // line 10
  43.             echo "\t";
  44.             $context["navStartNode"] = Pimcore\Model\Document::getById(1);
  45.         }
  46.         // line 12
  47.         echo "
  48. ";
  49.         // line 13
  50.         $context["mainNavigation"] = $this->extensions['App\Twig\Extension\NavigationExtension']->getCustomNavigation($this->sandbox->ensureToStringAllowed((isset($context["document"]) || array_key_exists("document"$context) ? $context["document"] : (function () { throw new RuntimeError('Variable "document" does not exist.'13$this->source); })()), 13$this->source), $this->sandbox->ensureToStringAllowed((isset($context["navStartNode"]) || array_key_exists("navStartNode"$context) ? $context["navStartNode"] : (function () { throw new RuntimeError('Variable "navStartNode" does not exist.'13$this->source); })()), 13$this->source));
  51.         // line 14
  52.         $context["home"] = (isset($context["navStartNode"]) || array_key_exists("navStartNode"$context) ? $context["navStartNode"] : (function () { throw new RuntimeError('Variable "navStartNode" does not exist.'14$this->source); })());
  53.         // line 15
  54.         echo "
  55.  ";
  56.         // line 30
  57.         $context["menuRenderer"] = $this->env->getFunction('pimcore_nav_renderer')->getCallable()("menu");
  58.         // line 31
  59.         ob_start();
  60.         // line 32
  61.         echo "\t";
  62.         $context['_parent'] = $context;
  63.         $context['_seq'] = twig_ensure_traversable((isset($context["mainNavigation"]) || array_key_exists("mainNavigation"$context) ? $context["mainNavigation"] : (function () { throw new RuntimeError('Variable "mainNavigation" does not exist.'32$this->source); })()));
  64.         $context['loop'] = [
  65.           'parent' => $context['_parent'],
  66.           'index0' => 0,
  67.           'index'  => 1,
  68.           'first'  => true,
  69.         ];
  70.         if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof \Countable)) {
  71.             $length count($context['_seq']);
  72.             $context['loop']['revindex0'] = $length 1;
  73.             $context['loop']['revindex'] = $length;
  74.             $context['loop']['length'] = $length;
  75.             $context['loop']['last'] = === $length;
  76.         }
  77.         foreach ($context['_seq'] as $context["_key"] => $context["page"]) {
  78.             // line 33
  79.             echo "\t\t";
  80.             // line 34
  81.             echo "\t\t";
  82.             if (((twig_get_attribute($this->env$this->source$context["page"], "isVisible", [], "method"falsefalsetrue34) && twig_get_attribute($this->env$this->source, (isset($context["menuRenderer"]) || array_key_exists("menuRenderer"$context) ? $context["menuRenderer"] : (function () { throw new RuntimeError('Variable "menuRenderer" does not exist.'34$this->source); })()), "accept", [=> $context["page"]], "method"falsefalsetrue34)) &&  !twig_get_attribute($this->env$this->source$context["page"], "getCustomSetting", [=> "navigationItemVirtual"], "method"falsefalsetrue34))) {
  83.                 // line 35
  84.                 echo "\t\t\t";
  85.                 $context["activeClassItem"] = ((twig_get_attribute($this->env$this->source$context["page"], "getActive", [=> true], "method"falsefalsetrue35)) ? ("navigation__item--active") : (""));
  86.                 // line 36
  87.                 echo "\t\t\t<li class=\"navigation__item navigation__item--first ";
  88.                 echo twig_escape_filter($this->env$this->sandbox->ensureToStringAllowed((isset($context["activeClassItem"]) || array_key_exists("activeClassItem"$context) ? $context["activeClassItem"] : (function () { throw new RuntimeError('Variable "activeClassItem" does not exist.'36$this->source); })()), 36$this->source), "html"nulltrue);
  89.                 echo " \">
  90. \t\t\t\t";
  91.                 // line 37
  92.                 $this->loadTemplate("navigation/partials/primary-link.html.twig""navigation/primary.html.twig"37)->display(twig_array_merge($context, ["page" => $context["page"], "classes" => [=> "navigation__link--first"]]));
  93.                 // line 38
  94.                 echo "\t\t\t\t";
  95.                 if (twig_get_attribute($this->env$this->source$context["page"], "hasVisiblePages", [], "method"falsefalsetrue38)) {
  96.                     // line 39
  97.                     echo "\t\t\t\t\t";
  98.                     $context["children"] = twig_get_attribute($this->env$this->source$context["page"], "getPages", [], "method"falsefalsetrue39);
  99.                     // line 40
  100.                     echo "\t\t\t\t\t<ul class=\"navigation__container navigation__container--second\">
  101. \t\t\t\t\t";
  102.                     // line 41
  103.                     $context['_parent'] = $context;
  104.                     $context['_seq'] = twig_ensure_traversable((isset($context["children"]) || array_key_exists("children"$context) ? $context["children"] : (function () { throw new RuntimeError('Variable "children" does not exist.'41$this->source); })()));
  105.                     $context['loop'] = [
  106.                       'parent' => $context['_parent'],
  107.                       'index0' => 0,
  108.                       'index'  => 1,
  109.                       'first'  => true,
  110.                     ];
  111.                     if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof \Countable)) {
  112.                         $length count($context['_seq']);
  113.                         $context['loop']['revindex0'] = $length 1;
  114.                         $context['loop']['revindex'] = $length;
  115.                         $context['loop']['length'] = $length;
  116.                         $context['loop']['last'] = === $length;
  117.                     }
  118.                     foreach ($context['_seq'] as $context["_key"] => $context["childPage"]) {
  119.                         // line 42
  120.                         echo "\t\t\t\t\t\t";
  121.                         if (((twig_get_attribute($this->env$this->source$context["childPage"], "isVisible", [], "method"falsefalsetrue42) && twig_get_attribute($this->env$this->source, (isset($context["menuRenderer"]) || array_key_exists("menuRenderer"$context) ? $context["menuRenderer"] : (function () { throw new RuntimeError('Variable "menuRenderer" does not exist.'42$this->source); })()), "accept", [=> $context["childPage"]], "method"falsefalsetrue42)) &&  !twig_get_attribute($this->env$this->source$context["childPage"], "getCustomSetting", [=> "navigationItemVirtual"], "method"falsefalsetrue42))) {
  122.                             // line 43
  123.                             echo "\t\t\t\t\t\t\t";
  124.                             $context["activeClassChildItem"] = ((twig_get_attribute($this->env$this->source$context["childPage"], "getActive", [=> true], "method"falsefalsetrue43)) ? ("navigation__item--active") : (""));
  125.                             // line 44
  126.                             echo "\t\t\t\t\t\t\t<li class=\"navigation__item navigation__item--second ";
  127.                             echo twig_escape_filter($this->env$this->sandbox->ensureToStringAllowed((isset($context["activeClassChildItem"]) || array_key_exists("activeClassChildItem"$context) ? $context["activeClassChildItem"] : (function () { throw new RuntimeError('Variable "activeClassChildItem" does not exist.'44$this->source); })()), 44$this->source), "html"nulltrue);
  128.                             echo " \">
  129. \t\t\t\t\t\t\t\t";
  130.                             // line 45
  131.                             $this->loadTemplate("navigation/partials/primary-link.html.twig""navigation/primary.html.twig"45)->display(twig_array_merge($context, ["page" => $context["childPage"], "classes" => [=> "navigation__link--second"], "icon" => "harke"]));
  132.                             // line 46
  133.                             echo "\t\t\t\t\t\t\t</li>
  134. \t\t\t\t\t\t";
  135.                         }
  136.                         // line 48
  137.                         echo "\t\t\t\t\t";
  138.                         ++$context['loop']['index0'];
  139.                         ++$context['loop']['index'];
  140.                         $context['loop']['first'] = false;
  141.                         if (isset($context['loop']['length'])) {
  142.                             --$context['loop']['revindex0'];
  143.                             --$context['loop']['revindex'];
  144.                             $context['loop']['last'] = === $context['loop']['revindex0'];
  145.                         }
  146.                     }
  147.                     $_parent $context['_parent'];
  148.                     unset($context['_seq'], $context['_iterated'], $context['_key'], $context['childPage'], $context['_parent'], $context['loop']);
  149.                     $context array_intersect_key($context$_parent) + $_parent;
  150.                     // line 49
  151.                     echo "\t\t\t\t\t</ul>
  152. \t\t\t\t";
  153.                 }
  154.                 // line 51
  155.                 echo "\t\t\t</li>
  156. \t\t";
  157.             }
  158.             // line 53
  159.             echo "\t";
  160.             ++$context['loop']['index0'];
  161.             ++$context['loop']['index'];
  162.             $context['loop']['first'] = false;
  163.             if (isset($context['loop']['length'])) {
  164.                 --$context['loop']['revindex0'];
  165.                 --$context['loop']['revindex'];
  166.                 $context['loop']['last'] = === $context['loop']['revindex0'];
  167.             }
  168.         }
  169.         $_parent $context['_parent'];
  170.         unset($context['_seq'], $context['_iterated'], $context['_key'], $context['page'], $context['_parent'], $context['loop']);
  171.         $context array_intersect_key($context$_parent) + $_parent;
  172.         $context["content"] = ('' === $tmp ob_get_clean()) ? '' : new Markup($tmp$this->env->getCharset());
  173.         // line 55
  174.         echo "
  175. <nav class=\"navigation navigation--primary\" aria-label=\"";
  176.         // line 56
  177.         echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("wcag.label.navigation-primary"), "html"nulltrue);
  178.         echo "\" id=\"clickable-navigation\">
  179. \t<ul class=\"navigation__container navigation__container--first clickable-navigation\">
  180. \t\t";
  181.         // line 58
  182.         echo twig_escape_filter($this->env$this->sandbox->ensureToStringAllowed((isset($context["content"]) || array_key_exists("content"$context) ? $context["content"] : (function () { throw new RuntimeError('Variable "content" does not exist.'58$this->source); })()), 58$this->source), "html"nulltrue);
  183.         echo "
  184. \t</ul>
  185. </nav>
  186. ";
  187.         
  188.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  189.         
  190.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  191.     }
  192.     public function getTemplateName()
  193.     {
  194.         return "navigation/primary.html.twig";
  195.     }
  196.     public function isTraitable()
  197.     {
  198.         return false;
  199.     }
  200.     public function getDebugInfo()
  201.     {
  202.         return array (  191 => 58,  186 => 56,  183 => 55,  168 => 53,  164 => 51,  160 => 49,  146 => 48,  142 => 46,  140 => 45,  135 => 44,  132 => 43,  129 => 42,  112 => 41,  109 => 40,  106 => 39,  103 => 38,  101 => 37,  96 => 36,  93 => 35,  90 => 34,  88 => 33,  70 => 32,  68 => 31,  66 => 30,  63 => 15,  61 => 14,  59 => 13,  56 => 12,  52 => 10,  50 => 9,  47 => 8,  45 => 7,);
  203.     }
  204.     public function getSourceContext()
  205.     {
  206.         return new Source("{#
  207. project: Pimcore - Schutzverband Nuernberg Rostbratwuerste
  208. User: erikb
  209. Year: 2022
  210. #}
  211. {# get the document which should be used to start in navigation | default home #}
  212. {% set navStartNode = document.getProperty('navigation-root-primary') %}
  213. {% if not navStartNode is instanceof('\\\\Pimcore\\\\Model\\\\Document\\\\Link') and not navStartNode is  instanceof('\\\\Pimcore\\\\Model\\\\Document\\\\Page')%}
  214. \t{% set navStartNode = pimcore_document(1) %}
  215. {% endif %}
  216. {% set mainNavigation = custom_build_nav(document, navStartNode) %}
  217. {% set home = navStartNode %}
  218.  {#
  219.  order: put it in front of all the others
  220.  uri: path to homepage
  221.  label: visible label
  222.  title: tooltip text
  223.  active: active state (boolean)
  224.  #}
  225. {# do mainNavigation.addPage({
  226. \torder: -1,
  227. \turi: ('/' ~ document.getProperty('language')),
  228. \tlabel: 'Home' | trans,
  229. \ttitle: 'Home' | trans,
  230. \tactive: (document.id == navStartNode.id or document.id == 1)
  231. }) #}
  232. {% set menuRenderer = pimcore_nav_renderer('menu') %}
  233. {% set content %}
  234. \t{% for page in mainNavigation %}
  235. \t\t{# here need to manually check for ACL conditions #}
  236. \t\t{% if page.isVisible() and menuRenderer.accept(page) and not page.getCustomSetting('navigationItemVirtual')  %}
  237. \t\t\t{% set activeClassItem = page.getActive(true) ? 'navigation__item--active' : '' %}
  238. \t\t\t<li class=\"navigation__item navigation__item--first {{ activeClassItem }} \">
  239. \t\t\t\t{% include 'navigation/partials/primary-link.html.twig' with { page: page, classes: ['navigation__link--first'] } %}
  240. \t\t\t\t{% if page.hasVisiblePages() %}
  241. \t\t\t\t\t{% set children = page.getPages() %}
  242. \t\t\t\t\t<ul class=\"navigation__container navigation__container--second\">
  243. \t\t\t\t\t{% for childPage in children %}
  244. \t\t\t\t\t\t{% if childPage.isVisible() and menuRenderer.accept(childPage) and not childPage.getCustomSetting('navigationItemVirtual') %}
  245. \t\t\t\t\t\t\t{% set activeClassChildItem = childPage.getActive(true) ? 'navigation__item--active' : '' %}
  246. \t\t\t\t\t\t\t<li class=\"navigation__item navigation__item--second {{ activeClassChildItem }} \">
  247. \t\t\t\t\t\t\t\t{% include 'navigation/partials/primary-link.html.twig' with { page: childPage, classes: ['navigation__link--second'], icon: 'harke' } %}
  248. \t\t\t\t\t\t\t</li>
  249. \t\t\t\t\t\t{% endif %}
  250. \t\t\t\t\t{% endfor %}
  251. \t\t\t\t\t</ul>
  252. \t\t\t\t{% endif %}
  253. \t\t\t</li>
  254. \t\t{% endif %}
  255. \t{% endfor %}
  256. {% endset %}
  257. <nav class=\"navigation navigation--primary\" aria-label=\"{{ 'wcag.label.navigation-primary'|trans }}\" id=\"clickable-navigation\">
  258. \t<ul class=\"navigation__container navigation__container--first clickable-navigation\">
  259. \t\t{{ content }}
  260. \t</ul>
  261. </nav>
  262. ""navigation/primary.html.twig""/var/www/snr/staging.nuernberger-bratwuerste.de/templates/navigation/primary.html.twig");
  263.     }
  264.     
  265.     public function checkSecurity()
  266.     {
  267.         static $tags = array("set" => 7"if" => 9"for" => 32"include" => 37);
  268.         static $filters = array("escape" => 36"trans" => 56);
  269.         static $functions = array("pimcore_document" => 10"custom_build_nav" => 13"pimcore_nav_renderer" => 30);
  270.         try {
  271.             $this->sandbox->checkSecurity(
  272.                 ['set''if''for''include'],
  273.                 ['escape''trans'],
  274.                 ['pimcore_document''custom_build_nav''pimcore_nav_renderer']
  275.             );
  276.         } catch (SecurityError $e) {
  277.             $e->setSourceContext($this->source);
  278.             if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) {
  279.                 $e->setTemplateLine($tags[$e->getTagName()]);
  280.             } elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) {
  281.                 $e->setTemplateLine($filters[$e->getFilterName()]);
  282.             } elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) {
  283.                 $e->setTemplateLine($functions[$e->getFunctionName()]);
  284.             }
  285.             throw $e;
  286.         }
  287.     }
  288. }