/** * @inheritdoc */ public function actions() { return ArrayHelper::merge(parent::actions(), ['index' => ["columns" => [['class' => CreatedAtColumn::className()], 'id', ['class' => DataColumn::className(), 'attribute' => 'status_code', 'format' => 'raw', 'filter' => ArrayHelper::map(ShopOrderStatus::find()->all(), 'code', 'name'), 'value' => function (ShopOrder $order) { return Html::label($order->status->name, null, ['style' => "background: {$order->status->color}", 'class' => "label"]) . "<br />" . Html::tag("small", \Yii::$app->formatter->asDatetime($order->status_at) . " (" . \Yii::$app->formatter->asRelativeTime($order->status_at) . ")"); }], ['class' => BooleanColumn::className(), 'attribute' => 'payed', 'format' => 'raw'], ['class' => DataColumn::className(), 'attribute' => "canceled", 'format' => "raw", 'filter' => ['Y' => \Yii::t('app', 'Yes'), 'N' => \Yii::t('app', 'No')], 'value' => function (ShopOrder $shopOrder) { return $shopOrder->canceled == "Y" ? \Yii::t('app', 'Yes') : \Yii::t('app', 'No'); }], ['class' => DataColumn::className(), 'attribute' => "user_id", 'label' => \skeeks\cms\shop\Module::t('app', 'Buyer'), 'format' => "raw", 'value' => function (ShopOrder $shopOrder) { return (new \skeeks\cms\shop\widgets\AdminBuyerUserWidget(['user' => $shopOrder->user]))->run(); }], ['class' => DataColumn::className(), 'filter' => false, 'format' => 'raw', 'label' => \skeeks\cms\shop\Module::t('app', 'Good'), 'value' => function (ShopOrder $model) { if ($model->shopBaskets) { $result = []; foreach ($model->shopBaskets as $shopBasket) { $money = \Yii::$app->money->intlFormatter()->format($shopBasket->money); $result[] = Html::a($shopBasket->name, $shopBasket->product->cmsContentElement->url, ['target' => '_blank']) . <<<HTML — {$shopBasket->quantity} {$shopBasket->measure_name} HTML; } return implode('<hr style="margin: 0px;"/>', $result); } }], ['class' => DataColumn::className(), 'format' => 'raw', 'attribute' => 'price', 'label' => \skeeks\cms\shop\Module::t('app', 'Sum'), 'value' => function (ShopOrder $model) { return \Yii::$app->money->intlFormatter()->format($model->money); }], ['class' => DataColumn::className(), 'filter' => ArrayHelper::map(CmsSite::find()->active()->all(), 'id', 'name'), 'attribute' => 'site_id', 'format' => 'raw', 'visible' => false, 'label' => \skeeks\cms\shop\Module::t('app', 'Site'), 'value' => function (ShopOrder $model) { return $model->site->name . " [{$model->site->code}]"; }]]], "view" => ['class' => AdminOneModelEditAction::className(), "name" => \Yii::t('app', "Информация"), "icon" => "glyphicon glyphicon-eye-open", "priority" => 5, "callback" => [$this, 'view']]]); }
/** * @inheritdoc */ public function actions() { return ArrayHelper::merge(parent::actions(), ['index' => ["columns" => ['value', ['class' => DataColumn::className(), 'value' => function (ShopTaxRate $model) { return $model->tax->name . " (" . $model->tax->site->name . ")"; }, 'attribute' => "tax_id"], ['class' => DataColumn::className(), 'value' => function (ShopTaxRate $model) { return $model->personType->name; }, 'attribute' => "person_type_id"], ['class' => BooleanColumn::className(), 'attribute' => "is_in_price"], ['class' => BooleanColumn::className(), 'attribute' => "active"], ['attribute' => "priority"]]]]); }
/** * @inheritdoc */ public function actions() { return ArrayHelper::merge(parent::actions(), ['index' => ["gridConfig" => ['settingsData' => ['order' => SORT_ASC, 'orderBy' => "priority"]], "columns" => ['name', 'priority', ['class' => DataColumn::className(), 'attribute' => "shopPaySystems", 'filter' => false, 'value' => function (ShopDelivery $model) { return implode(", ", ArrayHelper::map($model->shopPaySystems, 'id', 'name')); }], ['class' => DataColumn::className(), 'attribute' => "price", 'format' => 'raw', 'filter' => false, 'value' => function (ShopDelivery $model) { return \Yii::$app->money->intlFormatter()->format($model->money); }], ['class' => BooleanColumn::className(), 'attribute' => "active"]]]]); }
/** * @inheritdoc */ public function actions() { return ArrayHelper::merge(parent::actions(), ['index' => ["dataProviderCallback" => function (ActiveDataProvider $activeDataProvider) { $activeDataProvider->query->andWhere(['type' => ShopDiscount::TYPE_DEFAULT]); }, "gridConfig" => ['settingsData' => ['order' => SORT_ASC, 'orderBy' => "priority"]], "columns" => ['id', ['attribute' => 'name'], ['attribute' => 'value', 'class' => DataColumn::className(), 'value' => function (ShopDiscount $shopDiscount) { if ($shopDiscount->value_type == ShopDiscount::VALUE_TYPE_P) { return \Yii::$app->formatter->asPercent($shopDiscount->value / 100); } else { $money = Money::fromString((string) $shopDiscount->value, $shopDiscount->currency_code); return \Yii::$app->money->intlFormatter()->format($money); } }], ['attribute' => 'active', 'class' => BooleanColumn::className()], ['attribute' => 'active_from', 'class' => DateTimeColumnData::className()], ['attribute' => 'active_to', 'class' => DateTimeColumnData::className()], ['class' => UpdatedByColumn::className()], ['class' => UpdatedAtColumn::className()], 'priority']]]); }
<?php /** * @author Semenov Alexander <*****@*****.**> * @link http://skeeks.com/ * @copyright 2010 SkeekS (СкикС) * @date 02.06.2015 */ /* @var $this yii\web\View */ /* @var $searchModel \skeeks\cms\models\Search */ /* @var $dataProvider yii\data\ActiveDataProvider */ /* @var $model \skeeks\cms\models\CmsContentElement */ $dataProvider->setSort(['defaultOrder' => ['priority' => SORT_ASC]]); ?> <? $pjax = \yii\widgets\Pjax::begin(); ?> <?php echo $this->render('_search', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]); ?> <?php echo \skeeks\cms\modules\admin\widgets\GridViewStandart::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'autoColumns' => false, 'pjax' => $pjax, 'adminController' => $controller, 'columns' => [['class' => \skeeks\cms\grid\ImageColumn2::className()], 'name', 'code', ['class' => \skeeks\cms\grid\BooleanColumn::className(), 'attribute' => "active"], ['class' => \skeeks\cms\grid\BooleanColumn::className(), 'attribute' => "def"], 'priority']]); ?> <? \yii\widgets\Pjax::end(); ?>
<?php /** * index * * @author Semenov Alexander <*****@*****.**> * @link http://skeeks.com/ * @copyright 2010-2014 SkeekS (Sx) * @date 30.10.2014 * @since 1.0.0 */ /* @var $this yii\web\View */ /* @var $searchModel common\models\searchs\Game */ /* @var $dataProvider yii\data\ActiveDataProvider */ ?> <?php echo \skeeks\cms\modules\admin\widgets\GridViewStandart::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'adminController' => $controller, 'columns' => [['class' => \skeeks\cms\grid\ImageColumn2::className(), 'attribute' => 'image_id', 'relationName' => 'image'], 'username', 'name', ['class' => \skeeks\cms\grid\CreatedAtColumn::className()], ['class' => \skeeks\cms\grid\DateTimeColumnData::className(), 'attribute' => 'logged_at'], ['class' => \yii\grid\DataColumn::className(), 'value' => function (\skeeks\cms\models\User $model) { $result = []; if ($roles = \Yii::$app->authManager->getRolesByUser($model->id)) { foreach ($roles as $role) { $result[] = $role->description . " ({$role->name})"; } } return implode(', ', $result); }, 'format' => 'html', 'label' => \Yii::t('app', 'Roles')], ['class' => \skeeks\cms\grid\BooleanColumn::className(), 'attribute' => "active"]]]);
* * @author Semenov Alexander <*****@*****.**> * @link http://skeeks.com/ * @copyright 2010-2014 SkeekS (Sx) * @date 30.10.2014 * @since 1.0.0 */ /* @var $this yii\web\View */ /* @var $searchModel common\models\searchs\Game */ /* @var $dataProvider yii\data\ActiveDataProvider */ ?> <? $pjax = \skeeks\cms\modules\admin\widgets\Pjax::begin(); ?> <?php echo $this->render('_search', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]); ?> <?php echo \skeeks\cms\modules\admin\widgets\GridViewStandart::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'adminController' => $controller, 'pjax' => $pjax, 'settingsData' => ['order' => SORT_ASC, 'orderBy' => "priority"], 'columns' => ['name', 'priority', ['class' => \yii\grid\DataColumn::className(), 'attribute' => "siteCodes", 'filter' => false, 'value' => function (\skeeks\cms\shop\models\ShopPersonType $model) { $result = []; if ($model->sites) { foreach ($model->sites as $site) { $result[] = "{$site->name} [{$site->code}]"; } } return implode(", ", $result); }], ['class' => \skeeks\cms\grid\BooleanColumn::className(), 'attribute' => "active"]]]); ?> <? $pjax::end(); ?>
if (!$model->cmsTree) { return null; } $path = []; if ($model->cmsTree->parents) { foreach ($model->cmsTree->parents as $parent) { if ($parent->isRoot()) { $path[] = "[" . $parent->site->name . "] " . $parent->name; } else { $path[] = $parent->name; } } } $path = implode(" / ", $path); return "<small><a href='{$model->cmsTree->url}' target='_blank' data-pjax='0'>{$path} / {$model->cmsTree->name}</a></small>"; }, 'format' => 'raw', 'filter' => \skeeks\cms\helpers\TreeOptions::getAllMultiOptions(), 'attribute' => 'tree_id'], ['class' => \yii\grid\DataColumn::className(), 'value' => function (\skeeks\cms\models\CmsContentElement $model) { $result = []; if ($model->cmsContentElementTrees) { foreach ($model->cmsContentElementTrees as $contentElementTree) { $site = $contentElementTree->tree->root->site; $result[] = "<small><a href='{$contentElementTree->tree->url}' target='_blank' data-pjax='0'>[{$site->name}]/.../{$contentElementTree->tree->name}</a></small>"; } } return implode('<br />', $result); }, 'format' => 'raw', 'label' => \Yii::t('app', 'Additional sections')], ['attribute' => 'active', 'class' => \skeeks\cms\grid\BooleanColumn::className()], ['class' => \yii\grid\DataColumn::className(), 'value' => function (\skeeks\cms\models\CmsContentElement $model) { return \yii\helpers\Html::a('<i class="glyphicon glyphicon-arrow-right"></i>', $model->absoluteUrl, ['target' => '_blank', 'title' => \Yii::t('app', 'Watch to site (opens new window)'), 'data-pjax' => '0', 'class' => 'btn btn-default btn-sm']); }, 'format' => 'raw']]; ?>
echo $form->fieldRadioListBoolean($model, 'with_description'); echo $form->fieldSetEnd(); ?> <?php if (!$model->isNewRecord) { echo $form->fieldSet(\skeeks\cms\shop\Module::t('app', 'Values for the list')); ?> <?php echo \skeeks\cms\modules\admin\widgets\RelatedModelsGrid::widget(['label' => \skeeks\cms\shop\Module::t('app', 'Values for the list'), 'hint' => \skeeks\cms\shop\Module::t('app', 'You can snap to the element number of properties, and set the value to them'), 'parentModel' => $model, 'relation' => ['property_id' => 'id'], 'sort' => ['defaultOrder' => ['priority' => SORT_ASC]], 'dataProviderCallback' => function ($dataProvider) { /** * @var \yii\data\BaseDataProvider $dataProvider */ $dataProvider->getPagination()->defaultPageSize = 5000; }, 'controllerRoute' => 'shop/admin-person-type-property-enum', 'gridViewOptions' => ['sortable' => true, 'columns' => [['attribute' => 'id', 'enableSorting' => false], ['attribute' => 'code', 'enableSorting' => false], ['attribute' => 'value', 'enableSorting' => false], ['attribute' => 'priority', 'enableSorting' => false], ['class' => \skeeks\cms\grid\BooleanColumn::className(), 'attribute' => 'def', 'enableSorting' => false]]]]); ?> <?php echo $form->fieldSetEnd(); } ?> <?php echo $form->fieldSet('Связь с пользователем'); ?> <?php echo $form->fieldRadioListBoolean($model, 'is_user_email'); ?> <?php
<?php echo $form->fieldSet(\Yii::t('app', 'Captions')); ?> <?php echo $form->field($model, 'name_one')->textInput(); ?> <?php echo $form->field($model, 'name_meny')->textInput(); echo $form->fieldSetEnd(); ?> <?php if (!$model->isNewRecord) { ?> <?php echo $form->fieldSet(\Yii::t('app', 'Element properties')); ?> <?php echo \skeeks\cms\modules\admin\widgets\RelatedModelsGrid::widget(['label' => \Yii::t('app', 'Element properties'), 'hint' => \Yii::t('app', 'Every content on the site has its own set of properties, its sets here'), 'parentModel' => $model, 'relation' => ['tree_type_id' => 'id'], 'sort' => ['defaultOrder' => ['priority' => SORT_ASC]], 'dataProviderCallback' => function ($dataProvider) { /** * @var \yii\data\BaseDataProvider $dataProvider */ $dataProvider->getPagination()->defaultPageSize = 5000; }, 'controllerRoute' => 'cms/admin-cms-tree-type-property', 'gridViewOptions' => ['sortable' => true, 'columns' => [['attribute' => 'name', 'enableSorting' => false], ['class' => \skeeks\cms\grid\BooleanColumn::className(), 'attribute' => 'active', 'falseValue' => \skeeks\cms\components\Cms::BOOL_N, 'trueValue' => \skeeks\cms\components\Cms::BOOL_Y, 'enableSorting' => false], ['attribute' => 'code', 'enableSorting' => false], ['attribute' => 'priority', 'enableSorting' => false]]]]); ?> <?php echo $form->fieldSetEnd(); } echo $form->buttonsCreateOrUpdate($model); ActiveForm::end();
/** * @inheritdoc */ public function actions() { return ArrayHelper::merge(parent::actions(), ['index' => ["gridConfig" => ['settingsData' => ['order' => SORT_ASC, 'orderBy' => "priority"]], "columns" => [['class' => \skeeks\cms\grid\ImageColumn2::className()], 'name', 'code', ['class' => \skeeks\cms\grid\BooleanColumn::className(), 'attribute' => "active"], ['class' => \skeeks\cms\grid\BooleanColumn::className(), 'attribute' => "def"], 'priority']], "def-multi" => ['class' => AdminMultiModelEditAction::className(), "name" => "По умолчанию", "eachCallback" => [$this, 'eachMultiDef'], "priority" => 0], "activate-multi" => ['class' => AdminMultiModelEditAction::className(), "name" => "Активировать", "eachCallback" => [$this, 'eachMultiActivate']], "inActivate-multi" => ['class' => AdminMultiModelEditAction::className(), "name" => "Деактивировать", "eachCallback" => [$this, 'eachMultiInActivate']]]); }
/** * @author Semenov Alexander <*****@*****.**> * @link http://skeeks.com/ * @copyright 2010 SkeekS (СкикС) * @date 02.06.2015 */ /* @var $this yii\web\View */ /* @var $searchModel \skeeks\cms\models\Search */ /* @var $dataProvider yii\data\ActiveDataProvider */ $dataProvider->query->andWhere(['type' => \skeeks\cms\shop\models\ShopDiscount::TYPE_DEFAULT]); ?> <? $pjax = \skeeks\cms\modules\admin\widgets\Pjax::begin(); ?> <?php echo $this->render('_search', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]); ?> <?php echo \skeeks\cms\modules\admin\widgets\GridViewStandart::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'pjax' => $pjax, 'adminController' => \Yii::$app->controller, 'settingsData' => ['order' => SORT_ASC, 'orderBy' => "priority"], 'columns' => ['id', ['attribute' => 'name'], ['attribute' => 'value', 'class' => \yii\grid\DataColumn::className(), 'value' => function (\skeeks\cms\shop\models\ShopDiscount $shopDiscount) { if ($shopDiscount->value_type == \skeeks\cms\shop\models\ShopDiscount::VALUE_TYPE_P) { return \Yii::$app->formatter->asPercent($shopDiscount->value / 100); } else { $money = \skeeks\modules\cms\money\Money::fromString((string) $shopDiscount->value, $shopDiscount->currency_code); return \Yii::$app->money->intlFormatter()->format($money); } }], ['attribute' => 'active', 'class' => \skeeks\cms\grid\BooleanColumn::className()], ['attribute' => 'active_from', 'class' => \skeeks\cms\grid\DateTimeColumnData::className()], ['attribute' => 'active_to', 'class' => \skeeks\cms\grid\DateTimeColumnData::className()], ['class' => \skeeks\cms\grid\UpdatedByColumn::className()], ['class' => \skeeks\cms\grid\UpdatedAtColumn::className()], 'priority']]); ?> <? $pjax::end(); ?>
<?php /** * index * * @author Semenov Alexander <*****@*****.**> * @link http://skeeks.com/ * @copyright 2010-2014 SkeekS (Sx) * @date 30.10.2014 * @since 1.0.0 */ /* @var $this yii\web\View */ /* @var $searchModel common\models\searchs\Game */ /* @var $dataProvider yii\data\ActiveDataProvider */ ?> <?php echo \skeeks\cms\modules\admin\widgets\GridViewStandart::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'adminController' => $controller, 'columns' => ['value', ['class' => \skeeks\cms\grid\UserColumnData::className(), 'attribute' => 'user_id'], ['class' => \skeeks\cms\grid\BooleanColumn::className(), 'attribute' => 'approved'], ['class' => \skeeks\cms\grid\BooleanColumn::className(), 'attribute' => 'def']]]);
/** * @inheritdoc */ public function actions() { return ArrayHelper::merge(parent::actions(), ['index' => ["gridConfig" => ['settingsData' => ['order' => SORT_ASC, 'orderBy' => "priority"]], "columns" => ['name', 'priority', 'rate', ['class' => BooleanColumn::className(), 'attribute' => "active"]]]]); }
/** * @param CmsContent $cmsContent * @return array */ public static function getDefaultColumns($cmsContent = null) { $columns = [['class' => \skeeks\cms\grid\ImageColumn2::className()], 'name', ['class' => \skeeks\cms\grid\CreatedAtColumn::className()], ['class' => \skeeks\cms\grid\UpdatedAtColumn::className(), 'visible' => false], ['class' => \skeeks\cms\grid\PublishedAtColumn::className(), 'visible' => false], ['class' => \skeeks\cms\grid\DateTimeColumnData::className(), 'attribute' => "published_to", 'visible' => false], ['class' => \skeeks\cms\grid\CreatedByColumn::className()], ['class' => \yii\grid\DataColumn::className(), 'value' => function (\skeeks\cms\models\CmsContentElement $model) { if (!$model->cmsTree) { return null; } $path = []; if ($model->cmsTree->parents) { foreach ($model->cmsTree->parents as $parent) { if ($parent->isRoot()) { $path[] = "[" . $parent->site->name . "] " . $parent->name; } else { $path[] = $parent->name; } } } $path = implode(" / ", $path); return "<small><a href='{$model->cmsTree->url}' target='_blank' data-pjax='0'>{$path} / {$model->cmsTree->name}</a></small>"; }, 'format' => 'raw', 'filter' => \skeeks\cms\helpers\TreeOptions::getAllMultiOptions(), 'attribute' => 'tree_id'], 'additionalSections' => ['class' => \yii\grid\DataColumn::className(), 'value' => function (\skeeks\cms\models\CmsContentElement $model) { $result = []; if ($model->cmsContentElementTrees) { foreach ($model->cmsContentElementTrees as $contentElementTree) { $site = $contentElementTree->tree->root->site; $result[] = "<small><a href='{$contentElementTree->tree->url}' target='_blank' data-pjax='0'>[{$site->name}]/.../{$contentElementTree->tree->name}</a></small>"; } } return implode('<br />', $result); }, 'format' => 'raw', 'label' => \Yii::t('skeeks/cms', 'Additional sections'), 'visible' => false], ['attribute' => 'active', 'class' => \skeeks\cms\grid\BooleanColumn::className()], ['class' => \yii\grid\DataColumn::className(), 'label' => "Смотреть", 'value' => function (\skeeks\cms\models\CmsContentElement $model) { return \yii\helpers\Html::a('<i class="glyphicon glyphicon-arrow-right"></i>', $model->absoluteUrl, ['target' => '_blank', 'title' => \Yii::t('skeeks/cms', 'Watch to site (opens new window)'), 'data-pjax' => '0', 'class' => 'btn btn-default btn-sm']); }, 'format' => 'raw']]; return $columns; }
<?php /** * @author Semenov Alexander <*****@*****.**> * @link http://skeeks.com/ * @copyright 2010 SkeekS (СкикС) * @date 02.06.2015 */ /* @var $this yii\web\View */ /* @var $searchModel \skeeks\cms\models\Search */ /* @var $dataProvider yii\data\ActiveDataProvider */ $dataProvider->query->andWhere(['type' => \skeeks\cms\shop\models\ShopDiscount::TYPE_DISCOUNT_SAVE]); ?> <? $pjax = \skeeks\cms\modules\admin\widgets\Pjax::begin(); ?> <?php echo $this->render('_search', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]); ?> <?php echo \skeeks\cms\modules\admin\widgets\GridViewStandart::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'pjax' => $pjax, 'adminController' => \Yii::$app->controller, 'settingsData' => ['order' => SORT_ASC, 'orderBy' => "priority"], 'columns' => ['id', ['attribute' => 'name', 'label' => \Yii::t('skeeks/shop/app', 'Name of the program')], ['attribute' => 'active', 'class' => \skeeks\cms\grid\BooleanColumn::className()], ['class' => \skeeks\cms\grid\UpdatedByColumn::className()], ['class' => \skeeks\cms\grid\UpdatedAtColumn::className()], 'priority']]); ?> <? $pjax::end(); ?>
/** * @inheritdoc */ public function actions() { return ArrayHelper::merge(parent::actions(), ['index' => ["columns" => ['id', ['class' => UserColumnData::className(), 'attribute' => 'user_id'], ['attribute' => 'current_budget', 'class' => DataColumn::className(), 'value' => function (ShopUserAccount $userAccount) { return \Yii::$app->money->intlFormatter()->format($userAccount->money); }], ['attribute' => 'locked', 'class' => BooleanColumn::className()]]]]); }
/** * @inheritdoc */ public function actions() { return ArrayHelper::merge(parent::actions(), ['index' => ['columns' => ['name', 'code', ['class' => \skeeks\cms\grid\BooleanColumn::className(), 'falseValue' => \skeeks\cms\components\Cms::BOOL_N, 'trueValue' => \skeeks\cms\components\Cms::BOOL_Y, 'attribute' => 'active']]], "update" => ["modelScenario" => RelatedPropertyModel::SCENARIO_UPDATE_CONFIG]]); }
/** * @inheritdoc */ public function actions() { return ArrayHelper::merge(parent::actions(), ['index' => ["columns" => ['id', 'name', 'description', ['class' => \skeeks\cms\grid\DateTimeColumnData::className(), 'attribute' => "last_exec_at"], ['class' => \skeeks\cms\grid\DateTimeColumnData::className(), 'attribute' => "next_exec_at"], ['attribute' => "agent_interval"], ['class' => \skeeks\cms\grid\BooleanColumn::className(), 'attribute' => "active"]]], "activate-multi" => ['class' => AdminMultiModelEditAction::className(), "name" => "Активировать", "eachCallback" => [$this, 'eachMultiActivate']], "inActivate-multi" => ['class' => AdminMultiModelEditAction::className(), "name" => "Деактивировать", "eachCallback" => [$this, 'eachMultiInActivate']]]); }
/** * @inheritdoc */ public function actions() { return ArrayHelper::merge(parent::actions(), ['index' => ["gridConfig" => ['settingsData' => ['order' => SORT_ASC, 'orderBy' => "priority"]], "columns" => ['name', 'code', ['class' => DataColumn::className(), 'label' => \Yii::t('app', 'Number of sections'), 'value' => function (CmsTreeType $cmsTreeType) { return $cmsTreeType->getCmsTrees()->count(); }], ['class' => \skeeks\cms\grid\BooleanColumn::className(), 'attribute' => 'active'], 'priority']], "activate-multi" => ['class' => AdminMultiModelEditAction::className(), "name" => "Активировать", "eachCallback" => [$this, 'eachMultiActivate']], "inActivate-multi" => ['class' => AdminMultiModelEditAction::className(), "name" => "Деактивировать", "eachCallback" => [$this, 'eachMultiInActivate']]]); }
if ($parent->isRoot()) { $path[] = "[" . $parent->site->name . "] " . $parent->name; } else { $path[] = $parent->name; } } } $path = implode(" / ", $path); return "<small><a href='{$model->cmsTree->url}' target='_blank' data-pjax='0'>{$path} / {$model->cmsTree->name}</a></small>"; }, 'format' => 'raw', 'filter' => \skeeks\cms\helpers\TreeOptions::getAllMultiOptions(), 'attribute' => 'tree_id'], ['class' => \yii\grid\DataColumn::className(), 'value' => function (\skeeks\cms\models\CmsContentElement $model) { $result = []; if ($model->cmsContentElementTrees) { foreach ($model->cmsContentElementTrees as $contentElementTree) { $site = $contentElementTree->tree->root->site; $result[] = "<small><a href='{$contentElementTree->tree->url}' target='_blank' data-pjax='0'>[{$site->name}]/.../{$contentElementTree->tree->name}</a></small>"; } } return implode('<br />', $result); }, 'format' => 'raw', 'label' => \Yii::t('app', 'Additional sections')], ['label' => \skeeks\cms\shop\Module::t('app', 'Base price'), 'class' => \yii\grid\DataColumn::className(), 'value' => function (\skeeks\cms\models\CmsContentElement $model) { $shopProduct = \skeeks\cms\shop\models\ShopProduct::getInstanceByContentElement($model); if ($shopProduct) { return \Yii::$app->money->intlFormatter()->format($shopProduct->baseProductPrice->money); } return null; }], ['attribute' => 'active', 'class' => \skeeks\cms\grid\BooleanColumn::className()], ['class' => \yii\grid\DataColumn::className(), 'value' => function (\skeeks\cms\models\CmsContentElement $model) { return \yii\helpers\Html::a('<i class="glyphicon glyphicon-arrow-right"></i>', $model->absoluteUrl, ['target' => '_blank', 'title' => \Yii::t('app', 'Watch to site (opens new window)'), 'data-pjax' => '0', 'class' => 'btn btn-default btn-sm']); }, 'format' => 'raw']]; ?>
?> <?php echo $form->fieldSetEnd(); ?> <?php echo $form->fieldSet(\Yii::t('skeeks/cms', 'Captions')); ?> <?php echo $form->field($model, 'name_one')->textInput(); ?> <?php echo $form->field($model, 'name_meny')->textInput(); echo $form->fieldSetEnd(); ?> <? if (!$model->isNewRecord) : ?> <?php echo $form->fieldSet(\Yii::t('skeeks/cms', 'Element properties')); ?> <?php echo \skeeks\cms\modules\admin\widgets\RelatedModelsGrid::widget(['label' => \Yii::t('skeeks/cms', 'Element properties'), 'hint' => \Yii::t('skeeks/cms', 'Every content on the site has its own set of properties, its sets here'), 'parentModel' => $model, 'relation' => ['tree_type_id' => 'id'], 'controllerRoute' => 'cms/admin-cms-tree-type-property', 'gridViewOptions' => ['sortable' => true, 'columns' => [['attribute' => 'name', 'enableSorting' => false], ['class' => \skeeks\cms\grid\BooleanColumn::className(), 'attribute' => 'active', 'falseValue' => \skeeks\cms\components\Cms::BOOL_N, 'trueValue' => \skeeks\cms\components\Cms::BOOL_Y, 'enableSorting' => false], ['attribute' => 'code', 'enableSorting' => false], ['attribute' => 'priority', 'enableSorting' => false]]]]); ?> <?php echo $form->fieldSetEnd(); ?> <? endif; ?> <?php echo $form->buttonsCreateOrUpdate($model); ActiveForm::end();
?> <?php echo \skeeks\cms\modules\admin\widgets\GridView::widget(['dataProvider' => $dataProvider, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'name', 'fullName', ['class' => \yii\grid\DataColumn::className(), 'attribute' => 'schemaName', 'label' => \Yii::t('app', 'Number of columns'), 'value' => function (yii\db\TableSchema $model) { return count($model->columns); }], ['class' => \yii\grid\DataColumn::className(), 'attribute' => 'schemaName', 'label' => \Yii::t('app', 'Number of foreign keys'), 'value' => function (yii\db\TableSchema $model) { return count($model->foreignKeys); }]]]); echo $form->fieldSetEnd(); ?> <?php echo $form->fieldSet(\Yii::t('app', 'Settings')); ?> <?php echo \skeeks\cms\modules\admin\widgets\GridView::widget(['dataProvider' => new \yii\data\ArrayDataProvider(['allModels' => [['name' => \Yii::t('app', 'Cache table structure'), 'value' => $db->enableSchemaCache ? "Y" : "N"], ['name' => \Yii::t('app', 'Cache query'), 'value' => $db->enableSchemaCache ? "Y" : "N"]]]), 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'name', ['class' => \skeeks\cms\grid\BooleanColumn::className(), 'attribute' => 'value']]]); echo $form->fieldSetEnd(); ?> <?php echo $form->fieldSet(\Yii::t('app', 'Backup')); ?> <?php \skeeks\cms\modules\admin\widgets\Pjax::begin(['id' => 'sx-backups']); ?> <?php $url = \skeeks\cms\helpers\UrlHelper::construct('admin/db/backup')->enableAdmin()->toString(); ?> <?php echo \yii\helpers\Html::a("<i class=\"glyphicon glyphicon-save\"></i> " . \Yii::t('app', 'Make a backup'), $url, ['class' => 'btn btn-primary', 'onclick' => new \yii\web\JsExpression(<<<JS
<?php /** * @author Semenov Alexander <*****@*****.**> * @link http://skeeks.com/ * @copyright 2010 SkeekS (СкикС) * @date 02.06.2015 */ /* @var $this yii\web\View */ /* @var $searchModel \skeeks\cms\models\Search */ /* @var $dataProvider yii\data\ActiveDataProvider */ ?> <? $pjax = \skeeks\cms\modules\admin\widgets\Pjax::begin(); ?> <?php echo $this->render('_search', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]); ?> <?php echo \skeeks\cms\modules\admin\widgets\GridViewStandart::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'pjax' => $pjax, 'adminController' => \Yii::$app->controller, 'settingsData' => ['order' => SORT_ASC, 'orderBy' => "priority"], 'columns' => ['name', 'priority', 'rate', ['class' => \skeeks\cms\grid\BooleanColumn::className(), 'attribute' => "active"]]]); ?> <? $pjax::end(); ?>
<?php /** * index * * @author Semenov Alexander <*****@*****.**> * @link http://skeeks.com/ * @copyright 2010-2014 SkeekS (Sx) * @date 30.10.2014 * @since 1.0.0 */ /* @var $this yii\web\View */ /* @var $searchModel common\models\searchs\Game */ /* @var $dataProvider yii\data\ActiveDataProvider */ ?> <? $pjax = \skeeks\cms\modules\admin\widgets\Pjax::begin(); ?> <?php /*echo $this->render('_search', [ 'searchModel' => $searchModel, 'dataProvider' => $dataProvider ]); */ ?> <?php echo \skeeks\cms\modules\admin\widgets\GridViewStandart::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'adminController' => $controller, 'pjax' => $pjax, 'columns' => ['name', 'code', ['class' => \skeeks\cms\grid\BooleanColumn::className(), 'falseValue' => \skeeks\cms\components\Cms::BOOL_N, 'trueValue' => \skeeks\cms\components\Cms::BOOL_Y, 'attribute' => 'active']]]); ?> <? $pjax::end(); ?>
<?php /** * @author Semenov Alexander <*****@*****.**> * @link http://skeeks.com/ * @copyright 2010 SkeekS (СкикС) * @date 02.06.2015 */ /* @var $this yii\web\View */ /* @var $searchModel \skeeks\cms\models\Search */ /* @var $dataProvider yii\data\ActiveDataProvider */ ?> <? $pjax = \skeeks\cms\modules\admin\widgets\Pjax::begin(); ?> <?php echo $this->render('_search', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]); ?> <?php echo \skeeks\cms\modules\admin\widgets\GridViewStandart::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'pjax' => $pjax, 'adminController' => \Yii::$app->controller, 'columns' => ['id', ['attribute' => 'site_code', 'class' => \skeeks\cms\grid\SiteColumn::className()], ['attribute' => 'active', 'class' => \skeeks\cms\grid\BooleanColumn::className()], 'name', 'base_rate']]); ?> <? $pjax::end(); ?>
?> <?php echo $form->fieldSet(\Yii::t('app', 'General information')); ?> <?php echo $form->field($model, 'name')->textInput(); ?> <?php echo $form->field($model, 'code')->textInput(); ?> <?php echo $form->fieldInputInt($model, 'priority')->textInput(); echo $form->fieldSetEnd(); ?> <?php echo $form->fieldSet(\Yii::t('app', 'Content')); ?> <?php echo \skeeks\cms\modules\admin\widgets\RelatedModelsGrid::widget(['label' => \Yii::t('app', "Content"), 'hint' => "", 'parentModel' => $model, 'relation' => ['content_type' => 'code'], 'sort' => ['defaultOrder' => ['priority' => SORT_ASC]], 'controllerRoute' => 'cms/admin-cms-content', 'gridViewOptions' => ['sortable' => true, 'columns' => ['name', 'code', ['class' => \skeeks\cms\grid\BooleanColumn::className(), 'falseValue' => \skeeks\cms\components\Cms::BOOL_N, 'trueValue' => \skeeks\cms\components\Cms::BOOL_Y, 'attribute' => 'active']]]]); ?> <?php echo $form->fieldSetEnd(); ?> <?php echo $form->buttonsCreateOrUpdate($model); ActiveForm::end();
<?php /** * @author Semenov Alexander <*****@*****.**> * @link http://skeeks.com/ * @copyright 2010 SkeekS (СкикС) * @date 02.06.2015 */ /* @var $this yii\web\View */ /* @var $searchModel \skeeks\cms\models\Search */ /* @var $dataProvider yii\data\ActiveDataProvider */ ?> <? $pjax = \skeeks\cms\modules\admin\widgets\Pjax::begin(); ?> <?php echo $this->render('_search', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]); ?> <?php echo \skeeks\cms\modules\admin\widgets\GridViewStandart::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'pjax' => $pjax, 'adminController' => \Yii::$app->controller, 'settingsData' => ['order' => SORT_ASC, 'orderBy' => "priority"], 'columns' => ['name', 'code', ['class' => \yii\grid\DataColumn::className(), 'label' => \Yii::t('skeeks/cms', 'Number of sections'), 'value' => function (\skeeks\cms\models\CmsTreeType $cmsTreeType) { return $cmsTreeType->getCmsTrees()->count(); }], ['class' => \skeeks\cms\grid\BooleanColumn::className(), 'attribute' => 'active'], 'priority']]); ?> <? $pjax::end(); ?>
/** * @inheritdoc */ public function actions() { return ArrayHelper::merge(parent::actions(), ['index' => ["gridConfig" => ['settingsData' => ['order' => SORT_ASC, 'orderBy' => "priority"]], "columns" => ['code', 'name', 'priority', ['class' => \skeeks\cms\grid\BooleanColumn::className(), 'attribute' => "def"]]], "def-multi" => ['class' => AdminMultiModelEditAction::className(), "name" => \skeeks\cms\shop\Module::t('app', 'Default'), "eachCallback" => [$this, 'eachMultiDef'], "priority" => 0]]); }
if ($parent->isRoot()) { $path[] = "[" . $parent->site->name . "] " . $parent->name; } else { $path[] = $parent->name; } } } $path = implode(" / ", $path); return "<small><a href='{$model->cmsTree->url}' target='_blank' data-pjax='0'>{$path} / {$model->cmsTree->name}</a></small>"; }, 'format' => 'raw', 'filter' => \skeeks\cms\helpers\TreeOptions::getAllMultiOptions(), 'attribute' => 'tree_id'], ['class' => \yii\grid\DataColumn::className(), 'value' => function (\skeeks\cms\models\CmsContentElement $model) { $result = []; if ($model->cmsContentElementTrees) { foreach ($model->cmsContentElementTrees as $contentElementTree) { $site = $contentElementTree->tree->root->site; $result[] = "<small><a href='{$contentElementTree->tree->url}' target='_blank' data-pjax='0'>[{$site->name}]/.../{$contentElementTree->tree->name}</a></small>"; } } return implode('<br />', $result); }, 'format' => 'raw', 'label' => \skeeks\cms\shop\Module::t('app', 'Advanced Topics')], ['attribute' => 'active', 'class' => \skeeks\cms\grid\BooleanColumn::className()], ['label' => \skeeks\cms\shop\Module::t('app', 'Base price'), 'class' => \yii\grid\DataColumn::className(), 'value' => function (\skeeks\cms\models\CmsContentElement $model) { $shopProduct = \skeeks\cms\shop\models\ShopProduct::getInstanceByContentElement($model); if ($shopProduct) { return \Yii::$app->money->intlFormatter()->format($shopProduct->baseProductPrice->money); } return null; }], ['class' => \yii\grid\DataColumn::className(), 'value' => function (\skeeks\cms\models\CmsContentElement $model) { return \yii\helpers\Html::a('<i class="glyphicon glyphicon-arrow-right"></i>', $model->absoluteUrl, ['target' => '_blank', 'title' => \skeeks\cms\shop\Module::t('app', 'View online (opens new window)'), 'data-pjax' => '0', 'class' => 'btn btn-default btn-sm']); }, 'format' => 'raw']]; ?>