Beispiel #1
0
$this->title = Yii::t('app', 'Pages');
if (is_object($model)) {
    $this->title = Yii::t('app', 'Pages inside page: ') . '"' . $model->breadcrumbs_label . '"';
}
$parent_id = is_object($model) ? $model->id : '0';
$this->params['breadcrumbs'][] = $this->title;
?>

<?php 
echo app\widgets\Alert::widget(['id' => 'alert']);
?>

<div class="row">
    <div class="col-md-4">
        <?php 
echo TreeWidget::widget(['treeDataRoute' => ['getTree', 'selected_id' => $parent_id], 'changeParentAction' => 'move', 'reorderAction' => 'reorder', 'doubleClickAction' => ContextMenuHelper::actionUrl(['/page/backend/edit']), 'contextMenuItems' => ['edit' => ['label' => 'Edit', 'icon' => 'fa fa-pencil', 'action' => ContextMenuHelper::actionUrl(['/page/backend/edit'])], 'show' => ['label' => 'Show pages inside this page', 'icon' => 'fa fa-folder-o', 'action' => ContextMenuHelper::actionUrl(['/page/backend/index'], ['parent_id' => 'id'])], 'create' => ['label' => 'Create', 'icon' => 'fa fa-plus-circle', 'action' => ContextMenuHelper::actionUrl(['/page/backend/edit'], ['parent_id' => 'id'])], 'delete' => ['label' => 'Delete', 'icon' => 'fa fa-trash-o', 'action' => new \yii\web\JsExpression("function(node) {\n                            jQuery('#delete-confirmation')\n                                .attr('data-url', '/page/backend/delete?id=' + jQuery(node.reference[0]).data('id'))\n                                .attr('data-items', '')\n                                .modal('show');\n                            return true;\n                        }")]]]);
?>
    </div>
    <div class="col-md-8" id="jstree-more">

        <?php 
$this->beginBlock('buttonGroup');
?>
        <div class="btn-toolbar" role="toolbar">
            <div class="btn-group">
                <?php 
echo \yii\helpers\Html::a(Icon::show('plus') . Yii::t('app', 'Add'), ['/page/backend/edit', 'parent_id' => is_object($model) ? $model->id : 0, 'returnUrl' => \app\backend\components\Helper::getReturnUrl()], ['class' => 'btn btn-success']);
?>
            </div>
            <?php 
echo \app\backend\widgets\RemoveAllButton::widget(['url' => \yii\helpers\Url::toRoute(['/page/backend/remove-all', 'parent_id' => is_object($model) ? $model->id : 0]), 'gridSelector' => '.grid-view', 'htmlOptions' => ['class' => 'btn btn-danger pull-right']]);
Beispiel #2
0
    echo Html::encode($selectedCategory->name);
    ?>
    <?php 
} else {
    ?>
    <?php 
    echo Yii::t('app', 'Select category first');
    ?>
    <?php 
}
?>
</h1>
<div class="row">
    <div class="col-md-4">
        <?php 
echo TreeWidget::widget(['treeDataRoute' => ['/shop/backend-filter-sets/getTree'], 'changeParentAction' => '/backend/category/move', 'reorderAction' => '/backend/category/reorder', 'contextMenuItems' => ['open' => ['label' => 'Open', 'icon' => 'fa fa-folder-open', 'action' => ContextMenuHelper::actionUrl(['/shop/backend-filter-sets/index'], ['category_id' => 'id'])]]]);
?>
    </div>
    <div class="col-md-8" id="filter-sets">
        <?php 
echo Html::beginTag('div', ['class' => 'dropdown']);
echo Html::button(Yii::t('app', 'Add property') . ' <span class="caret"></span></button>', ['type' => 'button', 'class' => 'btn btn-default', 'data-toggle' => 'dropdown']);
echo DropdownX::widget(['items' => $propertiesDropdownItems]);
echo Html::endTag('div');
?>

        <?php 
