<?php



?>

<!-- Main Sidebar Container -->

 <aside class="main-sidebar text-light elevation-4">

    <!-- Brand Logo -->

    <a href="./" class="brand-link">

      <img src="img/sidebar-logo.png" alt="AdminLTE Logo" class="brand-image img-circle elevation-3" style="opacity: .8">

      <span class="brand-text font-weight-light text-dark"><b><?=$app_title_short?></b></span>

    </a>



    <!-- Sidebar -->

    <div class="sidebar bg-light">

      <!-- Sidebar user panel (optional) -->



      <!-- Sidebar Menu -->

      <nav class="mt-2">

        <ul class="nav nav-pills nav-child-indent nav-sidebar flex-column" data-widget="treeview" role="menu" data-accordion="false">

          <?php

          $ret='';

          foreach($_menu as $item):

            $item['url']=$item['url']??'#';

            $item['icon']=$item['icon']??'fa fa-angle-right';

            $item['visible']=$item['visible']??true;

            $item['default']=$item['default']??false;

            

            if(!$item['visible']){

                continue;

            }

            $child='';

            if(isset($item['children'])):

              $child.='<ul class="nav nav-treeview">';

              foreach($item['children'] as $items):

                $items['url']=$items['url']??'#';

                $items['visible']=$items['visible']??true;

                $items['default']=$items['default']??false;

                $items['icon']=$items['icon']??'fa fa-angle-right';

                $child.='<li class="nav-item">';

                $child.='<a href="'.$items['url'].'" class="nav-link">';

                $child.='<i class="nav-icon '.$items['icon'].'"></i>';

                $child.='<p>'.$items['title'].'</p>';

                $child.='</a>';

                $child.='</li>';

              endforeach;

              $child.='</ul>';

            endif;

            

            //$class_open=true:'menu-open':'';

            $class_children=$child?'<i class="right fas fa-angle-left"></i>':'';

            

            $ret.='<li class="nav-item">';

            $ret.='<a href="'.$item['url'].'" class="nav-link">';

            $ret.='<i class="nav-icon '.$item['icon'].'"></i>';

            $ret.='<p>'.$item['title'].$class_children.'</p>';

            $ret.='</a>';

            $ret.=$child;

            $ret.='</li>';

          endforeach;

          echo $ret;

          ?>

          

        </ul>

      </nav>

      <!-- /.sidebar-menu -->

    </div>

    <!-- /.sidebar -->

  </aside>