var/cache/dev/twig/50/508834447e017a6823725c47bcb3021c7e9ad8e5e69f352d4ba23c5d9588b305.php line 34

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. /* SonataAdminBundle:Core:add_block.html.twig */
  14. class __TwigTemplate_95c49faefba110aba5bd6e07740fe3f5ea1e2026769c6abc7b1e015c5ce93090 extends \Twig\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.             'user_block' => [$this'block_user_block'],
  25.         ];
  26.     }
  27.     protected function doDisplay(array $context, array $blocks = [])
  28.     {
  29.         $macros $this->macros;
  30.         $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  31.         $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""SonataAdminBundle:Core:add_block.html.twig"));
  32.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  33.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""SonataAdminBundle:Core:add_block.html.twig"));
  34.         // line 1
  35.         $this->displayBlock('user_block'$context$blocks);
  36.         
  37.         $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
  38.         
  39.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
  40.     }
  41.     public function block_user_block($context, array $blocks = [])
  42.     {
  43.         $macros $this->macros;
  44.         $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  45.         $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""user_block"));
  46.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  47.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""user_block"));
  48.         // line 2
  49.         echo "    ";
  50.         $context["items_per_column"] = twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, (isset($context["sonata_admin"]) || array_key_exists("sonata_admin"$context) ? $context["sonata_admin"] : (function () { throw new RuntimeError('Variable "sonata_admin" does not exist.'2$this->source); })()), "adminPool", [], "any"falsefalsefalse2), "getOption", [=> "dropdown_number_groups_per_colums"], "method"falsefalsefalse2);
  51.         // line 3
  52.         echo "    ";
  53.         $context["groups"] = [];
  54.         // line 4
  55.         echo "
  56.     ";
  57.         // line 5
  58.         $context['_parent'] = $context;
  59.         $context['_seq'] = twig_ensure_traversable(twig_array_filter(twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, (isset($context["sonata_admin"]) || array_key_exists("sonata_admin"$context) ? $context["sonata_admin"] : (function () { throw new RuntimeError('Variable "sonata_admin" does not exist.'5$this->source); })()), "adminPool", [], "any"falsefalsefalse5), "dashboardgroups", [], "any"falsefalsefalse5), function ($__group__) use ($context$macros) { $context["group"] = $__group__; return (twig_length_filter($this->envtwig_array_filter(twig_get_attribute($this->env$this->source$context["group"], "items", [], "any"falsefalsefalse5), function ($__admin__) use ($context$macros) { $context["admin"] = $__admin__; return (twig_get_attribute($this->env$this->source, (isset($context["admin"]) || array_key_exists("admin"$context) ? $context["admin"] : (function () { throw new RuntimeError('Variable "admin" does not exist.'5$this->source); })()), "hasRoute", [=> "create"], "method"falsefalsefalse5) && twig_get_attribute($this->env$this->source, (isset($context["admin"]) || array_key_exists("admin"$context) ? $context["admin"] : (function () { throw new RuntimeError('Variable "admin" does not exist.'5$this->source); })()), "hasAccess", [=> "create"], "method"falsefalsefalse5)); })) > 0); }));
  60.         foreach ($context['_seq'] as $context["_key"] => $context["group"]) {
  61.             // line 6
  62.             echo "        ";
  63.             $context["groups"] = twig_array_merge([=> $context["group"]], (isset($context["groups"]) || array_key_exists("groups"$context) ? $context["groups"] : (function () { throw new RuntimeError('Variable "groups" does not exist.'6$this->source); })()));
  64.             // line 7
  65.             echo "    ";
  66.         }
  67.         $_parent $context['_parent'];
  68.         unset($context['_seq'], $context['_iterated'], $context['_key'], $context['group'], $context['_parent'], $context['loop']);
  69.         $context array_intersect_key($context$_parent) + $_parent;
  70.         // line 8
  71.         echo "
  72.     ";
  73.         // line 9
  74.         $context["column_count"] = twig_round((twig_length_filter($this->env, (isset($context["groups"]) || array_key_exists("groups"$context) ? $context["groups"] : (function () { throw new RuntimeError('Variable "groups" does not exist.'9$this->source); })())) / (isset($context["items_per_column"]) || array_key_exists("items_per_column"$context) ? $context["items_per_column"] : (function () { throw new RuntimeError('Variable "items_per_column" does not exist.'9$this->source); })())), 0"ceil");
  75.         // line 10
  76.         echo "
  77.     <div class=\"dropdown-menu multi-column dropdown-add\"
  78.         ";
  79.         // line 12
  80.         if (((isset($context["column_count"]) || array_key_exists("column_count"$context) ? $context["column_count"] : (function () { throw new RuntimeError('Variable "column_count" does not exist.'12$this->source); })()) > 1)) {
  81.             echo "style=\"width: ";
  82.             echo twig_escape_filter($this->env, ((isset($context["column_count"]) || array_key_exists("column_count"$context) ? $context["column_count"] : (function () { throw new RuntimeError('Variable "column_count" does not exist.'12$this->source); })()) * 140), "html"nulltrue);
  83.             echo "px;\"";
  84.         }
  85.         // line 13
  86.         echo "    >
  87.         ";
  88.         // line 14
  89.         $context['_parent'] = $context;
  90.         $context['_seq'] = twig_ensure_traversable(twig_reverse_filter($this->env, (isset($context["groups"]) || array_key_exists("groups"$context) ? $context["groups"] : (function () { throw new RuntimeError('Variable "groups" does not exist.'14$this->source); })())));
  91.         $context['loop'] = [
  92.           'parent' => $context['_parent'],
  93.           'index0' => 0,
  94.           'index'  => 1,
  95.           'first'  => true,
  96.         ];
  97.         if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof \Countable)) {
  98.             $length count($context['_seq']);
  99.             $context['loop']['revindex0'] = $length 1;
  100.             $context['loop']['revindex'] = $length;
  101.             $context['loop']['length'] = $length;
  102.             $context['loop']['last'] = === $length;
  103.         }
  104.         foreach ($context['_seq'] as $context["_key"] => $context["group"]) {
  105.             // line 15
  106.             echo "            ";
  107.             $context["display"] = ((twig_test_empty(twig_get_attribute($this->env$this->source$context["group"], "roles", [], "any"falsefalsefalse15)) || $this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted(twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, (isset($context["sonata_admin"]) || array_key_exists("sonata_admin"$context) ? $context["sonata_admin"] : (function () { throw new RuntimeError('Variable "sonata_admin" does not exist.'15$this->source); })()), "adminPool", [], "any"falsefalsefalse15), "getOption", [=> "role_admin"], "method"falsefalsefalse15))) || (twig_length_filter($this->envtwig_array_filter(twig_get_attribute($this->env$this->source$context["group"], "roles", [], "any"falsefalsefalse15), function ($__role__) use ($context$macros) { $context["role"] = $__role__; return $this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted((isset($context["role"]) || array_key_exists("role"$context) ? $context["role"] : (function () { throw new RuntimeError('Variable "role" does not exist.'15$this->source); })())); })) > 0));
  108.             // line 16
  109.             echo "
  110.             ";
  111.             // line 17
  112.             if (twig_get_attribute($this->env$this->source$context["loop"], "first", [], "any"falsefalsefalse17)) {
  113.                 // line 18
  114.                 echo "                ";
  115.                 $context["render_first_element"] = true;
  116.                 // line 19
  117.                 echo "            ";
  118.             }
  119.             // line 20
  120.             echo "
  121.             ";
  122.             // line 21
  123.             if ((isset($context["display"]) || array_key_exists("display"$context) ? $context["display"] : (function () { throw new RuntimeError('Variable "display" does not exist.'21$this->source); })())) {
  124.                 // line 22
  125.                 echo "                ";
  126.                 if (((isset($context["render_first_element"]) || array_key_exists("render_first_element"$context) ? $context["render_first_element"] : (function () { throw new RuntimeError('Variable "render_first_element" does not exist.'22$this->source); })()) || ((twig_get_attribute($this->env$this->source$context["loop"], "index0", [], "any"falsefalsefalse22) % (isset($context["items_per_column"]) || array_key_exists("items_per_column"$context) ? $context["items_per_column"] : (function () { throw new RuntimeError('Variable "items_per_column" does not exist.'22$this->source); })())) == 0))) {
  127.                     // line 23
  128.                     echo "                    ";
  129.                     if ((isset($context["render_first_element"]) || array_key_exists("render_first_element"$context) ? $context["render_first_element"] : (function () { throw new RuntimeError('Variable "render_first_element" does not exist.'23$this->source); })())) {
  130.                         // line 24
  131.                         echo "                        <div class=\"container-fluid\">
  132.                             <div class=\"row\">
  133.                         ";
  134.                         // line 26
  135.                         $context["render_first_element"] = false;
  136.                         // line 27
  137.                         echo "                    ";
  138.                     } else {
  139.                         // line 28
  140.                         echo "                        </ul>
  141.                     ";
  142.                     }
  143.                     // line 30
  144.                     echo "                    <ul class=\"dropdown-menu";
  145.                     if (((isset($context["column_count"]) || array_key_exists("column_count"$context) ? $context["column_count"] : (function () { throw new RuntimeError('Variable "column_count" does not exist.'30$this->source); })()) > 1)) {
  146.                         echo " col-md-";
  147.                         echo twig_escape_filter($this->envtwig_round((12 / (isset($context["column_count"]) || array_key_exists("column_count"$context) ? $context["column_count"] : (function () { throw new RuntimeError('Variable "column_count" does not exist.'30$this->source); })()))), "html"nulltrue);
  148.                     }
  149.                     echo "\">
  150.                 ";
  151.                 }
  152.                 // line 32
  153.                 echo "                ";
  154.                 if (((twig_get_attribute($this->env$this->source$context["loop"], "index0", [], "any"falsefalsefalse32) % (isset($context["items_per_column"]) || array_key_exists("items_per_column"$context) ? $context["items_per_column"] : (function () { throw new RuntimeError('Variable "items_per_column" does not exist.'32$this->source); })())) != 0)) {
  155.                     // line 33
  156.                     echo "                    <li role=\"presentation\" class=\"divider\"></li>
  157.                 ";
  158.                 }
  159.                 // line 35
  160.                 echo "                <li role=\"presentation\" class=\"dropdown-header\">
  161.                     ";
  162.                 // line 36
  163.                 echo twig_get_attribute($this->env$this->source$context["group"], "icon", [], "any"falsefalsefalse36);
  164.                 echo "
  165.                     ";
  166.                 // line 37
  167.                 echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans(twig_get_attribute($this->env$this->source$context["group"], "label", [], "any"falsefalsefalse37), [], twig_get_attribute($this->env$this->source$context["group"], "label_catalogue", [], "any"falsefalsefalse37)), "html"nulltrue);
  168.                 echo "
  169.                 </li>
  170.                 ";
  171.                 // line 40
  172.                 $context['_parent'] = $context;
  173.                 $context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env$this->source$context["group"], "items", [], "any"falsefalsefalse40));
  174.                 foreach ($context['_seq'] as $context["_key"] => $context["admin"]) {
  175.                     // line 41
  176.                     echo "                    ";
  177.                     if ((twig_get_attribute($this->env$this->source$context["admin"], "hasRoute", [=> "create"], "method"falsefalsefalse41) && twig_get_attribute($this->env$this->source$context["admin"], "hasAccess", [=> "create"], "method"falsefalsefalse41))) {
  178.                         // line 42
  179.                         echo "                        ";
  180.                         if (twig_test_empty(twig_get_attribute($this->env$this->source$context["admin"], "subClasses", [], "any"falsefalsefalse42))) {
  181.                             // line 43
  182.                             echo "                            <li role=\"presentation\">
  183.                                 <a role=\"menuitem\" tabindex=\"-1\" href=\"";
  184.                             // line 44
  185.                             echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->source$context["admin"], "generateUrl", [=> "create"], "method"falsefalsefalse44), "html"nulltrue);
  186.                             echo "\">";
  187.                             echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans(twig_get_attribute($this->env$this->source$context["admin"], "label", [], "any"falsefalsefalse44), [], twig_get_attribute($this->env$this->source$context["admin"], "translationdomain", [], "any"falsefalsefalse44)), "html"nulltrue);
  188.                             echo "</a>
  189.                             </li>
  190.                         ";
  191.                         } else {
  192.                             // line 47
  193.                             echo "                            ";
  194.                             $context['_parent'] = $context;
  195.                             $context['_seq'] = twig_ensure_traversable(twig_get_array_keys_filter(twig_get_attribute($this->env$this->source$context["admin"], "subclasses", [], "any"falsefalsefalse47)));
  196.                             foreach ($context['_seq'] as $context["_key"] => $context["subclass"]) {
  197.                                 // line 48
  198.                                 echo "                                <li role=\"presentation\">
  199.                                     <a role=\"menuitem\" tabindex=\"-1\" href=\"";
  200.                                 // line 49
  201.                                 echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->source$context["admin"], "generateUrl", [=> "create"=> ["subclass" => $context["subclass"]]], "method"falsefalsefalse49), "html"nulltrue);
  202.                                 echo "\">";
  203.                                 echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans($context["subclass"], [], twig_get_attribute($this->env$this->source$context["admin"], "translationdomain", [], "any"falsefalsefalse49)), "html"nulltrue);
  204.                                 echo "</a>
  205.                                 </li>
  206.                             ";
  207.                             }
  208.                             $_parent $context['_parent'];
  209.                             unset($context['_seq'], $context['_iterated'], $context['_key'], $context['subclass'], $context['_parent'], $context['loop']);
  210.                             $context array_intersect_key($context$_parent) + $_parent;
  211.                             // line 52
  212.                             echo "                        ";
  213.                         }
  214.                         // line 53
  215.                         echo "                    ";
  216.                     }
  217.                     // line 54
  218.                     echo "                ";
  219.                 }
  220.                 $_parent $context['_parent'];
  221.                 unset($context['_seq'], $context['_iterated'], $context['_key'], $context['admin'], $context['_parent'], $context['loop']);
  222.                 $context array_intersect_key($context$_parent) + $_parent;
  223.                 // line 55
  224.                 echo "                ";
  225.                 if ((twig_get_attribute($this->env$this->source$context["loop"], "last", [], "any"falsefalsefalse55) &&  !(isset($context["render_first_element"]) || array_key_exists("render_first_element"$context) ? $context["render_first_element"] : (function () { throw new RuntimeError('Variable "render_first_element" does not exist.'55$this->source); })()))) {
  226.                     // line 56
  227.                     echo "                    </ul>
  228.                     </div>
  229.                     </div>
  230.                 ";
  231.                 }
  232.                 // line 60
  233.                 echo "            ";
  234.             }
  235.             // line 61
  236.             echo "        ";
  237.             ++$context['loop']['index0'];
  238.             ++$context['loop']['index'];
  239.             $context['loop']['first'] = false;
  240.             if (isset($context['loop']['length'])) {
  241.                 --$context['loop']['revindex0'];
  242.                 --$context['loop']['revindex'];
  243.                 $context['loop']['last'] = === $context['loop']['revindex0'];
  244.             }
  245.         }
  246.         $_parent $context['_parent'];
  247.         unset($context['_seq'], $context['_iterated'], $context['_key'], $context['group'], $context['_parent'], $context['loop']);
  248.         $context array_intersect_key($context$_parent) + $_parent;
  249.         // line 62
  250.         echo "    </div>
  251. ";
  252.         
  253.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
  254.         
  255.         $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
  256.     }
  257.     public function getTemplateName()
  258.     {
  259.         return "SonataAdminBundle:Core:add_block.html.twig";
  260.     }
  261.     public function getDebugInfo()
  262.     {
  263.         return array (  265 => 62,  251 => 61,  248 => 60,  242 => 56,  239 => 55,  233 => 54,  230 => 53,  227 => 52,  216 => 49,  213 => 48,  208 => 47,  200 => 44,  197 => 43,  194 => 42,  191 => 41,  187 => 40,  181 => 37,  177 => 36,  174 => 35,  170 => 33,  167 => 32,  158 => 30,  154 => 28,  151 => 27,  149 => 26,  145 => 24,  142 => 23,  139 => 22,  137 => 21,  134 => 20,  131 => 19,  128 => 18,  126 => 17,  123 => 16,  120 => 15,  103 => 14,  100 => 13,  94 => 12,  90 => 10,  88 => 9,  85 => 8,  79 => 7,  76 => 6,  72 => 5,  69 => 4,  66 => 3,  63 => 2,  44 => 1,);
  264.     }
  265.     public function getSourceContext()
  266.     {
  267.         return new Source("{% block user_block %}
  268.     {% set items_per_column = sonata_admin.adminPool.getOption('dropdown_number_groups_per_colums') %}
  269.     {% set groups = [] %}
  270.     {% for group in sonata_admin.adminPool.dashboardgroups|filter(group => group.items|filter(admin => admin.hasRoute('create') and admin.hasAccess('create'))|length > 0) %}
  271.         {% set groups = [group]|merge(groups) %}
  272.     {% endfor %}
  273.     {% set column_count = (groups|length / items_per_column)|round(0, 'ceil') %}
  274.     <div class=\"dropdown-menu multi-column dropdown-add\"
  275.         {% if column_count > 1 %}style=\"width: {{ column_count*140 }}px;\"{% endif %}
  276.     >
  277.         {% for group in groups|reverse %}
  278.             {% set display = group.roles is empty or is_granted(sonata_admin.adminPool.getOption('role_admin')) or group.roles|filter(role => is_granted(role))|length > 0 %}
  279.             {% if loop.first %}
  280.                 {% set render_first_element = true %}
  281.             {% endif %}
  282.             {% if display %}
  283.                 {% if render_first_element or loop.index0 % items_per_column == 0 %}
  284.                     {% if render_first_element %}
  285.                         <div class=\"container-fluid\">
  286.                             <div class=\"row\">
  287.                         {% set render_first_element = false %}
  288.                     {% else %}
  289.                         </ul>
  290.                     {% endif %}
  291.                     <ul class=\"dropdown-menu{% if column_count > 1 %} col-md-{{ (12/column_count)|round }}{% endif %}\">
  292.                 {% endif %}
  293.                 {% if loop.index0 % items_per_column != 0 %}
  294.                     <li role=\"presentation\" class=\"divider\"></li>
  295.                 {% endif %}
  296.                 <li role=\"presentation\" class=\"dropdown-header\">
  297.                     {{ group.icon|raw }}
  298.                     {{ group.label|trans({}, group.label_catalogue) }}
  299.                 </li>
  300.                 {% for admin in group.items %}
  301.                     {% if admin.hasRoute('create') and admin.hasAccess('create') %}
  302.                         {% if admin.subClasses is empty %}
  303.                             <li role=\"presentation\">
  304.                                 <a role=\"menuitem\" tabindex=\"-1\" href=\"{{ admin.generateUrl('create') }}\">{{ admin.label|trans({}, admin.translationdomain) }}</a>
  305.                             </li>
  306.                         {% else %}
  307.                             {% for subclass in admin.subclasses|keys %}
  308.                                 <li role=\"presentation\">
  309.                                     <a role=\"menuitem\" tabindex=\"-1\" href=\"{{ admin.generateUrl('create', {'subclass': subclass}) }}\">{{ subclass|trans({}, admin.translationdomain) }}</a>
  310.                                 </li>
  311.                             {% endfor %}
  312.                         {% endif %}
  313.                     {% endif %}
  314.                 {% endfor %}
  315.                 {% if loop.last and not render_first_element %}
  316.                     </ul>
  317.                     </div>
  318.                     </div>
  319.                 {% endif %}
  320.             {% endif %}
  321.         {% endfor %}
  322.     </div>
  323. {% endblock %}
  324. ""SonataAdminBundle:Core:add_block.html.twig""/var/www/radmin.tehnik.tech/vendor/sonata-project/admin-bundle/src/Resources/views/Core/add_block.html.twig");
  325.     }
  326. }