{#
 # ---------------------------------------------------------------------
 #
 # GLPI - Gestionnaire Libre de Parc Informatique
 #
 # http://glpi-project.org
 #
 # @copyright 2015-2023 Teclib' and contributors.
 # @copyright 2003-2014 by the INDEPNET Development Team.
 # @licence   https://www.gnu.org/licenses/gpl-3.0.html
 #
 # ---------------------------------------------------------------------
 #
 # LICENSE
 #
 # This file is part of GLPI.
 #
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # the Free Software Foundation, either version 3 of the License, or
 # (at your option) any later version.
 #
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <https://www.gnu.org/licenses/>.
 #
 # ---------------------------------------------------------------------
 #}

<ol class="breadcrumb breadcrumb-alternate pe-1 pe-sm-3" aria-label="breadcrumbs">
   <li class="breadcrumb-item text-truncate">
      <a href="{{ index_path() }}" title="{{ __('Home') }}">
         <i class="ti ti-home-2"></i>
         {{ __('Home') }}
      </a>
   </li>

   {% if menu[sector] is defined %}
   <li class="breadcrumb-item text-truncate">
      <a href="{{ path(menu[sector]['default'] ?? '/front/central.php') }}" title="{{ menu[sector]['title'] }}">
         <i class="{{ menu[sector]['icon'] ?? '' }}"></i>
         {{ menu[sector]['title'] }}
      </a>
   </li>
   {% endif %}

   {% set with_option = false %}
   {% if menu[sector]['content'][item] is defined %}
      {% if menu[sector]['content'][item]['page'] is defined %}
      {% set with_option = option is not empty and menu[sector]['content'][item]['options'][option]['title'] is defined and menu[sector]['content'][item]['options'][option]['page'] is defined %}
      <li class="breadcrumb-item text-truncate">
         <a href="{{ path(menu[sector]['content'][item]['page']) }}"
            class="{{ with_option ? '' : 'here' }}"
            title="{{ menu[sector]['content'][item]['title'] }}" >
            <i class="{{ menu[sector]['content'][item]['icon'] ?? '' }}"></i>
            {{ menu[sector]['content'][item]['title'] }}
         </a>
      </li>
      {% endif %}

      {% if with_option %}
      <li class="breadcrumb-item text-truncate">
         <a href="{{ path(menu[sector]['content'][item]['options'][option]['page']) }}"
            class="here"
            title="{{ menu[sector]['content'][item]['options'][option]['title'] }}" >
            <i class="{{ menu[sector]['content'][item]['options'][option]['icon'] ?? '' }}"></i>
            {{ menu[sector]['content'][item]['options'][option]['title']|u.truncate(17, '...') }}
         </a>
      </li>
      {% endif %}

   {% endif %}
</ol>

{% if menu[sector]['content'][item] is defined %}
    {{ include('layout/parts/context_links.html.twig') }}
{% endif %}
