/**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     // set upload config
     $this->uploadConfig = [$this->crudModelsClass['main'] => []];
     $this->on(self::EVENT_DELETE, function ($event) {
         foreach ($event->extraData['models'] as $model) {
             CmsMenuSimpleService::refreshMenu($model->cms_simple_menu_group_id);
         }
     });
     $this->on(self::EVENT_SAVE_EDIT, function ($event) {
         CmsMenuSimpleService::refreshMenu($event->extraData['models']['main']->cms_simple_menu_group_id);
     });
     $this->on(self::EVENT_SAVE_TRANSLATE, function ($event) {
         $listId = [];
         foreach ($event->extraData['models'] as $model) {
             if (!in_array($model->cms_simple_menu_id, $listId)) {
                 $listId[] = $model->cms_simple_menu_id;
             }
         }
         $cmsSimpleMenus = CmsSimpleMenu::find()->select('cms_simple_menu_group_id')->where(['id' => $listId])->asArray()->all();
         foreach ($cmsSimpleMenus as $cmsSimpleMenu) {
             CmsMenuSimpleService::refreshMenu($cmsSimpleMenu['cms_simple_menu_group_id']);
         }
     });
 }
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     $request = Yii::$app->request;
     if ($request->get('mode', false) === 'explorer') {
         $this->layout = '/simple/simple';
     }
     // set upload config
     $this->uploadConfig = [$this->crudModelsClass['main'] => ['file_path' => ['basePath' => Yii::getAlias('@kalibao/data/cms-image'), 'baseUrl' => Yii::$app->cdnManager->getBaseUrl() . '/common/data/cms-image', 'type' => 'image']]];
 }
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     // set upload config
     $this->uploadConfig = [$this->crudModelsClass['main'] => []];
     $this->on(self::EVENT_DELETE, function ($event) {
         foreach ($event->extraData['models'] as $model) {
             CmsMenuSimpleService::refreshMenu($model->id);
         }
     });
 }
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     // refresh messages
     $refreshMessages = function () {
         Yii::$app->i18n->getMessageSource('kalibao')->refreshMessages();
     };
     $this->on(self::EVENT_DELETE, $refreshMessages);
     $this->on(self::EVENT_SAVE_EDIT, $refreshMessages);
     $this->on(self::EVENT_SAVE_TRANSLATE, $refreshMessages);
 }
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     // set upload config
     $this->uploadConfig = [$this->crudModelsClass['main'] => []];
     // refresh users authorisations
     $refreshUsersAuth = function ($event) {
         Yii::$app->user->refreshAllUsersAuth();
     };
     $this->on(self::EVENT_DELETE, $refreshUsersAuth);
     $this->on(self::EVENT_SAVE_EDIT, $refreshUsersAuth);
 }
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     // set upload config
     $this->uploadConfig = [$this->crudModelsClass['main'] => []];
     // refresh languages
     $refreshLanguages = function ($event) {
         Yii::$app->appLanguage->refreshLanguages();
     };
     $this->on(self::EVENT_DELETE, $refreshLanguages);
     $this->on(self::EVENT_SAVE_EDIT, $refreshLanguages);
 }
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     // set upload config
     $this->uploadConfig = [$this->crudModelsClass['main'] => []];
     // refresh messages
     $refreshMessages = function () {
         Yii::$app->i18n->getMessageSource('kalibao')->refreshMessages();
     };
     $this->on(self::EVENT_DELETE, $refreshMessages);
     $this->on(self::EVENT_SAVE_EDIT, $refreshMessages);
     $this->on(self::EVENT_SAVE_TRANSLATE, $refreshMessages);
 }
Example #8
0
 /**
  * @inheritdoc
  */
 public function behaviors()
 {
     $b = parent::behaviors();
     $b['access']['rules'][] = ['actions' => ['view', 'advanced-drop-down-list', 'settings', 'export'], 'allow' => true, 'roles' => [$this->getActionControllerPermission('consult'), 'permission.consult:*']];
     $b['access']['rules'][] = ['actions' => ['delete-attribute', 'advanced-drop-down-list', 'settings', 'export'], 'allow' => true, 'roles' => [$this->getActionControllerPermission('update'), 'permission.update:*']];
     $b['access']['rules'][] = ['actions' => ['add-attribute', 'advanced-drop-down-list', 'settings', 'export'], 'allow' => true, 'roles' => [$this->getActionControllerPermission('update'), 'permission.update:*']];
     $b['access']['rules'][] = ['actions' => ['save-variant', 'advanced-drop-down-list', 'settings', 'export'], 'allow' => true, 'roles' => [$this->getActionControllerPermission('update'), 'permission.update:*']];
     $b['access']['rules'][] = ['actions' => ['save-variant-price', 'advanced-drop-down-list', 'settings', 'export'], 'allow' => true, 'roles' => [$this->getActionControllerPermission('update'), 'permission.update:*']];
     $b['access']['rules'][] = ['actions' => ['save-variant-logistic', 'advanced-drop-down-list', 'settings', 'export'], 'allow' => true, 'roles' => [$this->getActionControllerPermission('update'), 'permission.update:*']];
     $b['access']['rules'][] = ['actions' => ['add-cross-sale', 'advanced-drop-down-list', 'settings', 'export'], 'allow' => true, 'roles' => [$this->getActionControllerPermission('update'), 'permission.update:*']];
     $b['access']['rules'][] = ['actions' => ['save-discount', 'advanced-drop-down-list', 'settings', 'export'], 'allow' => true, 'roles' => [$this->getActionControllerPermission('update'), 'permission.update:*']];
     $b['access']['rules'][] = ['actions' => ['update-logistic-strategy', 'advanced-drop-down-list', 'settings', 'export'], 'allow' => true, 'roles' => [$this->getActionControllerPermission('update'), 'permission.update:*']];
     $b['access']['rules'][] = ['actions' => ['remove-media', 'advanced-drop-down-list', 'settings', 'export'], 'allow' => true, 'roles' => [$this->getActionControllerPermission('update'), 'permission.update:*']];
     return $b;
 }
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     // set upload config
     $this->uploadConfig = [$this->crudModelsClass['main'] => []];
 }
Example #10
0
 public function behaviors()
 {
     $b = parent::behaviors();
     $b['access']['rules'][] = ['actions' => ['view', 'advanced-drop-down-list', 'settings', 'export'], 'allow' => true, 'roles' => [$this->getActionControllerPermission('consult'), 'permission.consult:*']];
     return $b;
 }
Example #11
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     // set upload config
     $this->uploadConfig = [$this->crudModelsClass['main'] => [], 'kalibao\\common\\models\\media\\Media' => ['file' => ['basePath' => Yii::getAlias('@kalibao/data'), 'baseUrl' => Yii::$app->cdnManager->getBaseUrl() . '/common/data', 'type' => 'file']]];
 }
Example #12
0
 public function behaviors()
 {
     $b = parent::behaviors();
     $b['access']['rules'][] = ['actions' => ['download'], 'allow' => true, 'roles' => [$this->getActionControllerPermission('consult'), 'permission.consult:*']];
     return $b;
 }
Example #13
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     // set upload config
     $this->uploadConfig = [$this->crudModelsClass['main'] => [], $this->crudModelsClass['person'] => [], $this->crudModelsClass['company'] => [], $this->crudModelsClass['address'] => []];
 }