Skip to content

Commit

Permalink
Merge pull request #16 from dmstr/feature/fix-conrol-sidebar
Browse files Browse the repository at this point in the history
use Nav widget for control sidebar
  • Loading branch information
schmunk42 authored Sep 23, 2019
2 parents 986408a + 310cbf3 commit 8c0ddfe
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions src/views/layouts/_control-sidebar.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
<?php

use yii\bootstrap\Nav;
use yii\bootstrap\Nav as Menu;
use yii\helpers\Html;
use yii\helpers\Url;

?>


<?php
$backendModule = Yii::$app->getModule('backend');
foreach (\dmstr\helpers\Metadata::getModules() as $name => $module) {
Expand Down Expand Up @@ -144,18 +146,10 @@ class="fa fa-edit"></i></a></li>
<!-- Settings tab content -->
<div class="tab-pane" id="control-sidebar-settings-tab">
<?php if (isset(Yii::$app->params['context.menuItems']) && !empty(Yii::$app->params['context.menuItems'])): ?>

<h3 class="control-sidebar-heading"><?=Yii::t('backend-module','Context Menu')?></h3>
<ul class="control-sidebar-menu">

<?php foreach (Yii::$app->params['context.menuItems'] as $item): ?>
<li>
<?= Html::a(
$item['label'],
$item['url']
) ?>

</li>
<?php endforeach; ?>
<?= Nav::widget(['items' => Yii::$app->params['context.menuItems'], 'encodeLabels' => false]) ?>
</ul>

<?php endif; ?>
Expand Down

0 comments on commit 8c0ddfe

Please sign in to comment.