public function up()
 {
     $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE=InnoDB';
     $this->createTable('{{%prefiltered_pages}}', ['id' => Schema::TYPE_PK, 'slug' => Schema::TYPE_STRING, 'active' => Schema::TYPE_BOOLEAN . ' NOT NULL DEFAULT 1', 'last_category_id' => 'INT UNSIGNED NOT NULL DEFAULT 0', 'params' => 'TEXT', 'title' => Schema::TYPE_STRING . ' NOT NULL DEFAULT \'\'', 'announce' => 'TEXT', 'content' => 'TEXT', 'h1' => Schema::TYPE_STRING . ' NOT NULL DEFAULT \'\'', 'meta_description' => Schema::TYPE_STRING . ' NOT NULL DEFAULT \'\'', 'breadcrumbs_label' => Schema::TYPE_STRING . ' NOT NULL DEFAULT \'\'', 'view_id' => Schema::TYPE_INTEGER . ' NOT NULL DEFAULT 0'], $tableOptions);
     $prefiltered_pages_item = new BackendMenu();
     $prefiltered_pages_item->attributes = ['parent_id' => BackendMenu::find()->where(['name' => 'Shop'])->one()->id, 'name' => 'Prefiltered pages', 'route' => 'backend/prefiltered-pages/index', 'icon' => 'filter', 'sort_order' => '7', 'added_by_ext' => 'core', 'rbac_check' => 'shop manage', 'css_class' => '', 'translation_category' => 'app'];
     $prefiltered_pages_item->save();
 }
 public function up()
 {
     $ordersMenuItem = \app\backend\models\BackendMenu::find()->where(['name' => 'Orders', 'route' => 'shop/backend-order/index'])->orderBy(['parent_id' => SORT_ASC])->one();
     if (null !== $ordersMenuItem) {
         $ordersMenuItem->route = '';
         $ordersMenuItem->save();
     }
 }
Ejemplo n.º 3
0
 public function actionRemoveAll($parent_id)
 {
     $items = Yii::$app->request->post('items', []);
     if (!empty($items)) {
         $items = BackendMenu::find()->where(['in', 'id', $items])->all();
         foreach ($items as $item) {
             $item->delete();
         }
     }
     return $this->redirect(['index', 'parent_id' => $parent_id]);
 }
Ejemplo n.º 4
0
 public function up()
 {
     $mb = BackendMenu::find()->where(['name' => 'Settings', 'parent_id' => 1])->one();
     $this->insert(BackendMenu::tableName(), ['parent_id' => $mb->id, 'name' => 'YML', 'route' => 'backend/yml/settings', 'icon' => 'code', 'added_by_ext' => 'core', 'rbac_check' => 'content manage', 'translation_category' => 'app']);
 }
 public function up()
 {
     $currencies_page_item = new BackendMenu();
     $currencies_page_item->attributes = ['parent_id' => BackendMenu::find()->where(['name' => 'Shop'])->one()->id, 'name' => 'Currencies', 'route' => 'backend/currencies/index', 'icon' => 'dollar', 'sort_order' => '8', 'added_by_ext' => 'core', 'rbac_check' => 'shop manage', 'css_class' => '', 'translation_category' => 'app'];
     $currencies_page_item->save();
 }