Esempio n. 1
0
<?php

use oblagio\Helpers\Site;
use oblagio\Models\Menu;
$menu = Menu::where('controller', '!=', '#')->get();
Route::get(Site::routeGenerator(), 'Modules\\Obgl\\DefaultController@getIndex');
Route::get(Site::routeBackend(), 'Modules\\Backend\\DefaultController@getIndex');
Route::controller(Site::routeGenerator() . "/default", 'Modules\\Obgl\\DefaultController');
foreach ($menu as $row) {
    Route::controller(Site::routeBackend() . "/" . Site::aliasUrl($row->title), $row->controller);
}
<script type="text/javascript" src="{{ asset(null) }}public/shamcey/js/responsive-tables.js"></script>
<script type="text/javascript" src="{{ asset(null) }}public/shamcey/js/jquery.slimscroll.js"></script>
<script type="text/javascript" src="{{ asset(null) }}public/shamcey/js/custom.js"></script>

<script type="text/javascript" src="{{ asset(null) }}public/js/jquery.js"></script>
<script type="text/javascript" src="{{ asset(null) }}public/js/app.js"></script>
</head>

<body>

<div id="mainwrapper" class="mainwrapper">
    
    <div class="header">
        <div class="logo">
            <?php 
echo HTML::link(Site::routeBackend() . "/", Site::applicationName(), ['class' => 'logoObgl']);
?>
        </div>
        <div class="headerinner">
            <ul class="headmenu">
                <li class="odd">
                    <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                        <span class="count">4</span>
                        <span class="head-icon head-message"></span>
                        <span class="headmenu-label">Messages</span>
                    </a>
                    <ul class="dropdown-menu">
                        <li class="nav-header">Messages</li>
                        <li><a href="#"><span class="icon-envelope"></span> New message from <strong>Jack</strong> <small class="muted"> - 19 hours ago</small></a></li>
                        <li><a href="#"><span class="icon-envelope"></span> New message from <strong>Daniel</strong> <small class="muted"> - 2 days ago</small></a></li>
                        <li><a href="#"><span class="icon-envelope"></span> New message from <strong>Jane</strong> <small class="muted"> - 3 days ago</small></a></li>
                <?php 
$modelParent = Menu::whereParentId(0)->orderBy('order', 'asc')->get();
foreach ($modelParent as $parent) {
    if ($parent->controller == '#') {
        $cekUrl = '#';
    } else {
        $cekUrl = Site::routeBackend() . "/" . Site::aliasUrl($parent->title);
    }
    $setChild = Menu::whereParentId($parent->id)->orderBy('order', 'asc');
    $countChild = clone $setChild;
    $dropdown = $countChild->count() > 0 ? 'dropdown' : '';
    echo "<li class = '" . $dropdown . "'>";
    echo HTML::link($cekUrl, $parent->title);
    if ($countChild->count() > 0) {
        echo "<ul>";
        $modelChild = clone $setChild;
        foreach ($modelChild->get() as $child) {
            echo "<li>";
            echo HTML::link(Site::routeBackend() . "/" . Site::aliasUrl($child->title), $child->title);
            echo "</li>";
        }
        echo "</ul>";
    }
    echo "</li>";
}
?>
            </ul>
        </div><!--leftmenu-->
        
    </div><!-- leftpanel -->