You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

112 lines
3.4 KiB

<?php
/**
* Created by Error202
* Date: 11.07.2018
*/
3 years ago
use core\components\bootstrap4\widgets\Tab4;
use core\entities\menu\MenuItem;
use core\forms\menu\MenuItemForm;
use yii\helpers\Html;
use kartik\form\ActiveForm;
3 years ago
use yii\web\View;
/**
3 years ago
* @var $this View
* @var $item array
3 years ago
* @var $model MenuItemForm
*/
3 years ago
/* @var $menu_item MenuItem */
$menu_item = $item['item'];
?>
3 years ago
<li class="dd-item dd3-item" data-id="<?= $menu_item->id ?>" xmlns="http://www.w3.org/1999/html">
<div class="dd3-content">
3 years ago
<div class="card-group" id="accordion">
<div class="card m-0">
<div class="card-header" style="border: 0 !important; padding-left: 40px;">
<h4 class="card-title">
<div class="dd-handle dd3-handle"> </div>
3 years ago
<a data-toggle="collapse" data-parent="#accordion" href="#collapse<?= $menu_item->id ?>">
<?= $menu_item->translation->name ?>
<div style="position: absolute; right: 10px; top: 10px;">
<span style="font-size: 14px; color: #999"><?= Yii::t($menu_item->module, ucfirst($menu_item->module)) ?></span>
<i class="fas fa-angle-down" aria-hidden="true"></i>
</div>
</a>
</h4>
3 years ago
<div>
</div>
</div>
<div id="collapse<?= $menu_item->id ?>" class="panel-collapse collapse">
3 years ago
<div class="panel-body p-2">
<?php $form = ActiveForm::begin([
'action' => ['/menu/save-item', 'id' => $menu_item->id],
]); ?>
<?php
$items = [];
foreach (Yii::$app->params['translatedLanguages'] as $language => $language_name) {
$items[] = [
'label' => $language_name,
'content' => $this->render('_item_tab', [
'form' => $form,
'model' => $model,
'language' => $language,
]),
];
}
?>
<div class="nav-tabs-custom">
3 years ago
<?= Tab4::widget([
'items' => $items
]) ?>
</div>
<div class="row">
<div class="col-md-6">
<?= $form->field($model, 'target')->dropDownList([
'' => Yii::t('menu', 'Self Window'),
'_blank' => Yii::t('menu', 'Blank Window'),
3 years ago
], [
'class' => 'form-control form-control-sm'
]) ?>
<?= $form->field($model, 'style')->textInput(['maxlength' => true, 'class' => 'form-control form-control-sm'],) ?>
</div>
<div class="col-md-6">
3 years ago
<?= $form->field($model, 'css')->textInput(['maxlength' => true, 'class' => 'form-control form-control-sm']) ?>
<?php if (!$menu_item->url_params): ?>
3 years ago
<?= $form->field($model, 'url')->textInput(['maxlength' => true, 'class' => 'form-control form-control-sm']) ?>
<?php endif; ?>
</div>
</div>
3 years ago
<div class="float-right">
<?= Html::a(Yii::t('buttons', 'Delete'), '#', [
'class' => 'item-delete-button btn btn-sm btn-danger',
'data-id' => $menu_item->id,
]) ?>
<?= Html::submitButton(Yii::t('buttons', 'Save'), [
'class' => 'btn btn-success btn-sm'
]) ?>
</div>
<div style="clear: both"></div>
<?php ActiveForm::end(); ?>
</div>
</div>
</div>
</div>
</div>
<?php if (isset($item['children'])): ?>
<?= menu_generate($item['children']) ?>
<?php endif; ?>
</li>