<?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/main-nav.html.twig */
class __TwigTemplate_a7ac00eee3d02cd38a3e2fde6d7fa3e8 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/main-nav.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/main-nav.html.twig"));
// line 1
echo "<label for=\"toggleMobileNav\" class=\"main-nav--toggle\">
<span></span>
</label>
<nav class=\"main-nav\" id=\"main-nav\" role=\"navigation\">
";
// line 6
$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", [0 => "navigation_root"], "method", false, false, true, 6);
// line 7
echo " ";
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")) {
// line 8
echo " ";
$context["navigationRoot"] = Pimcore\Model\Document::getById(1);
// line 9
echo " ";
}
// line 10
echo " ";
$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));
// line 11
echo " ";
$context["renderer"] = $this->env->getFunction('pimcore_nav_renderer')->getCallable()("menu");
// line 12
echo " <ul class=\"main-nav--list\" role=\"menubar\">
";
// line 13
if (array_key_exists("mainNav", $context)) {
// line 14
echo " ";
$context['_parent'] = $context;
$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); })()));
foreach ($context['_seq'] as $context["key"] => $context["page"]) {
// line 15
echo " ";
if ((twig_get_attribute($this->env, $this->source, $context["page"], "isVisible", [], "method", false, false, true, 15) && 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", [0 => $context["page"]], "method", false, false, true, 15))) {
// line 16
echo " ";
ob_start();
// line 17
echo " ";
$context["activeClass"] = "";
// line 18
echo " ";
$context["hiddenClass"] = "";
// line 19
echo " ";
$context["additionalClass"] = "";
// line 20
echo " ";
if (twig_get_attribute($this->env, $this->source, $context["page"], "getActive", [0 => true], "method", false, false, true, 20)) {
// line 21
echo " ";
$context["activeClass"] = "is-active";
// line 22
echo " ";
}
// line 23
echo " ";
if (($this->env->getTest('instanceof')->getCallable()(twig_get_attribute($this->env, $this->source, $context["page"], "getCustomSetting", [0 => "document"], "method", false, false, true, 23), "\\Pimcore\\Model\\Document") && twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["page"], "getCustomSetting", [0 => "document"], "method", false, false, true, 23), "getProperty", [0 => "menuAsButton"], "method", false, false, true, 23))) {
// line 24
echo " ";
$context["additionalClass"] = "btn btn-primary";
// line 25
echo " ";
}
// line 26
echo " ";
$___internal_parse_6_ = ('' === $tmp = ob_get_clean()) ? '' : new Markup($tmp, $this->env->getCharset());
// line 16
echo twig_spaceless($___internal_parse_6_);
// line 27
echo " <li class=\"main-nav--item";
if (twig_get_attribute($this->env, $this->source, $context["page"], "hasPages", [], "any", false, false, true, 27)) {
echo " has-dropdown";
}
echo " ";
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", null, true);
echo " ";
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", null, true);
echo "\" role=\"none\">
";
// line 28
if (twig_get_attribute($this->env, $this->source, $context["page"], "hasVisiblePages", [], "any", false, false, true, 28)) {
// line 29
echo " <input type=\"checkbox\" name=\"toggleSubNav\" id=\"navbarDropdown";
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed($context["key"], 29, $this->source), "html", null, true);
echo "\" aria-hidden=\"true\" value=\"1\" />
<label for=\"navbarDropdown";
// line 30
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed($context["key"], 30, $this->source), "html", null, true);
echo "\" aria-hidden=\"true\"></label>
";
}
// line 32
echo " <a role=\"menuitem\" href=\"";
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, $context["page"], "href", [], "any", false, false, true, 32), 32, $this->source), "html", null, true);
echo "\" class=\"";
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", null, true);
echo "\">
";
// line 33
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, $context["page"], "label", [], "any", false, false, true, 33), 33, $this->source), "html", null, true);
echo "
</a>
";
// line 35
if (twig_get_attribute($this->env, $this->source, $context["page"], "hasVisiblePages", [], "any", false, false, true, 35)) {
// line 36
echo " <ul role=\"menu\" aria-label=\"";
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, $context["page"], "label", [], "any", false, false, true, 36), 36, $this->source), "html", null, true);
echo "\">
";
// line 37
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env, $this->source, $context["page"], "pages", [], "any", false, false, true, 37));
foreach ($context['_seq'] as $context["_key"] => $context["child"]) {
// line 38
echo " ";
if ((twig_get_attribute($this->env, $this->source, $context["child"], "isVisible", [], "method", false, false, true, 38) && 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", [0 => $context["child"]], "method", false, false, true, 38))) {
// line 39
echo " <li role=\"none\"";
if (twig_get_attribute($this->env, $this->source, $context["child"], "getActive", [0 => true], "method", false, false, true, 39)) {
echo " class=\"is-active\"";
}
echo ">
<a role=\"menuitem\" href=\"";
// line 40
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, $context["child"], "href", [], "any", false, false, true, 40), 40, $this->source), "html", null, true);
echo "\">";
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, $context["child"], "label", [], "any", false, false, true, 40), 40, $this->source), "html", null, true);
echo "</a>
</li>
";
}
// line 43
echo " ";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['child'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 44
echo " </ul>
";
}
// line 46
echo " </li>
";
}
// line 48
echo " ";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['key'], $context['page'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 49
echo " ";
}
// line 50
echo " </ul>
</nav>";
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
}
public function getTemplateName()
{
return "@Provider/partials/header/main-nav.html.twig";
}
public function isTraitable()
{
return false;
}
public function getDebugInfo()
{
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,);
}
public function getSourceContext()
{
return new Source("<label for=\"toggleMobileNav\" class=\"main-nav--toggle\">
<span></span>
</label>
<nav class=\"main-nav\" id=\"main-nav\" role=\"navigation\">
{% set navigationRoot = document.getProperty('navigation_root') %}
{% if not navigationRoot is instanceof('\\\\Pimcore\\\\Model\\\\Document') %}
{% set navigationRoot = pimcore_document(1) %}
{% endif %}
{% set mainNav = conecto_build_nav(document, navigationRoot) %}
{% set renderer = pimcore_nav_renderer('menu') %}
<ul class=\"main-nav--list\" role=\"menubar\">
{% if mainNav is defined %}
{% for key, page in mainNav %}
{% if page.isVisible() and renderer.accept(page) %}
{% apply spaceless %}
{% set activeClass = '' %}
{% set hiddenClass = '' %}
{% set additionalClass = '' %}
{% if page.getActive(true) %}
{% set activeClass = 'is-active' %}
{% endif %}
{% if page.getCustomSetting('document') is instanceof('\\\\Pimcore\\\\Model\\\\Document') and page.getCustomSetting('document').getProperty('menuAsButton') %}
{% set additionalClass = 'btn btn-primary' %}
{% endif %}
{% endapply %}
<li class=\"main-nav--item{% if page.hasPages %} has-dropdown{% endif%} {{ activeClass }} {{ hiddenClass }}\" role=\"none\">
{% if page.hasVisiblePages %}
<input type=\"checkbox\" name=\"toggleSubNav\" id=\"navbarDropdown{{ key }}\" aria-hidden=\"true\" value=\"1\" />
<label for=\"navbarDropdown{{ key }}\" aria-hidden=\"true\"></label>
{% endif %}
<a role=\"menuitem\" href=\"{{ page.href }}\" class=\"{{ additionalClass }}\">
{{ page.label }}
</a>
{% if page.hasVisiblePages %}
<ul role=\"menu\" aria-label=\"{{ page.label }}\">
{% for child in page.pages %}
{% if child.isVisible() and renderer.accept(child) %}
<li role=\"none\"{% if child.getActive(true) %} class=\"is-active\"{% endif %}>
<a role=\"menuitem\" href=\"{{ child.href }}\">{{ child.label }}</a>
</li>
{% endif %}
{% endfor %}
</ul>
{% endif %}
</li>
{% endif %}
{% endfor %}
{% endif %}
</ul>
</nav>", "@Provider/partials/header/main-nav.html.twig", "/html/pimcore/vendor/conecto/pimcore-provider/src/ProviderBundle/Resources/views/partials/header/main-nav.html.twig");
}
public function checkSecurity()
{
static $tags = array("set" => 6, "if" => 7, "for" => 14, "apply" => 16);
static $filters = array("spaceless" => 16, "escape" => 27);
static $functions = array("pimcore_document" => 8, "conecto_build_nav" => 10, "pimcore_nav_renderer" => 11);
try {
$this->sandbox->checkSecurity(
['set', 'if', 'for', 'apply'],
['spaceless', 'escape'],
['pimcore_document', 'conecto_build_nav', 'pimcore_nav_renderer']
);
} 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;
}
}
}