Esempio n. 1
0
<?php

use yii\helpers\Html;
use yii\widgets\Pjax;
/** @var \yii\data\ActiveDataProvider $widgetsDataProvider */
/** @var \app\extensions\DefaultTheme\models\ThemeWidgets  $widgetsSearchModel */
$this->beginBlock('bottom-buttons-parts');
echo \yii\helpers\Html::a(\kartik\icons\Icon::show('plus') . ' ' . Yii::t('app', 'Add'), ['/DefaultTheme/backend-configuration/edit-widget', 'returnUrl' => \app\backend\components\Helper::getReturnUrl()], ['class' => 'btn btn-success']);
$this->endBlock();
?>

<?php 
Pjax::begin(['enablePushState' => false]);
echo \kartik\dynagrid\DynaGrid::widget(['options' => ['id' => 'theme-widgets-grid'], 'columns' => ['id', 'name', 'widget', ['class' => \app\backend\columns\BooleanStatus::className(), 'attribute' => 'is_cacheable', 'header' => Yii::t('app', 'Is cacheable')], 'cache_lifetime', ['class' => \app\backend\columns\BooleanStatus::className(), 'attribute' => 'cache_vary_by_session', 'header' => Yii::t('app', 'Cache vary by session'), 'true_value' => Yii::t('app', 'Yes'), 'false_value' => Yii::t('app', 'No')], 'cache_tags', ['class' => app\backend\components\ActionColumn::className(), 'buttons' => ['edit-part' => ['url' => 'edit-widget', 'icon' => 'pencil', 'class' => 'btn-default', 'label' => Yii::t('app', 'Edit')], 'delete-part' => ['options' => ['data-action' => 'delete'], 'url' => 'delete-widget', 'icon' => 'trash-o', 'class' => 'btn-danger', 'label' => Yii::t('app', 'Delete')]]]], 'theme' => 'panel-default', 'gridOptions' => ['dataProvider' => $widgetsDataProvider, 'filterModel' => $widgetsSearchModel, 'hover' => true, 'panel' => ['heading' => Html::tag('h3', Yii::t('app', 'All available theme widgets'), ['class' => 'panel-title']), 'after' => $this->blocks['bottom-buttons-parts']]]]);
Pjax::end();
Esempio n. 2
0
<?php

use yii\helpers\Html;
use yii\widgets\Pjax;
/** @var \yii\data\ActiveDataProvider $variationsDataProvider */
/** @var \app\extensions\DefaultTheme\models\ThemeVariation $variationsSearchModel */
$this->beginBlock('bottom-buttons-parts');
echo \yii\helpers\Html::a(\kartik\icons\Icon::show('plus') . ' ' . Yii::t('app', 'Add'), ['/DefaultTheme/backend-configuration/edit-variation', 'returnUrl' => \app\backend\components\Helper::getReturnUrl()], ['class' => 'btn btn-success']);
$this->endBlock();
?>

<?php 
Pjax::begin(['enablePushState' => false]);
echo \kartik\dynagrid\DynaGrid::widget(['options' => ['id' => 'theme-variations-grid'], 'columns' => ['id', 'name', 'by_url', 'by_route', 'matcher_class_name', ['class' => \app\backend\columns\BooleanStatus::className(), 'attribute' => 'exclusive', 'header' => Yii::t('app', 'Exclusive'), 'true_value' => Yii::t('app', 'Yes'), 'false_value' => Yii::t('app', 'No')], ['class' => app\backend\components\ActionColumn::className(), 'buttons' => ['edit-part' => ['url' => 'edit-variation', 'icon' => 'pencil', 'class' => 'btn-default', 'label' => Yii::t('app', 'Edit')], 'active-widgets' => ['url' => 'active-widgets', 'icon' => 'list', 'class' => 'btn-primary', 'label' => Yii::t('app', 'Show active widgets')], 'delete-part' => ['options' => ['data-action' => 'delete'], 'url' => 'delete-variation', 'icon' => 'trash-o', 'class' => 'btn-danger', 'label' => Yii::t('app', 'Delete')]]]], 'theme' => 'panel-default', 'gridOptions' => ['dataProvider' => $variationsDataProvider, 'filterModel' => $variationsSearchModel, 'hover' => true, 'panel' => ['heading' => Html::tag('h3', Yii::t('app', 'Theme variations'), ['class' => 'panel-title']), 'after' => $this->blocks['bottom-buttons-parts']]]]);
Pjax::end();