',
+ ]
+],
+3. Добавляем в файл конфигурации:
+'request' => [
+ 'class' => 'artweb\artbox\language\components\LanguageRequest'
+],
+4. Добавляем в файл конфигурации:
+'language'=>'ru-RU',
+'i18n' => [
+ 'translations' => [
+ '*' => [
+ 'class' => 'yii\i18n\PhpMessageSource',
+ 'basePath' => '@frontend/messages',
+ 'sourceLanguage' => 'en',
+ 'fileMap' => [
+ ],
+ ],
+ ],
+],
+5. Переводы писать в файл frontend\messages\{language}\app.php, где {language} - нужный язык, например ru.
+6. Для вывода на странице сообщения с переводом используем функцию: Yii::t('app', {message}, $params = [], $language = null),
+ где {message} - нужное сообщение, $params - массив параметров, $language - нужный язык (по умолчанию используется текущий язык).
+7. В наличие также виджет переключения языка: LanguagePicker::widget()
+
+
+Как использовать мультиязычность для Active Record:
+1. Создаем для таблицы {table} таблицу с языками {table_lang}.
+2. Создаем для класса {Table} класс с языками {TableLang}.
+3. Подключаеи для класса {Table} поведение LanguageBehavior:
+public function behaviors() {
+ return [
+ 'language' => [
+ 'class' => LanguageBehavior::className(),
+ 'objectLang' => {TableLang}::className() // optional, default to {TableLang}::className()
+ 'ownerKey' => {Table}->id //optional, default to {Table}->primaryKey()[0]
+ 'langKey' => {TableLang}->table_id //optional, default to {Table}->tableName().'_id'
+ ],
+ ];
+}
+3.1. PHPDoc для {Table}:
+ * * From language behavior *
+ * @property {TableLang} $lang
+ * @property {TableLang}[] $langs
+ * @property {TableLang} $objectLang
+ * @property string $ownerKey
+ * @property string $langKey
+ * @property {TableLang}[] $modelLangs
+ * @property bool $transactionStatus
+ * @method string getOwnerKey()
+ * @method void setOwnerKey(string $value)
+ * @method string getLangKey()
+ * @method void setLangKey(string $value)
+ * @method ActiveQuery getLangs()
+ * @method ActiveQuery getLang( integer $language_id )
+ * @method {TableLang}[] generateLangs()
+ * @method void loadLangs(Request $request)
+ * @method bool linkLangs()
+ * @method bool saveLangs()
+ * @method bool getTransactionStatus()
+ * @method bool loadWithLangs( Request $request )
+ * @method bool saveWithLangs()
+ * * End language behavior *
+ * @see LanguageBehavior
+3.2. Убрать language behavior с наследуемых таблиц от {Table} ({TableSearch}...)
+4. Доступные полезные методы:
+ {Table}->getLangs() - получить все текущие {TableLang} для {Table} проиндексированные по language_id
+ {Table}->getLang($language_id = NULL) - получить {TableLang} для определенного языка (default: текущий язык) для {Table}
+ {Table}->generateLangs() - получить массив {TableLang} под каждый язык, включая существующие записи, для {Table}
+ {Table}->loadLangs($request) - заполнить массив {TableLang} данными с POST
+ {Table}->linkLangs() - связать каждый элемент массива {TableLang} с текущей {Table}
+ {Table}->saveLangs() - провалидировать и сохранить каждый элемент массива {TableLang}
+5. Добавить поля в форму (к примеру через Bootstrap Tabs).
+ В наличии:
+ LanguageForm::widget([
+ 'modelLangs' => {TableLang}[],
+ 'formView' => string,
+ 'form' => ActiveForm,
+ ]);
+6. Обрабатывать данные в контроллере.
+ 1. После создания/поиска {Table} создаем/находим языковые модели {Table}->generateLangs()
+ 2. При POST запросе загружаем данные в языковые модели {Table}->loadWithLangs(Request $request)
+ 3. Для сохранения используем метод {Table}->saveWithLangs(). Он вернет true если сохранение модели и всех языковых моделей прошло успешно.
+7. Получать данные на публичной части сайта через {Table}->lang.
diff --git a/artweb/artbox-core/messages/en/core.php b/artweb/artbox-core/messages/en/core.php
new file mode 100755
index 0000000..f6cb348
--- /dev/null
+++ b/artweb/artbox-core/messages/en/core.php
@@ -0,0 +1,3 @@
+ 'Мой вебсайт',
+ 'Main' => 'Главная',
+ 'Static pages' => 'Статические страницы',
+ 'SEO' => 'SEO',
+ 'Seo pages' => 'Seo страницы',
+ 'Robots' => 'Роботы',
+ 'Codes' => 'Коды',
+ 'Sitemap' => 'Карта сайта',
+ 'Welcome,' => 'Добро пожаловать,',
+ 'Change name' => 'Изменить имя',
+ 'Change image' => 'Изменить изображение',
+ 'Google Analytics Key' => 'Ключ Google аналитики',
+ 'Google analytics code' => 'Код Google аналитики',
+ 'Yandex metrics code' => 'Код Яндекс метрики',
+ 'Tag Manager code' => 'Код Tag Manager',
+ 'Phone' => 'Телефон',
+ 'Additional phone' => 'Дополнительный телефон',
+ 'Skype' => 'Skype',
+ 'Company name' => 'Название компании',
+ 'Email' => 'Email',
+ 'House' => 'Дом',
+ 'Street' => 'Улица',
+ 'Office' => 'Офис',
+ 'City' => 'Город',
+ 'Country' => 'Страна',
+ 'Latitude' => 'Широта',
+ 'Longitude' => 'Долгота',
+ 'Facebook' => 'Facebook',
+ 'VK' => 'VK',
+ 'Google' => 'Google',
+ 'Twitter' => 'Твиттер',
+ 'Company logo' => 'Логотип компании',
+ 'About us' => 'О нас',
+ 'Odnoklassniki' => 'Одноклассники',
+ 'ID' => 'ID',
+ 'Model' => 'Модель',
+ 'Status' => 'Статус',
+ 'Priority' => 'Приоритет',
+ 'Frequency' => 'Частота',
+ 'Url' => 'Url',
+ 'Contact phone for website' => 'Контактный телефон для сайта',
+ 'Contact email for website' => 'Контактный email для сайта',
+ 'Save' => 'Сохранить',
+ 'Social' => 'Соц. сети',
+ 'Contact' => 'Контактная информация',
+ 'Feedbacks' => 'Обратная связь',
+ 'Create Feedback' => 'Написать отзыв',
+ 'Pages' => 'Страницы',
+ 'Settings saved' => 'Настройки сохранены',
+ 'Robots saved' => 'Роботы сохранены',
+ 'Codes saved successfully' => 'Коды успешно сохранены',
+ 'Update sitemap' => 'Обновить карту сайта',
+ 'Dynamic pages' => 'Динамические страницы',
+ 'Save and generate' => 'Сохранить и сгенерировать',
+ 'Add field' => 'Добавить поле',
+ 'Title' => 'Заголовок',
+ 'Aliases' => "Псевдонимы",
+ 'Create {item}' => 'Создать {item}',
+ 'Value' => 'Значение',
+ 'Route' => 'Путь',
+ 'Search' => 'Поиск',
+ 'View generated sitemap.xml' => 'Посмотреть сгенерированный sitemap.xml',
+ 'Generate' => 'Сгенерировать',
+ 'Edit' => 'Редактировать',
+ 'Use in menu' => 'Отображение в меню',
+ 'Sort' => 'Сортировка',
+ "Doesn't look like robots" => 'Не похоже на робота',
+ 'Meta robots' => 'Meta роботы',
+ 'H1' => 'H1',
+ 'Description' => 'Описание',
+ 'Seo text' => 'Seo текст',
+ 'Entity' => 'Entity',
+ 'Available fields' => 'Доступные поля',
+ 'Language' => 'Язык',
+ 'Old password' => 'Старый пароль',
+ 'New password' => 'Новый пароль',
+ 'New password repeat' => 'Повторите новый пароль',
+ 'Provided old password doesn\'t match real password.' => 'При условии, что старый пароль не соответствует нынешнему.',
+ 'id' => 'ID',
+ 'name' => 'Имя',
+ 'phone' => 'Телефон',
+ 'created_at' => 'Создано',
+ 'ip' => 'IP',
+ 'url' => 'Url',
+ 'status' => 'Статус',
+ 'message' => 'Сообщение',
+ 'email' => 'Email',
+ 'Language ID' => 'ID языка',
+ 'Local' => 'Локально',
+ 'Name' => 'Имя',
+ 'Default' => 'По-умолчанию',
+ 'Date Create' => 'Дата создания',
+ 'Date Update' => 'Дата обновления',
+ 'The combination of Page ID and Language ID has already been taken.' => 'Комбинация из ID страницы и ID языка уже имеется.',
+ 'page_id' => 'ID страницы',
+ 'language_id' => 'ID языка',
+ 'Body' => 'Тело',
+ 'Alias' => 'псевдоним',
+ 'Mr.' => 'Г-н.',
+ 'Anonymous' => 'Аноним',
+ 'User ID' => 'ID пользователя',
+ 'Surname' => 'Фамилия',
+ 'Image' => 'Изображение',
+ 'Created At' => 'Создано',
+ 'Updated At' => 'Обновлено',
+ 'Visited At' => 'Последнее посещение',
+ 'Page' => 'страницу',
+ 'page_title' => 'Заголовок',
+ 'page_in_menu' => 'Отображение в меню',
+ 'page_sort' => 'Сортировка',
+ 'Create slug from {field} field' => 'Сгенерировать псевдоним из поля "{field}"',
+ 'Slugify' => 'Сгенерировать',
+ 'Create' => 'Создать',
+ 'Creating aliases by hand may cause bugs for your website. Use it only if you know what are you doing!' => 'Собственноручное создание псевдонимов может отразиться на работе вашего сайта. Используйте это, если вы действительно понимаете что делаете!',
+ 'Notification' => 'Оповещение',
+ 'Alias Value' => 'Значение псевдонима',
+ 'Update Category' => 'Обновить категорию',
+ 'Brand Title' => 'Заголовок бренда',
+ 'Upload Document' => 'Загрузить документ',
+ 'Send' => 'Отправить',
+ 'Common' => 'Общее',
+ 'Options' => 'Опции',
+ 'Gallery' => 'Галерея',
+ 'Add' => 'Добавить',
+ 'Product option group complementary' => 'Дополнительные группы опций товара',
+ 'Is Filter' => 'Является фильтром',
+ 'Search for a categories ...' => 'Поиск категорий ..',
+ 'Product option group exclude' => 'Исключения группы опций товара',
+ 'Variant option group exclude' => 'Исключения группы варианта товара',
+ 'Option Groups' => 'Группы опций',
+ 'Image Id' => 'ID изображения',
+ 'Body Preview' => 'Предпросмотр',
+ 'Author ID' => 'ID автора',
+ 'Parent ID' => 'Родительский ID',
+ 'Count' => 'Количество',
+
+ ];
\ No newline at end of file
diff --git a/artweb/artbox-core/migrations/m170309_000000_user.php b/artweb/artbox-core/migrations/m170309_000000_user.php
new file mode 100755
index 0000000..6da9d2b
--- /dev/null
+++ b/artweb/artbox-core/migrations/m170309_000000_user.php
@@ -0,0 +1,48 @@
+db->driverName === 'mysql') {
+ // http://stackoverflow.com/questions/766809/whats-the-difference-between-utf8-general-ci-and-utf8-unicode-ci
+ $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB';
+ }
+
+ $this->createTable(
+ 'user',
+ [
+ 'id' => $this->primaryKey(),
+ 'username' => $this->string()
+ ->notNull()
+ ->unique(),
+ 'auth_key' => $this->string(32)
+ ->notNull(),
+ 'password_hash' => $this->string()
+ ->notNull(),
+ 'password_reset_token' => $this->string()
+ ->unique(),
+ 'email' => $this->string()
+ ->notNull()
+ ->unique(),
+
+ 'status' => $this->smallInteger()
+ ->notNull()
+ ->defaultValue(10),
+ 'created_at' => $this->integer()
+ ->notNull(),
+ 'updated_at' => $this->integer()
+ ->notNull(),
+ ],
+ $tableOptions
+ );
+ }
+
+ public function safeDown()
+ {
+ $this->dropTable('user');
+ }
+ }
diff --git a/artweb/artbox-core/migrations/m170309_000001_feedback.php b/artweb/artbox-core/migrations/m170309_000001_feedback.php
new file mode 100755
index 0000000..c99d9ec
--- /dev/null
+++ b/artweb/artbox-core/migrations/m170309_000001_feedback.php
@@ -0,0 +1,31 @@
+createTable(
+ 'feedback',
+ [
+ 'id' => $this->primaryKey(),
+ 'name' => $this->string(255),
+ 'email' => $this->string(255),
+ 'phone' => $this->string(255),
+ 'message' => $this->text(),
+ 'created_at' => $this->integer(32),
+ 'ip' => $this->string(255),
+ 'url' => $this->string(255),
+ 'status' => $this->boolean()
+ ->notNull()
+ ->defaultValue(false),
+ ]
+ );
+ }
+
+ public function safeDown()
+ {
+ $this->dropTable('feedback');
+ }
+ }
diff --git a/artweb/artbox-core/migrations/m170309_000002_language.php b/artweb/artbox-core/migrations/m170309_000002_language.php
new file mode 100755
index 0000000..d66a9cc
--- /dev/null
+++ b/artweb/artbox-core/migrations/m170309_000002_language.php
@@ -0,0 +1,79 @@
+createTable(
+ 'language',
+ [
+ 'id' => $this->primaryKey(),
+ 'url' => $this->string(255)
+ ->notNull(),
+ 'local' => $this->string(255)
+ ->notNull(),
+ 'name' => $this->string(255)
+ ->notNull(),
+ 'default' => $this->boolean()
+ ->notNull()
+ ->defaultValue(false),
+ 'created_at' => $this->integer(32)
+ ->notNull(),
+ 'updated_at' => $this->integer(32)
+ ->notNull(),
+ 'status' => $this->boolean()
+ ->notNull()
+ ->defaultValue(false),
+ ]
+ );
+
+ $this->batchInsert(
+ 'language',
+ [
+ 'url',
+ 'local',
+ 'name',
+ 'default',
+ 'created_at',
+ 'updated_at',
+ 'status',
+ ],
+ [
+ [
+ 'en',
+ 'en-EN',
+ 'English',
+ true,
+ 0,
+ 0,
+ true,
+ ],
+ [
+ 'ru',
+ 'ru-RU',
+ 'Русский',
+ false,
+ 0,
+ 0,
+ true,
+ ],
+ [
+ 'ua',
+ 'ua-UA',
+ 'Українська',
+ false,
+ 0,
+ 0,
+ false,
+ ],
+ ]
+ );
+ }
+
+ public function safeDown()
+ {
+ $this->dropTable('language');
+ }
+ }
diff --git a/artweb/artbox-core/migrations/m170309_000003_alias.php b/artweb/artbox-core/migrations/m170309_000003_alias.php
new file mode 100755
index 0000000..484501e
--- /dev/null
+++ b/artweb/artbox-core/migrations/m170309_000003_alias.php
@@ -0,0 +1,22 @@
+createTable(
+ 'alias',
+ [
+ 'id'=> $this->primaryKey(),
+ 'value'=> $this->string()->notNull(),
+ ]
+ );
+ }
+
+ public function safeDown()
+ {
+ $this->dropTable('alias');
+ }
+}
diff --git a/artweb/artbox-core/migrations/m170309_000004_page.php b/artweb/artbox-core/migrations/m170309_000004_page.php
new file mode 100755
index 0000000..98b8def
--- /dev/null
+++ b/artweb/artbox-core/migrations/m170309_000004_page.php
@@ -0,0 +1,22 @@
+createTable(
+ 'page',
+ [
+ 'id'=> $this->primaryKey(),
+ 'in_menu'=> $this->boolean()->notNull()->defaultValue(false),
+ ]
+ );
+ }
+
+ public function safeDown()
+ {
+ $this->dropTable('page');
+ }
+}
diff --git a/artweb/artbox-core/migrations/m170309_000005_page_lang.php b/artweb/artbox-core/migrations/m170309_000005_page_lang.php
new file mode 100755
index 0000000..3d98134
--- /dev/null
+++ b/artweb/artbox-core/migrations/m170309_000005_page_lang.php
@@ -0,0 +1,32 @@
+createTable(
+ 'page_lang',
+ [
+ 'page_id'=> $this->integer(32)->notNull(),
+ 'language_id'=> $this->integer(32)->notNull(),
+ 'title'=> $this->string(255)->notNull(),
+ 'body'=> $this->text()->notNull(),
+ 'meta_title'=> $this->string(255)->null()->defaultValue(null),
+ 'meta_description'=> $this->string(255)->null()->defaultValue(null),
+ 'seo_text'=> $this->text()->null()->defaultValue(null),
+ 'h1'=> $this->string(255)->null()->defaultValue(null),
+ 'alias_id'=> $this->integer()->notNull(),
+ 'PRIMARY KEY(page_id, language_id)',
+ ]
+ );
+ $this->createIndex('page_lang_alias_id','page_lang','alias_id',true);
+ }
+
+ public function safeDown()
+ {
+ $this->dropIndex('page_lang_alias_id', 'page_lang');
+ $this->dropTable('page_lang');
+ }
+}
diff --git a/artweb/artbox-core/migrations/m170309_000006_relations.php b/artweb/artbox-core/migrations/m170309_000006_relations.php
new file mode 100755
index 0000000..789c38b
--- /dev/null
+++ b/artweb/artbox-core/migrations/m170309_000006_relations.php
@@ -0,0 +1,44 @@
+addForeignKey(
+ 'fk_page_lang_alias_id',
+ 'page_lang',
+ 'alias_id',
+ 'alias',
+ 'id',
+ 'RESTRICT',
+ 'CASCADE'
+ );
+ $this->addForeignKey(
+ 'fk_page_lang_language_id',
+ 'page_lang',
+ 'language_id',
+ 'language',
+ 'id',
+ 'CASCADE',
+ 'CASCADE'
+ );
+ $this->addForeignKey(
+ 'fk_page_lang_page_id',
+ 'page_lang',
+ 'page_id',
+ 'page',
+ 'id',
+ 'CASCADE',
+ 'CASCADE'
+ );
+ }
+
+ public function safeDown()
+ {
+ $this->dropForeignKey('fk_page_lang_alias_id', 'page_lang');
+ $this->dropForeignKey('fk_page_lang_language_id', 'page_lang');
+ $this->dropForeignKey('fk_page_lang_page_id', 'page_lang');
+ }
+ }
diff --git a/artweb/artbox-core/migrations/m170313_092544_create_user_data_table.php b/artweb/artbox-core/migrations/m170313_092544_create_user_data_table.php
new file mode 100755
index 0000000..2cba5e7
--- /dev/null
+++ b/artweb/artbox-core/migrations/m170313_092544_create_user_data_table.php
@@ -0,0 +1,38 @@
+createTable('user_data', [
+ 'user_id' => $this->integer()->notNull(),
+ 'name' => $this->string(),
+ 'surname' => $this->string(),
+ 'image' => $this->string(),
+ 'email' => $this->string(),
+ 'phone' => $this->string(),
+ 'created_at' => $this->integer(),
+ 'updated_at' => $this->integer(),
+ 'visited_at' => $this->integer(),
+ ]);
+
+ $this->addForeignKey('user_data_to_user', 'user_data', 'user_id', 'user', 'id', 'CASCADE', 'CASCADE');
+ $this->createIndex('user_id_uk', 'user_data', 'user_id', true);
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function safeDown()
+ {
+ $this->dropTable('user_data');
+ }
+}
diff --git a/artweb/artbox-core/migrations/m170316_103134_page_lang_drop_not_null.php b/artweb/artbox-core/migrations/m170316_103134_page_lang_drop_not_null.php
new file mode 100755
index 0000000..6e548f8
--- /dev/null
+++ b/artweb/artbox-core/migrations/m170316_103134_page_lang_drop_not_null.php
@@ -0,0 +1,48 @@
+dropForeignKey(
+ 'fk_page_lang_alias_id',
+ 'page_lang'
+ );
+ $this->execute("ALTER TABLE public.page_lang ALTER COLUMN alias_id DROP NOT NULL");
+ $this->addForeignKey(
+ 'fk_page_lang_alias_id',
+ 'page_lang',
+ 'alias_id',
+ 'alias',
+ 'id',
+ 'SET NULL',
+ 'CASCADE'
+ );
+ }
+
+ public function safeDown()
+ {
+ PageLang::deleteAll(
+ [
+ 'alias_id' => null,
+ ]
+ );
+ $this->dropForeignKey(
+ 'fk_page_lang_alias_id',
+ 'page_lang'
+ );
+ $this->addForeignKey(
+ 'fk_page_lang_alias_id',
+ 'page_lang',
+ 'alias_id',
+ 'alias',
+ 'id',
+ 'RESTRICT',
+ 'CASCADE'
+ );
+ $this->execute("ALTER TABLE public.page_lang ALTER COLUMN alias_id SET NOT NULL");
+ }
+ }
diff --git a/artweb/artbox-core/migrations/m170316_180155_alias_seo_fields.php b/artweb/artbox-core/migrations/m170316_180155_alias_seo_fields.php
new file mode 100755
index 0000000..5c0a152
--- /dev/null
+++ b/artweb/artbox-core/migrations/m170316_180155_alias_seo_fields.php
@@ -0,0 +1,26 @@
+addColumn('alias', 'route', $this->string());
+ $this->addColumn('alias', 'title', $this->string());
+ $this->addColumn('alias', 'description', $this->text());
+ $this->addColumn('alias', 'h1', $this->string());
+ $this->addColumn('alias', 'robots', $this->string());
+ $this->addColumn('alias', 'seo_text', $this->text());
+ }
+
+ public function safeDown()
+ {
+ $this->dropColumn('alias', 'route');
+ $this->dropColumn('alias', 'title');
+ $this->dropColumn('alias', 'description');
+ $this->dropColumn('alias', 'h1');
+ $this->dropColumn('alias', 'robots');
+ $this->dropColumn('alias', 'seo_text');
+ }
+ }
diff --git a/artweb/artbox-core/migrations/m170316_181841_page_lang_remove_seo_fields.php b/artweb/artbox-core/migrations/m170316_181841_page_lang_remove_seo_fields.php
new file mode 100755
index 0000000..ca6c527
--- /dev/null
+++ b/artweb/artbox-core/migrations/m170316_181841_page_lang_remove_seo_fields.php
@@ -0,0 +1,22 @@
+dropColumn('page_lang', 'meta_title');
+ $this->dropColumn('page_lang', 'meta_description');
+ $this->dropColumn('page_lang', 'seo_text');
+ $this->dropColumn('page_lang', 'h1');
+ }
+
+ public function safeDown()
+ {
+ $this->addColumn('page_lang', 'meta_title', $this->string());
+ $this->addColumn('page_lang', 'meta_description', $this->string());
+ $this->addColumn('page_lang', 'seo_text', $this->text());
+ $this->addColumn('page_lang', 'h1', $this->string());
+ }
+ }
diff --git a/artweb/artbox-core/migrations/m170317_104310_alias_add_entity_column.php b/artweb/artbox-core/migrations/m170317_104310_alias_add_entity_column.php
new file mode 100755
index 0000000..41d5b4e
--- /dev/null
+++ b/artweb/artbox-core/migrations/m170317_104310_alias_add_entity_column.php
@@ -0,0 +1,16 @@
+addColumn('alias', 'entity', $this->string());
+ }
+
+ public function safeDown()
+ {
+ $this->dropColumn('alias', 'entity');
+ }
+ }
diff --git a/artweb/artbox-core/migrations/m170317_155203_alias_add_fields_column.php b/artweb/artbox-core/migrations/m170317_155203_alias_add_fields_column.php
new file mode 100755
index 0000000..bd50765
--- /dev/null
+++ b/artweb/artbox-core/migrations/m170317_155203_alias_add_fields_column.php
@@ -0,0 +1,16 @@
+addColumn('alias', 'fields', $this->text());
+ }
+
+ public function safeDown()
+ {
+ $this->dropColumn('alias', 'fields');
+ }
+ }
\ No newline at end of file
diff --git a/artweb/artbox-core/migrations/m170317_155204_create_ImageManager_table.php b/artweb/artbox-core/migrations/m170317_155204_create_ImageManager_table.php
new file mode 100755
index 0000000..8c48de4
--- /dev/null
+++ b/artweb/artbox-core/migrations/m170317_155204_create_ImageManager_table.php
@@ -0,0 +1,37 @@
+createTable(
+ 'ImageManager',
+ [
+ 'id' => $this->primaryKey(),
+ 'fileName' => $this->string(128)
+ ->notNull(),
+ 'fileHash' => $this->string(32)
+ ->notNull(),
+ 'created' => $this->dateTime()
+ ->notNull(),
+ 'modified' => $this->dateTime(),
+ ]
+ );
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function safeDown()
+ {
+ $this->dropTable('ImageManager');
+ }
+ }
\ No newline at end of file
diff --git a/artweb/artbox-core/migrations/m170317_155205_addBlameableBehavior.php b/artweb/artbox-core/migrations/m170317_155205_addBlameableBehavior.php
new file mode 100755
index 0000000..9b2a050
--- /dev/null
+++ b/artweb/artbox-core/migrations/m170317_155205_addBlameableBehavior.php
@@ -0,0 +1,32 @@
+addColumn(
+ 'ImageManager',
+ 'createdBy',
+ $this->integer(10)
+ ->unsigned()
+ ->null()
+ ->defaultValue(null)
+ );
+ $this->addColumn(
+ 'ImageManager',
+ 'modifiedBy',
+ $this->integer(10)
+ ->unsigned()
+ ->null()
+ ->defaultValue(null)
+ );
+ }
+
+ public function safeDown()
+ {
+ $this->dropColumn('ImageManager', 'createdBy');
+ $this->dropColumn('ImageManager', 'modifiedBy');
+ }
+ }
diff --git a/artweb/artbox-core/migrations/m170327_134400_alias_add_language_column.php b/artweb/artbox-core/migrations/m170327_134400_alias_add_language_column.php
new file mode 100755
index 0000000..9ce40b6
--- /dev/null
+++ b/artweb/artbox-core/migrations/m170327_134400_alias_add_language_column.php
@@ -0,0 +1,18 @@
+addColumn('alias', 'language_id', $this->integer());
+ $this->addForeignKey('alias_to_language', 'alias', 'language_id', 'language', 'id', 'SET NULL', 'CASCADE');
+ }
+
+ public function safeDown()
+ {
+ $this->dropForeignKey('alias_to_language', 'alias');
+ $this->dropColumn('alias', 'language_id');
+ }
+ }
diff --git a/artweb/artbox-core/migrations/m170405_095957_page_add_column_sort.php b/artweb/artbox-core/migrations/m170405_095957_page_add_column_sort.php
new file mode 100755
index 0000000..0b83dc7
--- /dev/null
+++ b/artweb/artbox-core/migrations/m170405_095957_page_add_column_sort.php
@@ -0,0 +1,21 @@
+addColumn(
+ 'page',
+ 'sort',
+ $this->integer()
+ ->defaultValue(0)
+ );
+ }
+
+ public function safeDown()
+ {
+ $this->dropColumn('page', 'sort');
+ }
+ }
diff --git a/artweb/artbox-core/migrations/m170502_151419_insert_aliases.php b/artweb/artbox-core/migrations/m170502_151419_insert_aliases.php
new file mode 100755
index 0000000..86c4085
--- /dev/null
+++ b/artweb/artbox-core/migrations/m170502_151419_insert_aliases.php
@@ -0,0 +1,52 @@
+batchInsert(
+ 'alias',
+ [
+ 'value',
+ 'route',
+ 'title',
+ 'description',
+ 'h1',
+ 'language_id',
+ ],
+ [
+ [
+ 'home',
+ '{"0":"site/index"}',
+ 'Home page title',
+ 'Home page description',
+ 'Home page header',
+ 1,
+ ],
+ [
+ 'domashnyaya',
+ '{"0":"site/index"}',
+ 'Домашняя страница',
+ 'Описание домашней страницы',
+ 'Заголовок домашней страницы',
+ 2,
+ ],
+ [
+ 'domashnya',
+ '{"0":"site/index"}',
+ 'Домашня сторінка',
+ 'Опис домашньої сторінки',
+ 'Заголовок домашньої сторінки',
+ 3,
+ ],
+ ]
+ );
+ }
+
+ public function safeDown()
+ {
+
+ }
+ }
diff --git a/artweb/artbox-core/migrations/m170619_095632_create_ImageManagerLang_table.php b/artweb/artbox-core/migrations/m170619_095632_create_ImageManagerLang_table.php
new file mode 100755
index 0000000..ad8f21c
--- /dev/null
+++ b/artweb/artbox-core/migrations/m170619_095632_create_ImageManagerLang_table.php
@@ -0,0 +1,64 @@
+createTable(
+ 'ImageManagerLang',
+ [
+ 'image_id' => $this->integer(),
+ 'language_id' => $this->integer(),
+ 'title' => $this->string(),
+ 'alt' => $this->string(),
+ 'description' => $this->string(),
+ ]
+ );
+
+ $this->addForeignKey(
+ 'image_fk',
+ 'ImageManagerLang',
+ 'image_id',
+ 'ImageManager',
+ 'id',
+ 'CASCADE',
+ 'CASCADE'
+ );
+
+ $this->addForeignKey(
+ 'language_fk',
+ 'ImageManagerLang',
+ 'language_id',
+ 'language',
+ 'id',
+ 'CASCADE',
+ 'CASCADE'
+ );
+
+ $this->createIndex(
+ 'img_lang_uk',
+ 'ImageManagerLang',
+ [
+ 'language_id',
+ 'image_id',
+ ],
+ true
+ );
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function down()
+ {
+ $this->dropTable('ImageManagerLang');
+ }
+ }
diff --git a/artweb/artbox-core/migrations/m170717_142042_add_gallery_column_to_page_table.php b/artweb/artbox-core/migrations/m170717_142042_add_gallery_column_to_page_table.php
new file mode 100644
index 0000000..cd28dc4
--- /dev/null
+++ b/artweb/artbox-core/migrations/m170717_142042_add_gallery_column_to_page_table.php
@@ -0,0 +1,25 @@
+addColumn('page', 'gallery', $this->string());
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function down()
+ {
+ $this->dropColumn('page', 'gallery');
+ }
+}
diff --git a/artweb/artbox-core/migrations/m170718_134346_create_page_category_table.php b/artweb/artbox-core/migrations/m170718_134346_create_page_category_table.php
new file mode 100644
index 0000000..51ffe0a
--- /dev/null
+++ b/artweb/artbox-core/migrations/m170718_134346_create_page_category_table.php
@@ -0,0 +1,32 @@
+createTable(
+ 'page_category',
+ [
+ 'id' => $this->primaryKey(),
+ 'sort' => $this->integer(),
+ 'status' => $this->boolean(),
+ ]
+ );
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function down()
+ {
+ $this->dropTable('page_category');
+ }
+ }
diff --git a/artweb/artbox-core/migrations/m170718_134355_create_page_category_lang_table.php b/artweb/artbox-core/migrations/m170718_134355_create_page_category_lang_table.php
new file mode 100644
index 0000000..74c669a
--- /dev/null
+++ b/artweb/artbox-core/migrations/m170718_134355_create_page_category_lang_table.php
@@ -0,0 +1,77 @@
+createTable(
+ 'page_category_lang',
+ [
+ 'title' => $this->string(),
+ 'language_id' => $this->integer(),
+ 'page_category_id' => $this->integer(),
+ ]
+ );
+
+ $this->addForeignKey(
+ 'lang_fk',
+ 'page_category_lang',
+ 'language_id',
+ 'language',
+ 'id',
+ 'CASCADE',
+ 'CASCADE'
+ );
+
+ $this->addForeignKey(
+ 'category_fk',
+ 'page_category_lang',
+ 'page_category_id',
+ 'page_category',
+ 'id',
+ 'CASCADE',
+ 'CASCADE'
+ );
+
+ $this->createIndex(
+ 'pcat_lang_uk',
+ 'page_category_lang',
+ [
+ 'language_id',
+ 'page_category_id',
+ ],
+ true
+ );
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function down()
+ {
+ $this->dropIndex(
+ 'pcat_lang_uk',
+ 'page_category_lang'
+ );
+
+ $this->dropForeignKey(
+ 'category_fk',
+ 'page_category_lang'
+ );
+
+ $this->dropForeignKey(
+ 'lang_fk',
+ 'page_category_lang'
+ );
+
+ $this->dropTable('page_category_lang');
+ }
+ }
diff --git a/artweb/artbox-core/migrations/m170718_155356_create_page_to_category_table.php b/artweb/artbox-core/migrations/m170718_155356_create_page_to_category_table.php
new file mode 100644
index 0000000..1d2c13f
--- /dev/null
+++ b/artweb/artbox-core/migrations/m170718_155356_create_page_to_category_table.php
@@ -0,0 +1,64 @@
+createTable(
+ 'page_to_category',
+ [
+ 'page_id' => $this->integer(),
+ 'category_id' => $this->integer(),
+ ]
+ );
+
+ $this->addForeignKey('page_fk', 'page_to_category', 'page_id', 'page', 'id', 'CASCADE', 'CASCADE');
+
+ $this->addForeignKey(
+ 'cat_fk',
+ 'page_to_category',
+ 'category_id',
+ 'page_category',
+ 'id',
+ 'CASCADE',
+ 'CASCADE'
+ );
+
+ $this->createIndex(
+ 'page_cat_uk',
+ 'page_to_category',
+ [
+ 'page_id',
+ 'category_id',
+ ],
+ true
+ );
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function down()
+ {
+ $this->dropIndex(
+ 'page_cat_uk',
+ 'page_to_category'
+ );
+
+ $this->dropForeignKey(
+ 'cat_fk',
+ 'page_to_category'
+ );
+ $this->dropForeignKey('page_fk', 'page_to_category');
+
+ $this->dropTable('page_to_category');
+ }
+ }
diff --git a/artweb/artbox-core/models/Alias.php b/artweb/artbox-core/models/Alias.php
new file mode 100755
index 0000000..0811bf0
--- /dev/null
+++ b/artweb/artbox-core/models/Alias.php
@@ -0,0 +1,283 @@
+ 255,
+ ],
+ [
+ [
+ 'description',
+ 'seo_text',
+ ],
+ 'string',
+ ],
+ [
+ [ 'value' ],
+ 'filter',
+ 'filter' => function ($value) {
+ return SlugHelper::slugify($value);
+ },
+ ],
+ [
+ [ 'robots' ],
+ 'match',
+ 'pattern' => '~^(no)?index\s?\,\s?(no)?follow$~',
+ 'message' => Yii::t('core', "Doesn't look like robots"),
+ ],
+ [
+ [ 'robots' ],
+ 'match',
+ 'pattern' => '~^(no)?index\s?\,\s?(no)?follow$~',
+ 'message' => Yii::t('core', "Doesn't look like robots"),
+ ],
+ [
+ [ 'language_id' ],
+ 'integer',
+ ],
+ [
+ [ 'language_id' ],
+ 'exist',
+ 'targetClass' => Language::className(),
+ 'targetAttribute' => 'id',
+ ],
+ // [
+ // [ 'route' ],
+ // 'match',
+ // 'pattern' => '/^{[\'"]0[\'"]:["\'][\w-\/]+["\'][,\w\s\'":]*}$/',
+ // ],
+ [
+ [
+ 'route',
+ 'language_id',
+ ],
+ 'unique',
+ 'targetAttribute' => [
+ 'route',
+ 'language_id',
+ ],
+ ],
+ ];
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function attributeLabels()
+ {
+ return [
+ 'id' => Yii::t('core', 'ID'),
+ 'value' => Yii::t('core', 'Value'),
+ 'route' => Yii::t('core', 'Route'),
+ 'title' => Yii::t('core', 'Title'),
+ 'robots' => Yii::t('core', 'Meta robots'),
+ 'h1' => Yii::t('core', 'H1'),
+ 'description' => Yii::t('core', 'Description'),
+ 'seo_text' => Yii::t('core', 'Seo text'),
+ 'entity' => Yii::t('core', 'Entity'),
+ 'fields' => Yii::t('core', 'Available fields'),
+ 'language_id' => Yii::t('core', 'Language'),
+ ];
+ }
+
+ /**
+ * Check $fields property availability in $entity class and return only validated fields.
+ *
+ * @return array
+ */
+ public function getCheckedFields()
+ {
+ /**
+ * @var ActiveRecord $model
+ */
+
+ $model = \Yii::createObject($this->entity);
+ $fields = Json::decode($this->fields);
+
+ $checked = [];
+ if ($fields !== null) {
+ foreach ($fields as $field => $fieldTitle) {
+ $currentField = explode('.', $field);
+ $result = $model;
+ foreach ($currentField as $index => $item) {
+ if (($index + 1) < count($currentField)) {
+ $result = $result->getRelation($item, false);
+ if (empty($result)) {
+ break;
+ } else {
+ $result = \Yii::createObject($result->modelClass);
+ }
+ } else {
+ if ($result->canGetProperty($item)) {
+ $checked[$field] = $fieldTitle;
+ }
+ }
+ }
+ }
+ }
+ return $checked;
+ }
+
+ /**
+ * Find one alias model by url
+ *
+ * @param string $url
+ * @param \artbox\core\models\Language $language
+ *
+ * @return array|\artbox\core\models\Alias|null
+ */
+ public static function findUrl(string $url, Language $language)
+ {
+ return self::find()
+ ->where([ 'value' => ltrim($url, '/') ])
+ ->andWhere([ 'language_id' => $language->id ])
+ ->andWhere([
+ '!=',
+ 'value', 'home'
+ ])
+ ->one();
+ }
+
+ /**
+ * @param array $route
+ * @param \artbox\core\models\Language $language
+ *
+ * @return array|\artbox\core\models\Alias|null
+ */
+ public static function findRoute(array $route, Language $language)
+ {
+ try {
+ $encodedRoute = Json::encode(
+ $route,
+ JSON_FORCE_OBJECT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE
+ );
+ } catch (InvalidParamException $exception) {
+ return null;
+ }
+ $query = self::find()
+ ->where(
+ [
+ 'route' => $encodedRoute,
+ ]
+ );
+ $query->andWhere([ 'language_id' => $language->id ]);
+ return $query->one();
+ }
+
+ public function getTitle(): string
+ {
+ return strval($this->title);
+ }
+
+ public function getDesc(): string
+ {
+ return strval($this->description);
+ }
+
+ public function getH1(): string
+ {
+ return strval($this->h1);
+ }
+
+ public function getText(): string
+ {
+ return strval($this->seo_text);
+ }
+
+ public function getRobots(): string
+ {
+ return strval($this->robots);
+ }
+ public function getFields(): string
+ {
+ return strval($this->fields);
+ }
+ public function getSeoText(): string
+ {
+ return strval($this->seo_text);
+ }
+ public function getId()
+ {
+ return $this->id;
+ }
+ }
diff --git a/artweb/artbox-core/models/AliasSearch.php b/artweb/artbox-core/models/AliasSearch.php
new file mode 100755
index 0000000..34b75ed
--- /dev/null
+++ b/artweb/artbox-core/models/AliasSearch.php
@@ -0,0 +1,136 @@
+ $query,
+ ]
+ );
+
+ $this->load($params);
+
+ if (!$this->validate()) {
+ // uncomment the following line if you do not want to return any records when validation fails
+ // $query->where('0=1');
+ return $dataProvider;
+ }
+
+ // grid filtering conditions
+ $query->andFilterWhere(
+ [
+ 'entity' => $this->entity,
+ ]
+ );
+
+ $query->andFilterWhere(
+ [
+ 'ilike',
+ 'value',
+ $this->search,
+ ]
+ );
+
+ // If language_id == 0, search for records with null language
+ if ($this->language_id === '0') {
+ $query->andWhere(
+ [
+ 'language_id' => null,
+ ]
+ );
+ } else {
+ $query->andFilterWhere(
+ [
+ 'language_id' => $this->language_id,
+ ]
+ );
+ }
+
+ // If language_id == 0, search for records without entities
+ if ($this->static === '0') {
+ $query->andWhere(
+ [
+ 'entity' => null,
+ ]
+ );
+ } elseif ($this->static === '1') {
+ $query->andWhere(
+ [
+ 'not',
+ [
+ 'entity' => null,
+ ],
+ ]
+ );
+ }
+
+ return $dataProvider;
+ }
+ }
diff --git a/artweb/artbox-core/models/ChangePassword.php b/artweb/artbox-core/models/ChangePassword.php
new file mode 100755
index 0000000..848d806
--- /dev/null
+++ b/artweb/artbox-core/models/ChangePassword.php
@@ -0,0 +1,100 @@
+ \Yii::t('core', 'Old password'),
+ 'newPassword' => \Yii::t('core', 'New password'),
+ 'newPasswordRepeat' => \Yii::t('core', 'New password repeat'),
+ ];
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function rules()
+ {
+ return [
+ [
+ [
+ 'oldPassword',
+ 'newPassword',
+ 'newPasswordRepeat',
+ ],
+ 'required',
+ ],
+ [
+ [
+ 'oldPassword',
+ 'newPassword',
+ 'newPasswordRepeat',
+ ],
+ 'string',
+ 'length' => [
+ 6,
+ 255,
+ ],
+ ],
+ [
+ [ 'newPasswordRepeat' ],
+ 'compare',
+ 'compareAttribute' => 'newPassword',
+ ],
+ ];
+ }
+
+ /**
+ * Validate old password.
+ *
+ * @return bool True if password valid, otherwise false
+ */
+ public function validatePassword()
+ {
+ /**
+ * @var User $user
+ */
+ $user = \Yii::$app->user->identity;
+ $result = $user->validatePassword($this->oldPassword);
+ if (!$result) {
+ $this->addError('oldPassword', \Yii::t('core', 'Provided old password doesn\'t match real password.'));
+ }
+ return $result;
+ }
+
+ /**
+ * Save new password
+ *
+ * @return bool True if successfully saved
+ */
+ public function saveChanges()
+ {
+ /**
+ * @var User $user
+ */
+ $user = \Yii::$app->user->identity;
+ $user->setPassword($this->newPassword);
+ $user->generateAuthKey();
+ return $user->save();
+ }
+ }
\ No newline at end of file
diff --git a/artweb/artbox-core/models/DummyAlias.php b/artweb/artbox-core/models/DummyAlias.php
new file mode 100755
index 0000000..4697bb8
--- /dev/null
+++ b/artweb/artbox-core/models/DummyAlias.php
@@ -0,0 +1,58 @@
+title;
+ }
+
+ public function getDesc(): string
+ {
+ return $this->desc;
+ }
+
+ public function getH1(): string
+ {
+ return $this->h1;
+ }
+
+ public function getText(): string
+ {
+ return $this->text;
+ }
+
+ public function getRobots(): string
+ {
+ return $this->robots;
+ }
+ public function getFields(): string
+ {
+ return '';
+ }
+ public function getSeoText(): string
+ {
+ return $this->seoText;
+ }
+ public function getId()
+ {
+ return null;
+ }
+ }
\ No newline at end of file
diff --git a/artweb/artbox-core/models/Feedback.php b/artweb/artbox-core/models/Feedback.php
new file mode 100755
index 0000000..da30c09
--- /dev/null
+++ b/artweb/artbox-core/models/Feedback.php
@@ -0,0 +1,165 @@
+ [
+ 'name',
+ 'email',
+ 'message',
+ ],
+ self::SCENARIO_CALLBACK => [
+ 'name',
+ 'phone',
+ 'message',
+ ],
+ self::SCENARIO_CONTACT => [
+ 'name',
+ 'phone',
+ 'email',
+ 'message',
+ ],
+ ]
+ );
+ return $scenarios;
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function behaviors()
+ {
+ return [
+ [
+ 'class' => TimestampBehavior::className(),
+ 'updatedAtAttribute' => false,
+ ],
+ [
+ 'class' => AttributeBehavior::className(),
+ 'attributes' => [
+ ActiveRecord::EVENT_BEFORE_INSERT => 'ip',
+ ],
+ 'value' => function ($event) {
+ return \Yii::$app->request->userIP;
+ },
+ ],
+ [
+ 'class' => AttributeBehavior::className(),
+ 'attributes' => [
+ ActiveRecord::EVENT_BEFORE_INSERT => 'url',
+ ],
+ 'value' => function ($event) {
+ return \Yii::$app->request->referrer;
+ },
+ ],
+ ];
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function rules()
+ {
+ return [
+ [
+ [
+ 'phone',
+ 'name',
+ 'email',
+ ],
+ 'required',
+ ],
+ [
+ [ 'email' ],
+ 'email',
+ ],
+ // [
+ // [ 'phone' ],
+ // 'match',
+ // 'pattern' => '/^\+38\(\d{3}\)\d{3}-\d{2}-\d{2}$/',
+ // ],
+ [
+ [
+ 'name',
+ 'phone',
+ 'email',
+ ],
+ 'string',
+ 'max' => 255,
+ ],
+ [
+ [
+ 'message',
+ ],
+ 'string',
+ ],
+ [
+ [
+ 'status',
+ ],
+ 'boolean',
+ ],
+ ];
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function attributeLabels()
+ {
+ return [
+ 'id' => Yii::t('core', 'id'),
+ 'name' => Yii::t('core', 'name'),
+ 'phone' => Yii::t('core', 'phone'),
+ 'created_at' => Yii::t('core', 'created_at'),
+ 'ip' => Yii::t('core', 'ip'),
+ 'url' => Yii::t('core', 'url'),
+ 'status' => Yii::t('core', 'status'),
+ 'message' => Yii::t('core', 'message'),
+ 'email' => Yii::t('core', 'email'),
+ ];
+ }
+ }
diff --git a/artweb/artbox-core/models/FeedbackSearch.php b/artweb/artbox-core/models/FeedbackSearch.php
new file mode 100755
index 0000000..3330f19
--- /dev/null
+++ b/artweb/artbox-core/models/FeedbackSearch.php
@@ -0,0 +1,127 @@
+ $query,
+ ]
+ );
+
+ $this->load($params);
+
+ if (!$this->validate()) {
+ // uncomment the following line if you do not want to return any records when validation fails
+ // $query->where('0=1');
+ return $dataProvider;
+ }
+
+ // grid filtering conditions
+ $query->andFilterWhere(
+ [
+ 'id' => $this->id,
+ 'status' => $this->status,
+ ]
+ );
+
+ $query->andFilterWhere(
+ [
+ 'like',
+ 'name',
+ $this->name,
+ ]
+ )
+ ->andFilterWhere(
+ [
+ 'like',
+ 'phone',
+ $this->phone,
+ ]
+ )
+ ->andFilterWhere(
+ [
+ 'like',
+ 'ip',
+ $this->ip,
+ ]
+ )
+ ->andFilterWhere(
+ [
+ 'like',
+ 'url',
+ $this->url,
+ ]
+ )
+ ->andFilterWhere(
+ [
+ 'like',
+ 'email',
+ $this->email,
+ ]
+ )
+ ->andFilterWhere(
+ [
+ 'like',
+ 'message',
+ $this->message,
+ ]
+ );
+
+ return $dataProvider;
+ }
+ }
diff --git a/artweb/artbox-core/models/Image.php b/artweb/artbox-core/models/Image.php
new file mode 100755
index 0000000..867d82d
--- /dev/null
+++ b/artweb/artbox-core/models/Image.php
@@ -0,0 +1,111 @@
+ TimestampBehavior::className(),
+ 'createdAtAttribute' => 'created',
+ 'updatedAtAttribute' => 'modified',
+ 'value' => new Expression('NOW()'),
+ ],
+ ];
+ }
+
+ /**
+ * Path to stored image
+ *
+ * @return string
+ */
+ public function getPath(): string
+ {
+ /**
+ * @var ImageManagerGetPath $manager
+ */
+ $manager = \Yii::$app->get('imagemanager');
+
+ $path = $manager->mediaPath . '/' . $this->id . '_' . $this->fileHash . '.' . $this->extension;
+
+ if (file_exists($path)) {
+ return $path;
+ } else {
+ return \Yii::getAlias('@frontend/web/img/no-image.png');
+ }
+ }
+
+ /**
+ * Url to stored image
+ *
+ * @return string
+ */
+ public function getUrl(): string
+ {
+ return '/storage/' . $this->id . '_' . $this->fileHash . '.' . $this->extension;
+ }
+
+ /**
+ * Gets image tag
+ *
+ * @param array $options
+ *
+ * @return string
+ */
+ public function getImg(array $options = []): string
+ {
+ return Html::img($this->getUrl(), $options);
+ }
+
+ /**
+ * Gets file extension
+ *
+ * @return string
+ */
+ public function getExtension()
+ {
+ return pathinfo($this->fileName, PATHINFO_EXTENSION);
+ }
+
+ /**
+ * Multy language model with image's alt, title and description
+ *
+ * @return null|ActiveQuery
+ */
+ public function getLang()
+ {
+ return $this->hasOne(ImageLang::className(), [ 'image_id' => 'id' ])
+ ->inverseOf('image');
+ }
+ }
\ No newline at end of file
diff --git a/artweb/artbox-core/models/ImageLang.php b/artweb/artbox-core/models/ImageLang.php
new file mode 100755
index 0000000..54c72ce
--- /dev/null
+++ b/artweb/artbox-core/models/ImageLang.php
@@ -0,0 +1,21 @@
+hasOne(Image::className(), ['id' => 'image_id'])
+ ->inverseOf('lang');
+ }
+ }
\ No newline at end of file
diff --git a/artweb/artbox-core/models/Language.php b/artweb/artbox-core/models/Language.php
new file mode 100755
index 0000000..fb0b09a
--- /dev/null
+++ b/artweb/artbox-core/models/Language.php
@@ -0,0 +1,229 @@
+ [
+ 'class' => 'yii\behaviors\TimestampBehavior',
+ 'attributes' => [
+ ActiveRecord::EVENT_BEFORE_INSERT => [
+ 'created_at',
+ 'updated_at',
+ ],
+ ActiveRecord::EVENT_BEFORE_UPDATE => [
+ 'updated_at',
+ ],
+ ],
+ ],
+ ];
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function rules()
+ {
+ return [
+ [
+ [
+ 'url',
+ 'local',
+ 'name',
+ 'created_at',
+ 'updated_at',
+ ],
+ 'required',
+ ],
+ [
+ [ 'default' ],
+ 'boolean',
+ ],
+ [
+ [
+ 'created_at',
+ 'updated_at',
+ ],
+ 'integer',
+ ],
+ [
+ [
+ 'url',
+ 'local',
+ 'name',
+ ],
+ 'string',
+ 'max' => 255,
+ ],
+ ];
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function attributeLabels()
+ {
+ return [
+ 'id' => Yii::t('core', 'Language ID'),
+ 'url' => Yii::t('core', 'Url'),
+ 'local' => Yii::t('core', 'Local'),
+ 'name' => Yii::t('core', 'Name'),
+ 'default' => Yii::t('core', 'Default'),
+ 'created_at' => Yii::t('core', 'Date Create'),
+ 'updated_at' => Yii::t('core', 'Date Update'),
+ ];
+ }
+
+ /**
+ * Get current language
+ *
+ * @return null|Language
+ */
+ public static function getCurrent()
+ {
+ if (self::$current === null) {
+ self::$current = self::getDefaultLanguage();
+ }
+ return self::$current;
+ }
+
+ /**
+ * Set current language by Url param
+ *
+ * @param null|string $url Language url param
+ *
+ * @return bool
+ */
+ public static function setCurrent($url = null)
+ {
+ $language = self::getLanguageByUrl($url);
+ self::$current = ( $language === null ) ? self::getDefaultLanguage() : $language;
+ Yii::$app->language = self::getCurrent()->local;
+ if ($language === null) {
+ return false;
+ } else {
+ return true;
+ }
+ }
+
+ /**
+ * Get default language
+ *
+ * @return null|Language
+ */
+ public static function getDefaultLanguage()
+ {
+ if (\Yii::$app->request->hasMethod('getPreferredLanguage')) {
+ $preferred = \Yii::$app->request->getPreferredLanguage(
+ self::find()
+ ->select([ 'local' ])
+ ->where(
+ [
+ 'status' => true,
+ ]
+ )
+ ->asArray()
+ ->column()
+ );
+ }
+ if (!empty($preferred)) {
+ return self::getLanguageByUrl(strtolower(substr($preferred, -2, 2)));
+ } else {
+ /**
+ * @var null|Language $language
+ */
+ $language = self::find()
+ ->where([ 'default' => true ])
+ ->one();
+ return $language;
+ }
+ }
+
+ /**
+ * Get language by Url param
+ *
+ * @param null|string $url Language url param
+ *
+ * @return null|Language
+ */
+ public static function getLanguageByUrl($url = null)
+ {
+ if ($url === null) {
+ return null;
+ } else {
+ /**
+ * @var null|Language $language
+ */
+ $language = self::find()
+ ->where(
+ [
+ 'url' => $url,
+ 'status' => true,
+ ]
+ )
+ ->one();
+ if ($language === null) {
+ return null;
+ } else {
+ return $language;
+ }
+ }
+ }
+
+ /**
+ * Get active Languages and cache them
+ *
+ * @return array|\artbox\core\models\Language[]|null|\yii\db\ActiveRecord[]
+ */
+ public static function getActive()
+ {
+ if (empty(self::$active)) {
+ self::$active = self::find()
+ ->where([ 'status' => true ])
+ ->indexBy('id')
+ ->all();
+ }
+ return self::$active;
+ }
+ }
diff --git a/artweb/artbox-core/models/LoginForm.php b/artweb/artbox-core/models/LoginForm.php
new file mode 100755
index 0000000..f7b6e97
--- /dev/null
+++ b/artweb/artbox-core/models/LoginForm.php
@@ -0,0 +1,109 @@
+hasErrors()) {
+ $user = $this->getUser();
+ if (!$user || !$user->validatePassword($this->password)) {
+ $this->addError($attribute, 'Incorrect username or password.');
+ }
+ }
+ }
+
+ /**
+ * Logs in a user using the provided username and password.
+ *
+ * @return bool whether the user is logged in successfully
+ */
+ public function login()
+ {
+ if ($this->validate()) {
+ return Yii::$app->user->login($this->getUser(), $this->rememberMe ? 3600 * 24 * 30 : 0);
+ } else {
+ return false;
+ }
+ }
+
+ /**
+ * Finds user by [[username]]
+ *
+ * @return User|null
+ */
+ protected function getUser()
+ {
+ if ($this->_user === null) {
+ $this->_user = User::findByUsername($this->username);
+ }
+
+ return $this->_user;
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function attributeLabels()
+ {
+ return [
+ 'username' => Yii::t('app', 'Логин'),
+ 'password' => Yii::t('app', 'Пароль'),
+ 'rememberMe' => Yii::t('app', 'Запомнить'),
+ ];
+ }
+ }
diff --git a/artweb/artbox-core/models/Page.php b/artweb/artbox-core/models/Page.php
new file mode 100755
index 0000000..3f3e457
--- /dev/null
+++ b/artweb/artbox-core/models/Page.php
@@ -0,0 +1,124 @@
+ [
+ 'class' => LanguageBehavior::className(),
+ ],
+ 'gallery' => [
+ 'class' => GalleryBehavior::className(),
+ ],
+ 'manyToMany' => [
+ 'class' => ManyToManyBehavior::className(),
+ ],
+ ];
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function rules()
+ {
+ return [
+ [
+ [
+ 'in_menu',
+ ],
+ 'boolean',
+ ],
+ [
+ [
+ 'sort',
+ ],
+ 'integer',
+ 'min' => 0,
+ ],
+ ];
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function attributeLabels()
+ {
+ return [
+ 'id' => Yii::t('core', 'page_id'),
+ 'in_menu' => Yii::t('core', 'page_in_menu'),
+ 'sort' => Yii::t('core', 'page_sort'),
+ 'title' => Yii::t('core', 'page_title'),
+ ];
+ }
+
+ /**
+ * @return ActiveQuery
+ */
+ public function getCategories()
+ {
+ return $this->hasMany(PageCategory::className(), [ 'id' => 'category_id' ])
+ ->viaTable('page_to_category', [ 'page_id' => 'id' ]);
+ }
+ }
diff --git a/artweb/artbox-core/models/PageCategory.php b/artweb/artbox-core/models/PageCategory.php
new file mode 100644
index 0000000..b2b5fa0
--- /dev/null
+++ b/artweb/artbox-core/models/PageCategory.php
@@ -0,0 +1,119 @@
+ [
+ 'class' => LanguageBehavior::className(),
+ ],
+ ];
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function rules()
+ {
+ return [
+ [
+ [ 'sort' ],
+ 'integer',
+ ],
+ [
+ [ 'status' ],
+ 'boolean',
+ ],
+ ];
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function attributeLabels()
+ {
+ return [
+ 'id' => 'ID',
+ 'sort' => 'Sort',
+ 'status' => 'Status',
+ ];
+ }
+
+ /**
+ * @return \yii\db\ActiveQuery
+ */
+ public function getPageCategoryLangs()
+ {
+ return $this->hasMany(PageCategoryLang::className(), [ 'page_category_id' => 'id' ]);
+ }
+
+ /**
+ * @return \yii\db\ActiveQuery
+ */
+ public function getLanguages()
+ {
+ return $this->hasMany(Language::className(), [ 'id' => 'language_id' ])
+ ->viaTable('page_category_lang', [ 'page_category_id' => 'id' ]);
+ }
+
+ /**
+ * @return ActiveQuery
+ */
+ public function getPages()
+ {
+ return $this->hasMany(Page::className(), [ 'id' => 'page_id' ])
+ ->viaTable('page_to_category', [ 'category_id' => 'id' ]);
+ }
+ }
diff --git a/artweb/artbox-core/models/PageCategoryLang.php b/artweb/artbox-core/models/PageCategoryLang.php
new file mode 100644
index 0000000..7e04dd7
--- /dev/null
+++ b/artweb/artbox-core/models/PageCategoryLang.php
@@ -0,0 +1,100 @@
+ 255,
+ ],
+ [
+ [
+ 'language_id',
+ 'page_category_id',
+ ],
+ 'unique',
+ 'targetAttribute' => [
+ 'language_id',
+ 'page_category_id',
+ ],
+ 'message' => 'The combination of Language ID and Page Category ID has already been taken.',
+ ],
+ [
+ [ 'language_id' ],
+ 'exist',
+ 'skipOnError' => true,
+ 'targetClass' => Language::className(),
+ 'targetAttribute' => [ 'language_id' => 'id' ],
+ ],
+ [
+ [ 'page_category_id' ],
+ 'exist',
+ 'skipOnError' => true,
+ 'targetClass' => PageCategory::className(),
+ 'targetAttribute' => [ 'page_category_id' => 'id' ],
+ ],
+ ];
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function attributeLabels()
+ {
+ return [
+ 'title' => 'Title',
+ 'language_id' => 'Language ID',
+ 'page_category_id' => 'Page Category ID',
+ ];
+ }
+
+ /**
+ * @return \yii\db\ActiveQuery
+ */
+ public function getLanguage()
+ {
+ return $this->hasOne(Language::className(), [ 'id' => 'language_id' ]);
+ }
+
+ /**
+ * @return \yii\db\ActiveQuery
+ */
+ public function getPageCategory()
+ {
+ return $this->hasOne(PageCategory::className(), [ 'id' => 'page_category_id' ]);
+ }
+ }
diff --git a/artweb/artbox-core/models/PageCategorySearch.php b/artweb/artbox-core/models/PageCategorySearch.php
new file mode 100644
index 0000000..fbd56c4
--- /dev/null
+++ b/artweb/artbox-core/models/PageCategorySearch.php
@@ -0,0 +1,100 @@
+joinWith('lang');
+
+ // add conditions that should always apply here
+
+ $dataProvider = new ActiveDataProvider(
+ [
+ 'query' => $query,
+ ]
+ );
+
+ $this->load($params);
+
+ if (!$this->validate()) {
+ // uncomment the following line if you do not want to return any records when validation fails
+ // $query->where('0=1');
+ return $dataProvider;
+ }
+
+ // grid filtering conditions
+ $query->andFilterWhere(
+ [
+ 'id' => $this->id,
+ 'sort' => $this->sort,
+ 'status' => $this->status,
+ ]
+ );
+
+ $query->andFilterWhere(
+ [
+ 'ilike',
+ 'page_category_lang.title',
+ $this->title,
+ ]
+ );
+
+ return $dataProvider;
+ }
+ }
diff --git a/artweb/artbox-core/models/PageLang.php b/artweb/artbox-core/models/PageLang.php
new file mode 100755
index 0000000..0612001
--- /dev/null
+++ b/artweb/artbox-core/models/PageLang.php
@@ -0,0 +1,162 @@
+ [
+ 'class' => SlugBehavior::className(),
+ 'action' => 'page/view',
+ 'params' => [
+ 'id' => 'page_id',
+ ],
+ 'fields' => [
+ 'title' => 'Page title',
+ 'page.id' => 'Page id',
+ 'body' => 'Page body',
+ 'page.lang.title' => 'Page title 2',
+ ],
+ ],
+ ];
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function rules()
+ {
+ return [
+ [
+ [
+ 'title',
+ 'body',
+ ],
+ 'required',
+ ],
+ [
+ [
+ 'body',
+ 'aliasValue',
+ ],
+ 'string',
+ ],
+ [
+ [
+ 'title',
+ 'aliasValue',
+ ],
+ 'string',
+ 'max' => 255,
+ ],
+ [
+ [
+ 'page_id',
+ 'language_id',
+ ],
+ 'unique',
+ 'targetAttribute' => [
+ 'page_id',
+ 'language_id',
+ ],
+ 'message' => \Yii::t(
+ 'core',
+ 'The combination of Page ID and Language ID has already been taken.'
+ ),
+ ],
+ [
+ [ 'language_id' ],
+ 'exist',
+ 'skipOnError' => true,
+ 'targetClass' => Language::className(),
+ 'targetAttribute' => [ 'language_id' => 'id' ],
+ ],
+ [
+ [ 'page_id' ],
+ 'exist',
+ 'skipOnError' => true,
+ 'targetClass' => Page::className(),
+ 'targetAttribute' => [ 'page_id' => 'id' ],
+ ],
+ ];
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function attributeLabels()
+ {
+ return [
+ 'page_id' => Yii::t('core', 'page_id'),
+ 'language_id' => Yii::t('core', 'language_id'),
+ 'title' => Yii::t('core', 'Title'),
+ 'body' => Yii::t('core', 'Body'),
+ 'alias_id' => Yii::t('core', 'Alias'),
+ 'aliasValue' => Yii::t('core', 'Alias'),
+ ];
+ }
+
+ /**
+ * @return \yii\db\ActiveQuery
+ */
+ public function getLanguage()
+ {
+ return $this->hasOne(Language::className(), [ 'id' => 'language_id' ]);
+ }
+
+ /**
+ * @return \yii\db\ActiveQuery
+ */
+ public function getPage()
+ {
+ return $this->hasOne(Page::className(), [ 'id' => 'page_id' ]);
+ }
+
+ /**
+ * @return \yii\db\ActiveQuery
+ */
+ public function getAlias()
+ {
+ return $this->hasOne(Alias::className(), [ 'id' => 'alias_id' ]);
+ }
+ }
diff --git a/artweb/artbox-core/models/PageSearch.php b/artweb/artbox-core/models/PageSearch.php
new file mode 100755
index 0000000..9740bd6
--- /dev/null
+++ b/artweb/artbox-core/models/PageSearch.php
@@ -0,0 +1,106 @@
+joinWith('lang');
+
+ // add conditions that should always apply here
+
+ $dataProvider = new ActiveDataProvider(
+ [
+ 'query' => $query,
+ 'sort' => [
+ 'attributes' => [
+ 'title' => [
+ 'asc' => [ 'page_lang.title' => SORT_ASC ],
+ 'desc' => [ 'page_lang.title' => SORT_DESC ],
+ ],
+ 'id',
+ 'in_menu',
+ ],
+ ],
+ ]
+ );
+
+ $this->load($params);
+
+ if (!$this->validate()) {
+ // uncomment the following line if you do not want to return any records when validation fails
+ // $query->where('0=1');
+ return $dataProvider;
+ }
+
+ // grid filtering conditions
+ $query->andFilterWhere(
+ [
+ 'id' => $this->id,
+ 'in_menu' => $this->in_menu,
+ ]
+ )
+ ->andFilterWhere(
+ [
+ 'ilike',
+ 'page_lang.title',
+ $this->title,
+ ]
+ );
+
+ return $dataProvider;
+ }
+ }
diff --git a/artweb/artbox-core/models/SitemapDynamic.php b/artweb/artbox-core/models/SitemapDynamic.php
new file mode 100755
index 0000000..261565c
--- /dev/null
+++ b/artweb/artbox-core/models/SitemapDynamic.php
@@ -0,0 +1,121 @@
+get('sitemapdb');
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function attributes()
+ {
+ return [
+ 'id',
+ 'entity',
+ 'status',
+ 'priority',
+ 'frequency',
+ ];
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public static function primaryKey()
+ {
+ return [ 'id' ];
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function rules()
+ {
+ return [
+ [
+ [
+ 'entity',
+ 'status',
+ 'priority',
+ 'frequency',
+ ],
+ 'required',
+ ],
+ [
+ [
+ 'status',
+ ],
+ 'boolean',
+ ],
+ [
+ [
+ 'entity',
+ 'frequency',
+ ],
+ 'string',
+ ],
+ [
+ [
+ 'priority',
+ ],
+ 'double',
+ 'min' => 0,
+ 'max' => 1,
+ ],
+ ];
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function attributeLabels()
+ {
+ return [
+ 'id' => Yii::t('core', 'ID'),
+ 'entity' => Yii::t('core', 'Model'),
+ 'status' => Yii::t('core', 'Status'),
+ 'priority' => Yii::t('core', 'Priority'),
+ 'frequency' => Yii::t('core', 'Frequency'),
+ ];
+ }
+
+ /**
+ * Find maximum ID value from SitemapStatic models
+ */
+ public static function max(): int
+ {
+ $models = self::find()
+ ->all();
+ $array = ArrayHelper::getColumn($models, self::primaryKey()[ 0 ], false);
+ if (empty($array)) {
+ return 0;
+ } else {
+ return max($array);
+ }
+ }
+ }
\ No newline at end of file
diff --git a/artweb/artbox-core/models/SitemapStatic.php b/artweb/artbox-core/models/SitemapStatic.php
new file mode 100755
index 0000000..cd4faaa
--- /dev/null
+++ b/artweb/artbox-core/models/SitemapStatic.php
@@ -0,0 +1,106 @@
+get('sitemapdb');
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function attributes()
+ {
+ return [
+ 'id',
+ 'url',
+ 'priority',
+ 'frequency',
+ ];
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public static function primaryKey()
+ {
+ return [ 'id' ];
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function rules()
+ {
+ return [
+ [
+ [
+ 'url',
+ 'priority',
+ ],
+ 'required',
+ ],
+ [
+ [
+ 'priority',
+ ],
+ 'double',
+ 'min' => 0,
+ 'max' => 1,
+ ],
+ [
+ [
+ 'url',
+ 'frequency',
+ ],
+ 'string',
+ ],
+ ];
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function attributeLabels()
+ {
+ return [
+ 'id' => Yii::t('core', 'ID'),
+ 'url' => Yii::t('core', 'Url'),
+ 'priority' => Yii::t('core', 'Priority'),
+ 'frequency' => Yii::t('core', 'Frequency'),
+ ];
+ }
+
+ /**
+ * Find maximum ID value from SitemapStatic models
+ */
+ public static function max(): int
+ {
+ $models = self::find()
+ ->all();
+ $array = ArrayHelper::getColumn($models, self::primaryKey()[ 0 ], false);
+ if (empty($array)) {
+ return 0;
+ } else {
+ return max($array);
+ }
+ }
+ }
\ No newline at end of file
diff --git a/artweb/artbox-core/models/Slide.php b/artweb/artbox-core/models/Slide.php
new file mode 100755
index 0000000..1f72742
--- /dev/null
+++ b/artweb/artbox-core/models/Slide.php
@@ -0,0 +1,127 @@
+ [
+ 'class' => LanguageBehavior::className(),
+ ],
+ ];
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function rules()
+ {
+ return [
+ [
+ [ 'slider_id' ],
+ 'required',
+ ],
+ [
+ [
+ 'slider_id',
+ 'sort',
+ ],
+ 'integer',
+ ],
+ [
+ [ 'status' ],
+ 'boolean',
+ ],
+ [
+ [ 'slider_id' ],
+ 'exist',
+ 'skipOnError' => true,
+ 'targetClass' => Slider::className(),
+ 'targetAttribute' => [ 'slider_id' => 'id' ],
+ ],
+ ];
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function attributeLabels()
+ {
+ return [
+ 'id' => Yii::t('core', 'ID'),
+ 'slider_id' => Yii::t('core', 'Slider ID'),
+ 'status' => Yii::t('core', 'Status'),
+ 'sort' => Yii::t('core', 'Sort'),
+ ];
+ }
+
+ /**
+ * @return \yii\db\ActiveQuery
+ */
+ public function getSlider()
+ {
+ return $this->hasOne(Slider::className(), [ 'id' => 'slider_id' ])
+ ->inverseOf('slides');
+ }
+
+ /**
+ * @return \yii\db\ActiveQuery
+ */
+ public function getSlideLangs()
+ {
+ return $this->hasMany(SlideLang::className(), [ 'slide_id' => 'id' ])
+ ->inverseOf('slide');
+ }
+ }
diff --git a/artweb/artbox-core/models/SlideLang.php b/artweb/artbox-core/models/SlideLang.php
new file mode 100755
index 0000000..40b15eb
--- /dev/null
+++ b/artweb/artbox-core/models/SlideLang.php
@@ -0,0 +1,128 @@
+ 255,
+ ],
+ [
+ [ 'image_id' ],
+ 'exist',
+ 'skipOnError' => true,
+ 'targetClass' => Image::className(),
+ 'targetAttribute' => [ 'image_id' => 'id' ],
+ ],
+ [
+ [ 'language_id' ],
+ 'exist',
+ 'skipOnError' => true,
+ 'targetClass' => Language::className(),
+ 'targetAttribute' => [ 'language_id' => 'id' ],
+ ],
+ [
+ [ 'slide_id' ],
+ 'exist',
+ 'skipOnError' => true,
+ 'targetClass' => Slide::className(),
+ 'targetAttribute' => [ 'slide_id' => 'id' ],
+ ],
+ ];
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function attributeLabels()
+ {
+ return [
+ 'slide_id' => Yii::t('core', 'Slide ID'),
+ 'language_id' => Yii::t('core', 'Language ID'),
+ 'link' => Yii::t('core', 'Link'),
+ 'image_id' => Yii::t('core', 'Image ID'),
+ 'title' => Yii::t('core', 'Title'),
+ ];
+ }
+
+ /**
+ * @return \yii\db\ActiveQuery
+ */
+ public function getImage()
+ {
+ return $this->hasOne(Image::className(), [ 'id' => 'image_id' ]);
+ }
+
+ /**
+ * @return \yii\db\ActiveQuery
+ */
+ public function getLanguage()
+ {
+ return $this->hasOne(Language::className(), [ 'id' => 'language_id' ]);
+ }
+
+ /**
+ * @return \yii\db\ActiveQuery
+ */
+ public function getSlide()
+ {
+ return $this->hasOne(Slide::className(), [ 'id' => 'slide_id' ])
+ ->inverseOf('slideLangs');
+ }
+
+ public static function primaryKey()
+ {
+ return ['slide_id', 'language_id'];
+ }
+
+ }
diff --git a/artweb/artbox-core/models/SlideSearch.php b/artweb/artbox-core/models/SlideSearch.php
new file mode 100755
index 0000000..93a7632
--- /dev/null
+++ b/artweb/artbox-core/models/SlideSearch.php
@@ -0,0 +1,92 @@
+where([ 'slider_id' => $slider->id ]);
+
+ $dataProvider = new ActiveDataProvider(
+ [
+ 'query' => $query,
+ ]
+ );
+
+ $this->load($params);
+
+ if (!$this->validate()) {
+ // uncomment the following line if you do not want to return any records when validation fails
+ // $query->where('0=1');
+ return $dataProvider;
+ }
+
+ // grid filtering conditions
+ $query->andFilterWhere(
+ [
+ 'id' => $this->id,
+ 'slider_id' => $this->slider_id,
+ 'status' => $this->status,
+ 'sort' => $this->sort,
+ ]
+ );
+
+ return $dataProvider;
+ }
+ }
diff --git a/artweb/artbox-core/models/Slider.php b/artweb/artbox-core/models/Slider.php
new file mode 100755
index 0000000..69ca789
--- /dev/null
+++ b/artweb/artbox-core/models/Slider.php
@@ -0,0 +1,63 @@
+ Yii::t('core', 'ID'),
+ 'status' => Yii::t('core', 'Status'),
+ 'sort' => Yii::t('core', 'Sort'),
+ ];
+ }
+
+ /**
+ * @return \yii\db\ActiveQuery
+ */
+ public function getSlides()
+ {
+ return $this->hasMany(Slide::className(), [ 'slider_id' => 'id' ])
+ ->inverseOf('slider');
+ }
+ }
diff --git a/artweb/artbox-core/models/SliderSearch.php b/artweb/artbox-core/models/SliderSearch.php
new file mode 100755
index 0000000..0952d17
--- /dev/null
+++ b/artweb/artbox-core/models/SliderSearch.php
@@ -0,0 +1,80 @@
+ $query,
+ ]
+ );
+
+ $this->load($params);
+
+ if (!$this->validate()) {
+ // uncomment the following line if you do not want to return any records when validation fails
+ // $query->where('0=1');
+ return $dataProvider;
+ }
+
+ // grid filtering conditions
+ $query->andFilterWhere(
+ [
+ 'id' => $this->id,
+ 'status' => $this->status,
+ 'sort' => $this->sort,
+ ]
+ );
+
+ return $dataProvider;
+ }
+ }
diff --git a/artweb/artbox-core/models/User.php b/artweb/artbox-core/models/User.php
new file mode 100755
index 0000000..e005ba6
--- /dev/null
+++ b/artweb/artbox-core/models/User.php
@@ -0,0 +1,242 @@
+ [
+ 'class' => LinkBehavior::className(),
+ 'linkClass' => UserData::className(),
+ 'linkKey' => 'user_id',
+ 'detachBehaviors' => [
+ 'blameable',
+ ],
+ ],
+ ];
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function rules()
+ {
+ return [
+ [
+ 'status',
+ 'default',
+ 'value' => self::STATUS_ACTIVE,
+ ],
+ [
+ 'status',
+ 'in',
+ 'range' => [
+ self::STATUS_ACTIVE,
+ self::STATUS_DELETED,
+ ],
+ ],
+ ];
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public static function findIdentity($id)
+ {
+ return static::findOne(
+ [
+ 'id' => $id,
+ 'status' => self::STATUS_ACTIVE,
+ ]
+ );
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public static function findIdentityByAccessToken($token, $type = null)
+ {
+ throw new NotSupportedException('"findIdentityByAccessToken" is not implemented.');
+ }
+
+ /**
+ * Finds user by username
+ *
+ * @param string $username
+ *
+ * @return static|null
+ */
+ public static function findByUsername($username)
+ {
+ return static::findOne(
+ [
+ 'username' => $username,
+ 'status' => self::STATUS_ACTIVE,
+ ]
+ );
+ }
+
+ /**
+ * Finds user by password reset token
+ *
+ * @param string $token password reset token
+ *
+ * @return static|null
+ */
+ public static function findByPasswordResetToken($token)
+ {
+ if (!static::isPasswordResetTokenValid($token)) {
+ return null;
+ }
+
+ return static::findOne(
+ [
+ 'password_reset_token' => $token,
+ 'status' => self::STATUS_ACTIVE,
+ ]
+ );
+ }
+
+ /**
+ * Finds out if password reset token is valid
+ *
+ * @param string $token password reset token
+ *
+ * @return bool
+ */
+ public static function isPasswordResetTokenValid($token)
+ {
+ if (empty( $token )) {
+ return false;
+ }
+
+ $timestamp = (int) substr($token, strrpos($token, '_') + 1);
+ $expire = Yii::$app->params[ 'user.passwordResetTokenExpire' ];
+ return $timestamp + $expire >= time();
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function getId()
+ {
+ return $this->getPrimaryKey();
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function getAuthKey()
+ {
+ return $this->auth_key;
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function validateAuthKey($authKey)
+ {
+ return $this->getAuthKey() === $authKey;
+ }
+
+ /**
+ * Validates password
+ *
+ * @param string $password password to validate
+ *
+ * @return bool if password provided is valid for current user
+ */
+ public function validatePassword($password)
+ {
+ return Yii::$app->security->validatePassword($password, $this->password_hash);
+ }
+
+ /**
+ * Generates password hash from password and sets it to the model
+ *
+ * @param string $password
+ */
+ public function setPassword($password)
+ {
+ $this->password_hash = Yii::$app->security->generatePasswordHash($password);
+ }
+
+ /**
+ * Generates "remember me" authentication key
+ */
+ public function generateAuthKey()
+ {
+ $this->auth_key = Yii::$app->security->generateRandomString();
+ }
+
+ /**
+ * Generates new password reset token
+ */
+ public function generatePasswordResetToken()
+ {
+ $this->password_reset_token = Yii::$app->security->generateRandomString() . '_' . time();
+ }
+
+ /**
+ * Removes password reset token
+ */
+ public function removePasswordResetToken()
+ {
+ $this->password_reset_token = null;
+ }
+
+ /**
+ * Link for user data model
+ *
+ * @return \yii\db\ActiveQuery
+ */
+ public function getData()
+ {
+ return $this->hasOne(UserData::className(), [ 'user_id' => 'id' ]);
+ }
+ }
diff --git a/artweb/artbox-core/models/UserData.php b/artweb/artbox-core/models/UserData.php
new file mode 100755
index 0000000..7155ba9
--- /dev/null
+++ b/artweb/artbox-core/models/UserData.php
@@ -0,0 +1,165 @@
+ [
+ 'class' => BlameableBehavior::className(),
+ 'createdByAttribute' => 'user_id',
+ 'updatedByAttribute' => false,
+ ],
+ [
+ 'class' => AttributeBehavior::className(),
+ 'attributes' => [
+ ActiveRecord::EVENT_AFTER_FIND => 'visited_at',
+ ],
+ 'value' => function ($event) {
+ return time();
+ },
+ ],
+ ];
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function rules()
+ {
+ return [
+ [
+ [
+ 'name',
+ 'surname',
+ 'image',
+ 'email',
+ 'phone',
+ ],
+ 'string',
+ 'max' => 255,
+ ],
+ [
+ [ 'email' ],
+ 'email',
+ ],
+ [
+ [ 'phone' ],
+ 'match',
+ 'pattern' => '/^\+\d{1,3}\(\d+\)\d+-\d+-\d+$/',
+ ],
+ [
+ [ 'user_id' ],
+ 'unique',
+ ],
+ [
+ [ 'user_id' ],
+ 'exist',
+ 'skipOnError' => true,
+ 'targetClass' => User::className(),
+ 'targetAttribute' => [ 'user_id' => 'id' ],
+ ],
+ [
+ [ 'image' ],
+ 'filter',
+ 'filter' => function ($value) {
+ if (!$value) {
+ return null;
+ } else {
+ return $value;
+ }
+ },
+ ],
+ ];
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function attributeLabels()
+ {
+ return [
+ 'user_id' => Yii::t('core', 'User ID'),
+ 'name' => Yii::t('core', 'Name'),
+ 'surname' => Yii::t('core', 'Surname'),
+ 'image' => Yii::t('core', 'Image'),
+ 'email' => Yii::t('core', 'Email'),
+ 'phone' => Yii::t('core', 'Phone'),
+ 'created_at' => Yii::t('core', 'Created At'),
+ 'updated_at' => Yii::t('core', 'Updated At'),
+ 'visited_at' => Yii::t('core', 'Visited At'),
+ ];
+ }
+
+ /**
+ * @return \yii\db\ActiveQuery
+ */
+ public function getUser()
+ {
+ return $this->hasOne(User::className(), [ 'id' => 'user_id' ]);
+ }
+
+ /**
+ * Get fullname
+ *
+ * @return string
+ */
+ public function getFullname()
+ {
+ if (empty( $this->name ) && empty( $this->surname )) {
+ return \Yii::t('core', 'Anonymous');
+ } else {
+ return implode(
+ ' ',
+ [
+ $this->name ? : \Yii::t('core', 'Mr.'),
+ $this->surname,
+ ]
+ );
+ }
+ }
+ }
diff --git a/artweb/artbox-core/models/interfaces/AliasInterface.php b/artweb/artbox-core/models/interfaces/AliasInterface.php
new file mode 100755
index 0000000..8153c2d
--- /dev/null
+++ b/artweb/artbox-core/models/interfaces/AliasInterface.php
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+ = $form->field($model, 'route')
+ ->textInput() ?>
+
+ = $form->field($model, 'value')
+ ->textInput() ?>
+
+ = $form->field($model, 'language_id')
+ ->dropDownList($languages) ?>
+
+ = $form->field($model, 'title')
+ ->textInput() ?>
+
+ = $form->field($model, 'description')
+ ->textarea() ?>
+
+ = $form->field($model, 'h1')
+ ->textInput() ?>
+
+ field($model, 'seo_text')
+ ->widget(
+ TinyMce::className(),
+ [
+ 'options' => [ 'rows' => 30 ],
+ 'language' => 'ru',
+ 'clientOptions' => [
+ 'file_browser_callback' => new yii\web\JsExpression(
+ "function(field_name, url, type, win) {
+window.open('" . yii\helpers\Url::to(
+ [
+ 'imagemanager/manager',
+ 'view-mode' => 'iframe',
+ 'select-type' => 'tinymce',
+ ]
+ ) . "&tag_name='+field_name,'','width=800,height=540 ,toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no');
+}"
+ ),
+ 'plugins' => [
+ "advlist autolink lists link charmap print preview anchor",
+ "searchreplace visualblocks code fullscreen",
+ "insertdatetime media table contextmenu paste image",
+ ],
+ 'toolbar' => "undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image | code",
+ 'image_advtab' => true,
+ ],
+ ]
+ );
+ ?>
+
+ = $form->field($model, 'entity')
+ ->textInput([ 'readonly' => true ]) ?>
+
+ = $form->field($model, 'robots')
+ ->dropDownList(
+ [
+ 'index, follow' => 'index, follow',
+ 'index, nofollow' => 'index, nofollow',
+ 'noindex, follow' => 'noindex, follow',
+ 'noindex, nofollow' => 'noindex, nofollow',
+ ]
+ ) ?>
+
+
+ = Html::submitButton(
+ $model->isNewRecord ? 'Create' : 'Update',
+ [ 'class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary' ]
+ ) ?>
+
+
+
+
+
diff --git a/artweb/artbox-core/views/alias/_form_update.php b/artweb/artbox-core/views/alias/_form_update.php
new file mode 100755
index 0000000..f30e69d
--- /dev/null
+++ b/artweb/artbox-core/views/alias/_form_update.php
@@ -0,0 +1,146 @@
+
+
+
+
+
+
+ field(
+ $model,
+ 'value'
+ )
+ ->hint(
+ \Yii::t(
+ 'core',
+ '{field} field would be slugified.',
+ [
+ 'field' => $model->getAttributeLabel('value'),
+ ]
+ )
+ );
+ echo SlugifyDecorator::decorate(
+ $valueField,
+ [ '/alias/slugify' ],
+ $valueField,
+ true,
+ $model->language_id
+ )
+ ->textInput() ?>
+
+
+
+
+
+
+ entity)) {
+ ?>
+
+
+ getCheckedFields() as $field => $fieldTitle) {
+ ?>
+
+ | = $field ?> |
+ - = $fieldTitle ?> |
+
+
+
+
+
+
+
+
+
+
Your text with custom [[example]] field.
+
+
+
+
+
+ = $form->field($model, 'title')
+ ->textInput() ?>
+
+ = $form->field($model, 'description')
+ ->textarea() ?>
+
+ = $form->field($model, 'h1')
+ ->textInput() ?>
+
+ field($model, 'seo_text')
+ ->widget(
+ TinyMce::className(),
+ [
+ 'options' => [ 'rows' => 30 ],
+ 'language' => 'ru',
+ 'clientOptions' => [
+ 'file_browser_callback' => new yii\web\JsExpression(
+ "function(field_name, url, type, win) {
+window.open('" . yii\helpers\Url::to(
+ [
+ 'imagemanager/manager',
+ 'view-mode' => 'iframe',
+ 'select-type' => 'tinymce',
+ ]
+ ) . "&tag_name='+field_name,'','width=800,height=540 ,toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no');
+}"
+ ),
+ 'plugins' => [
+ "advlist autolink lists link charmap print preview anchor",
+ "searchreplace visualblocks code fullscreen",
+ "insertdatetime media table contextmenu paste image",
+ ],
+ 'toolbar' => "undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image | code",
+ 'image_advtab' => true,
+ ],
+ ]
+ );
+ ?>
+
+
+
+ = $form->field($model, 'robots')
+ ->dropDownList(
+ [
+ 'index, follow' => 'index, follow',
+ 'index, nofollow' => 'index, nofollow',
+ 'noindex, follow' => 'noindex, follow',
+ 'noindex, nofollow' => 'noindex, nofollow',
+ ]
+ ) ?>
+
+
+ = Html::submitButton(
+ $model->isNewRecord ? 'Create' : 'Update',
+ [ 'class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary' ]
+ ) ?>
+
+
+
+
+
diff --git a/artweb/artbox-core/views/alias/_search.php b/artweb/artbox-core/views/alias/_search.php
new file mode 100755
index 0000000..7bd394f
--- /dev/null
+++ b/artweb/artbox-core/views/alias/_search.php
@@ -0,0 +1,63 @@
+
+
+ [ 'index' ],
+ 'method' => 'get',
+ 'options' => [
+ 'class' => 'form-inline',
+ ],
+ ]
+ );
+ ?>
+ field($model, 'search')
+ ->label(false)
+ ->textInput();
+ echo $form->field($model, 'entity')
+ ->label(false)
+ ->dropDownList(
+ $entities,
+ [
+ 'prompt' => ' ',
+ ]
+ );
+ echo $form->field($model, 'static')
+ ->label(false)
+ ->dropDownList(
+ [
+ \Yii::t('core', 'Static pages'),
+ \Yii::t('core', 'Dynamic pages'),
+ ],
+ [
+ 'prompt' => ' ',
+ ]
+ );
+ echo $form->field($model, 'language_id')
+ ->label(false)
+ ->dropDownList(
+ $languages,
+ [
+ 'prompt' => ' ',
+ ]
+ );
+ echo Html::submitButton(\Yii::t('core', 'Search'), [ 'class' => 'btn btn-default' ]);
+ ?>
+
+
diff --git a/artweb/artbox-core/views/alias/create.php b/artweb/artbox-core/views/alias/create.php
new file mode 100755
index 0000000..6329510
--- /dev/null
+++ b/artweb/artbox-core/views/alias/create.php
@@ -0,0 +1,41 @@
+title = \Yii::t('core', 'Create {item}', [ 'item' => 'Alias' ]);
+ $this->params[ 'breadcrumbs' ][] = [
+ 'label' => \Yii::t('core', 'Aliases'),
+ 'url' => [ 'index' ],
+ ];
+ $this->params[ 'breadcrumbs' ][] = $this->title;
+?>
+
+ $this->title,
+ ]
+ );
+ ?>
+
+ = $this->render(
+ '_form_create',
+ [
+ 'model' => $model,
+ 'languages' => $languages,
+ ]
+ ) ?>
+
+
+
+
diff --git a/artweb/artbox-core/views/alias/index.php b/artweb/artbox-core/views/alias/index.php
new file mode 100755
index 0000000..5629fe3
--- /dev/null
+++ b/artweb/artbox-core/views/alias/index.php
@@ -0,0 +1,114 @@
+title = \Yii::t('core', 'Aliases');
+ $this->params[ 'breadcrumbs' ][] = $this->title;
+?>
+
+
+ \Yii::t('core', 'Create filter alias'),
+ 'collapsable' => true,
+ ]
+ ); ?>
+
+
+ Example: http://domain.com/catalog/category/filter1_filter2
+
+
+ = Html::beginForm(
+ [ 'alias/create' ],
+ 'GET',
+ [
+ 'class' => 'form-horizontal form-label-left',
+ ]
+ ) ?>
+
+ = Html::endForm(); ?>
+
+
+
+ $this->title,
+ ]
+ );
+ ?>
+ render(
+ '_search',
+ [
+ 'model' => $searchModel,
+ 'languages' => $languages,
+ 'entities' => $entities,
+ ]
+ );
+ ?>
+
+ = Html::a(
+ \Yii::t('core', 'Create {item}', [ 'item' => \Yii::t('core', 'Alias') ]),
+ [ 'create' ],
+ [
+ 'class' => 'btn btn-danger',
+ 'data-confirm' => \Yii::t(
+ 'core',
+ 'Creating aliases by hand may cause bugs for your website. Use it only if you know what are you doing!'
+ ),
+ ]
+ ) ?>
+
+
+ = GridView::widget(
+ [
+ 'dataProvider' => $dataProvider,
+ 'columns' => [
+ 'id',
+ 'value',
+ 'route',
+ 'title',
+ [ 'class' => 'yii\grid\ActionColumn' ],
+ ],
+ ]
+ ); ?>
+
+
diff --git a/artweb/artbox-core/views/alias/update.php b/artweb/artbox-core/views/alias/update.php
new file mode 100755
index 0000000..4aa0b12
--- /dev/null
+++ b/artweb/artbox-core/views/alias/update.php
@@ -0,0 +1,52 @@
+title = \Yii::t(
+ 'core',
+ 'Update {item}',
+ [
+ 'item' => \Yii::t('core', 'Alias'),
+ ]
+ ) . ': ' . $model->value;
+ $this->params[ 'breadcrumbs' ][] = [
+ 'label' => \Yii::t('core', 'Aliases'),
+ 'url' => [ 'index' ],
+ ];
+ $this->params[ 'breadcrumbs' ][] = [
+ 'label' => $model->value,
+ 'url' => [
+ 'view',
+ 'id' => $model->id,
+ ],
+ ];
+ $this->params[ 'breadcrumbs' ][] = \Yii::t('core', 'Update');
+?>
+
+
+ $this->title,
+ ]
+ )
+ ?>
+
+ = $this->render(
+ '_form_update',
+ [
+ 'model' => $model,
+ ]
+ ) ?>
+
+
+
diff --git a/artweb/artbox-core/views/alias/view.php b/artweb/artbox-core/views/alias/view.php
new file mode 100755
index 0000000..e51b2d4
--- /dev/null
+++ b/artweb/artbox-core/views/alias/view.php
@@ -0,0 +1,74 @@
+title = $model->value;
+ $this->params[ 'breadcrumbs' ][] = [
+ 'label' => \Yii::t('core', 'Aliases'),
+ 'url' => [ 'index' ],
+ ];
+ $this->params[ 'breadcrumbs' ][] = $this->title;
+?>
+
+
+ $this->title,
+ ]
+ );
+ ?>
+
+
+ = Html::a(
+ \Yii::t('core', 'Update'),
+ [
+ 'update',
+ 'id' => $model->id,
+ ],
+ [ 'class' => 'btn btn-primary' ]
+ ) ?>
+ = Html::a(
+ \Yii::t('core', 'Delete'),
+ [
+ 'delete',
+ 'id' => $model->id,
+ ],
+ [
+ 'class' => 'btn btn-danger',
+ 'data' => [
+ 'confirm' => \Yii::t('core', 'Are you sure you want to delete this item?'),
+ 'method' => 'post',
+ ],
+ ]
+ ) ?>
+
+
+ = DetailView::widget(
+ [
+ 'model' => $model,
+ 'attributes' => [
+ 'id',
+ 'value',
+ 'route',
+ 'title',
+ 'description',
+ 'h1',
+ 'robots',
+ 'seo_text',
+ ],
+ ]
+ ) ?>
+
+
+
diff --git a/artweb/artbox-core/views/feedback/_form.php b/artweb/artbox-core/views/feedback/_form.php
new file mode 100755
index 0000000..30b9a46
--- /dev/null
+++ b/artweb/artbox-core/views/feedback/_form.php
@@ -0,0 +1,43 @@
+
+
+
diff --git a/artweb/artbox-core/views/feedback/create.php b/artweb/artbox-core/views/feedback/create.php
new file mode 100755
index 0000000..5453996
--- /dev/null
+++ b/artweb/artbox-core/views/feedback/create.php
@@ -0,0 +1,26 @@
+title = Yii::t('core', 'Create Feedback');
+ $this->params[ 'breadcrumbs' ][] = [
+ 'label' => Yii::t('core', 'Feedbacks'),
+ 'url' => [ 'index' ],
+ ];
+ $this->params[ 'breadcrumbs' ][] = $this->title;
+?>
+
+
+
= Html::encode($this->title) ?>
+
+ = $this->render(
+ '_form',
+ [
+ 'model' => $model,
+ ]
+ ) ?>
+
+
diff --git a/artweb/artbox-core/views/feedback/index.php b/artweb/artbox-core/views/feedback/index.php
new file mode 100755
index 0000000..657c549
--- /dev/null
+++ b/artweb/artbox-core/views/feedback/index.php
@@ -0,0 +1,88 @@
+title = Yii::t('core', 'Feedbacks');
+ $this->params[ 'breadcrumbs' ][] = $this->title;
+?>
+
+ $this->title,
+ 'options' => [
+ 'class' => 'x_panel feedback-index',
+ ],
+ ]
+) ?>
+
+= GridView::widget(
+ [
+ 'dataProvider' => $dataProvider,
+ 'rowOptions' => function (Feedback $model) {
+ if ($model->status) {
+ return [];
+ } else {
+ return [
+ 'class' => 'success',
+ ];
+ }
+ },
+ 'columns' => [
+ [ 'class' => 'yii\grid\SerialColumn' ],
+
+ 'name',
+ 'email',
+ 'phone',
+ [
+ 'attribute' => 'created_at',
+ 'format' => [
+ 'datetime',
+ 'php:d.m.Y H:i',
+ ],
+ ],
+ [
+ 'class' => 'yii\grid\ActionColumn',
+ 'buttons' => [
+ 'viewed' => function (string $url, Feedback $model) {
+ if ($model->status) {
+ return Html::tag(
+ 'span',
+ '',
+ [
+ 'class' => 'glyphicon glyphicon-ok',
+ ]
+ );
+ } else {
+ return Html::a(
+ Html::tag(
+ 'span',
+ '',
+ [
+ 'class' => 'glyphicon glyphicon-flag',
+ ]
+ ),
+ $url,
+ [
+ 'class' => 'viewed-toggle',
+ ]
+ );
+ }
+ },
+ ],
+ 'template' => '{viewed} {view} {update} {delete}',
+ ],
+ ],
+ ]
+); ?>
+
+
diff --git a/artweb/artbox-core/views/feedback/update.php b/artweb/artbox-core/views/feedback/update.php
new file mode 100755
index 0000000..dcc15dc
--- /dev/null
+++ b/artweb/artbox-core/views/feedback/update.php
@@ -0,0 +1,45 @@
+title = Yii::t(
+ 'core',
+ 'Update {modelClass}: ',
+ [
+ 'modelClass' => 'Feedback',
+ ]
+ ) . $model->name;
+ $this->params[ 'breadcrumbs' ][] = [
+ 'label' => Yii::t('core', 'Feedbacks'),
+ 'url' => [ 'index' ],
+ ];
+ $this->params[ 'breadcrumbs' ][] = [
+ 'label' => $model->name,
+ 'url' => [
+ 'view',
+ 'id' => $model->id,
+ ],
+ ];
+ $this->params[ 'breadcrumbs' ][] = Yii::t('core', 'Update');
+?>
+
+ $this->title,
+ 'options' => [
+ 'class' => 'x_panel feedback-update',
+ ],
+ ]
+) ?>
+
+= $this->render(
+ '_form',
+ [
+ 'model' => $model,
+ ]
+) ?>
+
+
diff --git a/artweb/artbox-core/views/feedback/view.php b/artweb/artbox-core/views/feedback/view.php
new file mode 100755
index 0000000..71f2b62
--- /dev/null
+++ b/artweb/artbox-core/views/feedback/view.php
@@ -0,0 +1,69 @@
+title = $model->name;
+ $this->params[ 'breadcrumbs' ][] = [
+ 'label' => Yii::t('core', 'Feedbacks'),
+ 'url' => [ 'index' ],
+ ];
+ $this->params[ 'breadcrumbs' ][] = $this->title;
+?>
+
+ $this->title,
+ 'options' => [
+ 'class' => 'x_panel feedback-view',
+ ],
+ ]
+); ?>
+
+
+ = Html::a(
+ Yii::t('core', 'Update'),
+ [
+ 'update',
+ 'id' => $model->id,
+ ],
+ [ 'class' => 'btn btn-primary' ]
+ ) ?>
+ = Html::a(
+ Yii::t('core', 'Delete'),
+ [
+ 'delete',
+ 'id' => $model->id,
+ ],
+ [
+ 'class' => 'btn btn-danger',
+ 'data' => [
+ 'confirm' => Yii::t('core', 'Are you sure you want to delete this item?'),
+ 'method' => 'post',
+ ],
+ ]
+ ) ?>
+
+
+= DetailView::widget(
+ [
+ 'model' => $model,
+ 'attributes' => [
+ 'id',
+ 'name',
+ 'email:email',
+ 'phone',
+ 'message:ntext',
+ 'created_at',
+ 'ip',
+ 'url:url',
+ 'status:boolean',
+ ],
+ ]
+) ?>
+
+
diff --git a/artweb/artbox-core/views/page-category/_form.php b/artweb/artbox-core/views/page-category/_form.php
new file mode 100644
index 0000000..7d0944a
--- /dev/null
+++ b/artweb/artbox-core/views/page-category/_form.php
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+ = LanguageForm::widget(
+ [
+ 'modelLangs' => $modelLangs,
+ 'formView' => '@artbox/core/views/page-category/_form_language',
+ 'form' => $form,
+ ]
+ ) ?>
+
+ = $form->field($model, 'sort')
+ ->textInput() ?>
+
+ = $form->field($model, 'status')
+ ->checkbox([
+ 'class' => 'flat',
+ ]) ?>
+
+
+ = Html::submitButton(
+ $model->isNewRecord ? 'Create' : 'Update',
+ [ 'class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary' ]
+ ) ?>
+
+
+
+
+
diff --git a/artweb/artbox-core/views/page-category/_form_language.php b/artweb/artbox-core/views/page-category/_form_language.php
new file mode 100755
index 0000000..e96c8d3
--- /dev/null
+++ b/artweb/artbox-core/views/page-category/_form_language.php
@@ -0,0 +1,18 @@
+
+
+= $form->field($model_lang, '[' . $language->id . ']title')
+ ->textInput([ 'maxlength' => true ]);
+?>
+
diff --git a/artweb/artbox-core/views/page-category/create.php b/artweb/artbox-core/views/page-category/create.php
new file mode 100644
index 0000000..a20d310
--- /dev/null
+++ b/artweb/artbox-core/views/page-category/create.php
@@ -0,0 +1,40 @@
+title = 'Create Page Category';
+ $this->params[ 'breadcrumbs' ][] = [
+ 'label' => 'Page Categories',
+ 'url' => [ 'index' ],
+ ];
+ $this->params[ 'breadcrumbs' ][] = $this->title;
+?>
+
+
+
+ $this->title,
+ ]
+ ) ?>
+
+ = $this->render(
+ '_form',
+ [
+ 'model' => $model,
+ 'modelLangs' => $modelLangs,
+ ]
+ ) ?>
+
+
+
+
diff --git a/artweb/artbox-core/views/page-category/index.php b/artweb/artbox-core/views/page-category/index.php
new file mode 100644
index 0000000..b112649
--- /dev/null
+++ b/artweb/artbox-core/views/page-category/index.php
@@ -0,0 +1,51 @@
+title = 'Page Categories';
+ $this->params[ 'breadcrumbs' ][] = $this->title;
+?>
+
+
+ $this->title,
+ ]
+ ) ?>
+
+
+ = Html::a('Create Page Category', [ 'create' ], [ 'class' => 'btn btn-success' ]) ?>
+
+ = GridView::widget(
+ [
+ 'dataProvider' => $dataProvider,
+ 'filterModel' => $searchModel,
+ 'columns' => [
+ [ 'class' => 'yii\grid\SerialColumn' ],
+
+ [
+ 'attribute' => 'title',
+ 'value' => 'lang.title'
+ ],
+ 'sort',
+ 'status:boolean',
+
+ [ 'class' => 'yii\grid\ActionColumn' ],
+ ],
+ ]
+ ); ?>
+
+
+
+
diff --git a/artweb/artbox-core/views/page-category/update.php b/artweb/artbox-core/views/page-category/update.php
new file mode 100644
index 0000000..5ac7c3e
--- /dev/null
+++ b/artweb/artbox-core/views/page-category/update.php
@@ -0,0 +1,46 @@
+title = 'Update Page Category: ' . $model->id;
+ $this->params[ 'breadcrumbs' ][] = [
+ 'label' => 'Page Categories',
+ 'url' => [ 'index' ],
+ ];
+ $this->params[ 'breadcrumbs' ][] = [
+ 'label' => $model->id,
+ 'url' => [
+ 'view',
+ 'id' => $model->id,
+ ],
+ ];
+ $this->params[ 'breadcrumbs' ][] = 'Update';
+?>
+
+
+ $this->title,
+ ]
+ ) ?>
+
+ = $this->render(
+ '_form',
+ [
+ 'model' => $model,
+ 'modelLangs' => $modelLangs,
+ ]
+ ) ?>
+
+
+
+
diff --git a/artweb/artbox-core/views/page-category/view.php b/artweb/artbox-core/views/page-category/view.php
new file mode 100644
index 0000000..551c137
--- /dev/null
+++ b/artweb/artbox-core/views/page-category/view.php
@@ -0,0 +1,60 @@
+title = $model->id;
+ $this->params[ 'breadcrumbs' ][] = [
+ 'label' => 'Page Categories',
+ 'url' => [ 'index' ],
+ ];
+ $this->params[ 'breadcrumbs' ][] = $this->title;
+?>
+
+
+
= Html::encode($this->title) ?>
+
+
+ = Html::a(
+ 'Update',
+ [
+ 'update',
+ 'id' => $model->id,
+ ],
+ [ 'class' => 'btn btn-primary' ]
+ ) ?>
+ = Html::a(
+ 'Delete',
+ [
+ 'delete',
+ 'id' => $model->id,
+ ],
+ [
+ 'class' => 'btn btn-danger',
+ 'data' => [
+ 'confirm' => 'Are you sure you want to delete this item?',
+ 'method' => 'post',
+ ],
+ ]
+ ) ?>
+
+
+ = DetailView::widget(
+ [
+ 'model' => $model,
+ 'attributes' => [
+ 'id',
+ 'sort',
+ 'status:boolean',
+ ],
+ ]
+ ) ?>
+
+
diff --git a/artweb/artbox-core/views/page/_form.php b/artweb/artbox-core/views/page/_form.php
new file mode 100755
index 0000000..0d983da
--- /dev/null
+++ b/artweb/artbox-core/views/page/_form.php
@@ -0,0 +1,64 @@
+
+
+
+
+
+
+
+ [
+ [
+ 'label' => \Yii::t('core', 'Common'),
+ 'content' => $this->render(
+ '_form_common',
+ [
+ 'form' => $form,
+ 'model' => $model,
+ 'modelLangs' => $modelLangs,
+ ]
+ ),
+ ],
+ [
+ 'label' => \Yii::t('core', 'Gallery'),
+ 'content' => $this->render(
+ '_gallery',
+ [
+ 'model' => $model,
+ ]
+ ),
+ ],
+ ],
+ 'options' => [
+ 'class' => 'bar_tabs',
+ ],
+ ]
+ );
+ ?>
+
+
+ = Html::submitButton(
+ $model->isNewRecord ? 'Создать' : 'Обновить',
+ [ 'class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary' ]
+ ) ?>
+
+
+
+
+
diff --git a/artweb/artbox-core/views/page/_form_common.php b/artweb/artbox-core/views/page/_form_common.php
new file mode 100644
index 0000000..3a9da7b
--- /dev/null
+++ b/artweb/artbox-core/views/page/_form_common.php
@@ -0,0 +1,89 @@
+
+
+= LanguageForm::widget(
+ [
+ 'modelLangs' => $modelLangs,
+ 'formView' => '@artbox/core/views/page/_form_language',
+ 'form' => $form,
+ ]
+) ?>
+
+
+
+ 'categoryIds',
+ 'options' => [
+ 'placeholder' => \Yii::t('core', 'Search for a categories ...'),
+ 'multiple' => true,
+ ],
+ 'value' => array_keys($model->categoryIds),
+ 'data' => $model->categoryIds,
+ 'pluginOptions' => [
+ 'allowClear' => true,
+ 'minimumInputLength' => 3,
+ 'language' => [
+ 'errorLoading' => new JsExpression(
+ "function () { return 'Waiting for results...'; }"
+ ),
+ ],
+ 'ajax' => [
+ 'url' => Url::to([ '/page-category/list' ]),
+ 'dataType' => 'json',
+ 'data' => new JsExpression(
+ 'function(params) {
+ return {
+ q:params.term
+ };
+ }'
+ ),
+ ],
+ 'escapeMarkup' => new JsExpression(
+ 'function (markup) {
+ return markup;
+ }'
+ ),
+ 'templateResult' => new JsExpression(
+ 'function (brand) {
+ return brand.text;
+ }'
+ ),
+ 'templateSelection' => new JsExpression(
+ 'function (brand) {
+ return brand.text;
+ }'
+ ),
+ ],
+ ]
+ );
+ ?>
+
+
+= $form->field($model, 'in_menu')
+ ->checkbox(
+ [
+ 'class' => 'flat',
+ ]
+ ) ?>
+
+= $form->field($model, 'sort')
+ ->input('number') ?>
\ No newline at end of file
diff --git a/artweb/artbox-core/views/page/_form_language.php b/artweb/artbox-core/views/page/_form_language.php
new file mode 100755
index 0000000..187aaf1
--- /dev/null
+++ b/artweb/artbox-core/views/page/_form_language.php
@@ -0,0 +1,59 @@
+
+field($model_lang, '[' . $language->id . ']title')
+ ->textInput([ 'maxlength' => true ]);
+ echo $attributeField;
+?>
+
+= SlugifyDecorator::decorate(
+ $form->field($model_lang, '[' . $language->id . ']aliasValue'),
+ [ '/alias/slugify' ],
+ $attributeField,
+ false,
+ $language->id
+)
+ ->textInput([ 'maxlength' => true ]); ?>
+
+field($model_lang, '[' . $language->id . ']body')
+ ->widget(
+ TinyMce::className(),
+ [
+ 'options' => [ 'rows' => 6 ],
+ 'language' => 'ru',
+ 'clientOptions' => [
+ 'file_browser_callback' => new yii\web\JsExpression(
+ "function(field_name, url, type, win) {
+window.open('" . yii\helpers\Url::to(
+ [
+ 'imagemanager/manager',
+ 'view-mode' => 'iframe',
+ 'select-type' => 'tinymce',
+ ]
+ ) . "&tag_name='+field_name,'','width=800,height=540 ,toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no');
+}"
+ ),
+ 'plugins' => [
+ "advlist autolink lists link charmap print preview anchor",
+ "searchreplace visualblocks code fullscreen",
+ "insertdatetime media table contextmenu paste image",
+ ],
+ 'toolbar' => "undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image | code",
+ ],
+ ]
+ );
+?>
\ No newline at end of file
diff --git a/artweb/artbox-core/views/page/_gallery.php b/artweb/artbox-core/views/page/_gallery.php
new file mode 100644
index 0000000..2499927
--- /dev/null
+++ b/artweb/artbox-core/views/page/_gallery.php
@@ -0,0 +1,20 @@
+
+
+ $model,
+ ]
+ );
+?>
\ No newline at end of file
diff --git a/artweb/artbox-core/views/page/create.php b/artweb/artbox-core/views/page/create.php
new file mode 100755
index 0000000..b326b6f
--- /dev/null
+++ b/artweb/artbox-core/views/page/create.php
@@ -0,0 +1,41 @@
+title = \Yii::t('core', 'Создать страницу');
+ $this->params[ 'breadcrumbs' ][] = [
+ 'label' => \Yii::t('core', 'Pages'),
+ 'url' => [ 'index' ],
+ ];
+ $this->params[ 'breadcrumbs' ][] = $this->title;
+?>
+
+ $this->title,
+ ]
+ );
+ ?>
+
+ = $this->render(
+ '_form',
+ [
+ 'model' => $model,
+ 'modelLangs' => $modelLangs,
+ ]
+ ) ?>
+
+
+
+
diff --git a/artweb/artbox-core/views/page/index.php b/artweb/artbox-core/views/page/index.php
new file mode 100755
index 0000000..968c1b7
--- /dev/null
+++ b/artweb/artbox-core/views/page/index.php
@@ -0,0 +1,65 @@
+title = \Yii::t('core', 'Pages');
+ $this->params[ 'breadcrumbs' ][] = $this->title;
+?>
+
+ $this->title,
+ ]
+ );
+ ?>
+
+
+
+ = Html::a(
+ \Yii::t('core', 'Create {item}', [ 'item' => \Yii::t('core', 'Page') ]),
+ [ 'create' ],
+ [ 'class' => 'btn btn-success' ]
+ ) ?>
+
+ = GridView::widget(
+ [
+ 'dataProvider' => $dataProvider,
+ 'filterModel' => $searchModel,
+ 'columns' => [
+ 'id',
+ [
+ 'attribute' => 'title',
+ 'value' => 'lang.title',
+ ],
+ [
+ 'attribute' => 'in_menu',
+ 'value' => function ($model) {
+ /**
+ * @var Page $model
+ */
+ return ( !$model->in_menu ) ? \Yii::t('core', 'Не в меню') : \Yii::t('core', 'В меню');
+ },
+ 'filter' => [
+ 0 => \Yii::t('core', 'Не в меню'),
+ 1 => \Yii::t('core', 'В меню'),
+ ],
+ ],
+ [ 'class' => 'yii\grid\ActionColumn' ],
+ ],
+ ]
+ ); ?>
+
+
diff --git a/artweb/artbox-core/views/page/update.php b/artweb/artbox-core/views/page/update.php
new file mode 100755
index 0000000..7f7a780
--- /dev/null
+++ b/artweb/artbox-core/views/page/update.php
@@ -0,0 +1,55 @@
+title = \Yii::t(
+ 'core',
+ 'Update {item}',
+ [
+ 'item' => \Yii::t('core', 'Page'),
+ ]
+ ) . ': ' . $model->lang->title;
+ $this->params[ 'breadcrumbs' ][] = [
+ 'label' => \Yii::t('core', 'Pages'),
+ 'url' => [ 'index' ],
+ ];
+ $this->params[ 'breadcrumbs' ][] = [
+ 'label' => $model->lang->title,
+ 'url' => [
+ 'view',
+ 'id' => $model->id,
+ ],
+ ];
+ $this->params[ 'breadcrumbs' ][] = \Yii::t('core', 'Update');
+?>
+
+
+ $this->title,
+ ]
+ )
+ ?>
+
+ = $this->render(
+ '_form',
+ [
+ 'model' => $model,
+ 'modelLangs' => $modelLangs,
+ ]
+ ) ?>
+
+
+
diff --git a/artweb/artbox-core/views/page/view.php b/artweb/artbox-core/views/page/view.php
new file mode 100755
index 0000000..f377992
--- /dev/null
+++ b/artweb/artbox-core/views/page/view.php
@@ -0,0 +1,73 @@
+title = $model->lang->title;
+ $this->params[ 'breadcrumbs' ][] = [
+ 'label' => \Yii::t('core', 'Pages'),
+ 'url' => [ 'index' ],
+ ];
+ $this->params[ 'breadcrumbs' ][] = $this->title;
+?>
+
+
+ $this->title,
+ ]
+ );
+ ?>
+
+
+ = Html::a(
+ \Yii::t('core', 'Update'),
+ [
+ 'update',
+ 'id' => $model->id,
+ ],
+ [ 'class' => 'btn btn-primary' ]
+ ) ?>
+ = Html::a(
+ \Yii::t('core', 'Delete'),
+ [
+ 'delete',
+ 'id' => $model->id,
+ ],
+ [
+ 'class' => 'btn btn-danger',
+ 'data' => [
+ 'confirm' => \Yii::t('core', 'Are you sure you want to delete this item?'),
+ 'method' => 'post',
+ ],
+ ]
+ ) ?>
+
+
+ = DetailView::widget(
+ [
+ 'model' => $model,
+ 'attributes' => [
+ 'id',
+ 'lang.title',
+ [
+ 'attribute' => 'in_menu',
+ 'value' => $model->in_menu ? Yii::t('app', 'В меню') : Yii::t('app', 'Не в меню'),
+ ],
+ 'lang.body:html',
+ ],
+ ]
+ ) ?>
+
+
+
diff --git a/artweb/artbox-core/views/profile/_change_password.php b/artweb/artbox-core/views/profile/_change_password.php
new file mode 100755
index 0000000..d47ca77
--- /dev/null
+++ b/artweb/artbox-core/views/profile/_change_password.php
@@ -0,0 +1,63 @@
+ [ 'change-password' ],
+ 'method' => 'POST',
+ 'errorCssClass' => 'has-error bad',
+ ]
+ );
+ echo $form->field(
+ $changePasswordModel,
+ 'oldPassword',
+ [
+ 'options' => [
+ 'class' => 'form-group item',
+ ],
+ 'errorOptions' => [
+ 'class' => 'help-block alert',
+ ],
+ ]
+ )
+ ->passwordInput();
+ echo $form->field(
+ $changePasswordModel,
+ 'newPassword',
+ [
+ 'options' => [
+ 'class' => 'form-group item',
+ ],
+ 'errorOptions' => [
+ 'class' => 'help-block alert',
+ ],
+ ]
+ )
+ ->passwordInput();
+ echo $form->field(
+ $changePasswordModel,
+ 'newPasswordRepeat',
+ [
+ 'options' => [
+ 'class' => 'form-group item',
+ ],
+ 'errorOptions' => [
+ 'class' => 'help-block alert',
+ ],
+ ]
+ )
+ ->passwordInput();
+ echo Html::submitButton(
+ \Yii::t('core', 'Submit'),
+ [
+ 'class' => 'btn btn-default',
+ ]
+ );
+ $form::end();
diff --git a/artweb/artbox-core/views/profile/_profile_info.php b/artweb/artbox-core/views/profile/_profile_info.php
new file mode 100755
index 0000000..f593e9e
--- /dev/null
+++ b/artweb/artbox-core/views/profile/_profile_info.php
@@ -0,0 +1,192 @@
+ Yii::getAlias('@storage'),
+ ]
+ );
+?>
+ [ 'update' ],
+ 'method' => 'POST',
+ 'errorCssClass' => 'has-error bad',
+ ]
+ );
+ if (!empty( $userData->image )) {
+ echo Html::tag(
+ 'div',
+ Html::img($imageSearch->getImagePath($userData->image)),
+ [
+ 'class' => 'col-xs-6 col-xs-offset-3 profile_edit_image',
+ ]
+ );
+ }
+ echo $form->field($userData, 'image')
+ ->label(false)
+ ->widget(
+ ImageManagerInputWidget::className(),
+ [
+ 'showPreview' => true,
+ 'showDeletePickedImageConfirm' => false,
+ ]
+ );
+ echo $form->field(
+ $userData,
+ 'name',
+ [
+ 'inputTemplate' => '{input}' . Html::icon(
+ 'user',
+ [
+ 'prefix' => 'fa fa-',
+ 'class' => 'form-control-feedback left',
+ ]
+ ),
+ 'options' => [
+ 'class' => 'col-sm-6 col-xs-12 has-feedback item',
+ ],
+ 'inputOptions' => [
+ 'class' => 'form-control has-feedback-left',
+ 'placeholder' => $userData->getAttributeLabel('name'),
+ ],
+ 'errorOptions' => [
+ 'class' => 'help-block alert',
+ ],
+ ]
+ )
+ ->label(false)
+ ->textInput();
+ echo $form->field(
+ $userData,
+ 'surname',
+ [
+ 'inputTemplate' => '{input}' . Html::icon(
+ 'user',
+ [
+ 'prefix' => 'fa fa-',
+ 'class' => 'form-control-feedback right',
+ ]
+ ),
+ 'options' => [
+ 'class' => 'col-sm-6 col-xs-12 has-feedback item',
+ ],
+ 'inputOptions' => [
+ 'placeholder' => $userData->getAttributeLabel('surname'),
+ ],
+ 'errorOptions' => [
+ 'class' => 'help-block alert',
+ ],
+ ]
+ )
+ ->label(false)
+ ->textInput();
+ echo $form->field(
+ $userData,
+ 'email',
+ [
+ 'inputTemplate' => '{input}' . Html::icon(
+ 'envelope',
+ [
+ 'prefix' => 'fa fa-',
+ 'class' => 'form-control-feedback left',
+ ]
+ ),
+ 'options' => [
+ 'class' => 'col-sm-6 col-xs-12 has-feedback item',
+ ],
+ 'inputOptions' => [
+ 'class' => 'form-control has-feedback-left',
+ 'placeholder' => $userData->getAttributeLabel('email'),
+ ],
+ 'errorOptions' => [
+ 'class' => 'help-block alert',
+ ],
+ ]
+ )
+ ->label(false)
+ ->textInput();
+ echo $form->field(
+ $userData,
+ 'phone',
+ [
+ 'inputTemplate' => '{input}' . Html::icon(
+ 'phone',
+ [
+ 'prefix' => 'fa fa-',
+ 'class' => 'form-control-feedback right',
+ ]
+ ),
+ 'options' => [
+ 'class' => 'col-sm-6 col-xs-12 has-feedback item',
+ ],
+ 'inputOptions' => [
+ 'placeholder' => '+38(000)000-00-00',
+ ],
+ 'errorOptions' => [
+ 'class' => 'help-block alert',
+ ],
+ ]
+ )
+ ->label(false)
+ ->textInput();
+ echo Html::tag(
+ 'div',
+ '',
+ [
+ 'class' => 'clearfix',
+ ]
+ );
+ echo Html::submitButton(
+ \Yii::t('core', 'Submit'),
+ [
+ 'class' => 'btn btn-default col-xs-4 col-sm-3 col-md-2 personal_info_submit_button',
+ ]
+ );
+ echo Html::tag(
+ 'div',
+ '',
+ [
+ 'class' => 'clearfix',
+ ]
+ );
+ $form::end();
+ echo Html::tag('hr');
+ echo Html::tag(
+ 'p',
+ \Yii::t(
+ 'core',
+ 'Registered on {date}',
+ [
+ 'date' => \Yii::$app->formatter->asDate($userData->created_at),
+ ]
+ ),
+ [
+ 'class' => 'small col-xs-6',
+ ]
+ );
+ echo Html::tag(
+ 'p',
+ \Yii::t(
+ 'core',
+ 'Last update on {date}',
+ [
+ 'date' => \Yii::$app->formatter->asDatetime($userData->updated_at, 'php:d.m.Y H:i'),
+ ]
+ ),
+ [
+ 'class' => 'small col-xs-6 text-right',
+ ]
+ );
diff --git a/artweb/artbox-core/views/profile/index.php b/artweb/artbox-core/views/profile/index.php
new file mode 100755
index 0000000..12e3a5d
--- /dev/null
+++ b/artweb/artbox-core/views/profile/index.php
@@ -0,0 +1,76 @@
+title = 'Profile';
+
+ $this->params[ 'breadcrumbs' ][] = $this->title;
+?>
+
+
+ \Yii::t('core', 'Profile information'),
+ ]
+ );
+ echo Collapse::widget(
+ [
+ 'items' => [
+ [
+ 'label' => Html::tag(
+ 'p',
+ \Yii::t('core', 'Personal information'),
+ [
+ 'class' => 'collapse_toggle_text',
+ ]
+ ),
+ 'content' => $this->render(
+ '_profile_info',
+ [
+ 'user' => $user,
+ 'userData' => $userData,
+ ]
+ ),
+ 'contentOptions' => [ 'class' => $changePasswordModel->hasErrors() ? '' : 'in' ],
+ ],
+ [
+ 'label' => Html::tag(
+ 'p',
+ \Yii::t('core', 'Change password'),
+ [
+ 'class' => 'collapse_toggle_text',
+ ]
+ ),
+ 'content' => $this->render(
+ '_change_password',
+ [
+ 'changePasswordModel' => $changePasswordModel,
+ ]
+ ),
+ 'contentOptions' => [ 'class' => $changePasswordModel->hasErrors() ? 'in' : '' ],
+ ],
+ ],
+ 'options' => [
+ 'class' => 'accordion profile_info_accordion',
+ ],
+ 'encodeLabels' => false,
+ ]
+ );
+ $xPanel::end();
+ ?>
+
+
+
\ No newline at end of file
diff --git a/artweb/artbox-core/views/seo/index.php b/artweb/artbox-core/views/seo/index.php
new file mode 100755
index 0000000..92b19c3
--- /dev/null
+++ b/artweb/artbox-core/views/seo/index.php
@@ -0,0 +1,20 @@
+
+
+
To be done!
+
...
+
'btn btn-primary btn-lg',
+ 'role' => 'button',
+ ]
+ ); ?>
+
+ \Yii::t('core', 'Static pages'),
+ 'collapsable' => true,
+ 'options' => [
+ 'class' => 'x_panel dynamic_fields',
+ ],
+ ]
+ );
+ foreach ($models as $index => $model) {
+ echo Html::tag(
+ 'div',
+ $form->field(
+ $model,
+ "[$index]url",
+ [
+ 'options' => [
+ 'class' => 'form-group col-xs-5',
+ ],
+ ]
+ )
+ ->textInput() . $form->field(
+ $model,
+ "[$index]priority",
+ [
+ 'options' => [
+ 'class' => 'form-group col-xs-2',
+ ],
+ ]
+ )
+ ->textInput() . Html::icon(
+ 'minus',
+ [
+ 'class' => 'col-xs-1 field-group-remove',
+ 'onclick' => 'sitemap_remove(this)',
+ ]
+ ),
+ [
+ 'class' => 'row field-group',
+ ]
+ );
+ }
+ echo Html::button(
+ \Yii::t('core', 'Add field'),
+ [
+ 'class' => 'btn btn-default',
+ 'onclick' => 'sitemap_add(this)',
+ 'data' => [
+ 'url' => Url::to([ 'seo/create-static' ]),
+ ],
+ ]
+ );
+ $xPanel::end();
+ $xPanel2 = Panel::begin(
+ [
+ 'header' => \Yii::t('core', 'Dynamic pages'),
+ 'collapsable' => true,
+ ]
+ );
+ echo Html::tag('h3', 'To be done...');
+ $xPanel2::end();
+ echo Html::submitButton(
+ \Yii::t('core', 'Generate'),
+ [
+ 'class' => 'btn btn-primary',
+ ]
+ );
+ $form::end();
+ $js = << 1) {
+ $(e)
+ .parents('.field-group')
+ .remove();
+ }
+ }
+JS;
+ $this->registerJs($js, $this::POS_END);
\ No newline at end of file
diff --git a/artweb/artbox-core/views/slide/_form.php b/artweb/artbox-core/views/slide/_form.php
new file mode 100755
index 0000000..d5deba2
--- /dev/null
+++ b/artweb/artbox-core/views/slide/_form.php
@@ -0,0 +1,52 @@
+
+
+
diff --git a/artweb/artbox-core/views/slide/_form_language.php b/artweb/artbox-core/views/slide/_form_language.php
new file mode 100755
index 0000000..0e8c46c
--- /dev/null
+++ b/artweb/artbox-core/views/slide/_form_language.php
@@ -0,0 +1,30 @@
+field($model_lang, '[' . $language->id . ']image_id')
+ ->widget(
+ ImageManagerInputWidget::className(),
+ [
+ 'aspectRatio' => ( 16 / 9 ),
+ //set the aspect ratio
+ 'showPreview' => true,
+ //false to hide the preview
+ 'showDeletePickedImageConfirm' => false,
+ //on true show warning before detach image
+ ]
+ );
+ echo $form->field($model_lang, '[' . $language->id . ']title')
+ ->textInput([ 'maxlength' => true ]);
+ echo $form->field($model_lang, '[' . $language->id . ']link')
+ ->textInput([ 'maxlength' => true ]);
+?>
\ No newline at end of file
diff --git a/artweb/artbox-core/views/slide/_search.php b/artweb/artbox-core/views/slide/_search.php
new file mode 100755
index 0000000..004b118
--- /dev/null
+++ b/artweb/artbox-core/views/slide/_search.php
@@ -0,0 +1,37 @@
+
+
+
+
+ [ 'index' ],
+ 'method' => 'get',
+ ]
+ ); ?>
+
+ = $form->field($model, 'id') ?>
+
+ = $form->field($model, 'slider_id') ?>
+
+ = $form->field($model, 'status')
+ ->checkbox() ?>
+
+ = $form->field($model, 'sort') ?>
+
+
+ = Html::submitButton(Yii::t('core', 'Search'), [ 'class' => 'btn btn-primary' ]) ?>
+ = Html::resetButton(Yii::t('core', 'Reset'), [ 'class' => 'btn btn-default' ]) ?>
+
+
+
+
+
diff --git a/artweb/artbox-core/views/slide/create.php b/artweb/artbox-core/views/slide/create.php
new file mode 100755
index 0000000..b0a65b1
--- /dev/null
+++ b/artweb/artbox-core/views/slide/create.php
@@ -0,0 +1,36 @@
+title = Yii::t('core', 'Create Slide');
+ $this->params[ 'breadcrumbs' ][] = [
+ 'label' => Yii::t('core', 'Slides'),
+ 'url' => [
+ 'index',
+ 'slider_id' => $slider->id,
+ ],
+ ];
+ $this->params[ 'breadcrumbs' ][] = $this->title;
+?>
+
+
+
= Html::encode($this->title) ?>
+
+ = $this->render(
+ '_form',
+ [
+ 'model' => $model,
+ 'modelLangs' => $modelLangs,
+ 'slider' => $slider,
+ ]
+ ) ?>
+
+
diff --git a/artweb/artbox-core/views/slide/index.php b/artweb/artbox-core/views/slide/index.php
new file mode 100755
index 0000000..c356555
--- /dev/null
+++ b/artweb/artbox-core/views/slide/index.php
@@ -0,0 +1,45 @@
+title = Yii::t('core', 'Slides');
+ $this->params[ 'breadcrumbs' ][] = $this->title;
+?>
+
+
+
= Html::encode($this->title) ?>
+ render('_search', ['model' => $searchModel]); ?>
+
+
+ = Html::a(Yii::t('core', 'Create Slide'),
+ [
+ 'create',
+ 'slider_id' => $slider->id,
+ ],
+ [ 'class' => 'btn btn-success' ]
+ ) ?>
+
+ = GridView::widget(
+ [
+ 'dataProvider' => $dataProvider,
+ 'filterModel' => $searchModel,
+ 'columns' => [
+ [ 'class' => 'yii\grid\SerialColumn' ],
+
+ 'id',
+ 'slider_id',
+ 'status:boolean',
+ 'sort',
+
+ [ 'class' => 'yii\grid\ActionColumn' ],
+ ],
+ ]
+ ); ?>
+
diff --git a/artweb/artbox-core/views/slide/update.php b/artweb/artbox-core/views/slide/update.php
new file mode 100755
index 0000000..a889880
--- /dev/null
+++ b/artweb/artbox-core/views/slide/update.php
@@ -0,0 +1,49 @@
+title = Yii::t(
+ 'core',
+ 'Update {modelClass}: ',
+ [
+ 'modelClass' => 'Slide',
+ ]
+ ) . $model->id;
+ $this->params[ 'breadcrumbs' ][] = [
+ 'label' => Yii::t('core', 'Slides'),
+ 'url' => [
+ 'index',
+ 'slider_id' => $slider->id,
+ ],
+ ];
+ $this->params[ 'breadcrumbs' ][] = [
+ 'label' => $model->id,
+ 'url' => [
+ 'view',
+ 'id' => $model->id,
+ ],
+ ];
+ $this->params[ 'breadcrumbs' ][] = Yii::t('core', 'Update');
+?>
+
+
+
= Html::encode($this->title) ?>
+
+ = $this->render(
+ '_form',
+ [
+ 'model' => $model,
+ 'modelLangs' => $modelLangs,
+ 'slider' => $slider,
+ ]
+ ) ?>
+
+
diff --git a/artweb/artbox-core/views/slide/view.php b/artweb/artbox-core/views/slide/view.php
new file mode 100755
index 0000000..2b98b54
--- /dev/null
+++ b/artweb/artbox-core/views/slide/view.php
@@ -0,0 +1,58 @@
+title = $model->id;
+ $this->params[ 'breadcrumbs' ][] = [
+ 'label' => Yii::t('core', 'Slides'),
+ 'url' => [ 'index' ],
+ ];
+ $this->params[ 'breadcrumbs' ][] = $this->title;
+?>
+
+
+
= Html::encode($this->title) ?>
+
+
+ = Html::a(
+ Yii::t('core', 'Update'),
+ [
+ 'update',
+ 'id' => $model->id,
+ ],
+ [ 'class' => 'btn btn-primary' ]
+ ) ?>
+ = Html::a(
+ Yii::t('core', 'Delete'),
+ [
+ 'delete',
+ 'id' => $model->id,
+ ],
+ [
+ 'class' => 'btn btn-danger',
+ 'data' => [
+ 'confirm' => Yii::t('core', 'Are you sure you want to delete this item?'),
+ 'method' => 'post',
+ ],
+ ]
+ ) ?>
+
+
+ = DetailView::widget(
+ [
+ 'model' => $model,
+ 'attributes' => [
+ 'id',
+ 'slider_id',
+ 'status:boolean',
+ 'sort',
+ ],
+ ]
+ ) ?>
+
+
diff --git a/artweb/artbox-core/views/slider/_form.php b/artweb/artbox-core/views/slider/_form.php
new file mode 100755
index 0000000..a8bb67b
--- /dev/null
+++ b/artweb/artbox-core/views/slider/_form.php
@@ -0,0 +1,33 @@
+
+
+
diff --git a/artweb/artbox-core/views/slider/_search.php b/artweb/artbox-core/views/slider/_search.php
new file mode 100755
index 0000000..6242edc
--- /dev/null
+++ b/artweb/artbox-core/views/slider/_search.php
@@ -0,0 +1,35 @@
+
+
+
+
+ [ 'index' ],
+ 'method' => 'get',
+ ]
+ ); ?>
+
+ = $form->field($model, 'id') ?>
+
+ = $form->field($model, 'status')
+ ->checkbox() ?>
+
+ = $form->field($model, 'sort') ?>
+
+
+ = Html::submitButton(Yii::t('core', 'Search'), [ 'class' => 'btn btn-primary' ]) ?>
+ = Html::resetButton(Yii::t('core', 'Reset'), [ 'class' => 'btn btn-default' ]) ?>
+
+
+
+
+
diff --git a/artweb/artbox-core/views/slider/create.php b/artweb/artbox-core/views/slider/create.php
new file mode 100755
index 0000000..e1c7385
--- /dev/null
+++ b/artweb/artbox-core/views/slider/create.php
@@ -0,0 +1,27 @@
+title = Yii::t('core', 'Create Slider');
+ $this->params[ 'breadcrumbs' ][] = [
+ 'label' => Yii::t('core', 'Sliders'),
+ 'url' => [ 'index' ],
+ ];
+ $this->params[ 'breadcrumbs' ][] = $this->title;
+?>
+
+
+
= Html::encode($this->title) ?>
+
+ = $this->render(
+ '_form',
+ [
+ 'model' => $model,
+ ]
+ ) ?>
+
+
diff --git a/artweb/artbox-core/views/slider/index.php b/artweb/artbox-core/views/slider/index.php
new file mode 100755
index 0000000..2efc8a6
--- /dev/null
+++ b/artweb/artbox-core/views/slider/index.php
@@ -0,0 +1,68 @@
+title = Yii::t('core', 'Sliders');
+ $this->params[ 'breadcrumbs' ][] = $this->title;
+?>
+
+
+
= Html::encode($this->title) ?>
+ render('_search', ['model' => $searchModel]); ?>
+
+
+ = Html::a(Yii::t('core', 'Create Slider'), [ 'create' ], [ 'class' => 'btn btn-success' ]) ?>
+
+ = GridView::widget(
+ [
+ 'dataProvider' => $dataProvider,
+ 'filterModel' => $searchModel,
+ 'columns' => [
+ [ 'class' => 'yii\grid\SerialColumn' ],
+
+ 'id',
+ 'status:boolean',
+ [
+ 'attribute' => 'sort',
+ 'filter' => false,
+ ],
+ [
+ 'class' => 'yii\grid\ActionColumn',
+ 'buttons' => [
+ 'slides' => function ($url, $model, $key) {
+ /**
+ * @var \artbox\core\models\Slider $model
+ */
+ return Html::a(
+ Html::tag(
+ 'i',
+ '',
+ [
+ 'class' => 'glyphicon glyphicon-picture',
+ ]
+ ),
+ [
+ 'slide/index',
+ 'slider_id' => $model->id,
+ ],
+ [
+ 'title' => \Yii::t('core', 'Slides'),
+ 'data' => [
+ 'pjax' => 0,
+ ],
+ ]
+ );
+ },
+ ],
+ 'template' => '{slides} {view} {update} {delete}',
+ ],
+ ],
+ ]
+ ); ?>
+
diff --git a/artweb/artbox-core/views/slider/update.php b/artweb/artbox-core/views/slider/update.php
new file mode 100755
index 0000000..2485a80
--- /dev/null
+++ b/artweb/artbox-core/views/slider/update.php
@@ -0,0 +1,40 @@
+title = Yii::t(
+ 'core',
+ 'Update {modelClass}: ',
+ [
+ 'modelClass' => 'Slider',
+ ]
+ ) . $model->id;
+ $this->params[ 'breadcrumbs' ][] = [
+ 'label' => Yii::t('core', 'Sliders'),
+ 'url' => [ 'index' ],
+ ];
+ $this->params[ 'breadcrumbs' ][] = [
+ 'label' => $model->id,
+ 'url' => [
+ 'view',
+ 'id' => $model->id,
+ ],
+ ];
+ $this->params[ 'breadcrumbs' ][] = Yii::t('core', 'Update');
+?>
+
+
+
= Html::encode($this->title) ?>
+
+ = $this->render(
+ '_form',
+ [
+ 'model' => $model,
+ ]
+ ) ?>
+
+
diff --git a/artweb/artbox-core/views/slider/view.php b/artweb/artbox-core/views/slider/view.php
new file mode 100755
index 0000000..310962d
--- /dev/null
+++ b/artweb/artbox-core/views/slider/view.php
@@ -0,0 +1,57 @@
+title = $model->id;
+ $this->params[ 'breadcrumbs' ][] = [
+ 'label' => Yii::t('core', 'Sliders'),
+ 'url' => [ 'index' ],
+ ];
+ $this->params[ 'breadcrumbs' ][] = $this->title;
+?>
+
+
+
= Html::encode($this->title) ?>
+
+
+ = Html::a(
+ Yii::t('core', 'Update'),
+ [
+ 'update',
+ 'id' => $model->id,
+ ],
+ [ 'class' => 'btn btn-primary' ]
+ ) ?>
+ = Html::a(
+ Yii::t('core', 'Delete'),
+ [
+ 'delete',
+ 'id' => $model->id,
+ ],
+ [
+ 'class' => 'btn btn-danger',
+ 'data' => [
+ 'confirm' => Yii::t('core', 'Are you sure you want to delete this item?'),
+ 'method' => 'post',
+ ],
+ ]
+ ) ?>
+
+
+ = DetailView::widget(
+ [
+ 'model' => $model,
+ 'attributes' => [
+ 'id',
+ 'status:boolean',
+ 'sort',
+ ],
+ ]
+ ) ?>
+
+
diff --git a/artweb/artbox-core/web/css/styles.css b/artweb/artbox-core/web/css/styles.css
new file mode 100755
index 0000000..0bb7e67
--- /dev/null
+++ b/artweb/artbox-core/web/css/styles.css
@@ -0,0 +1,380 @@
+.profile_custom_title.x_title h2 {
+ float: none;
+ text-align: center; }
+ @media (max-width: 1200px) {
+ .profile_custom_title.x_title h2 {
+ width: 100%; } }
+
+.profile_info_accordion .form-group {
+ position: relative; }
+ .profile_info_accordion .form-group .help-block.alert {
+ position: relative;
+ top: 0;
+ margin-bottom: 10px;
+ left: -20px;
+ border-radius: 0 0 4px 3px;
+ white-space: nowrap;
+ overflow: hidden;
+ width: 100%;
+ max-width: inherit;
+ text-overflow: ellipsis; }
+ .profile_info_accordion .form-group .image-manager-input .image-wrapper-new {
+ cursor: default;
+ position: relative;
+ overflow: hidden;
+ border-radius: 50%;
+ width: 170px;
+ height: 170px;
+ display: block;
+ margin: 0 auto;
+ margin-bottom: 20px;
+ border: 5px solid #fff;
+ box-shadow: 0 0 3px 1px #ddd; }
+ .profile_info_accordion .form-group .image-manager-input .image-wrapper-new .add_image {
+ cursor: pointer;
+ position: absolute;
+ background-color: rgba(0, 0, 0, 0.5);
+ width: 100%;
+ height: 100%;
+ bottom: -100%;
+ transition: 0.2s; }
+ .profile_info_accordion .form-group .image-manager-input .image-wrapper-new .add_image i.glyphicon-folder-open {
+ color: white;
+ font-size: 24px;
+ position: absolute;
+ top: calc(50% - 12px);
+ left: calc(50% - 12px); }
+ .profile_info_accordion .form-group .image-manager-input .image-wrapper-new:hover .add_image {
+ bottom: 0; }
+ .profile_info_accordion .form-group .image-manager-input .image-wrapper-new:after {
+ content: '';
+ display: block;
+ background: #dadada;
+ width: 165px;
+ height: 165px; }
+ .profile_info_accordion .form-group .image-manager-input .input-group {
+ display: none; }
+ .profile_info_accordion .form-group .image-manager-input .image-wrapper {
+ cursor: default;
+ position: relative;
+ overflow: hidden;
+ border-radius: 50%;
+ width: 170px;
+ height: 170px;
+ display: block;
+ margin: 0 auto;
+ margin-bottom: 20px;
+ border: 5px solid #fff;
+ box-shadow: 0 0 3px 1px #ddd; }
+ .profile_info_accordion .form-group .image-manager-input .image-wrapper .delete_image {
+ position: absolute;
+ background-color: rgba(0, 0, 0, 0.5);
+ width: 30%;
+ height: 30%;
+ display: block;
+ top: -30%;
+ right: -30%;
+ border-radius: 0 0 0 5px;
+ transition: 0.2s;
+ cursor: pointer; }
+ .profile_info_accordion .form-group .image-manager-input .image-wrapper .delete_image i.glyphicon-remove {
+ color: white;
+ font-size: 15px;
+ position: absolute;
+ top: 27px;
+ left: 7px;
+ text-shadow: 0 1px 1px rgba(0, 0, 0, 0.4); }
+ .profile_info_accordion .form-group .image-manager-input .image-wrapper .add_image {
+ content: '';
+ width: 100%;
+ height: 30%;
+ background-color: rgba(0, 0, 0, 0.5);
+ position: absolute;
+ bottom: -30%;
+ left: 0;
+ transition: 0.3s;
+ cursor: pointer; }
+ .profile_info_accordion .form-group .image-manager-input .image-wrapper .add_image i.glyphicon-folder-open {
+ color: white;
+ font-size: 15px;
+ position: absolute;
+ top: 25%;
+ left: calc(50% - 7px);
+ text-shadow: 0 1px 1px rgba(0, 0, 0, 0.4); }
+ .profile_info_accordion .form-group .image-manager-input .image-wrapper:hover .add_image {
+ bottom: 0; }
+ .profile_info_accordion .form-group .image-manager-input .image-wrapper:hover .delete_image {
+ top: 0;
+ right: 0;
+ transition: 0.2s; }
+ .profile_info_accordion .form-group .image-manager-input .image-wrapper img {
+ object-fit: cover;
+ width: 165px !important;
+ height: 165px !important;
+ margin: -5px;
+ text-align: center; }
+.profile_info_accordion .panel-heading {
+ padding: 0; }
+.profile_info_accordion .collapse_toggle_text {
+ margin: 0;
+ padding: 10px 0; }
+.profile_info_accordion .panel:hover {
+ background: none; }
+.profile_info_accordion .panel .panel-body {
+ text-align: left; }
+ .profile_info_accordion .panel .panel-body .personal_info_submit_button {
+ margin-left: 10px; }
+ .profile_info_accordion .panel .panel-body .profile_edit_image {
+ text-align: center; }
+ .profile_info_accordion .panel .panel-body .profile_edit_image img {
+ max-width: 100%;
+ border-radius: 50%; }
+
+.form-control-feedback {
+ margin: 0;
+ height: 32px;
+ margin-top: 1px;
+ padding-top: 4px; }
+
+.profile_edit_image {
+ display: none; }
+
+.form-control.has-feedback-left {
+ padding-right: 10px !important; }
+
+.table.borderless td, .table.borderless th {
+ border: none; }
+
+.right_border {
+ border-right: 2px lightgrey solid; }
+
+.nav-sm .navbar.nav_title a span.fa {
+ display: block;
+ min-height: 50px;
+ top: 25px;
+ left: 15px;
+ position: relative; }
+
+.has-feedback.has-error.bad {
+ padding-bottom: 8px; }
+ .has-feedback.has-error.bad .help-block.alert {
+ opacity: 1;
+ position: relative;
+ max-width: inherit;
+ top: 0;
+ left: 0;
+ margin: 0;
+ z-index: 2;
+ width: 100%;
+ overflow: hidden;
+ margin-bottom: 10px;
+ border-radius: 0 0 4px 3px; }
+ @media (min-width: 1200px) {
+ .has-feedback.has-error.bad .help-block.alert {
+ opacity: 1;
+ position: absolute;
+ max-width: inherit;
+ width: initial;
+ top: 4px;
+ left: 100%;
+ z-index: 4;
+ overflow: visible;
+ margin: 0;
+ border-radius: 3px 4px 4px 3px; } }
+
+@media (min-width: 1200px) {
+ .field-userdata-email.has-error.bad .help-block.alert {
+ left: initial;
+ right: 100%; }
+ .field-userdata-email.has-error.bad .help-block.alert:after {
+ border-color: transparent transparent transparent #ce5454;
+ left: initial;
+ right: -13px; } }
+
+.alias-search .form-group input, .alias-search .form-group select {
+ width: 100%; }
+.alias-search .field-aliassearch-search {
+ width: 30%;
+}
+
+.alias-search .field-aliassearch-entity {
+ width: 20%;
+}
+.alias-search .field-aliassearch-static {
+ width: 20%; }
+.alias-search .field-aliassearch-language_id {
+ width: 20%; }
+.alias-search .btn {
+ width: 10%;
+ border-radius: 0;
+ margin-bottom: 10px;
+ margin-right: 0; }
+
+.field-group .field-group-remove {
+ display: block;
+ height: 50px;
+ padding-top: 25px;
+ font-size: 23px; }
+
+.sitemap-buttons .btn {
+ height: 200px;
+ font-size: 25px;
+ padding: 10% 10%;
+ overflow: hidden;
+ width: 50%; }
+ .sitemap-buttons .btn .fa {
+ font-size: 70px; }
+ .sitemap-buttons .btn .indexed {
+ z-index: 100;
+ position: relative; }
+ .sitemap-buttons .btn.active .spinner {
+ display: block; }
+ .sitemap-buttons .btn .spinner {
+ display: none;
+ position: absolute;
+ border-radius: 100%;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ background-color: palegreen;
+ -webkit-animation: sk-scaleout 1.5s infinite ease-in-out;
+ animation: sk-scaleout 1.5s infinite ease-in-out; }
+
+@-webkit-keyframes sk-scaleout {
+ 0% {
+ -webkit-transform: scale(0); }
+ 100% {
+ -webkit-transform: scale(1.5);
+ opacity: 0.5; } }
+@keyframes sk-scaleout {
+ 0% {
+ -webkit-transform: scale(0);
+ transform: scale(0); }
+ 100% {
+ -webkit-transform: scale(1.5);
+ transform: scale(1.5);
+ opacity: 0.5; } }
+.language-form-frame {
+ border-bottom: 25px solid #f5f7fa;
+ border-right: 15px solid #f5f7fa;
+ border-left: 15px solid #f5f7fa;
+ border-top: 15px solid #f5f7fa;
+ margin-top: 30px; }
+ .language-form-frame .tab-content {
+ padding: 0 15px; }
+
+.bar_tabs > li.disabled a {
+ background-color: lightgrey; }
+ .bar_tabs > li.disabled a:hover, .bar_tabs > li.disabled a:focus {
+ background-color: lightgrey; }
+
+.gw-item {
+ overflow: hidden;
+ padding: 0 0 10px;
+ margin: 0 10px 20px;
+ text-align: center;
+ border-radius: 5px;
+ box-shadow: 0px 0px 0px 1px #e6e9ed; }
+ .gw-item .text-info {
+ min-height: 19px; }
+ .gw-item .image_gall {
+ background-color: #f5f7fa;
+ position: relative;
+ padding: 0 0 80%;
+ margin: 0 0 10px;
+ border-bottom: 1px solid #e6e9ed; }
+ .gw-item .image_gall img {
+ position: absolute;
+ width: calc(100% - 20px);
+ height: calc(100% - 20px);
+ left: 0;
+ margin: 10px;
+ background-color: white;
+ outline: none; }
+
+.icheckbox_flat-green,
+.iradio_flat-green {
+ margin-right: 7px;
+ margin-bottom: 2px; }
+
+.loader-wrapper {
+ background: rgba(255, 255, 255, 0.7);
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ z-index: 2000;
+}
+
+.loader {
+ display: block;
+ position: relative;
+ left: 50%;
+ top: 50%;
+ width: 150px;
+ height: 150px;
+ margin: -75px 0 0 -75px;
+ border-radius: 50%;
+ border: 3px solid transparent;
+ border-top-color: #1980b3;
+ z-index: 2001;
+ -webkit-animation: spin 2s linear infinite;
+ animation: spin 2s linear infinite;
+}
+
+.loader:before {
+ content: "";
+ position: absolute;
+ top: 5px;
+ left: 5px;
+ right: 5px;
+ bottom: 5px;
+ border-radius: 50%;
+ border: 3px solid transparent;
+ border-top-color: #3399cc;
+ -webkit-animation: spin 3s linear infinite;
+ animation: spin 3s linear infinite;
+}
+
+.loader:after {
+ content: "";
+ position: absolute;
+ top: 15px;
+ left: 15px;
+ right: 15px;
+ bottom: 15px;
+ border-radius: 50%;
+ border: 3px solid transparent;
+ border-top-color: #70b7da;
+ -webkit-animation: spin 1.5s linear infinite;
+ animation: spin 1.5s linear infinite;
+}
+
+@-webkit-keyframes spin {
+ 0% {
+ -webkit-transform: rotate(0deg);
+ -ms-transform: rotate(0deg);
+ transform: rotate(0deg);
+ }
+ 100% {
+ -webkit-transform: rotate(360deg);
+ -ms-transform: rotate(360deg);
+ transform: rotate(360deg);
+ }
+}
+@keyframes spin {
+ 0% {
+ -webkit-transform: rotate(0deg);
+ -ms-transform: rotate(0deg);
+ transform: rotate(0deg);
+ }
+ 100% {
+ -webkit-transform: rotate(360deg);
+ -ms-transform: rotate(360deg);
+ transform: rotate(360deg);
+ }
+}
+
+/*# sourceMappingURL=styles.css.map */
diff --git a/artweb/artbox-core/web/css/styles.css.map b/artweb/artbox-core/web/css/styles.css.map
new file mode 100755
index 0000000..8a5fcb7
--- /dev/null
+++ b/artweb/artbox-core/web/css/styles.css.map
@@ -0,0 +1,7 @@
+{
+"version": 3,
+ "mappings": "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",
+"sources": ["styles.scss"],
+"names": [],
+"file": "styles.css"
+}
\ No newline at end of file
diff --git a/artweb/artbox-core/web/css/styles.scss b/artweb/artbox-core/web/css/styles.scss
new file mode 100755
index 0000000..2fc5d6b
--- /dev/null
+++ b/artweb/artbox-core/web/css/styles.scss
@@ -0,0 +1,475 @@
+$small-screen: 768px;
+$medium-screen: 970px;
+$large-screen: 1200px;
+
+.profile_custom_title.x_title {
+ h2 {
+ @media (max-width: $large-screen) {
+ width: 100%;
+ }
+ float: none;
+ text-align: center;
+ }
+}
+
+.profile_info_accordion {
+ .form-group {
+ position: relative;
+ .help-block.alert {
+ position: relative;
+ top: 0;
+ margin-bottom: 10px;
+ left: -20px;
+ border-radius: 0 0 4px 3px;
+ white-space: nowrap;
+ overflow: hidden;
+ width: 100%;
+ max-width: inherit;
+ text-overflow: ellipsis;
+ }
+ .image-manager-input {
+ .image-wrapper-new {
+ cursor: default;
+ position: relative;
+ overflow: hidden;
+ border-radius: 50%;
+ width: 170px;
+ height: 170px;
+ display: block;
+ margin: 0 auto;
+ margin-bottom: 20px;
+ border: 5px solid #fff;
+ box-shadow: 0 0 3px 1px #ddd;
+ .add_image {
+ cursor: pointer;
+ position: absolute;
+ background-color: rgba(0, 0, 0, 0.5);
+ width: 100%;
+ height: 100%;
+ bottom: -100%;
+ transition: 0.2s;
+ i.glyphicon-folder-open {
+ color: white;
+ font-size: 24px;
+ position: absolute;
+ top: calc(50% - 12px);
+ left: calc(50% - 12px);
+ }
+ }
+ &:hover .add_image {
+ bottom: 0;
+ }
+ &:after {
+ content: '';
+ display: block;
+ background: #dadada;
+ width: 165px;
+ height: 165px;
+ }
+ }
+ .input-group {
+ display: none;
+ }
+ .image-wrapper {
+ cursor: default;
+ position: relative;
+ overflow: hidden;
+ border-radius: 50%;
+ width: 170px;
+ height: 170px;
+ display: block;
+ margin: 0 auto;
+ margin-bottom: 20px;
+ border: 5px solid #fff;
+ box-shadow: 0 0 3px 1px #ddd;
+ .delete_image {
+ position: absolute;
+ background-color: rgba(0, 0, 0, 0.5);
+ width: 30%;
+ height: 30%;
+ display: block;
+ top: -30%;
+ right: -30%;
+ border-radius: 0 0 0 5px;
+ transition: 0.2s;
+ cursor: pointer;
+ i.glyphicon-remove {
+ color: rgb(255, 255, 255);
+ font-size: 15px;
+ position: absolute;
+ top: 27px;
+ left: 7px;
+ text-shadow: 0 1px 1px rgba(0, 0, 0, 0.4);
+ }
+ }
+ .add_image {
+ content: '';
+ width: 100%;
+ height: 30%;
+ background-color: rgba(0, 0, 0, 0.5);
+ position: absolute;
+ bottom: -30%;
+ left: 0;
+ transition: 0.3s;
+ cursor: pointer;
+ i.glyphicon-folder-open {
+ color: white;
+ font-size: 15px;
+ position: absolute;
+ top: 25%;
+ left: calc(50% - 7px);
+ text-shadow: 0 1px 1px rgba(0, 0, 0, 0.4);
+ }
+ }
+ &:hover .add_image {
+ bottom: 0;
+ }
+ &:hover .delete_image {
+ top: 0;
+ right: 0;
+ transition: 0.2s;
+ }
+ img {
+ object-fit: cover;
+ width: 165px !important;
+ height: 165px !important;
+ margin: -5px;
+ text-align: center;
+ }
+ }
+ }
+ }
+ .panel-heading {
+ padding: 0;
+ }
+ .collapse_toggle_text {
+ margin: 0;
+ padding: 10px 0;
+ }
+ .panel {
+ &:hover {
+ background: none;
+ }
+ .panel-body {
+ text-align: left;
+ .personal_info_submit_button {
+ margin-left: 10px;
+ }
+ .profile_edit_image {
+ text-align: center;
+ img {
+ max-width: 100%;
+ border-radius: 50%;
+ }
+ }
+ }
+ }
+}
+
+.form-control-feedback {
+ margin: 0;
+ height: 32px;
+ margin-top: 1px;
+ padding-top: 4px;
+}
+
+.profile_edit_image {
+ display: none;
+}
+
+.form-control.has-feedback-left {
+ padding-right: 10px !important;
+}
+
+.table.borderless {
+ td, th {
+ border: none;
+ }
+}
+
+.right_border {
+ border-right: 2px lightgrey solid;
+}
+
+.nav-sm .navbar.nav_title a span.fa {
+ display: block;
+ min-height: 50px;
+ top: 25px;
+ left: 15px;
+ position: relative;
+}
+
+.has-feedback.has-error.bad {
+ padding-bottom: 8px;
+ .help-block.alert {
+ opacity: 1;
+ position: relative;
+ max-width: inherit;
+ top: 0;
+ left: 0;
+ margin: 0;
+ z-index: 2;
+ width: 100%;
+ overflow: hidden;
+ margin-bottom: 10px;
+ border-radius: 0 0 4px 3px;
+ @media(min-width: $large-screen) {
+ opacity: 1;
+ position: absolute;
+ max-width: inherit;
+ width: initial;
+ top: 4px;
+ left: 100%;
+ z-index: 4;
+ overflow: visible;
+ margin: 0;
+ border-radius: 3px 4px 4px 3px;
+ }
+ }
+}
+
+.field-userdata-email.has-error.bad {
+ @media(min-width: $large-screen) {
+ .help-block.alert {
+ left: initial;
+ right: 100%;
+ &:after {
+ border-color: transparent transparent transparent #ce5454;
+ left: initial;
+ right: -13px;
+ }
+ }
+ }
+}
+
+.alias-search {
+ .form-group {
+ input, select {
+ width: 100%;
+ }
+ }
+ .field-aliassearch-search {
+ width: 30%;
+ }
+ .field-aliassearch-entity {
+ width: 20%;
+ }
+ .field-aliassearch-static {
+ width: 20%;
+ }
+ .field-aliassearch-language_id {
+ width: 20%;
+ }
+ .btn {
+ width: 10%;
+ border-radius: 0;
+ margin-bottom: 10px;
+ margin-right: 0;
+ }
+}
+
+.field-group {
+ .field-group-remove {
+ display: block;
+ height: 50px;
+ padding-top: 25px;
+ font-size: 23px;
+ }
+}
+
+.sitemap-buttons {
+ .btn {
+ height: 200px;
+ font-size: 25px;
+ padding: 10% 10%;
+ overflow: hidden;
+ width: 50%;
+ .fa {
+ font-size: 70px;
+ }
+ .indexed {
+ z-index: 100;
+ position: relative;
+ }
+ &.active {
+ .spinner {
+ display: block;
+ }
+ }
+ .spinner {
+ display: none;
+ position: absolute;
+ border-radius: 100%;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ background-color: palegreen;
+ -webkit-animation: sk-scaleout 1.5s infinite ease-in-out;
+ animation: sk-scaleout 1.5s infinite ease-in-out;
+ }
+ }
+}
+
+@-webkit-keyframes sk-scaleout {
+ 0% {
+ -webkit-transform: scale(0)
+ }
+ 100% {
+ -webkit-transform: scale(1.5);
+ opacity: 0.5;
+ }
+}
+
+@keyframes sk-scaleout {
+ 0% {
+ -webkit-transform: scale(0);
+ transform: scale(0);
+ }
+ 100% {
+ -webkit-transform: scale(1.5);
+ transform: scale(1.5);
+ opacity: 0.5;
+ }
+}
+
+.language-form-frame {
+ border-bottom: 25px solid #f5f7fa;
+ border-right: 15px solid #f5f7fa;
+ border-left: 15px solid #f5f7fa;
+ border-top: 15px solid #f5f7fa;
+ margin-top: 30px;
+ .tab-content {
+ padding: 0 15px;
+ }
+}
+
+.bar_tabs {
+ & > li {
+ &.disabled {
+ a {
+ background-color: lightgrey;
+ &:hover, &:focus {
+ background-color: lightgrey;
+ }
+ }
+ }
+ }
+}
+
+.gw-item {
+ overflow: hidden;
+ padding: 0 0 10px;
+ margin: 0 10px 20px;
+ text-align: center;
+ border-radius: 5px;
+ box-shadow: 0px 0px 0px 1px #e6e9ed;
+ .text-info {
+ min-height: 19px;
+ }
+ .image_gall {
+ background-color: #f5f7fa;
+ position: relative;
+ padding: 0 0 80%;
+ margin: 0 0 10px;
+ border-bottom: 1px solid #e6e9ed;
+ img {
+ position: absolute;
+ width: calc(100% - 20px);
+ height: calc(100% - 20px);
+ left: 0;
+ margin: 10px;
+ background-color: white;
+ outline: none;
+ }
+ }
+}
+
+.icheckbox_flat-green,
+.iradio_flat-green {
+ margin-right: 7px;
+ margin-bottom: 2px;
+}
+
+.loader-wrapper {
+ background: rgba(255, 255, 255, 0.7);
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ z-index: 2000;
+}
+
+.loader {
+ display: block;
+ position: relative;
+ left: 50%;
+ top: 50%;
+ width: 150px;
+ height: 150px;
+ margin: -75px 0 0 -75px;
+ border-radius: 50%;
+ border: 3px solid transparent;
+ border-top-color: #1980b3;
+ z-index: 2001;
+
+ -webkit-animation: spin 2s linear infinite;
+ animation: spin 2s linear infinite;
+}
+
+.loader:before {
+ content: "";
+ position: absolute;
+ top: 5px;
+ left: 5px;
+ right: 5px;
+ bottom: 5px;
+ border-radius: 50%;
+ border: 3px solid transparent;
+ border-top-color: #3399cc;
+
+ -webkit-animation: spin 3s linear infinite;
+ animation: spin 3s linear infinite;
+}
+
+.loader:after {
+ content: "";
+ position: absolute;
+ top: 15px;
+ left: 15px;
+ right: 15px;
+ bottom: 15px;
+ border-radius: 50%;
+ border: 3px solid transparent;
+ border-top-color: #70b7da;
+
+ -webkit-animation: spin 1.5s linear infinite;
+ animation: spin 1.5s linear infinite;
+}
+
+@-webkit-keyframes spin {
+ 0% {
+ -webkit-transform: rotate(0deg);
+ -ms-transform: rotate(0deg);
+ transform: rotate(0deg);
+ }
+ 100% {
+ -webkit-transform: rotate(360deg);
+ -ms-transform: rotate(360deg);
+ transform: rotate(360deg);
+ }
+}
+
+@keyframes spin {
+ 0% {
+ -webkit-transform: rotate(0deg);
+ -ms-transform: rotate(0deg);
+ transform: rotate(0deg);
+ }
+ 100% {
+ -webkit-transform: rotate(360deg);
+ -ms-transform: rotate(360deg);
+ transform: rotate(360deg);
+ }
+}
diff --git a/artweb/artbox-core/web/js/script.js b/artweb/artbox-core/web/js/script.js
new file mode 100755
index 0000000..0c14550
--- /dev/null
+++ b/artweb/artbox-core/web/js/script.js
@@ -0,0 +1,157 @@
+$(function() {
+
+ $('.profile_info_accordion .image-wrapper')
+ .append('
');
+ if ($(".profile_info_accordion .image-wrapper.hide")
+ .hasClass("hide")) {
+ $('.profile_info_accordion .image-manager-input')
+ .append('');
+ } else {
+ $('.profile_info_accordion .image-manager-input')
+ .append('');
+ }
+
+ $(document)
+ .on('click', '.add_image', function() {
+ $(this)
+ .parent()
+ .parent()
+ .find(".open-modal-imagemanager")
+ .click();
+ $(".image-wrapper-new")
+ .addClass('hide');
+ $(".image-wrapper")
+ .removeClass('hide');
+
+ });
+ $(document)
+ .on('click', '.delete_image', function() {
+ $(this)
+ .parent()
+ .parent()
+ .find(".delete-selected-image")
+ .click();
+ $(".image-wrapper-new")
+ .removeClass("hide");
+ return false;
+ });
+ $(document)
+ .on('click', '.slugify_button', function() {
+ var id = $(this)
+ .data('id');
+ var attribute_id = $(this)
+ .data('attribute-id');
+ var url = $(this)
+ .data('url');
+ var language_id = $(this)
+ .data('language-id');
+ var input = $('#' + id);
+ var attribute_input = $('#' + attribute_id);
+ var value = attribute_input.val();
+ if (id !== undefined && url !== undefined && value !== undefined && attribute_id !== undefined && value.length > 0) {
+ $.get(url, {
+ text: value,
+ languageId: language_id
+ }, function(data) {
+ input.val(data);
+ });
+ }
+ });
+ $(document)
+ .on('click', '.slugify_cancel_button', function() {
+ var id = $(this)
+ .data('id');
+ var value = $(this)
+ .data('value');
+ var input = $('#' + id);
+ if (id !== undefined && value !== undefined) {
+ input.val(value);
+ }
+ });
+
+ $(document)
+ .on('click', 'a.viewed-toggle', function(e) {
+ e.preventDefault();
+ var a = $(this);
+ $.ajax({
+ type: "POST",
+ url: a.attr('href'),
+ success: function(data) {
+ console.log(data);
+ a.parent()
+ .parent()
+ .removeClass('success');
+ a.replaceWith(data.text);
+ $('.feedback-widget')
+ .replaceWith(data.widget);
+ new PNotify({
+ title: data.message.title,
+ text: data.message.text,
+ type: "success",
+ styling: "bootstrap3",
+ icon: "glyphicon glyphicon-exclamation-sign"
+ });
+ }
+ });
+ });
+ $(document)
+ .on('click', '.main_menu .homepage_link a', function() {
+ $(this)
+ .parents('.homepage_link')
+ .removeClass('active');
+ });
+ $(document)
+ .on('click', '.sitemap-buttons .btn.ajax', function(e) {
+ e.preventDefault();
+ var url = $(this)
+ .attr('href');
+ $(this)
+ .addClass('active');
+ $.get(url, function() {
+ $(this)
+ .removeClass('active');
+ new PNotify({
+ title: "Карта сайта",
+ text: "Карта сайта успещно сгенерирована",
+ type: "success",
+ styling: "bootstrap3",
+ icon: "glyphicon glyphicon-exclamation-sign"
+ });
+ if ($(this)
+ .data('need-reload')) {
+ setTimeout(function() {
+ location.reload();
+ }, 1000);
+ }
+ }.bind(this))
+ .fail(function() {
+ $(this)
+ .removeClass('active');
+ new PNotify({
+ title: "Карта сайта",
+ text: "Ошибка при генерации карты сайта",
+ type: "error",
+ styling: "bootstrap3",
+ icon: "glyphicon glyphicon-exclamation-sign"
+ });
+ }.bind(this));
+ });
+ $('.bar_tabs>li.disabled a')
+ .removeAttr('data-toggle');
+ $(document)
+ .on('click', '.artbox-selection-delete', function(e) {
+ var selectedRows = $('.grid-view')
+ .yiiGridView('getSelectedRows');
+ var msg = $(this)
+ .data('message');
+ var url = $(this)
+ .data('url');
+ if (selectedRows.length > 0 && confirm(msg)) {
+ $.post(url + '?ids=' + encodeURIComponent(selectedRows), function(data) {
+ if (data.success) {
+ location.reload();
+ }
+ })
+ }
+ });
+});
\ No newline at end of file
diff --git a/artweb/artbox-core/widgets/BitMaskWidget.php b/artweb/artbox-core/widgets/BitMaskWidget.php
new file mode 100755
index 0000000..de7bcc0
--- /dev/null
+++ b/artweb/artbox-core/widgets/BitMaskWidget.php
@@ -0,0 +1,73 @@
+model->fields as $id => $field) {
+ $value = boolval($this->model->getMaskInt() & 2 ** $field);
+ echo Html::beginTag('div', [ 'class' => 'form-group' ]);
+ echo Html::checkbox(
+ $this->model->getModelName() . '[masks][' . $id . ']',
+ $value,
+ [ 'class' => 'flat' ]
+ );
+ echo Html::label(
+ $id,
+ null,
+ [
+ 'class' => 'control-label',
+ ]
+ );
+ echo Html::endTag('div');
+ }
+ }
+
+ /**
+ * Only for Active records
+ *
+ * @param \yii\db\ActiveRecord $model
+ */
+ public function setModel(ActiveRecord $model)
+ {
+ $this->model = $model;
+ }
+
+ /**
+ * Form must be active form
+ *
+ * @param \yii\widgets\ActiveForm $form
+ */
+ public function setForm(ActiveForm $form)
+ {
+ $this->form = $form;
+ }
+ }
\ No newline at end of file
diff --git a/artweb/artbox-core/widgets/FeedbackWidget.php b/artweb/artbox-core/widgets/FeedbackWidget.php
new file mode 100755
index 0000000..3b48eb4
--- /dev/null
+++ b/artweb/artbox-core/widgets/FeedbackWidget.php
@@ -0,0 +1,31 @@
+where(
+ [
+ 'status' => false,
+ ]
+ )
+ ->count();
+
+ return $this->render(
+ '_feedback',
+ [
+ 'count' => $count,
+ ]
+ );
+ }
+ }
\ No newline at end of file
diff --git a/artweb/artbox-core/widgets/FlashWidget.php b/artweb/artbox-core/widgets/FlashWidget.php
new file mode 100755
index 0000000..273b44f
--- /dev/null
+++ b/artweb/artbox-core/widgets/FlashWidget.php
@@ -0,0 +1,41 @@
+flashes as $flash) {
+ if (Yii::$app->session->hasFlash($flash)) {
+ $message = Yii::$app->session->getFlash($flash);
+ $js = '
+ new PNotify({
+ title: "' . Yii::t('core', 'Notification') . ':",
+ text: "' . $message . '",
+ type: "' . $flash . '",
+ styling: "bootstrap3",
+ icon: "glyphicon glyphicon-exclamation-sign"
+ });
+ ';
+ return $this->render('_flash', [ 'js' => $js ]);
+ }
+ }
+ return '';
+ }
+
+ }
\ No newline at end of file
diff --git a/artweb/artbox-core/widgets/GalleryWidget.php b/artweb/artbox-core/widgets/GalleryWidget.php
new file mode 100755
index 0000000..44252fc
--- /dev/null
+++ b/artweb/artbox-core/widgets/GalleryWidget.php
@@ -0,0 +1,28 @@
+render(
+ '_gallery_view',
+ [
+ 'images' => $this->model->getImages(),
+ ]
+ );
+ }
+ }
\ No newline at end of file
diff --git a/artweb/artbox-core/widgets/LangLink.php b/artweb/artbox-core/widgets/LangLink.php
new file mode 100755
index 0000000..7ece995
--- /dev/null
+++ b/artweb/artbox-core/widgets/LangLink.php
@@ -0,0 +1,97 @@
+languageIds)) {
+ $this->languageIds = Language::find()
+ ->select(
+ [
+ 'url',
+ 'id',
+ ]
+ )
+ ->where([ 'status' => true ])
+ ->asArray()
+ ->indexBy('id')
+ ->column();
+ }
+ if (count($this->languageIds) < 2) {
+ return;
+ }
+ foreach ($this->languageIds as $languageId => $url) {
+ if (Language::getCurrent()->id !== $languageId) {
+ $this->links[ $languageId ] = Html::a(
+ $url,
+ Url::to(
+ [ \Yii::$app->requestedRoute ] + \Yii::$app->request->get(
+ ) + [ 'language_id' => $languageId ],
+ true
+ )
+ );
+ } else {
+ $this->links[ $languageId ] = $url;
+ }
+ }
+ }
+
+ public function run()
+ {
+ return $this->render('_langLink');
+ }
+
+ protected function mapAliases(array $aliases): array
+ {
+ $map = [];
+ $result = [];
+ $currentLanguageId = Language::getCurrent()->id;
+ foreach ($aliases as $alias) {
+ if ($alias[ 'language_id' ] === $currentLanguageId) {
+ $map[ $alias[ 'route' ] ][ 0 ] = $alias[ 'value' ];
+ } else {
+ $map[ $alias[ 'route' ] ][ 1 ] = $alias[ 'value' ];
+ }
+ }
+ foreach ($map as $route => $alias) {
+ if (!empty($alias[ 0 ]) && !empty($alias[ 1 ])) {
+ $result[ $alias[ 0 ] ] = $alias[ 1 ];
+ } else {
+ \Yii::getLogger()
+ ->log("Missing alias for route $route.", Logger::LEVEL_ERROR);
+ }
+ }
+ return $result;
+ }
+
+ protected function replaceParams(array $map): array
+ {
+ $params = \Yii::$app->request->get();
+ if (isset($params[ 'filter' ])) {
+ $filter = explode('_', $params[ 'filter' ]);
+ }
+ if (array_key_exists($params[ 'category' ], $map)) {
+ $params[ 'category' ] = $map[ $params[ 'category' ] ];
+ }
+ if (!empty($filter)) {
+ foreach ($filter as $index => $item) {
+ if (array_key_exists($item, $map)) {
+ $filter[ $index ] = $map[ $item ];
+ }
+ }
+ $params[ 'filter' ] = implode('_', $filter);
+ }
+ return $params;
+ }
+ }
\ No newline at end of file
diff --git a/artweb/artbox-core/widgets/LanguageForm.php b/artweb/artbox-core/widgets/LanguageForm.php
new file mode 100755
index 0000000..8dfdef7
--- /dev/null
+++ b/artweb/artbox-core/widgets/LanguageForm.php
@@ -0,0 +1,82 @@
+formView === null) {
+ throw new InvalidConfigException('Form view must be set');
+ }
+ if (empty( $this->modelLangs ) || !is_array($this->modelLangs)) {
+ throw new InvalidConfigException('Language models must be passed');
+ }
+ if (empty( $this->getForm() )) {
+ throw new InvalidConfigException('Form model must be set');
+ }
+ $this->languages = Language::find()
+ ->where([ 'status' => true ])
+ ->orderBy([ 'default' => SORT_DESC ])
+ ->indexBy('id')
+ ->all();
+ }
+
+ public function run()
+ {
+ return $this->render(
+ 'language_form_frame',
+ [
+ 'languages' => $this->languages,
+ 'form_view' => $this->formView,
+ 'modelLangs' => $this->modelLangs,
+ 'form' => $this->getForm(),
+ 'idPrefix' => $this->idPrefix,
+ ]
+ );
+ }
+
+ public function getForm(): ActiveForm
+ {
+ return $this->form;
+ }
+
+ public function setForm(ActiveForm $value)
+ {
+ $this->form = $value;
+ }
+ }
+
\ No newline at end of file
diff --git a/artweb/artbox-core/widgets/LanguagePicker.php b/artweb/artbox-core/widgets/LanguagePicker.php
new file mode 100755
index 0000000..08076b1
--- /dev/null
+++ b/artweb/artbox-core/widgets/LanguagePicker.php
@@ -0,0 +1,35 @@
+render(
+ 'view',
+ [
+ 'current' => Language::getCurrent(),
+ 'languages' => Language::find()
+ ->where(
+ [
+ '!=',
+ 'id',
+ Language::getCurrent()->id,
+ ]
+ )
+ ->all(),
+ ]
+ );
+ }
+ }
+
\ No newline at end of file
diff --git a/artweb/artbox-core/widgets/views/_feedback.php b/artweb/artbox-core/widgets/views/_feedback.php
new file mode 100755
index 0000000..e1cd914
--- /dev/null
+++ b/artweb/artbox-core/widgets/views/_feedback.php
@@ -0,0 +1,16 @@
+
+
+
+
+
+ = $count ?>
+
+
diff --git a/artweb/artbox-core/widgets/views/_flash.php b/artweb/artbox-core/widgets/views/_flash.php
new file mode 100755
index 0000000..0291baf
--- /dev/null
+++ b/artweb/artbox-core/widgets/views/_flash.php
@@ -0,0 +1,9 @@
+registerJs($js, View::POS_READY);
diff --git a/artweb/artbox-core/widgets/views/_gallery_view.php b/artweb/artbox-core/widgets/views/_gallery_view.php
new file mode 100755
index 0000000..2dff629
--- /dev/null
+++ b/artweb/artbox-core/widgets/views/_gallery_view.php
@@ -0,0 +1,203 @@
+registerJs("imageManagerInput.baseUrl = '" . $sBaseUrl . "';");
+ $this->registerJs(
+ "imageManagerInput.message = " . Json::encode(
+ [
+ 'detachWarningMessage' => Yii::t('core', 'Are you sure you want to detach the image?'),
+ ]
+ ) . ";"
+ );
+
+ GalleryAsset::register($this);
+
+?>
+
+
+
+
+
+ $hash,
+ 'class' => 'gw-image-input',
+ 'data' => [
+ 'img' => $hash . '_img',
+ 'name' => $hash . '_name',
+ ],
+ ]
+ );
+ ?>
+
+ 'img-rounded',
+ 'id' => $hash . '_img',
+ ]
+ );
+ ?>
+
+ 'text-info',
+ 'id' => $hash . '_name',
+ ]
+ );
+
+ echo Html::button(
+ Html::tag(
+ 'i',
+ '',
+ [
+ 'class' => 'fa fa-folder-open',
+ ]
+ ),
+ [
+ 'class' => 'open-modal-imagemanager btn btn-primary',
+ 'data' => [
+ 'aspect-ratio' => '',
+ 'crop-view-mode' => 1,
+ 'input-id' => $hash,
+ ],
+ ]
+ );
+
+ echo Html::button(
+ Html::tag(
+ 'i',
+ '',
+ [
+ 'class' => 'fa fa-trash',
+ ]
+ ),
+ [
+ 'class' => 'remove-img btn btn-danger',
+ ]
+ );
+ ?>
+
+
+
+
+ id,
+ [
+ 'id' => $hash,
+ 'class' => 'gw-image-input',
+ 'data' => [
+ 'img' => $hash . '_img',
+ 'name' => $hash . '_name',
+ ],
+ ]
+ );
+ ?>
+
+ getPath())
+ ->resize(400, 400)
+ ->renderImage(
+ [
+ 'id' => $hash . '_img',
+ ]
+ );
+ ?>
+
+ fileName,
+ [
+ 'class' => 'text-info',
+ 'id' => $hash . '_name',
+ ]
+ );
+
+ echo Html::button(
+ Html::tag(
+ 'i',
+ '',
+ [
+ 'class' => 'fa fa-folder-open',
+ ]
+ ),
+ [
+ 'class' => 'open-modal-imagemanager btn btn-primary',
+ 'data' => [
+ 'aspect-ratio' => '',
+ 'crop-view-mode' => 1,
+ 'input-id' => $hash,
+ ],
+ ]
+ );
+
+ echo Html::button(
+ Html::tag(
+ 'i',
+ '',
+ [
+ 'class' => 'fa fa-trash',
+ ]
+ ),
+ [
+ 'class' => 'remove-img btn btn-danger',
+ ]
+ );
+ ?>
+
+
+
+
+
+
+= Html::button(
+ Html::tag(
+ 'li',
+ '',
+ [
+ 'class' => 'fa fa-plus',
+ ]
+ ) . ' Add',
+ [
+ 'id' => 'add-image',
+ 'class' => 'btn btn-success',
+ ]
+) ?>
\ No newline at end of file
diff --git a/artweb/artbox-core/widgets/views/_langLink.php b/artweb/artbox-core/widgets/views/_langLink.php
new file mode 100755
index 0000000..d64d848
--- /dev/null
+++ b/artweb/artbox-core/widgets/views/_langLink.php
@@ -0,0 +1,7 @@
+context;
+ echo implode(' / ', $widget->links);
diff --git a/artweb/artbox-core/widgets/views/language_form_frame.php b/artweb/artbox-core/widgets/views/language_form_frame.php
new file mode 100755
index 0000000..5e097c7
--- /dev/null
+++ b/artweb/artbox-core/widgets/views/language_form_frame.php
@@ -0,0 +1,87 @@
+
+
diff --git a/artweb/artbox-core/widgets/views/view.php b/artweb/artbox-core/widgets/views/view.php
new file mode 100755
index 0000000..46e84c4
--- /dev/null
+++ b/artweb/artbox-core/widgets/views/view.php
@@ -0,0 +1,35 @@
+
+
+
+ name;
+ ?>
+ ▼
+
+
+
+ -
+ getRequest();
+ echo Html::a($language->name, '/' . $language->url . $request->getLanguageUrl());
+ ?>
+
+
+
+
--
libgit2 0.21.4