Skip to content

Commit

Permalink
dev
Browse files Browse the repository at this point in the history
  • Loading branch information
skeeks-semenov committed Dec 9, 2024
1 parent 5f594ae commit eb71995
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 12 deletions.
24 changes: 18 additions & 6 deletions src/controllers/AdminShopBrandController.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@

use skeeks\cms\backend\controllers\BackendModelStandartController;
use skeeks\cms\grid\BooleanColumn;
use skeeks\cms\grid\DateTimeColumnData;
use skeeks\cms\grid\ImageColumn2;
use skeeks\cms\grid\UserColumnData;
use skeeks\cms\helpers\Image;
use skeeks\cms\models\CmsCountry;
use skeeks\cms\queryfilters\QueryFiltersEvent;
Expand Down Expand Up @@ -40,15 +42,15 @@ public function init()
$this->modelShowAttribute = "name";
$this->modelClassName = ShopBrand::class;

$this->generateAccessActions = false;
$this->permissionName = CmsManager::PERMISSION_ADMIN_ACCESS;
$this->generateAccessActions = true;
/*$this->permissionName = CmsManager::PERMISSION_ADMIN_ACCESS;*/

$this->accessCallback = function () {
/*$this->accessCallback = function () {
if (!\Yii::$app->skeeks->site->is_default) {
return false;
}
return \Yii::$app->user->can(CmsManager::PERMISSION_ROLE_ADMIN_ACCESS);
};
};*/


parent::init();
Expand Down Expand Up @@ -126,7 +128,7 @@ public function actions()
],
'grid' => [
'defaultOrder' => [
'name' => SORT_ASC,
'created_at' => SORT_DESC,
],
/*'sortAttributes' => [
'countProducts' => [
Expand All @@ -141,18 +143,28 @@ public function actions()
'checkbox',
'actions',

'created_at',
'custom',

'country_alpha2',

'countProducts',
'is_active',
'priority',
'created_by',
'view',
],

'columns' => [

'created_at' => [
'class' => DateTimeColumnData::class
],
'updated_at' => [
'class' => DateTimeColumnData::class
],
'created_by' => [
'class' => UserColumnData::class
],
'countProducts' => [
'format' => 'raw',
'value' => function (ShopBrand $shopBrand) {
Expand Down
25 changes: 19 additions & 6 deletions src/controllers/AdminShopCollectionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@

use skeeks\cms\backend\controllers\BackendModelStandartController;
use skeeks\cms\grid\BooleanColumn;
use skeeks\cms\grid\DateTimeColumnData;
use skeeks\cms\grid\ImageColumn2;
use skeeks\cms\grid\UserColumnData;
use skeeks\cms\helpers\Image;
use skeeks\cms\models\CmsCountry;
use skeeks\cms\queryfilters\QueryFiltersEvent;
Expand Down Expand Up @@ -42,15 +44,15 @@ public function init()
$this->modelShowAttribute = "name";
$this->modelClassName = ShopCollection::class;

$this->generateAccessActions = false;
$this->permissionName = CmsManager::PERMISSION_ROLE_ADMIN_ACCESS;
$this->generateAccessActions = true;
/*$this->permissionName = CmsManager::PERMISSION_ROLE_ADMIN_ACCESS;*/

$this->accessCallback = function () {
/*$this->accessCallback = function () {
if (!\Yii::$app->skeeks->site->is_default) {
return false;
}
return \Yii::$app->user->can(CmsManager::PERMISSION_ROLE_ADMIN_ACCESS);
};
};*/


parent::init();
Expand Down Expand Up @@ -127,7 +129,7 @@ public function actions()
],
'grid' => [
'defaultOrder' => [
'name' => SORT_ASC,
'created_at' => SORT_DESC,
],
/*'sortAttributes' => [
'countProducts' => [
Expand All @@ -142,18 +144,29 @@ public function actions()
'checkbox',
'actions',

'created_at',
'custom',

'brand',

'countProducts',
'is_active',
'priority',
'created_by',
'view',
],

'columns' => [

'created_at' => [
'class' => DateTimeColumnData::class
],
'updated_at' => [
'class' => DateTimeColumnData::class
],
'created_by' => [
'class' => UserColumnData::class
],

'countProducts' => [
'format' => 'raw',
'value' => function (ShopCollection $shopBrand) {
Expand Down

0 comments on commit eb71995

Please sign in to comment.