if ($selectedCategory !== null) {
    ?>
            <?php 
    $filterSets = $selectedCategory->filterSets();
Beispiel #3
0
echo Icon::show('plus');
?>
    <?php 
echo Yii::t('app', 'Add');
?>
</a>
<?php 
echo \app\backend\widgets\PublishSwitchButtons::widget(['url' => Url::toRoute(['publish-switch']), 'gridSelector' => '.grid-view']);
echo \app\backend\widgets\RemoveAllButton::widget(['url' => Url::toRoute(['remove-all', 'parent_id' => $parent_id]), 'gridSelector' => '.grid-view', 'htmlOptions' => ['class' => 'btn btn-danger pull-right']]);
$this->endBlock();
?>

<div class="row">
    <div class="col-md-4">
        <?php 
echo TreeWidget::widget(['treeDataRoute' => ['getTree'], 'doubleClickAction' => ContextMenuHelper::actionUrl(['index', 'returnUrl' => Helper::getReturnUrl()], ['parent_id' => 'id']), 'contextMenuItems' => ['show' => ['label' => 'Show products in category', 'icon' => 'fa fa-folder-open', 'action' => ContextMenuHelper::actionUrl(['index'], ['parent_id' => 'id'])], 'createProduct' => ['label' => 'Create product in this category', 'icon' => 'fa fa-plus-circle', 'action' => ContextMenuHelper::actionUrl(['edit', 'returnUrl' => Helper::getReturnUrl()], ['parent_id' => 'id'])], 'edit' => ['label' => 'Edit category', 'icon' => 'fa fa-pencil', 'action' => ContextMenuHelper::actionUrl(['/shop/backend-category/edit', 'returnUrl' => Helper::getReturnUrl()])], 'create' => ['label' => 'Create category', 'icon' => 'fa fa-plus-circle', 'action' => ContextMenuHelper::actionUrl(['/shop/backend-category/edit', 'returnUrl' => Helper::getReturnUrl()], ['parent_id' => 'id'])], 'delete' => ['label' => 'Delete', 'icon' => 'fa fa-trash-o', 'action' => new \yii\web\JsExpression("function(node) {\n                            jQuery('#delete-category-confirmation')\n                                .attr('data-url', '/backend/category/delete?id=' + jQuery(node.reference[0]).data('id'))\n                                .attr('data-items', '')\n                                .modal('show');\n                            return true;\n                        }")]]]);
?>
    </div>
    <div class="col-md-8" id="jstree-more">
        <?php 
echo DynaGrid::widget(['options' => ['id' => 'Product-grid'], 'columns' => [['class' => \kartik\grid\CheckboxColumn::className(), 'options' => ['width' => '10px']], ['class' => 'yii\\grid\\DataColumn', 'attribute' => 'id'], ['class' => 'yii\\grid\\DataColumn', 'attribute' => 'name'], 'slug', ['class' => \kartik\grid\EditableColumn::className(), 'attribute' => 'active', 'editableOptions' => ['data' => [0 => Yii::t('app', 'Inactive'), 1 => Yii::t('app', 'Active')], 'inputType' => 'dropDownList', 'placement' => 'left', 'formOptions' => ['action' => 'update-editable']], 'filter' => [0 => Yii::t('app', 'Inactive'), 1 => Yii::t('app', 'Active')], 'format' => 'raw', 'value' => function (Product $model) {
    if ($model === null || $model->active === null) {
        return null;
    }
    if ($model->active === 1) {
        $label_class = 'label-success';
        $value = 'Active';
    } else {
        $value = 'Inactive';
        $label_class = 'label-default';
    }
Beispiel #4
0
use kartik\helpers\Html;
use kartik\icons\Icon;
use yii\bootstrap\ActiveForm;
use yii\bootstrap\Modal;
use yii\helpers\Url;
$this->title = Yii::t('app', 'Content Blocks');
$this->params['breadcrumbs'][] = $this->title;
?>

<?php 
echo app\widgets\Alert::widget(['id' => 'alert']);
?>
<div class="row">
    <div class="col-md-4">
        <?php 
echo TreeWidget::widget(['treeDataRoute' => ['getTree', 'selected_id' => $parent_id], 'changeParentAction' => 'move', 'reorderAction' => 'reorder', 'doubleClickAction' => ContextMenuHelper::actionUrl(['/core/backend-chunk-group/update', 'returnUrl' => Helper::getReturnUrl()]), 'contextMenuItems' => ['edit' => ['label' => 'Edit', 'icon' => 'fa fa-pencil', 'action' => ContextMenuHelper::actionUrl(['/core/backend-chunk-group/update', 'returnUrl' => Helper::getReturnUrl()])], 'open' => ['label' => 'Open', 'icon' => 'fa fa-folder-open', 'action' => ContextMenuHelper::actionUrl(['index'], ['group_id' => 'id'])], 'create' => ['label' => 'Create', 'icon' => 'fa fa-plus-circle', 'action' => ContextMenuHelper::actionUrl(['/core/backend-chunk-group/create', 'returnUrl' => Helper::getReturnUrl()], ['parent_id' => 'id', 'returnUrl' => Helper::getReturnUrl()])], 'delete' => ['label' => 'Delete', 'icon' => 'fa fa-trash-o', 'action' => new \yii\web\JsExpression("function(node) {\n                                jQuery('#confirm_delete')\n                                    .modal('toggle');\n\n                                jQuery('#confirm_delete form').attr('action', '/core/backend-chunk-group/delete?id=' + jQuery(node.reference[0]).data('id'))\n                                return true;\n                            }")]]]);
?>
    </div>
    <div class="col-md-8">
        <?php 
echo DynaGrid::widget(['options' => ['id' => 'backend-chunk-grid'], 'columns' => [['class' => \kartik\grid\CheckboxColumn::className(), 'options' => ['width' => '10px']], ['class' => 'yii\\grid\\DataColumn', 'attribute' => 'id'], 'name', 'key', ['class' => BooleanColumn::className(), 'attribute' => 'preload'], ['attribute' => 'group', 'value' => 'group.name'], ['class' => ActionColumn::className(), 'options' => ['width' => '95px'], 'buttons' => [['url' => 'edit', 'icon' => 'pencil', 'class' => 'btn-primary', 'label' => Yii::t('app', 'Edit')], ['url' => 'delete', 'icon' => 'trash-o', 'class' => 'btn-danger', 'label' => Yii::t('app', 'Delete')]]]], 'theme' => 'panel-default', 'gridOptions' => ['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'hover' => true, 'panel' => ['heading' => Html::tag('h3', $this->title, ['class' => 'panel-title']), 'after' => Html::a(Icon::show('plus') . Yii::t('app', 'Add'), ['/core/backend-chunk/edit', 'group_id' => $parent_id, 'returnUrl' => \app\backend\components\Helper::getReturnUrl()], ['class' => 'btn btn-success']) . '&nbsp' . Html::a(Yii::t('app', 'Show all'), ['/core/backend-chunk/index'], ['class' => 'btn btn-warning']) . \app\backend\widgets\RemoveAllButton::widget(['url' => '/core/backend-chunk/remove-all', 'gridSelector' => '.grid-view', 'htmlOptions' => ['class' => 'btn btn-danger pull-right']])]]]);
?>
    </div>
</div>

<?php 
Modal::begin(['id' => 'confirm_delete', 'header' => Yii::t('app', 'Confirm delete item')]);
?>

<?php 
$form = ActiveForm::begin(['options' => ['action' => Url::to(['/core/backend-chunk-group/delete', 'returnUrl' => Helper::getReturnUrl()])]]);
    echo $form->field($submission, 'processed_by_user_id');
    ?>
                <?php 
    echo $form->field($submission, 'spam');
    ?>
            <?php 
    BackendWidget::end();
}
?>

            <?php 
if (false === $review->isNewRecord) {
    BackendWidget::begin(['title' => Yii::t('app', 'Reviews'), 'icon' => 'cubes']);
    ?>
            <?php 
    echo \devgroup\JsTreeWidget\TreeWidget::widget(['treeDataRoute' => ['ajax-get-tree', 'root_id' => $review->root_id, 'current_id' => $review->id], 'doubleClickAction' => \devgroup\JsTreeWidget\ContextMenuHelper::actionUrl(['view']), 'contextMenuItems' => ['edit' => ['label' => 'Edit', 'icon' => 'fa fa-pencil', 'action' => \devgroup\JsTreeWidget\ContextMenuHelper::actionUrl(['view'])], 'delete' => ['label' => 'Delete', 'icon' => 'fa fa-trash-o', 'action' => new \yii\web\JsExpression("function(node) {\n                                jQuery('#delete-category-confirmation')\n                                    .attr('data-url', '/review/backend-review/delete?id=' + jQuery(node.reference[0]).data('id'))\n                                    .attr('data-items', '')\n                                    .modal('show');\n                                return true;\n                            }")]], 'options' => ['types' => ['leaf' => ['icon' => 'fa fa-comments'], 'current' => ['icon' => 'fa fa-check']]]]);
    ?>
            <?php 
    BackendWidget::end();
}
?>
        </article>
    </div>
</div>
<?php 
$form->end();
$_js = <<<'JSCODE'
$(function(){
    $('select#review-object_id').on('change', function(event) {
        $('select#review-object_model_id').val(0).trigger('change');
    });
Beispiel #6
0
$this->title = Yii::t('app', 'Backend menu items');
if (is_object($model)) {
    $this->title = Yii::t('app', 'Items inside item: ') . '"' . $model->name . '"';
}
$parent_id = is_object($model) ? $model->id : '0';
$this->params['breadcrumbs'][] = $this->title;
?>

<?php 
echo app\widgets\Alert::widget(['id' => 'alert']);
?>

<div class="row">
    <div class="col-md-4">
        <?php 
echo TreeWidget::widget(['treeDataRoute' => ['/backend/backend-menu/getTree'], 'contextMenuItems' => ['edit' => ['label' => 'Edit', 'icon' => 'fa fa-pencil', 'action' => ContextMenuHelper::actionUrl(['/backend/backend-menu/edit', 'returnUrl' => Helper::getReturnUrl()], ['parent_id' => 'parent_id', 'id' => 'id'])], 'open' => ['label' => 'Open', 'icon' => 'fa fa-folder-open', 'action' => ContextMenuHelper::actionUrl(['/backend/backend-menu/index'], ['parent_id' => 'id'])], 'create' => ['label' => 'Create', 'icon' => 'fa fa-plus-circle', 'action' => ContextMenuHelper::actionUrl(['/backend/backend-menu/edit', 'returnUrl' => Helper::getReturnUrl()], ['parent_id' => 'id'])], 'delete' => ['label' => 'Delete', 'icon' => 'fa fa-trash-o', 'action' => new \yii\web\JsExpression("function(node) {\n                                jQuery('#delete-confirmation')\n                                    .attr('data-url', '/backend/backend-menu/delete?id=' + jQuery(node.reference[0]).data('id'))\n                                    .attr('data-items', '')\n                                    .modal('show');\n                                return true;\n                            }")]]]);
?>
    </div>
    <div class="col-md-8" id="jstree-more">
        <?php 
$this->beginBlock('add-button');
?>
                <a href="<?php 
echo Url::to(['/backend/backend-menu/edit', 'parent_id' => is_object($model) ? $model->id : 0, 'returnUrl' => \app\backend\components\Helper::getReturnUrl()]);
?>
" class="btn btn-success">
                    <?php 
echo Icon::show('plus');
?>
                    <?php 
echo Yii::t('app', 'Add');