/** * Creates a URL for the given action and model. * This method is called for each button and each row. * @param string $action the button name (or action ID) * @param \yii\db\ActiveRecord $model the data model * @param mixed $key the key associated with the data model * @param integer $index the current row index * @param bool $appendReturnUrl custom return url for each button * @param string $url_append custom append url for each button * @param string $keyParam custom param if $key is string * @param array $attrs list of model attributes used in route params * @return string the created URL */ public function createUrl($action, $model, $key, $index, $appendReturnUrl = null, $url_append = null, $keyParam = 'id', $attrs = []) { if ($this->urlCreator instanceof Closure) { return call_user_func($this->urlCreator, $action, $model, $key, $index); } else { $params = []; if (is_array($key)) { $params = $key; } else { if (is_null($keyParam) === false) { $params = [$keyParam => (string) $key]; } } $params[0] = $this->controller ? $this->controller . '/' . $action : $action; foreach ($attrs as $attrName) { if ($attrName === 'model') { $params['model'] = $model; } elseif ($attrName === 'mainCategory.category_group_id' && $model->getMainCategory()) { $params['category_group_id'] = $model->getMainCategory()->category_group_id; } else { $params[$attrName] = $model->getAttribute($attrName); } } if (is_null($appendReturnUrl) === true) { $appendReturnUrl = $this->appendReturnUrl; } if (is_null($url_append) === true) { $url_append = $this->url_append; } if ($appendReturnUrl) { $params['returnUrl'] = Helper::getReturnUrl(); } return Url::toRoute($params) . $url_append; } }
public function run() { $this->genButton = Html::a(Icon::show('edit') . Yii::t('app', 'Generate'), '#', ['class' => 'btn btn-success', 'id' => 'btn-generate']); $parent_id = $this->model->main_category_id; $owner_id = $this->model->id; $this->addButton = Html::a(Icon::show('plus') . Yii::t('app', 'Add'), Url::toRoute(['/shop/backend-product/edit', 'parent_id' => $parent_id, 'owner_id' => $owner_id, 'returnUrl' => \app\backend\components\Helper::getReturnUrl()]), ['class' => 'btn btn-success', 'id' => 'btn-add']); if (!empty($this->footer)) { $this->footer = Html::tag('div', $this->addButton . ' ' . $this->genButton, ['class' => 'widget-footer']); } $this->object = Object::getForClass(get_class($this->model)); $rest_pg = (new Query())->select('id, name')->from(PropertyGroup::tableName())->where(['object_id' => $this->object->id])->orderBy('sort_order')->all(); $this->property_groups_to_add = []; foreach ($rest_pg as $row) { $this->property_groups_to_add[$row['id']] = $row['name']; } $optionGenerate = Json::decode($this->model->option_generate); if (null === PropertyGroup::findOne($optionGenerate['group'])) { $this->model->option_generate = $optionGenerate = null; } $groupModel = null; if (isset($optionGenerate['group'])) { $groupModel = PropertyGroup::findOne($optionGenerate['group']); $properties = Property::getForGroupId($optionGenerate['group']); } else { $group_ids = array_keys($this->property_groups_to_add); $group_id = array_shift($group_ids); $groupModel = PropertyGroup::findOne($group_id); $properties = Property::getForGroupId($group_id); } if (is_null($groupModel)) { $groupModel = new PropertyGroup(); } return $this->render($this->viewFile, ['model' => $this->model, 'form' => $this->form, 'groups' => $this->property_groups_to_add, 'groupModel' => $groupModel, 'properties' => $properties, 'optionGenerate' => $optionGenerate, 'footer' => $this->footer]); }
protected function getProductLinks($id) { $model = Product::findById($id, null); if (is_null($model)) { return false; } $this->frontendLink = Html::a($model->name, ['@product', 'model' => $model, 'category_group_id' => isset($model->category) ? $model->category->category_group_id : null]); $this->backendLink = Html::a($model->name, ['/shop/backend-product/edit', 'id' => $model->id, 'returnUrl' => Helper::getReturnUrl()]); }
/** * Creates a URL for the given action and model. * This method is called for each button and each row. * @param string $action the button name (or action ID) * @param \yii\db\ActiveRecord $model the data model * @param mixed $key the key associated with the data model * @param integer $index the current row index * @return string the created URL */ public function createUrl($action, $model, $key, $index) { if ($this->urlCreator instanceof Closure) { return call_user_func($this->urlCreator, $action, $model, $key, $index); } else { $params = is_array($key) ? $key : ['id' => (string) $key]; $params[0] = $this->controller ? $this->controller . '/' . $action : $action; if ($this->appendReturnUrl) { $params['returnUrl'] = Helper::getReturnUrl(); } return Url::toRoute($params) . $this->url_append; } }
/** * @var yii\web\View $this * @var yii\data\ActiveDataProvider $dataProvider * @var \app\models\Form $searchModel */ use kartik\dynagrid\DynaGrid; use kartik\helpers\Html; $this->title = Yii::t('app', 'Currencies'); $this->params['breadcrumbs'][] = $this->title; ?> <?php echo app\widgets\Alert::widget(['id' => 'alert']); $this->beginBlock('add-button'); echo \yii\helpers\Html::a(\kartik\icons\Icon::show('plus') . ' ' . Yii::t('app', 'Add'), ['edit', 'returnUrl' => \app\backend\components\Helper::getReturnUrl()], ['class' => 'btn btn-success']); echo \app\backend\widgets\RemoveAllButton::widget(['url' => 'remove-all', 'gridSelector' => '.grid-view', 'htmlOptions' => ['class' => 'btn btn-danger pull-right']]); $this->endBlock(); ?> <div class="row"> <div class="col-md-12"> <?php echo DynaGrid::widget(['options' => ['id' => 'currencies-grid'], 'columns' => [['class' => \app\backend\columns\CheckboxColumn::className()], 'id', 'name', 'iso_code', 'convert_nominal', 'convert_rate', ['attribute' => 'currency_rate_provider_id', 'class' => \kartik\grid\EditableColumn::className(), 'editableOptions' => ['data' => [0 => '-'] + \app\components\Helper::getModelMap(\app\modules\shop\models\CurrencyRateProvider::className(), 'id', 'name'), 'inputType' => 'dropDownList', 'placement' => 'left', 'formOptions' => ['action' => 'update-editable']], 'filter' => \app\components\Helper::getModelMap(\app\modules\shop\models\CurrencyRateProvider::className(), 'id', 'name'), 'format' => 'raw', 'value' => function ($model, $key, $index, $column) { if ($model === null || $model->rateProvider === null) { return null; } return Html::tag('div', $model->rateProvider->name, ['class' => $model->rateProvider->name]); }], ['class' => \app\backend\components\ActionColumn::className()]], 'theme' => 'panel-default', 'gridOptions' => ['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'hover' => true, 'panel' => ['heading' => $this->render('_tabs', ['currencies' => true]), 'after' => $this->blocks['add-button']]]]);
<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']]); ?> </div> <?php $this->endBlock(); ?> <?php echo DynaGrid::widget(['options' => ['id' => 'page-grid'], 'columns' => [['class' => \kartik\grid\CheckboxColumn::className(), 'options' => ['width' => '10px']], ['class' => 'yii\\grid\\DataColumn', 'attribute' => 'id'], ['class' => 'yii\\grid\\DataColumn', 'attribute' => 'title'], 'slug', ['class' => 'app\\backend\\columns\\BooleanStatus', 'attribute' => 'published'], ['class' => 'app\\backend\\components\\ActionColumn', 'buttons' => [['url' => 'edit', 'icon' => 'pencil', 'class' => 'btn-primary', 'label' => Yii::t('app', 'Edit')], ['url' => 'clone', 'icon' => 'copy', 'class' => 'btn-success', 'label' => Yii::t('app', 'Clone')], ['url' => 'delete', 'icon' => 'trash-o', 'class' => 'btn-danger', 'label' => Yii::t('app', 'Delete'), 'options' => ['data-action' => 'delete']]], 'url_append' => '&parent_id=' . (is_object($model) ? $model->id : 0)]], 'theme' => 'panel-default', 'gridOptions' => ['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'hover' => true, 'panel' => ['heading' => '<h3 class="panel-title">' . $this->title . '</h3>', 'after' => $this->blocks['buttonGroup']]]]); ?> </div> </div>
* @var \app\modules\seo\models\Meta $searchModel */ $this->title = Yii::t('app', 'Meta tags'); $this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'SEO'), 'url' => ['index']]; $this->params['breadcrumbs'][] = $this->title; ?> <div class="meta-tags-index"> <h1><?php echo Html::encode($this->title); ?> </h1> <p> <?php echo Html::a(Yii::t('app', 'Create Meta tag'), ['create-meta', 'returnUrl' => \app\backend\components\Helper::getReturnUrl()], ['class' => 'btn btn-success']); ?> <?php echo Html::button(Yii::t('app', 'Delete selected'), ['class' => 'btn btn-danger', 'id' => 'deleteTasks']); ?> <?php echo Yii::$app->user->can('cache manage') ? Html::button(Yii::t('app', 'Delete Meta Cache') . ' <span class="fa"></span>', ['class' => 'btn btn-warning pull-right', 'id' => 'flushCache']) : ''; ?> </p> <?php echo $this->render('_metaGrid', ['dataProvider' => $dataProvider, 'searchModel' => $searchModel, 'id' => 'meta-tags']); ?> </div>
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'; }
<?php use yii\grid\GridView; use yii\helpers\Url; use yii\widgets\Pjax; /** * @var $id * @var yii\web\View $this * @var yii\data\ActiveDataProvider $dataProvider * @var app\modules\seo\models\Redirect $searchModel */ ?> <?php Pjax::begin(); ?> <?php echo GridView::widget(['id' => $id, 'dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'layout' => "{items}\n{summary}\n{pager}", 'columns' => [['class' => 'yii\\grid\\CheckboxColumn', 'options' => ['width' => '10px']], ['class' => 'yii\\grid\\DataColumn', 'attribute' => 'id', 'options' => ['width' => '60px']], ['class' => 'yii\\grid\\DataColumn', 'attribute' => 'type', 'filter' => \app\modules\seo\models\Redirect::getTypes()], 'from', 'to', ['class' => 'yii\\grid\\DataColumn', 'attribute' => 'active', 'filter' => [0 => 'false', 1 => 'true']], ['class' => 'app\\backend\\components\\ActionColumn', 'urlCreator' => function ($action, $model, $key, $index) { $params = is_array($key) ? $key : ['id' => (string) $key]; $action .= '-redirect'; $params[0] = $this->context->id ? $this->context->id . '/' . $action : $action; $params['returnUrl'] = \app\backend\components\Helper::getReturnUrl(); return Url::toRoute($params); }, 'options' => ['width' => '95px'], 'buttons' => [['url' => 'update', 'icon' => 'pencil', 'class' => 'btn-primary', 'label' => Yii::t('app', 'Edit')], ['url' => 'delete', 'icon' => 'trash-o', 'class' => 'btn-danger', 'label' => Yii::t('app', 'Delete')]]]], 'tableOptions' => ['class' => 'table table-striped table-condensed table-hover']]); ?> <?php Pjax::end();
<?php /** * @var yii\web\View $this * @var yii\data\ActiveDataProvider $dataProvider * @var \app\models\Form $searchModel */ use app\backend\components\ActionColumn; use kartik\dynagrid\DynaGrid; use kartik\grid\BooleanColumn; use kartik\helpers\Html; use kartik\icons\Icon; $this->title = Yii::t('app', 'Content Blocks'); $this->params['breadcrumbs'][] = $this->title; ?> <?php echo app\widgets\Alert::widget(['id' => 'alert']); ?> <?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'], ['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', 'returnUrl' => \app\backend\components\Helper::getReturnUrl()], ['class' => 'btn btn-success']) . \app\backend\widgets\RemoveAllButton::widget(['url' => '/core/backend-chunk/remove-all', 'gridSelector' => '.grid-view', 'htmlOptions' => ['class' => 'btn btn-danger pull-right']])]]]);
<?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();
?> <?php foreach ($models as $activeWidget) { ?> <?php if ($activeWidget->part_id !== intval($partsRow['id'])) { continue; } ?> <li class="well well-sm well-light" activewidget="<?php echo $activeWidget->id; ?> "> <div class="pull-right btn-group"> <?php echo Html::a(Icon::show('cogs') . Yii::t('app', 'Configure'), ['/DefaultTheme/backend-configuration/configure-json', 'id' => $activeWidget->id, 'returnUrl' => \app\backend\components\Helper::getReturnUrl()], ['class' => 'btn btn-success btn-xs configure-active-widget']); ?> <?php echo Html::a(Icon::show('trash-o'), ['delete-active-widget', 'id' => $activeWidget->id], ['class' => 'btn btn-danger btn-xs', 'data-action' => 'post']); ?> </div> <?php echo $activeWidget->widget->name; ?> <?php $matchedCount++; ?> </li> <?php } ?>
<?php use app\backend\components\Helper; use app\backend\widgets\RemoveAllButton; use kartik\dynagrid\DynaGrid; use kartik\grid\CheckboxColumn; use kartik\icons\Icon; use yii\helpers\Html; /** * @var yii\web\View $this * @var yii\data\ActiveDataProvider $dataProvider * @var \app\models\Form $searchModel */ $this->title = Yii::t('app', 'Thumbnail size'); $this->params['breadcrumbs'][] = $this->title; ?> <?php $this->beginBlock('add-button'); echo Html::a(Icon::show('plus') . ' ' . Yii::t('app', 'Add'), ['edit', 'returnUrl' => Helper::getReturnUrl()], ['class' => 'btn btn-success']); echo RemoveAllButton::widget(['url' => '/image/backend-thumbnail-size/remove-all', 'gridSelector' => '.grid-view', 'htmlOptions' => ['class' => 'btn btn-danger pull-right']]); $this->endBlock(); ?> <?php echo DynaGrid::widget(['options' => ['id' => 'form-grid'], 'columns' => [['class' => CheckboxColumn::className(), 'options' => ['width' => '10px']], 'id', 'width', 'height', 'quality', ['class' => 'app\\backend\\components\\ActionColumn', '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')]], 'options' => ['width' => '85px']]], 'theme' => 'panel-default', 'gridOptions' => ['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'hover' => true, 'panel' => ['heading' => '<h3 class="panel-title">' . $this->title . '</h3>', 'after' => $this->blocks['add-button']]]]);
<?php use yii\helpers\Json; use kartik\dynagrid\DynaGrid; /** * @var yii\web\View $this * @var yii\data\ActiveDataProvider $dataProvider * @var \app\models\Form $searchModel */ $this->title = Yii::t('app', 'Extensions'); $this->params['breadcrumbs'][] = $this->title; $this->beginBlock('add-button'); ?> <?php echo \yii\helpers\Html::a(\kartik\icons\Icon::show('plus') . ' ' . Yii::t('app', 'Install new extension'), ['/core/backend-extensions/explore', 'returnUrl' => \app\backend\components\Helper::getReturnUrl()], ['class' => 'btn btn-success']); ?> <?php $this->endBlock(); ?> <?php echo DynaGrid::widget(['options' => ['id' => 'extensions-grid'], 'columns' => [['class' => \kartik\grid\CheckboxColumn::className(), 'options' => ['width' => '10px']], 'id', 'name', 'type.name', 'force_version', 'current_package_version_timestamp', ['class' => 'app\\backend\\components\\ActionColumn', 'urlCreator' => function ($action, $model, $key, $index) { $params = ['/core/backend-extensions/' . $action, 'name' => $model->name]; $params['returnUrl'] = app\backend\components\Helper::getReturnUrl(); return yii\helpers\Url::toRoute($params); }, 'buttons' => [['url' => 'show-package', 'icon' => 'eye', 'class' => 'btn-info btn-show-package', 'label' => Yii::t('app', 'View')]], 'options' => ['width' => '125px']]], 'theme' => 'panel-default', 'gridOptions' => ['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'hover' => true, 'panel' => ['heading' => '<h3 class="panel-title">' . $this->title . '</h3>', 'after' => $this->blocks['add-button']]]]); ?> <?php $extensionInformation = Json::encode(Yii::t('app', 'Extension information'));
<?php use yii\helpers\Html; use kartik\dynagrid\DynaGrid; use app\backend\components\ActionColumn; use kartik\icons\Icon; /* @var $this yii\web\View */ /* @var $searchModel app\components\SearchModel */ /* @var $dataProvider yii\data\ActiveDataProvider */ $this->title = Yii::t('app', 'Categories groups'); $this->params['breadcrumbs'][] = $this->title; ?> <div class="category-group-index"> <?php echo DynaGrid::widget(['options' => ['id' => 'order-statuses-grid'], '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'), ['edit', 'returnUrl' => \app\backend\components\Helper::getReturnUrl()], ['class' => 'btn btn-success'])]], 'columns' => ['id', 'name', ['class' => ActionColumn::className()]]]); ?> </div>
$this->params['breadcrumbs'][] = ['label' => 'SEO', 'url' => ['index']]; $this->params['breadcrumbs'][] = $this->title; ?> <div class="meta-tags-index"> <h1><?php echo Html::encode($this->title); ?> </h1> <p> <?php echo Html::a(Yii::t('app', 'Create Redirect'), ['create-redirect', 'returnUrl' => \app\backend\components\Helper::getReturnUrl()], ['class' => 'btn btn-success']); ?> <?php echo Html::a(Yii::t('app', 'Create Redirects'), ['create-redirects', 'returnUrl' => \app\backend\components\Helper::getReturnUrl()], ['class' => 'btn btn-warning']); ?> <?php echo Html::button(Yii::t('app', 'Delete selected'), ['class' => 'btn btn-danger', 'id' => 'deleteRedirects']); ?> </p> <?php echo $this->render('_redirectGrid', ['dataProvider' => $dataProvider, 'searchModel' => $searchModel, 'id' => 'redirects']); ?> <p> <?php echo Html::button(Yii::t('app', 'Generate Redirect File'), ['class' => 'btn btn-danger', 'id' => 'generateButton']); ?> <?php
use kartik\helpers\Html; use kartik\dynagrid\DynaGrid; use kartik\icons\Icon; use yii\helpers\Url; $this->params['breadcrumbs'][] = $this->title = Yii::t('app', 'Views'); ?> <?php echo app\widgets\Alert::widget(['id' => 'alert']); ?> <div class="row"> <div class="col-md-12"> <?php $this->beginBlock('add-button'); ?> <?php echo \yii\helpers\Html::a(Icon::show('plus') . Yii::t('app', 'Add'), ['/backend/view/add', 'returnUrl' => \app\backend\components\Helper::getReturnUrl()], ['class' => 'btn btn-success']); ?> <?php echo \app\backend\widgets\RemoveAllButton::widget(['url' => '/backend/view/remove-all', 'gridSelector' => '.grid-view', 'htmlOptions' => ['class' => 'btn btn-danger pull-right']]); ?> <?php $this->endBlock(); ?> <?php echo DynaGrid::widget(['options' => ['id' => 'views-grid'], 'columns' => [['class' => \kartik\grid\CheckboxColumn::className(), 'options' => ['width' => '10px']], ['class' => 'yii\\grid\\DataColumn', 'attribute' => 'id'], 'name', 'view', 'category', 'internal_name', ['class' => 'app\\backend\\components\\ActionColumn', 'options' => ['width' => '95px']]], 'theme' => 'panel-default', 'gridOptions' => ['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'hover' => true, 'panel' => ['heading' => '<h3 class="panel-title">' . $this->title . '</h3>', 'after' => $this->blocks['add-button']]]]); ?> </div> </div>
<?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(['edit', 'returnUrl' => Helper::getReturnUrl()]), 'contextMenuItems' => ['edit' => ['label' => 'Edit', 'icon' => 'fa fa-pencil', 'action' => ContextMenuHelper::actionUrl(['edit', 'returnUrl' => Helper::getReturnUrl()])], 'open' => ['label' => 'Open', 'icon' => 'fa fa-folder-open', 'action' => ContextMenuHelper::actionUrl(['index'], ['parent_id' => 'id'])], 'create' => ['label' => 'Create', 'icon' => 'fa fa-plus-circle', 'action' => ContextMenuHelper::actionUrl(['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', '/shop/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 $this->beginBlock('add-button'); ?> <a href="<?php echo Url::to(['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'); ?> </a> <?php echo \app\backend\widgets\RemoveAllButton::widget(['url' => Url::to(['remove-all', 'parent_id' => is_object($model) ? $model->id : 0]), 'gridSelector' => '.grid-view', 'modalSelector' => '#delete-category-confirmation', 'htmlOptions' => ['class' => 'btn btn-danger pull-right']]); ?> <?php $this->endBlock(); ?>
*/ use app\backend\widgets\BackendWidget; use app\backend\widgets\flushcache\FlushCacheButton; use kartik\helpers\Html; use yii\bootstrap\Tabs; $this->title = Yii::t('app', 'Rbac'); $this->params['breadcrumbs'][] = $this->title; $this->beginBlock('buttonGroup'); ?> <div class="btn-toolbar" role="toolbar"> <div class="btn-group"> <?php echo Html::a(Yii::t('app', 'Create Permission'), ['create', 'returnUrl' => \app\backend\components\Helper::getReturnUrl(), 'type' => \yii\rbac\Item::TYPE_PERMISSION], ['class' => 'btn btn-success']); ?> <?php echo Html::a(Yii::t('app', 'Create Role'), ['create', 'returnUrl' => \app\backend\components\Helper::getReturnUrl(), 'type' => \yii\rbac\Item::TYPE_ROLE], ['class' => 'btn btn-success']); ?> </div> <?php echo Html::button(Yii::t('app', 'Delete selected'), ['class' => 'btn btn-danger', 'id' => 'deleteItems']); ?> </div> <?php $this->endBlock(); ?> <div class="user-index"> <?php BackendWidget::begin(['icon' => 'lock', 'title' => $this->title, 'footer' => $this->blocks['buttonGroup']]); ?> <?php echo Tabs::widget(['items' => [['label' => Yii::t('app', 'Permissions'), 'content' => $this->render('_rbacGrid', ['data' => $permissions, 'isRules' => $isRules, 'id' => 'operations']), 'active' => true], ['label' => Yii::t('app', 'Roles'), 'content' => $this->render('_rbacGrid', ['data' => $roles, 'isRules' => $isRules, 'id' => 'roles'])]]]);
<?php use app\backend\components\ActionColumn; use kartik\dynagrid\DynaGrid; use kartik\icons\Icon; use yii\helpers\Html; /* @var $this yii\web\View */ /* @var $dataProvider yii\data\ActiveDataProvider */ $this->title = Yii::t('app', 'Wysiwygs'); $this->params['breadcrumbs'][] = $this->title; ?> <div class="wysiwyg-index"> <h1><?php echo Html::encode($this->title); ?> </h1> <?php echo DynaGrid::widget(['options' => ['id' => 'backend-wysiwyg-grid'], 'columns' => ['id', 'name', 'class_name', ['class' => ActionColumn::className(), 'options' => ['width' => '95px'], 'buttons' => [['url' => 'update', '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-wysiwyg/create', 'returnUrl' => \app\backend\components\Helper::getReturnUrl()], ['class' => 'btn btn-success'])]]]); ?> </div>
<?php echo Html::submitButton(Icon::show('save') . Yii::t('app', 'Save & Go next'), ['class' => 'btn btn-success', 'name' => 'action', 'value' => 'next']); } ?> <?php echo Html::submitButton(Icon::show('save') . Yii::t('app', 'Save & Go back'), ['class' => 'btn btn-warning', 'name' => 'action', 'value' => 'back']); ?> <?php echo Html::submitButton(Icon::show('save') . Yii::t('app', 'Save'), ['class' => 'btn btn-primary', 'name' => 'action', 'value' => 'save']); $this->endBlock('submit'); $this->beginBlock('add-button'); ?> <a href="<?php echo Url::to(['/backend/properties/edit-static-value', 'property_id' => $model->id, 'returnUrl' => \app\backend\components\Helper::getReturnUrl()]); ?> " class="btn btn-success"> <?php echo Icon::show('plus'); ?> <?php echo Yii::t('app', 'Add value'); ?> </a> <?php $this->endBlock(); ?> <section id="widget-grid"> <div class="row">
<?php use app\backend\components\ActionColumn; use kartik\dynagrid\DynaGrid; use kartik\helpers\Html; use kartik\icons\Icon; /** * @var $this yii\web\View * @var $searchModel app\components\SearchModel * @var $dataProvider yii\data\ActiveDataProvider */ $this->title = Yii::t('app', 'Warehouse'); $this->params['breadcrumbs'][] = $this->title; ?> <div class="order-status-index"> <?php echo DynaGrid::widget(['options' => ['id' => 'order-statuses-grid'], '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'), ['edit', 'returnUrl' => \app\backend\components\Helper::getReturnUrl()], ['class' => 'btn btn-success']) . \app\backend\widgets\RemoveAllButton::widget(['url' => '/backend/order-status/remove-all', 'gridSelector' => '.grid-view', 'htmlOptions' => ['class' => 'btn btn-danger pull-right']])]], 'columns' => [['class' => \kartik\grid\CheckboxColumn::className(), 'options' => ['width' => '10px']], 'id', 'name', 'address', ['class' => ActionColumn::className()]]]); ?> </div>
<?php /** * @var \yii\web\View $this * @var \yii\data\ActiveDataProvider $dataProvider * @var \app\components\SearchModel $searchModel */ use yii\helpers\Html; $this->title = Yii::t('app', 'Customers'); $this->params['breadcrumbs'][] = $this->title; ?> <div class="customers-index"> <?php echo \kartik\dynagrid\DynaGrid::widget(['options' => ['id' => 'customers-index-grid'], 'theme' => 'panel-default', 'gridOptions' => ['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'hover' => true, 'panel' => ['heading' => Html::tag('h3', $this->title, ['class' => 'panel-title']), 'after' => Html::a(\kartik\icons\Icon::show('plus') . Yii::t('app', 'Add'), ['create', 'returnUrl' => \app\backend\components\Helper::getReturnUrl()], ['class' => 'btn btn-success'])], 'rowOptions' => function ($model, $key, $index, $grid) { /** @var \app\modules\shop\models\Customer $model */ if (intval($model->user_id) <= 0) { return ['class' => 'warning']; } return []; }], 'columns' => ['id', ['attribute' => 'orders', 'label' => Yii::t('app', 'Orders count'), 'value' => function ($model, $key, $index, $column) { /** @var \app\modules\shop\models\Customer $model */ return count($model->orders); }], ['attribute' => 'user', 'label' => Yii::t('app', 'User'), 'value' => function ($model, $key, $index, $column) { /** @var \app\modules\shop\models\Customer $model */ /** @var \app\modules\user\models\User $user */ $user = $model->user; return null === $user ? Yii::t('app', 'Guest') : $user->username; }], 'first_name', 'middle_name', 'last_name', 'email', 'phone', ['class' => 'app\\backend\\components\\ActionColumn', 'buttons' => function ($model, $key, $index, $parent) { $result = [['url' => 'edit', 'icon' => 'eye', 'class' => 'btn-info', 'label' => Yii::t('app', 'View')]]; return $result; }]]]);
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']) . ' ' . 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()])]]); $contentBlockModel = new ContentBlockGroup(); ?> <?php echo $form->field($contentBlockModel, 'id')->hiddenInput()->label(false); echo $form->field($contentBlockModel, 'deleteMethod')->dropDownList([ContentBlockGroup::DELETE_METHOD_PARENT_ROOT => Yii::t('app', 'Move child chunks to root group'), ContentBlockGroup::DELETE_METHOD_ALL => Yii::t('app', 'Delete all child chunks')]); ?> <?php echo Html::submitButton(Yii::t('app', 'Delete'), ['class' => ['btn btn-danger']]); ?> <?php ActiveForm::end();
<?php /** * @var yii\web\View $this * @var yii\data\ActiveDataProvider $dataProvider * @var \app\models\Form $searchModel */ use app\backend\components\ActionColumn; use kartik\dynagrid\DynaGrid; use kartik\grid\BooleanColumn; use kartik\helpers\Html; use kartik\icons\Icon; $this->title = Yii::t('app', 'Property groups'); $this->params['breadcrumbs'][] = $this->title; ?> <?php echo app\widgets\Alert::widget(['id' => 'alert']); ?> <?php echo DynaGrid::widget(['options' => ['id' => 'properties-grid'], 'columns' => [['class' => \kartik\grid\CheckboxColumn::className(), 'options' => ['width' => '10px']], ['class' => 'yii\\grid\\DataColumn', 'attribute' => 'id'], ['class' => 'yii\\grid\\DataColumn', 'attribute' => 'object_id', 'filter' => app\models\Object::getSelectArray(), 'value' => function ($model, $key, $index, $widget) { $array = app\models\Object::getSelectArray(); return $array[$model->object_id]; }], 'name', ['class' => BooleanColumn::className(), 'attribute' => 'is_internal'], ['class' => BooleanColumn::className(), 'attribute' => 'hidden_group_title'], ['class' => ActionColumn::className(), 'options' => ['width' => '95px'], 'buttons' => [['url' => 'group', 'icon' => 'pencil', 'class' => 'btn-primary', 'label' => Yii::t('app', 'Edit')], ['url' => 'delete-group', 'icon' => 'trash-o', 'class' => 'btn-danger', 'label' => Yii::t('app', 'Delete'), 'options' => ['data-action' => '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'), ['/backend/properties/group', 'returnUrl' => \app\backend\components\Helper::getReturnUrl()], ['class' => 'btn btn-success']) . \app\backend\widgets\RemoveAllButton::widget(['url' => '/backend/properties/remove-all-groups', 'gridSelector' => '.grid-view', 'htmlOptions' => ['class' => 'btn btn-danger pull-right']])]]]);
<?php echo $form->field($model, 'name'); ?> <?php echo $form->field($model, 'object_id')->dropDownList(app\models\Object::getSelectArray()); ?> <?php echo $form->field($model, 'is_internal')->checkbox(); ?> <?php echo $form->field($model, 'hidden_group_title')->checkbox(); ?> <?php echo $form->field($model, 'sort_order'); ?> <?php BackendWidget::end(); ?> </article> </div> </section> <?php ActiveForm::end(); if (!$model->isNewRecord) { ?> <?php echo DynaGrid::widget(['options' => ['id' => 'group-grid'], 'columns' => [['class' => \kartik\grid\CheckboxColumn::className(), 'options' => ['width' => '10px']], ['class' => \kartik\grid\DataColumn::className(), 'attribute' => 'id'], ['attribute' => 'property_handler_id', 'filter' => app\models\PropertyHandler::getSelectArray(), 'value' => function ($model, $key, $index, $widget) { $array = app\models\PropertyHandler::getSelectArray(); return $array[$model->property_handler_id]; }], 'name', 'key', ['class' => \kartik\grid\BooleanColumn::className(), 'attribute' => 'has_static_values'], ['class' => \kartik\grid\BooleanColumn::className(), 'attribute' => 'has_slugs_in_values'], ['class' => \kartik\grid\BooleanColumn::className(), 'attribute' => 'is_eav'], ['class' => \kartik\grid\BooleanColumn::className(), 'attribute' => 'is_column_type_stored'], ['class' => \kartik\grid\BooleanColumn::className(), 'attribute' => 'multiple'], ['class' => ActionColumn::className(), 'buttons' => [['url' => 'edit-property', 'icon' => 'pencil', 'class' => 'btn-primary', 'label' => 'Edit'], ['url' => 'delete-property', 'icon' => 'trash-o', 'class' => 'btn-danger', 'label' => 'Delete', 'options' => ['data-action' => 'delete']]], 'url_append' => '&property_group_id=' . $model->id]], 'theme' => 'panel-default', 'gridOptions' => ['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'hover' => true, 'panel' => ['heading' => Html::tag('h3', Yii::t('app', 'Properties'), ['class' => 'panel-title']), 'after' => Html::a(Icon::show('plus') . Yii::t('app', 'Add'), ['/backend/properties/edit-property', 'property_group_id' => $model->id, 'returnUrl' => \app\backend\components\Helper::getReturnUrl()], ['class' => 'btn btn-success']) . \app\backend\widgets\RemoveAllButton::widget(['url' => \yii\helpers\Url::to(['/backend/properties/remove-all-properties', 'group_id' => $model->id]), 'gridSelector' => '.grid-view', 'htmlOptions' => ['class' => 'btn btn-danger pull-right']])]]]); }