mirror of
https://github.com/avecms/AVE.cms.git
synced 2026-12-04 00:45:07 +00:00
Compare commits
4
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5dad4a1cf1 | ||
|
|
95c92e7142 | ||
|
|
b21858a4e5 | ||
|
|
33fe774e1a |
+388
@@ -0,0 +1,388 @@
|
||||
# История изменений AVE.cms
|
||||
|
||||
Здесь собраны заметные для пользователей изменения AVE.cms 3.3, начиная со
|
||||
сборки 0.30. Внутренние рефакторинги, тестовые файлы и служебные изменения
|
||||
сборщика перечислены только тогда, когда они влияют на установку, обновление
|
||||
или поведение системы.
|
||||
|
||||
Часть возможностей распространяется отдельными модулями. Такие изменения
|
||||
помечены как изменения каталога модулей и не означают, что модуль автоматически
|
||||
установлен вместе с чистым ядром.
|
||||
|
||||
## Не выпущено
|
||||
|
||||
Новые изменения будут добавлены после build 0.41.
|
||||
|
||||
## 3.3 build 0.41 — 7 сентября 2026
|
||||
|
||||
### Контент и каталог
|
||||
|
||||
- Уточнены роли товарных полей и связи между разделами каталога, документами и
|
||||
нативными характеристиками; редакторы получили более понятные переходы к
|
||||
связанным настройкам.
|
||||
- Массовые и быстрые изменения документов используют единый безопасный путь
|
||||
записи и корректно обновляют производные данные и кеш.
|
||||
- Улучшены диагностика качества, выборки товаров и совместимость запросов с
|
||||
MariaDB 10.3.
|
||||
|
||||
### Публичный сайт и фиды
|
||||
|
||||
- Фиды корректно обновляются после изменения товара, устойчивее генерируются
|
||||
параллельно и учитывают видимость служебного контента.
|
||||
- Поиск и товарные выборки точнее обрабатывают доступность, роли полей и
|
||||
специальные условия показа.
|
||||
|
||||
### Панель управления
|
||||
|
||||
- Раздел 404 поддерживает безопасный редирект на произвольный локальный путь и
|
||||
выбор любого доступного публичного документа, а таблицы журнала адаптированы
|
||||
для мобильного экрана.
|
||||
- Исправлено мобильное отображение журнала событий; виджет заказов по статусам
|
||||
теперь использует тот же период 14 дней, что и общая статистика.
|
||||
- Дополнены переводы, подсказки и пользовательская справка для изменённых
|
||||
разделов.
|
||||
|
||||
### Надёжность
|
||||
|
||||
- Операции корзины, оформления заказа, оплаты и доставки получили дополнительные
|
||||
проверки целостности и регрессионные тесты.
|
||||
- Для build 0.41 подготовлены чистая core-сборка, компактный установщик,
|
||||
накопительное обновление с build 0.20 и обновлённый каталог модулей.
|
||||
- Проектные торговые расширения и ИИ-помощник не входят в публичную core-сборку
|
||||
и репозиторий модулей.
|
||||
|
||||
## 3.3 build 0.40 — 25 августа 2026
|
||||
|
||||
### Публичный сайт и вход
|
||||
|
||||
- Неизвестный адрес снова показывает назначенную страницу 404, а не содержимое
|
||||
главной страницы. HTTP-статус 404 и метаданные сохранены.
|
||||
- Публичная регистрация и вход могут работать только по телефону: email больше
|
||||
не требуется, номер форматируется по маске, а доступные способы входа
|
||||
определяются настройками системы.
|
||||
- Настройки телефонного входа и подсказки в кабинете приведены к одному набору
|
||||
разрешённых способов авторизации.
|
||||
|
||||
### Пользователи сайта
|
||||
|
||||
- В разделе пользователей сайта форма учитывает регистрацию без email и
|
||||
корректно показывает телефон как основной идентификатор.
|
||||
|
||||
### Выпуск
|
||||
|
||||
- Для build 0.40 подготовлены чистая core-сборка, компактный установщик и
|
||||
накопительное обновление с build 0.20.
|
||||
|
||||
## 3.3 build 0.39 — 25 августа 2026
|
||||
|
||||
### Документы и публичные шаблоны
|
||||
|
||||
- Карта публичных шаблонов показывает, из каких штатных компонентов AVE.cms
|
||||
собираются основные типы страниц и где каждый компонент редактируется.
|
||||
- Поля оформленных информационных страниц снова доступны в редакторе документа,
|
||||
включая подписи, адреса и содержимое карт на странице контактов.
|
||||
- Исправлено сохранение документа из режима исходного HTML-кода редактора.
|
||||
- Публичный адрес под названием документа в таблице стал активной ссылкой и
|
||||
открывается в новой вкладке.
|
||||
- Существующий документ можно сохранять со своим URL, даже если рядом с ним
|
||||
позднее появился системный маршрут установленного модуля.
|
||||
|
||||
### Рубрики и темы
|
||||
|
||||
- Дополнительные шаблоны рубрики открываются в полноразмерной рабочей панели,
|
||||
поддерживают проверку и корректно возвращаются из полноэкранного режима.
|
||||
- Из редактора дополнительного шаблона можно перейти к связанному документу.
|
||||
- Улучшено отображение представлений и публичных шаблонов в разделе темы.
|
||||
|
||||
### Поиск
|
||||
|
||||
- Поиск распознаёт артикулы без разделителя между буквами и цифрами, сохраняет
|
||||
правила русской и английской раскладки и учитывает управляемые синонимы.
|
||||
- Добавлена осторожная коррекция опечаток с подсказкой «Возможно, вы искали»;
|
||||
исходный запрос пользователя не заменяется без объяснения.
|
||||
- Переиндексация получила более устойчивый пошаговый прогресс и словарь
|
||||
поисковых вариантов.
|
||||
|
||||
### Каталог модулей
|
||||
|
||||
- Модуль слайдеров добавлен в публичный каталог: слайды, ссылки, навигация,
|
||||
адаптивные изображения и внешний вид управляются из панели.
|
||||
- Галереи получили обновлённый публичный просмотр изображений.
|
||||
- Модуль SMS-входа получил журнал событий и расширенную диагностику отправки.
|
||||
- Обновлены модули поиска и связанных материалов.
|
||||
- Торговые, проектные и служебные модули по-прежнему исключены из публичной
|
||||
core-сборки и каталога.
|
||||
|
||||
### Выпуск
|
||||
|
||||
- Для build 0.39 подготовлены чистая core-сборка, компактный установщик и
|
||||
накопительное обновление с build 0.20.
|
||||
|
||||
## 3.3 build 0.38 — 5 августа 2026
|
||||
|
||||
### Поля документов
|
||||
|
||||
- Описание поля снова поддерживает безопасную HTML-разметку и показывается
|
||||
редактору под полем документа.
|
||||
- Для подсказок можно использовать выделение, уменьшенный текст, переносы,
|
||||
ссылки и списки. Скрипты и опасные HTML-атрибуты автоматически удаляются.
|
||||
|
||||
### Пользователи и безопасность
|
||||
|
||||
- В карточке пользователя появились активные сеансы с возможностью завершить
|
||||
отдельный сеанс или все остальные устройства.
|
||||
- Неудачные попытки входа записываются в аудит и доступны для контроля.
|
||||
- Поддержан временный пароль с обязательной сменой при следующем входе.
|
||||
- Усилены проверки API-токенов, внешних адресов, возврата после авторизации и
|
||||
публичных форм.
|
||||
- Антиспам получил автоматические блокировки и уведомления о всплесках.
|
||||
|
||||
### Медиа и публичное оформление
|
||||
|
||||
- Медиатека получила безопасную корзину, анализ использования файлов и
|
||||
восстановление удалённых объектов.
|
||||
- В редакторе документа можно заменить изображения его папки без отдельного
|
||||
перехода в медиатеку.
|
||||
- Исправлена очистка и повторная генерация миниатюр.
|
||||
- Публичные представления модулей доступны для редактирования в активной теме
|
||||
с проверкой шаблона, ревизиями и возвратом к поставке модуля.
|
||||
|
||||
### Поиск и работа с контентом
|
||||
|
||||
- Поиск документов и товаров учитывает русскую и английскую запись, неверную
|
||||
раскладку, формы слов и приоритет точного совпадения.
|
||||
- Модуль поиска получил управляемые синонимы, области выдачи и редактируемые
|
||||
публичные шаблоны.
|
||||
- Массовый редактор документов безопасно обновляет только выбранные поля и
|
||||
корректно инвалидирует публичный кеш.
|
||||
- Улучшены быстрые переходы из публичного режима редактирования к реальным
|
||||
разделам панели.
|
||||
|
||||
### Модули
|
||||
|
||||
- A/B-тесты показывают достаточность выборки и статистическую достоверность
|
||||
результата, а не только проценты конверсии.
|
||||
- Рейтинги получили просмотр и модерацию отдельных голосов.
|
||||
- Задачи Todo и Канбан поддерживают сроки, исполнителей, видимость и связь с
|
||||
документами.
|
||||
- Всплывающие окна получили защиту от повторного учёта событий и уведомления.
|
||||
- В публичный каталог добавлены кросспостинг, импорт документов и безопасное
|
||||
сравнение локальной и рабочей систем.
|
||||
- Встроенные разделы панели, включая медиатеку, больше не показываются как
|
||||
отдельные устанавливаемые модули.
|
||||
- Из публичного каталога исключены закрытые и проектные расширения, инструменты
|
||||
разработчика, товарный контур и служебные помощники выпуска.
|
||||
|
||||
### Выпуск и диагностика
|
||||
|
||||
- Помощник выпуска проверяет миграции отдельно устанавливаемых модулей отдельно
|
||||
от миграций чистого ядра.
|
||||
- Мониторинг здоровья, планировщик и каталоги обновлений получили дополнительные
|
||||
уведомления о требующих внимания состояниях.
|
||||
- Для build 0.38 опубликованы чистая core-сборка, установщик и накопительное
|
||||
обновление с build 0.20.
|
||||
- Чистая сборка по-прежнему не содержит торговые, проектные и закрытые модули.
|
||||
|
||||
## 3.3 build 0.37 — 30 июля 2026
|
||||
|
||||
### Медиа
|
||||
|
||||
- Добавлены именованные виды изображений: администратор может заранее задать
|
||||
назначение, размеры и способ кадрирования изображения.
|
||||
- В редакторе изображения появилось действие «Подогнать под вид».
|
||||
- Для вида изображения можно создавать WebP-двойник.
|
||||
|
||||
### Рубрики
|
||||
|
||||
- Удаление рубрики стало обратимым: удалённые рубрики помещаются в корзину.
|
||||
- Из корзины рубрику можно восстановить или удалить окончательно.
|
||||
- Ревизии схемы рубрики переведены на общий механизм хранения истории.
|
||||
|
||||
### Пользователи
|
||||
|
||||
- Глобальный поиск теперь находит пользователей панели.
|
||||
- В таблицу пользователей добавлена дата последнего входа.
|
||||
- Поиск пользователей корректно работает с кириллицей.
|
||||
- Защищён текущий публичный аккаунт: пользователь не может случайно отключить
|
||||
или удалить собственную учётную запись во время работы.
|
||||
- Для публичных аккаунтов добавлено управляемое удаление с проверкой прав и
|
||||
защитой связанных данных.
|
||||
|
||||
### Исправления
|
||||
|
||||
- Начальная установка создаёт таблицы для видов изображений.
|
||||
- Улучшена совместимость панели каталога, рубрик и тем с модульными ресурсами.
|
||||
|
||||
## 3.3 build 0.36 — 30 июля 2026
|
||||
|
||||
### Каталог
|
||||
|
||||
- Редактор разделов каталога получил наглядное древовидное представление.
|
||||
- Порядок и вложенность разделов можно менять перетаскиванием.
|
||||
- Исправлено выделение активного раздела и обновление дерева после операций.
|
||||
- Улучшена работа с большими деревьями и длинными названиями разделов.
|
||||
|
||||
### Товарные фиды
|
||||
|
||||
- Переработан интерфейс создания и редактирования фидов.
|
||||
- Добавлены понятные настройки источника, разделов, полей и правил выгрузки.
|
||||
- Улучшены проверка конфигурации и формирование публичного файла фида.
|
||||
- Модуль товарных фидов поставляется отдельно через каталог модулей.
|
||||
|
||||
## 3.3 build 0.35 — 30 июля 2026
|
||||
|
||||
### Поиск
|
||||
|
||||
- Добавлен единый механизм провайдеров глобального поиска. Разделы и модули
|
||||
могут добавлять собственные типы результатов без изменения поискового ядра.
|
||||
- Поиск документов учитывает раскладку клавиатуры, транслитерацию, части слов
|
||||
и приоритет совпадения.
|
||||
- Результаты получили единый формат заголовков, пояснений, ссылок и иконок.
|
||||
|
||||
### Диагностика контента
|
||||
|
||||
- Добавлена безопасная интроспекция страницы: система может определить
|
||||
используемые документы, рубрики, запросы, блоки, навигацию и представления.
|
||||
- Диагностика сообщает о недостающих связях и шаблонах без выполнения
|
||||
пользовательского PHP-кода.
|
||||
- Публичный отладчик получил более точные сведения о составе страницы.
|
||||
|
||||
### Ревизии
|
||||
|
||||
- Создан общий механизм JSON-ревизий для административных сущностей.
|
||||
- Блоки, шаблоны, рубрики и представления используют единый формат снимков,
|
||||
сравнения и восстановления.
|
||||
|
||||
### Интеграции и безопасность
|
||||
|
||||
- Исходящие HTTP-запросы получили единый журнал с временем выполнения,
|
||||
результатом и безопасно очищенными диагностическими данными.
|
||||
- Усилена проверка внешних адресов и защита от обращения к запрещённым сетевым
|
||||
ресурсам.
|
||||
- Старые MD5-пароли публичных пользователей автоматически заменяются
|
||||
современным хешем после успешного входа.
|
||||
- Усилена проверка локальных адресов возврата после авторизации.
|
||||
- API-токены получили более строгую проверку областей доступа.
|
||||
|
||||
### Модули
|
||||
|
||||
- Планировщик поддерживает длительные задания, разбитые на небольшие шаги.
|
||||
- Поиск и похожие документы могут выполнять переиндексацию через планировщик.
|
||||
- В каталог модулей добавлен MCP-мост для управляемого доступа внешних
|
||||
инструментов к разрешённым данным AVE.cms.
|
||||
- Для платёжных модулей и модуля магазина добавлен журнал обращений и проверка
|
||||
фактического статуса платежа. Эти возможности не входят в чистое ядро.
|
||||
|
||||
## 3.3 build 0.34 — 29 июля 2026
|
||||
|
||||
### Модель контента
|
||||
|
||||
- Справочники стали отдельной сущностью для повторно используемых значений
|
||||
полей без создания лишних публичных документов.
|
||||
- Добавлены двусторонние связи документов.
|
||||
- Добавлены вычисляемые поля.
|
||||
- Появилась библиотека готовых наборов полей для быстрого создания рубрик.
|
||||
- Визуальная карта сайта показывает основные сущности и их связи.
|
||||
|
||||
### Управление
|
||||
|
||||
- Добавлена командная палитра и глобальный административный поиск.
|
||||
- Аудит действий стал нагляднее: события проще фильтровать и просматривать по
|
||||
времени и пользователям.
|
||||
- Улучшена страница диагностики и готовности сайта.
|
||||
|
||||
### Представления
|
||||
|
||||
- Для публичных представлений добавлены ревизии и безопасный предпросмотр.
|
||||
- Модуль A/B-тестов умеет проверять разные варианты представлений.
|
||||
|
||||
### Надёжность
|
||||
|
||||
- Добавлен модуль надёжных исходящих событий: неотправленные события
|
||||
сохраняются, повторяются и доступны в журнале.
|
||||
- Добавлен модуль автоматического прогрева кеша.
|
||||
- Миграция из старых версий получила полную и выборочную схемы переноса,
|
||||
предварительный анализ таблиц и пошаговый прогресс.
|
||||
|
||||
## 3.3 build 0.33 — 28 июля 2026
|
||||
|
||||
### Публичный сайт
|
||||
|
||||
- Добавлен раздел управления публичным сайтом со структурой, размещениями и
|
||||
представлениями.
|
||||
- Представление можно назначить документу, рубрике, запросу или другому
|
||||
поддерживаемому источнику без жёсткой привязки разметки в PHP-коде.
|
||||
- Добавлены предпросмотр и история изменений представлений.
|
||||
- Карта размещений показывает, какой компонент и шаблон формируют конкретную
|
||||
часть страницы.
|
||||
|
||||
### Контент
|
||||
|
||||
- Документы, рубрики, запросы, блоки и навигация получили единые контракты
|
||||
сохранения и вывода.
|
||||
- Зависимости тегов контента учитываются при обновлении и очистке кеша.
|
||||
- Выбор документов вынесен в общий репозиторий и используется разными
|
||||
редакторами панели.
|
||||
- Улучшено объяснение условий запросов и предпросмотр результата.
|
||||
|
||||
### Совместимость
|
||||
|
||||
- Нативная система представлений добавлена без принудительной замены
|
||||
существующих шаблонов публичного сайта.
|
||||
- Модули поиска, похожих документов, галерей, комментариев и других публичных
|
||||
компонентов адаптированы к общему механизму вывода.
|
||||
|
||||
## 3.3 build 0.32 — 27 июля 2026
|
||||
|
||||
### Чистое ядро
|
||||
|
||||
- Проектные настройки и оформление конкретного сайта отделены от публичной
|
||||
core-сборки.
|
||||
- Локальные примеры и тестовые данные исключены из Git и релизных архивов.
|
||||
- В чистой сборке сохраняются только ядро, установщик, базовая тема и
|
||||
системная документация.
|
||||
|
||||
### Разработка
|
||||
|
||||
- Исходный PHP-код приведён к единому стилю AVE.cms с проверкой совместимости
|
||||
с PHP 7.3.
|
||||
- Добавлены правила для безопасного хранения runtime-каталогов и локальных
|
||||
файлов после установки.
|
||||
|
||||
## 3.3 build 0.31 — 27 июля 2026
|
||||
|
||||
### Установка модулей
|
||||
|
||||
- Архивы модулей публикуются вместе с корректным описанием зависимостей.
|
||||
- Установщик пакета проверяет и устанавливает необходимые зависимости в
|
||||
правильном порядке.
|
||||
|
||||
### Обновления
|
||||
|
||||
- Резервная копия перед обновлением ограничивается таблицами, которых
|
||||
действительно касается миграция.
|
||||
- Исправлена область резервирования миграций пользователей и сохранённых
|
||||
представлений.
|
||||
- Обновлено описание чистой публичной сборки и порядка установки.
|
||||
|
||||
## 3.3 build 0.30 — 27 июля 2026
|
||||
|
||||
### Языки панели
|
||||
|
||||
- Панель управления получила русскую и английскую локализацию.
|
||||
- Язык можно выбрать при установке и позднее изменить в профиле.
|
||||
- Переведены системные разделы, сообщения, элементы интерфейса и клиентские
|
||||
уведомления.
|
||||
|
||||
### Справка
|
||||
|
||||
- Добавлена английская версия пользовательской справки по установке, полям,
|
||||
контенту, API, модулям, хукам, отладке и работе с базой данных.
|
||||
- Справка открывается на выбранном языке панели.
|
||||
|
||||
### Установщик и пакеты
|
||||
|
||||
- Мастер установки стал локализованным.
|
||||
- Пакеты демонстрационных сайтов могут объявлять необходимые модули и
|
||||
устанавливать их как зависимости.
|
||||
- Инструменты сборки проверяют языковые файлы и состав модульных архивов.
|
||||
+221
-179
File diff suppressed because it is too large
Load Diff
@@ -75,6 +75,46 @@
|
||||
return $saved;
|
||||
}
|
||||
|
||||
/** Синхронизировать переключатель из карточки модуля с общей раскладкой главной. */
|
||||
public static function setModuleDashboardVisibility($moduleCode, $visible, array $definitions)
|
||||
{
|
||||
$moduleCode = (string) $moduleCode;
|
||||
$targetCodes = array();
|
||||
foreach ($definitions as $definition) {
|
||||
if (!is_array($definition) || !isset($definition['module_code'], $definition['layout_code'])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((string) $definition['module_code'] === $moduleCode) {
|
||||
$targetCodes[(string) $definition['layout_code']] = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$targetCodes) {
|
||||
return self::config('dashboard');
|
||||
}
|
||||
|
||||
$config = self::config('dashboard');
|
||||
$seen = array();
|
||||
foreach ($config as &$row) {
|
||||
$code = (string) $row['code'];
|
||||
if (isset($targetCodes[$code])) {
|
||||
$row['visible'] = (bool) $visible;
|
||||
$seen[$code] = true;
|
||||
}
|
||||
}
|
||||
|
||||
unset($row);
|
||||
foreach (array_keys($targetCodes) as $code) {
|
||||
if (!isset($seen[$code])) {
|
||||
$config[] = array('code' => $code, 'visible' => (bool) $visible);
|
||||
}
|
||||
}
|
||||
|
||||
Settings::set(self::key('dashboard'), $config, 'json');
|
||||
return $config;
|
||||
}
|
||||
|
||||
protected static function prepare(array $items, $codeKey)
|
||||
{
|
||||
$prepared = array();
|
||||
|
||||
@@ -106,6 +106,7 @@
|
||||
public static function notifications($base, array $summary)
|
||||
{
|
||||
foreach (self::contributions('notifications') as $contribution) {
|
||||
$moduleCode = isset($contribution['module_code']) ? (string) $contribution['module_code'] : '';
|
||||
$data = isset($contribution['data']) ? $contribution['data'] : array();
|
||||
$items = isset($data['items']) && is_array($data['items']) ? $data['items'] : (self::isList($data) ? $data : array());
|
||||
foreach ($items as $item) {
|
||||
@@ -113,6 +114,11 @@
|
||||
continue;
|
||||
}
|
||||
|
||||
$key = isset($item['key']) ? trim((string) $item['key']) : '';
|
||||
if ($key !== '' && !self::notificationEnabled($moduleCode, $key)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$count = isset($item['count']) ? max(0, (int) $item['count']) : 1;
|
||||
if ($count < 1) {
|
||||
continue;
|
||||
@@ -137,8 +143,7 @@
|
||||
'title' => AdminLocale::translateMarkup(isset($item['title']) ? (string) $item['title'] : ''),
|
||||
));
|
||||
$summary['total'] += $count;
|
||||
if (!empty($item['key'])) {
|
||||
$key = (string) $item['key'];
|
||||
if ($key !== '') {
|
||||
$summary[$key] = isset($summary[$key]) ? (int) $summary[$key] + $count : $count;
|
||||
}
|
||||
}
|
||||
@@ -147,6 +152,80 @@
|
||||
return $summary;
|
||||
}
|
||||
|
||||
/** Настраиваемые элементы колокольчика без запуска их провайдеров. */
|
||||
public static function notificationPreferences()
|
||||
{
|
||||
self::boot();
|
||||
$out = array();
|
||||
foreach (self::$extensions as $code => $extension) {
|
||||
$module = self::currentModule($code, $extension['module']);
|
||||
if (empty($module['installed']) || empty($module['enabled'])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$config = $extension['config'];
|
||||
if (empty($config['notifications'])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
foreach (self::normalizeItems($config['notifications']) as $item) {
|
||||
if (!is_array($item) || !self::allowed($item) || empty($item['preferences']) || !is_array($item['preferences'])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
foreach ($item['preferences'] as $preference) {
|
||||
if (!is_array($preference)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$key = isset($preference['key']) ? trim((string) $preference['key']) : '';
|
||||
$label = isset($preference['label']) ? trim((string) $preference['label']) : '';
|
||||
if (!preg_match('/^[a-z][a-z0-9_]{0,63}$/', $key) || $label === '') {
|
||||
continue;
|
||||
}
|
||||
|
||||
$default = !empty($preference['default']);
|
||||
$out[] = array(
|
||||
'module_code' => (string) $code,
|
||||
'key' => $key,
|
||||
'label' => AdminLocale::translateMarkup($label),
|
||||
'description' => AdminLocale::translateMarkup(isset($preference['description']) ? (string) $preference['description'] : ''),
|
||||
'enabled' => (bool) ModuleSettings::get(self::notificationSettingKey($key), $default, $code),
|
||||
'default' => $default,
|
||||
'sort_order' => isset($preference['sort_order']) ? (int) $preference['sort_order'] : 100,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
usort($out, function ($left, $right) {
|
||||
if ($left['sort_order'] === $right['sort_order']) {
|
||||
return strcmp($left['label'], $right['label']);
|
||||
}
|
||||
|
||||
return $left['sort_order'] <=> $right['sort_order'];
|
||||
});
|
||||
return $out;
|
||||
}
|
||||
|
||||
/** Сохранить один объявленный модулем переключатель уведомлений. */
|
||||
public static function setNotificationPreference($moduleCode, $key, $enabled)
|
||||
{
|
||||
$moduleCode = strtolower(trim((string) $moduleCode));
|
||||
$key = strtolower(trim((string) $key));
|
||||
foreach (self::notificationPreferences() as $preference) {
|
||||
if ($preference['module_code'] !== $moduleCode || $preference['key'] !== $key) {
|
||||
continue;
|
||||
}
|
||||
|
||||
ModuleSettings::set(self::notificationSettingKey($key), (bool) $enabled, $moduleCode, 'bool');
|
||||
$preference['enabled'] = (bool) $enabled;
|
||||
return $preference;
|
||||
}
|
||||
|
||||
throw new \InvalidArgumentException('Настройка уведомления не найдена');
|
||||
}
|
||||
|
||||
public static function catalog()
|
||||
{
|
||||
self::boot();
|
||||
@@ -410,4 +489,20 @@
|
||||
{
|
||||
return (bool) ModuleSettings::get('adminx_' . $type . '_enabled', true, $code);
|
||||
}
|
||||
|
||||
protected static function notificationEnabled($moduleCode, $key)
|
||||
{
|
||||
foreach (self::notificationPreferences() as $preference) {
|
||||
if ($preference['module_code'] === (string) $moduleCode && $preference['key'] === (string) $key) {
|
||||
return !empty($preference['enabled']);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
protected static function notificationSettingKey($key)
|
||||
{
|
||||
return 'adminx_notification_' . preg_replace('/[^a-z0-9_]+/', '_', strtolower((string) $key)) . '_enabled';
|
||||
}
|
||||
}
|
||||
|
||||
+117
-7
@@ -16,8 +16,12 @@
|
||||
|
||||
defined('BASEPATH') || die('Direct access to this location is not allowed.');
|
||||
|
||||
use App\Common\PublicConfiguration;
|
||||
|
||||
class PhpCode
|
||||
{
|
||||
const LINT_TIMEOUT = 3;
|
||||
|
||||
public static function source($code)
|
||||
{
|
||||
$code = trim((string) $code);
|
||||
@@ -41,12 +45,27 @@
|
||||
return array('ok' => false, 'message' => 'Не удалось записать временный файл.', 'output' => '', 'line' => 0);
|
||||
}
|
||||
|
||||
$php = defined('PHP_BINARY') && PHP_BINARY ? PHP_BINARY : 'php';
|
||||
$output = array();
|
||||
$status = 0;
|
||||
@exec(escapeshellarg($php) . ' -l ' . escapeshellarg($file) . ' 2>&1', $output, $status);
|
||||
if (!function_exists('proc_open')) {
|
||||
@unlink($file);
|
||||
return array('ok' => false, 'message' => 'Проверка PHP недоступна на сервере.', 'output' => 'Функция proc_open отключена хостингом.', 'line' => 0);
|
||||
}
|
||||
|
||||
$php = self::resolvePhpBinary();
|
||||
if ($php === '') {
|
||||
@unlink($file);
|
||||
return array('ok' => false, 'message' => 'PHP CLI не найден.', 'output' => 'Укажите путь к PHP CLI в ADMINX_PHP_BINARY.', 'line' => 0);
|
||||
}
|
||||
|
||||
$result = self::runProcess(
|
||||
escapeshellarg($php) . ' -l ' . escapeshellarg($file),
|
||||
self::LINT_TIMEOUT
|
||||
);
|
||||
@unlink($file);
|
||||
$text = trim(implode("\n", $output));
|
||||
if ($result['timed_out']) {
|
||||
return array('ok' => false, 'message' => 'Проверка PHP превысила лимит времени.', 'output' => 'Проверьте ADMINX_PHP_BINARY: требуется консольный PHP, а не php-fpm.', 'line' => 0);
|
||||
}
|
||||
|
||||
$text = trim($result['output']);
|
||||
$text = str_replace($file, 'код', $text);
|
||||
$line = 0;
|
||||
if (preg_match('/ on line ([0-9]+)/i', $text, $match)) {
|
||||
@@ -54,10 +73,101 @@
|
||||
}
|
||||
|
||||
return array(
|
||||
'ok' => $status === 0 && $text !== '',
|
||||
'message' => $status === 0 ? 'Синтаксис PHP без ошибок.' : 'В PHP-коде есть синтаксическая ошибка.',
|
||||
'ok' => $result['exit_code'] === 0 && $text !== '',
|
||||
'message' => $result['exit_code'] === 0 ? 'Синтаксис PHP без ошибок.' : 'В PHP-коде есть синтаксическая ошибка.',
|
||||
'output' => $text,
|
||||
'line' => $line,
|
||||
);
|
||||
}
|
||||
|
||||
protected static function resolvePhpBinary()
|
||||
{
|
||||
$candidates = array();
|
||||
$configured = trim((string) getenv('ADMINX_PHP_BINARY'));
|
||||
if ($configured !== '') { $candidates[] = $configured; }
|
||||
$config = PublicConfiguration::value('admin_console', array());
|
||||
if (is_array($config) && !empty($config['php_binary'])) {
|
||||
$candidates[] = trim((string) $config['php_binary']);
|
||||
}
|
||||
|
||||
if (defined('PHP_BINDIR') && PHP_BINDIR !== '') {
|
||||
$candidates[] = rtrim(PHP_BINDIR, '/\\') . DIRECTORY_SEPARATOR . 'php';
|
||||
}
|
||||
|
||||
if (defined('PHP_BINARY') && PHP_BINARY !== '') {
|
||||
$candidates[] = dirname(PHP_BINARY) . DIRECTORY_SEPARATOR . 'php';
|
||||
$candidates[] = PHP_BINARY;
|
||||
}
|
||||
|
||||
$candidates[] = 'php';
|
||||
|
||||
foreach (array_unique($candidates) as $candidate) {
|
||||
$result = self::runProcess(
|
||||
escapeshellarg((string) $candidate) . ' -r ' . escapeshellarg('echo PHP_VERSION_ID;'),
|
||||
1
|
||||
);
|
||||
if (!$result['timed_out'] && $result['exit_code'] === 0 && preg_match('/^\d{5,6}$/', trim($result['output']))) {
|
||||
return (string) $candidate;
|
||||
}
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
protected static function runProcess($command, $timeout)
|
||||
{
|
||||
$pipes = array();
|
||||
try {
|
||||
$process = @proc_open($command, array(
|
||||
0 => array('pipe', 'r'),
|
||||
1 => array('pipe', 'w'),
|
||||
2 => array('pipe', 'w'),
|
||||
), $pipes);
|
||||
} catch (\Throwable $e) {
|
||||
return array('exit_code' => 1, 'timed_out' => false, 'output' => $e->getMessage());
|
||||
}
|
||||
|
||||
if (!is_resource($process)) {
|
||||
return array('exit_code' => 1, 'timed_out' => false, 'output' => 'Не удалось запустить PHP CLI.');
|
||||
}
|
||||
|
||||
fclose($pipes[0]);
|
||||
stream_set_blocking($pipes[1], false);
|
||||
stream_set_blocking($pipes[2], false);
|
||||
$started = microtime(true);
|
||||
$output = '';
|
||||
$error = '';
|
||||
$timedOut = false;
|
||||
$knownExitCode = null;
|
||||
do {
|
||||
$output .= (string) stream_get_contents($pipes[1]);
|
||||
$error .= (string) stream_get_contents($pipes[2]);
|
||||
$status = proc_get_status($process);
|
||||
if (!$status['running']) {
|
||||
$knownExitCode = isset($status['exitcode']) ? (int) $status['exitcode'] : null;
|
||||
break;
|
||||
}
|
||||
|
||||
if (microtime(true) - $started >= max(1, (int) $timeout)) {
|
||||
$timedOut = true;
|
||||
proc_terminate($process, 9);
|
||||
break;
|
||||
}
|
||||
|
||||
usleep(20000);
|
||||
} while (true);
|
||||
|
||||
$output .= (string) stream_get_contents($pipes[1]);
|
||||
$error .= (string) stream_get_contents($pipes[2]);
|
||||
fclose($pipes[1]);
|
||||
fclose($pipes[2]);
|
||||
$closedExitCode = proc_close($process);
|
||||
$exitCode = $knownExitCode !== null && $knownExitCode >= 0 ? $knownExitCode : $closedExitCode;
|
||||
|
||||
return array(
|
||||
'exit_code' => $exitCode,
|
||||
'timed_out' => $timedOut,
|
||||
'output' => $output . ($error !== '' ? ($output !== '' ? "\n" : '') . $error : ''),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,11 +76,13 @@
|
||||
protected static function definitions()
|
||||
{
|
||||
return array(
|
||||
self::item('#^/documents/bulk-editor$#', 'Массовый редактор', 'Меняет одинаковые настройки сразу у выбранной группы документов и сначала показывает точный предпросмотр.', array('Служебный документ остаётся доступен полям, запросам и связям, но его публичный адрес возвращает 404.', 'Служебные документы автоматически исключаются из публичного поиска, sitemap, SEO-задач и проверок качества.', 'Внутренний поиск, robots и участие в sitemap можно менять отдельными действиями, не скрывая саму страницу.'), 'Сначала выберите рубрику или другой узкий фильтр, проверьте примеры и только затем запускайте изменение.'),
|
||||
self::item('#^/documents/redirects$#', 'Редиректы документов', 'Управляет старыми адресами страниц и перенаправляет посетителей на актуальные документы.', array('Ищите редирект по старому URL, названию или ID документа.', 'Коды 301/308 подходят для постоянного переноса, 302/307 — для временного.', 'Перед удалением убедитесь, что старый адрес больше не используется во внешних ссылках.'), 'Каждый старый URL должен быть уникальным и вести на существующий документ.'),
|
||||
self::item('#^/documents/views$#', 'Статистика просмотров', 'Показывает посещаемость документов по дням и помогает находить наиболее востребованные страницы.', array('Период влияет только на подневную статистику.', 'Общий счётчик документа хранится отдельно и не очищается вместе с дневными данными.', 'Очистка статистики необратима и предназначена для обслуживания.'), 'Для бизнес-аналитики используйте внешнюю систему аналитики; здесь хранится внутренняя статистика CMS.'),
|
||||
self::item('#^/documents/(?:create|\d+/edit)$#', 'Редактор документа', 'Создаёт и изменяет страницу сайта: её адрес, публикацию, SEO и значения полей выбранной рубрики.', array('Набор полей и их группы задаются рубрикой.', 'Изменение alias может автоматически создать редирект со старого URL.', 'Ctrl+S сохраняет изменения и оставляет редактор открытым; ревизии позволяют вернуться к прошлой версии.'), 'Смена рубрики существующего документа запрещена без отдельной миграции полей.'),
|
||||
self::item('#^/documents#', 'Документы', 'Основной реестр страниц и товарных карточек сайта, построенных на рубриках и их полях.', array('Фильтруйте документы по рубрике, состоянию и названию.', 'Публикацию, копирование и удаление можно выполнять из списка или пакетно.', 'Удалённый документ сначала попадает в корзину и только затем может быть удалён окончательно.'), 'Документ №1 и системная страница 404 защищены от окончательного удаления.', 'content/documents'),
|
||||
self::item('#^/public-site/presentations$#', 'Представления', 'Создаёт повторно используемое оформление карточек, списков, слайдеров и других результатов.', array('Черновик проверяется на реальном материале и не меняет публичный сайт.', 'Публикация фиксирует версию, а назначение выбирает место и режим применения.', 'Представление меняет внешний вид готовых данных, но не заменяет рубрику, запрос, блок или модуль.'), 'Для совместимости каждое новое назначение начинает работу в режиме «Текущий вывод».', 'content/public-site'),
|
||||
self::item('#^/public-site/template-map$#', 'Карта шаблонов', 'Показывает фактическую цепочку сборки обычных страниц, списков, каталога и товаров.', array('Общий шаблон создаёт внешний каркас страницы.', 'Шаблон рубрики размещает поля, блоки, запросы и модульные теги.', 'Тема оформляет только подключённые компоненты, если не включён отдельный режим оболочки темы.'), 'Карта работает только на чтение; каждая кнопка открывает штатный редактор выбранного слоя.', 'content/public-site'),
|
||||
self::item('#^/public-site/map$#', 'Визуальная карта сайта', 'Показывает деревья меню, связанные страницы и опубликованные документы вне навигации.', array('Уровни строятся из действующих пунктов навигации.', 'Ссылка документа открывает его штатный редактор.', 'Документ вне меню может использоваться запросом, каталогом или прямой ссылкой.'), 'Карта является обзором и ничего не публикует.', 'content/public-site'),
|
||||
self::item('#^/public-site/placements$#', 'Размещения компонентов', 'Показывает, в каких сохранённых шаблонах используются блоки, подборки, навигации и модульные теги.', array('Вкладка «Размещения» показывает каждое найденное место отдельно.', 'Вкладка «Где используется» объединяет одинаковые компоненты и показывает число связей.', 'Кнопки справа открывают конкретный исходный шаблон и конкретный подключённый компонент.'), 'Карта предназначена для поиска связей и ничего не меняет на публичном сайте.', 'content/public-site'),
|
||||
self::item('#^/public-site/templates$#', 'Шаблоны публичного сайта', 'Редактирует общие файловые Twig-компоненты активной темы.', array('Список материалов имеет системный резерв.', 'Оболочка страницы и остальные компоненты темы редактируются без поиска файла вручную.', 'Сохранение проверяет Twig, создаёт ревизию и очищает публичный кеш.'), 'Шаблоны рубрик, запросов и блоков остаются в собственных разделах.', 'content/public-site'),
|
||||
@@ -132,12 +134,12 @@
|
||||
self::item('#^/settings/benchmark$#', 'Производительность', 'Измеряет скорость PHP, базы данных, файловых операций и кеша на текущем сервере.', array('Результаты нужны для сравнения одного окружения во времени, а не разных проектов.', 'Повторяйте тест после обновления PHP, БД или инфраструктуры.', 'Тест создаёт кратковременную нагрузку и сохраняет историю запусков.'), 'Оценивайте не только общий балл, но и конкретный медленный этап.'),
|
||||
self::item('#^/settings#', 'Настройки системы', 'Собирает общие параметры AVE.cms, интерфейс, константы, пагинацию, обслуживание и диагностику.', array('Каждый подраздел имеет собственный URL и назначение.', 'Типизированные значения проверяются перед сохранением.', 'Настройки устанавливаемых модулей хранятся вместе с соответствующим модулем.'), 'Меняйте только параметры, назначение которых понятно и проверено на текущем сайте.', 'administration/settings'),
|
||||
self::item('#^/events#', 'Системные события', 'Объединяет аудит действий, ошибки, SQL-журнал, 404 и статистику внешних переходов.', array('Цвет и состояние помогают отличать успешные операции, предупреждения и ошибки.', 'Переходы группируются по посетителю, странице входа и источнику; открытые IP и произвольные query-параметры не сохраняются.', 'Фильтры и CSV-экспорт работают отдельно для каждого источника.'), 'Очистка журнала необратима и не исправляет причину ошибки.'),
|
||||
self::item('#^/security/ip-blocks#', 'IP-блокировки', 'Управляет ручными блокировками адресов, а автоматические ограничения выполняет RateLimiter.', array('Блокировка может быть постоянной или иметь дату окончания.', 'Причина видна администраторам и записывается в аудит.', 'Разблокировка возвращает доступ сразу.'), 'Не блокируйте адрес reverse proxy без проверки реального клиентского IP.'),
|
||||
self::item('#^/security/ip-blocks#', 'Блокировки запросов', 'Ограничивает доступ к публичному сайту по IP-адресу или характерной строке User-Agent.', array('IP и User-Agent находятся на отдельных вкладках.', 'Правило может быть постоянным или иметь дату окончания.', 'Для робота используйте его уникальное имя, а не общие слова Mozilla, Chrome или Safari.', 'Причина и действия блокировки записываются в аудит.'), 'Перед блокировкой User-Agent проверьте предложенный фрагмент: слишком общее правило может затронуть обычных посетителей.'),
|
||||
self::item('#^/database#', 'База данных', 'Показывает рабочие таблицы AVE.cms, выполняет обслуживание, применяет миграции ядра и управляет полными резервными копиями.', array('OPTIMIZE применяется только к выбранной таблице или ко всей рабочей схеме после подтверждения.', 'Применение миграций не восстанавливает данные: это отдельная операция развития структуры ядра.', 'Новые дампы используют {{prefix}}, поэтому могут восстанавливаться с другим dbpref.', 'Перед восстановлением система проверяет файл и автоматически создаёт страховочную копию.'), 'Восстановление полностью заменяет таблицы текущей установки; рабочую копию дополнительно храните вне сервера.', 'database'),
|
||||
self::item('#^/kanban$#', 'Канбан', 'Организует рабочие карточки по колонкам и показывает доску на дашборде.', array('Карточки и порядок сохраняются без перезагрузки.', 'Колонки можно настроить под собственный процесс.', 'Карточке можно назначить ответственного, срок и связанный документ.', 'Командная карточка видна коллегам, а назначенная отдельно появляется у ответственного.'), 'Колонки принадлежат владельцу доски: назначенный сотрудник видит карточку в общем списке, но не перестраивает чужую доску.'),
|
||||
self::item('#^/notes$#', 'Заметки', 'Хранит личные текстовые заметки сотрудника и закрепляет важные записи на дашборде.', array('Заметки видны только их владельцу.', 'Закрепление влияет на порядок выдачи.', 'Быстрое создание доступно из шапки, если вклад модуля включён.'), 'Не храните в заметках пароли, токены и другие секреты.'),
|
||||
self::item('#^/reminders$#', 'Напоминания', 'Хранит личные задачи с датой и выводит просроченные пункты в общем колокольчике.', array('Срок определяет состояние напоминания.', 'Выполнение сохраняется сразу.', 'Просроченный счётчик формируется отдельно для текущего сотрудника.'), 'Удаление напоминания необратимо; выполненный пункт можно вернуть в работу.'),
|
||||
self::item('#^/notfound$#', 'Ошибки 404', 'Показывает несуществующие публичные адреса и помогает создать документ или редирект.', array('Сначала проверьте источник переходов и частоту запроса.', 'Для старого адреса существующей страницы создайте постоянный редирект.', 'Случайные сканирующие URL можно удалить из журнала без создания страницы.'), 'Редирект должен вести на действительно соответствующий документ, а не всегда на главную.'),
|
||||
self::item('#^/notfound$#', 'Ошибки 404', 'Показывает несуществующие публичные адреса, источник перехода, IP и программу или робота, который сделал запрос.', array('Кнопка «Подробнее» раскрывает полный реферер, User-Agent и время первого и последнего обращения.', 'Для старого адреса существующей страницы создайте постоянный редирект.', 'Нежелательного робота можно отправить в блокировки прямо из записи.', 'CSV учитывает текущий поиск и переключатель нерешённых записей.', 'Очистка всего журнала необратима, но новые ошибки начнут собираться снова.'), 'Не блокируйте обычный браузер только из-за одного ошибочного адреса; сначала оцените источник и частоту обращений.'),
|
||||
self::item('#^/seo-audit$#', 'SEO-аудит', 'Проверяет документы на технические и редакционные проблемы, влияющие на поисковое представление.', array('Фильтры помогают сначала разобрать критичные и массовые проблемы.', 'Оценка документа складывается из нескольких независимых проверок.', 'Исправления выполняются в редакторе документа и проявляются после повторного аудита.'), 'Автоматическая оценка является подсказкой и не заменяет проверку содержания страницы.', 'modules/seo-audit'),
|
||||
self::item('#^/todo$#', 'Todo', 'Хранит рабочие задачи сотрудников со сроками и связями с документами.', array('Задачу можно создать из выпадающего списка в шапке на любой странице панели управления.', 'Ответственный видит назначенную задачу и может отметить её выполненной.', 'Режим «Команда» открывает задачу всем сотрудникам с правом просмотра Todo.', 'Связанный документ открывается прямо из строки задачи.'), 'Изменять и удалять задачу может её создатель; выполнение доступно создателю и ответственному.'),
|
||||
self::item('#^/modules/search#', 'Поиск по сайту', 'Индексирует опубликованные документы и формирует обычную страницу результатов и JSON для живого поиска.', array('Области позволяют отдельно искать по товарам, новостям, статьям и другим наборам рубрик.', 'Алгоритм определяет разбор строки и вес точного совпадения, заголовка и содержимого.', 'Штатный HTML можно заменить шаблонами модуля или существующим запросом документов.'), 'После изменения рубрик или индексируемых полей выполните полную переиндексацию.', 'modules/search'),
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
'legacy_migration.write' => 'Изменение реквизитов исходной системы',
|
||||
'legacy_migration.execute' => 'Очистка стартовых данных и миграция старой AVE.cms',
|
||||
'database.restore' => 'Полная замена рабочей схемы данными из резервной копии',
|
||||
'external_connection.write' => 'Изменение адреса или секрета внешнего подключения',
|
||||
);
|
||||
protected static $required = array(
|
||||
'POST /modules/archive/install' => array('module.code', 'install_module_code'),
|
||||
|
||||
@@ -100,6 +100,7 @@
|
||||
}
|
||||
|
||||
try {
|
||||
ThemeAssets::registerViewOverrides();
|
||||
Twig::twig()->createTemplate($content, 'public_view_' . preg_replace('/[^a-z0-9_]/i', '_', (string) $code));
|
||||
} catch (\Throwable $e) {
|
||||
return array('ok' => false, 'message' => 'Ошибка Twig: ' . $e->getMessage());
|
||||
|
||||
@@ -537,6 +537,16 @@ hr {
|
||||
.notif-head b {
|
||||
font-size: 13px;
|
||||
}
|
||||
.notif-head-actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
}
|
||||
.notif-head-actions .btn {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
min-height: 32px;
|
||||
}
|
||||
.notif-list {
|
||||
max-height: 60vh;
|
||||
overflow-y: auto;
|
||||
@@ -591,6 +601,66 @@ hr {
|
||||
margin-bottom: 6px;
|
||||
color: var(--color-success);
|
||||
}
|
||||
.notif-settings {
|
||||
max-height: 60vh;
|
||||
overflow-y: auto;
|
||||
padding: 6px;
|
||||
background: var(--background-subtle);
|
||||
border-top: 1px solid var(--border-default);
|
||||
}
|
||||
.notif-settings-copy {
|
||||
padding: 8px 8px 6px;
|
||||
}
|
||||
.notif-settings-copy b,
|
||||
.notif-settings-copy small {
|
||||
display: block;
|
||||
}
|
||||
.notif-settings-copy b {
|
||||
font-size: 12px;
|
||||
}
|
||||
.notif-settings-copy small {
|
||||
margin-top: 2px;
|
||||
color: var(--text-muted);
|
||||
font-size: 11px;
|
||||
line-height: 1.35;
|
||||
text-wrap: pretty;
|
||||
}
|
||||
.notif-setting-row {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(0, 1fr) 44px;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
min-height: 56px;
|
||||
padding: 8px;
|
||||
border-radius: var(--radius-sm);
|
||||
background: var(--surface-card);
|
||||
cursor: pointer;
|
||||
}
|
||||
.notif-setting-row + .notif-setting-row {
|
||||
margin-top: 5px;
|
||||
}
|
||||
.notif-setting-row > span:first-child {
|
||||
min-width: 0;
|
||||
}
|
||||
.notif-setting-row b,
|
||||
.notif-setting-row small {
|
||||
display: block;
|
||||
}
|
||||
.notif-setting-row b {
|
||||
font-size: 12.5px;
|
||||
}
|
||||
.notif-setting-row small {
|
||||
margin-top: 2px;
|
||||
color: var(--text-muted);
|
||||
font-size: 10.5px;
|
||||
line-height: 1.3;
|
||||
text-wrap: pretty;
|
||||
}
|
||||
.notif-setting-row .switch {
|
||||
min-width: 40px;
|
||||
min-height: 40px;
|
||||
justify-content: center;
|
||||
}
|
||||
/* Заголовок в меню пользователя */
|
||||
#userMenu > .dropdown-menu {
|
||||
width: 280px;
|
||||
@@ -3137,18 +3207,27 @@ table.table {
|
||||
gap: 12px;
|
||||
padding: var(--space-5) var(--space-5) 0;
|
||||
}
|
||||
.modal-header > div {
|
||||
min-width: 0;
|
||||
flex: 1 1 auto;
|
||||
}
|
||||
.modal-header h3 {
|
||||
flex: 1;
|
||||
}
|
||||
.modal-close {
|
||||
display: grid;
|
||||
flex: 0 0 32px;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
place-items: center;
|
||||
border: none;
|
||||
background: none;
|
||||
cursor: pointer;
|
||||
color: var(--text-muted);
|
||||
font-size: 18px;
|
||||
padding: 4px;
|
||||
padding: 0;
|
||||
border-radius: var(--radius-xs);
|
||||
margin: -4px -4px 0 0;
|
||||
margin: -4px -4px 0 auto;
|
||||
}
|
||||
.modal-close:hover {
|
||||
color: var(--text-primary);
|
||||
@@ -5088,6 +5167,30 @@ ul.sortable {
|
||||
flex: 0 0 auto;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.media-picker-manage {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
.media-picker-manage[hidden] {
|
||||
display: none;
|
||||
}
|
||||
.media-picker-folder-form {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
.media-picker-folder-form[hidden] {
|
||||
display: none;
|
||||
}
|
||||
.media-picker-folder-form .input-wrap {
|
||||
min-width: 0;
|
||||
flex: 1 1 auto;
|
||||
}
|
||||
.media-picker-folder-form .btn-icon {
|
||||
min-width: 40px;
|
||||
}
|
||||
.media-picker-url {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
@@ -5279,6 +5382,20 @@ ul.sortable {
|
||||
.media-picker-tools .media-picker-search {
|
||||
flex-basis: calc(100% - 50px);
|
||||
}
|
||||
.media-picker-manage {
|
||||
width: 100%;
|
||||
}
|
||||
.media-picker-manage .btn-primary {
|
||||
min-width: 0;
|
||||
flex: 1 1 auto;
|
||||
}
|
||||
.media-picker-folder-form {
|
||||
align-items: stretch;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.media-picker-folder-form .input-wrap {
|
||||
flex-basis: 100%;
|
||||
}
|
||||
.media-picker-grid {
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
}
|
||||
|
||||
@@ -221,6 +221,87 @@
|
||||
}
|
||||
};
|
||||
|
||||
// ------------------------------------------------------------------ //
|
||||
// Простые формы модулей: стандартный Ajax-контракт без отдельного JS.
|
||||
// ------------------------------------------------------------------ //
|
||||
Adminx.initAjaxForms = function () {
|
||||
document.addEventListener('submit', function (event) {
|
||||
var form = event.target.closest ? event.target.closest('form[data-ax-ajax-form]') : null;
|
||||
if (!form || form.getAttribute('data-ax-submitting') === '1') { return; }
|
||||
event.preventDefault();
|
||||
|
||||
var submit = event.submitter || form.querySelector('button[type="submit"],input[type="submit"]');
|
||||
var data = new FormData(form);
|
||||
if (submit && submit.name && !data.has(submit.name)) { data.append(submit.name, submit.value || '1'); }
|
||||
|
||||
form.setAttribute('data-ax-submitting', '1');
|
||||
form.setAttribute('aria-busy', 'true');
|
||||
if (submit) { submit.disabled = true; }
|
||||
Adminx.Loader.show();
|
||||
|
||||
Adminx.Ajax.request(form.getAttribute('action') || window.location.href, {
|
||||
method: (form.getAttribute('method') || 'POST').toUpperCase(),
|
||||
body: data
|
||||
}).then(function (payload) {
|
||||
var response = Adminx.Ajax.handle(payload);
|
||||
if (payload.ok && response.success !== false) {
|
||||
form.dispatchEvent(new CustomEvent('adminx:form-saved', { bubbles: true, detail: response }));
|
||||
if (form.hasAttribute('data-ax-reset-on-success')) { form.reset(); }
|
||||
}
|
||||
}).catch(function (error) {
|
||||
Adminx.Toast.show(error && error.message ? error.message : Adminx.t('server_unavailable', 'Сервер недоступен. Повторите попытку.'), 'error');
|
||||
}).then(function () {
|
||||
Adminx.Loader.hide();
|
||||
form.removeAttribute('data-ax-submitting');
|
||||
form.removeAttribute('aria-busy');
|
||||
if (submit) { submit.disabled = false; }
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
// ------------------------------------------------------------------ //
|
||||
// Пакетная загрузка обходит серверный max_file_uploads без изменения php.ini.
|
||||
// ------------------------------------------------------------------ //
|
||||
Adminx.Upload = {
|
||||
BATCH_SIZE: 20,
|
||||
|
||||
files: function (url, files, makeData, onProgress) {
|
||||
files = Array.prototype.slice.call(files || []);
|
||||
if (!files.length) { return Promise.resolve({ files: [], batches: 0, total: 0 }); }
|
||||
|
||||
var self = this;
|
||||
var uploaded = [];
|
||||
var batches = Math.ceil(files.length / self.BATCH_SIZE);
|
||||
var run = function (batch) {
|
||||
if (batch >= batches) {
|
||||
return Promise.resolve({ files: uploaded, batches: batches, total: files.length });
|
||||
}
|
||||
|
||||
var start = batch * self.BATCH_SIZE;
|
||||
var chunk = files.slice(start, start + self.BATCH_SIZE);
|
||||
var data = makeData(chunk, batch, batches);
|
||||
return Adminx.Ajax.post(url, data).then(function (payload) {
|
||||
var response = payload.data || {};
|
||||
if (!payload.ok || response.success === false) {
|
||||
var error = new Error(response.message || 'Не удалось загрузить файлы');
|
||||
error.uploaded = uploaded.slice();
|
||||
error.batch = batch;
|
||||
throw error;
|
||||
}
|
||||
|
||||
var result = response.data || {};
|
||||
uploaded = uploaded.concat(result.files || []);
|
||||
if (typeof onProgress === 'function') {
|
||||
onProgress(Math.min(start + chunk.length, files.length), files.length, uploaded.length, response);
|
||||
}
|
||||
return run(batch + 1);
|
||||
});
|
||||
};
|
||||
|
||||
return run(0);
|
||||
}
|
||||
};
|
||||
|
||||
// ------------------------------------------------------------------ //
|
||||
Adminx.Sidebar = {
|
||||
KEY: 'adminx-sidebar',
|
||||
@@ -407,6 +488,53 @@
|
||||
}
|
||||
};
|
||||
|
||||
// ------------------------------------------------------------------ //
|
||||
// Видимость отдельных элементов в колокольчике.
|
||||
// ------------------------------------------------------------------ //
|
||||
Adminx.NotificationPreferences = {
|
||||
init: function () {
|
||||
document.addEventListener('click', function (event) {
|
||||
var toggle = event.target.closest('[data-notification-settings-toggle]');
|
||||
if (!toggle) { return; }
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
var menu = toggle.closest('.notif-menu');
|
||||
var panel = menu ? menu.querySelector('[data-notification-settings]') : null;
|
||||
var list = menu ? menu.querySelector('.notif-list') : null;
|
||||
if (!panel) { return; }
|
||||
var opening = panel.hidden;
|
||||
panel.hidden = !opening;
|
||||
if (list) { list.hidden = opening; }
|
||||
toggle.setAttribute('aria-expanded', opening ? 'true' : 'false');
|
||||
});
|
||||
|
||||
document.addEventListener('change', function (event) {
|
||||
var input = event.target.closest('[data-notification-preference]');
|
||||
if (!input) { return; }
|
||||
var previous = !input.checked;
|
||||
var data = new FormData();
|
||||
data.append('module_code', input.getAttribute('data-module-code') || '');
|
||||
data.append('key', input.getAttribute('data-key') || '');
|
||||
data.append('enabled', input.checked ? '1' : '0');
|
||||
input.disabled = true;
|
||||
Adminx.Ajax.post(Adminx.base() + '/settings/notifications', data).then(function (payload) {
|
||||
var response = Adminx.Ajax.handle(payload);
|
||||
if (!payload.ok || response.success === false) {
|
||||
input.checked = previous;
|
||||
return;
|
||||
}
|
||||
|
||||
window.location.reload();
|
||||
}).catch(function () {
|
||||
input.checked = previous;
|
||||
Adminx.Toast.show(Adminx.t('server_unavailable', 'Сервер недоступен. Повторите попытку.'), 'error');
|
||||
}).then(function () {
|
||||
input.disabled = false;
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// ------------------------------------------------------------------ //
|
||||
// Меню пользователя в подвале сайдбара. Сайдбар имеет overflow:hidden,
|
||||
// поэтому всплывающее меню позиционируем fixed вручную (над триггером),
|
||||
@@ -896,10 +1024,12 @@
|
||||
Adminx.Sidebar.init();
|
||||
Adminx.Theme.init();
|
||||
Adminx.Dropdown.init();
|
||||
Adminx.NotificationPreferences.init();
|
||||
Adminx.SidebarUser.init();
|
||||
Adminx.Tabs.init();
|
||||
Adminx.Drawer.init();
|
||||
Adminx.Tooltip.init();
|
||||
Adminx.initAjaxForms();
|
||||
Adminx.initLogout();
|
||||
Adminx.initCopyTag();
|
||||
Adminx.initSectionHelp();
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -47,8 +47,14 @@
|
||||
+ '<div class="media-picker-tools">'
|
||||
+ '<div class="input-wrap media-picker-search"><i class="ti ti-search"></i><input class="input" type="search" placeholder="' + placeholder + '" data-mp-search></div>'
|
||||
+ '<button class="btn btn-ghost btn-icon" type="button" data-mp-up data-tooltip="На уровень выше" aria-label="На уровень выше"><i class="ti ti-arrow-up"></i></button>'
|
||||
+ '<div class="media-picker-manage" data-mp-manage hidden>'
|
||||
+ '<button class="btn btn-secondary btn-icon" type="button" data-mp-folder-toggle data-tooltip="Создать папку" aria-label="Создать папку"><i class="ti ti-folder-plus"></i></button>'
|
||||
+ '<button class="btn btn-primary" type="button" data-mp-upload><i class="ti ti-upload"></i>' + (type === 'image' ? 'Загрузить изображения' : 'Загрузить файлы') + '</button>'
|
||||
+ '<input type="file" data-mp-upload-input multiple hidden' + (type === 'image' ? ' accept="image/*"' : '') + '>'
|
||||
+ '</div>'
|
||||
+ (onUrl ? '<button class="btn btn-ghost btn-sm" type="button" data-mp-url-toggle><i class="ti ti-link"></i>По ссылке</button>' : '')
|
||||
+ '</div>'
|
||||
+ '<div class="media-picker-folder-form" data-mp-folder-form hidden><span class="input-wrap"><i class="ti ti-folder"></i><input class="input" type="text" maxlength="120" placeholder="Название новой папки" data-mp-folder-name></span><button class="btn btn-primary btn-sm" type="button" data-mp-folder-create><i class="ti ti-check"></i>Создать</button><button class="btn btn-ghost btn-icon btn-sm" type="button" data-mp-folder-cancel aria-label="Отмена" data-tooltip="Отмена"><i class="ti ti-x"></i></button></div>'
|
||||
+ (onUrl ? '<div class="media-picker-url" data-mp-url hidden><input class="input" type="url" placeholder="https://…" data-mp-url-input><button class="btn btn-primary btn-sm" type="button" data-mp-url-apply><i class="ti ti-check"></i>Вставить</button></div>' : '')
|
||||
+ '<div class="media-picker-crumbs" data-mp-crumbs></div>'
|
||||
+ '<div class="media-picker-status" data-mp-status>Загрузка…</div>'
|
||||
@@ -63,12 +69,16 @@
|
||||
document.body.appendChild(overlay);
|
||||
window.requestAnimationFrame(function () { overlay.classList.add('show'); });
|
||||
|
||||
var state = { dir: options.dir || '/uploads', parent: '', page: 1, pages: 1, q: '', type: type };
|
||||
var state = { dir: options.dir || '/uploads', parent: '', page: 1, pages: 1, q: '', type: type, canManage: false, busy: false };
|
||||
var grid = overlay.querySelector('[data-mp-grid]');
|
||||
var crumbs = overlay.querySelector('[data-mp-crumbs]');
|
||||
var status = overlay.querySelector('[data-mp-status]');
|
||||
var count = overlay.querySelector('[data-mp-count]');
|
||||
var search = overlay.querySelector('[data-mp-search]');
|
||||
var manage = overlay.querySelector('[data-mp-manage]');
|
||||
var uploadInput = overlay.querySelector('[data-mp-upload-input]');
|
||||
var folderForm = overlay.querySelector('[data-mp-folder-form]');
|
||||
var folderName = overlay.querySelector('[data-mp-folder-name]');
|
||||
var timer = null;
|
||||
|
||||
function close() {
|
||||
@@ -89,6 +99,8 @@
|
||||
var folders = data.folders || [];
|
||||
var files = data.files || [];
|
||||
renderCrumbs(data.breadcrumbs || []);
|
||||
state.canManage = !!data.can_manage;
|
||||
manage.hidden = !state.canManage;
|
||||
grid.innerHTML = '';
|
||||
folders.forEach(function (folder) {
|
||||
var folderMeta = state.q
|
||||
@@ -111,6 +123,74 @@
|
||||
overlay.querySelector('[data-mp-up]').disabled = !state.parent;
|
||||
}
|
||||
|
||||
function responseData(payload) {
|
||||
var response = payload && payload.data ? payload.data : {};
|
||||
if (!payload || !payload.ok || response.success === false) {
|
||||
throw new Error(response.message || (response.error && response.error.message) || 'Не удалось выполнить действие');
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
function setBusy(value, message) {
|
||||
state.busy = !!value;
|
||||
manage.querySelectorAll('button').forEach(function (button) { button.disabled = state.busy; });
|
||||
status.hidden = !message;
|
||||
if (message) { status.textContent = message; }
|
||||
}
|
||||
|
||||
function clearSearch() {
|
||||
state.q = '';
|
||||
search.value = '';
|
||||
}
|
||||
|
||||
function createFolder() {
|
||||
var name = folderName.value.trim();
|
||||
if (!name || state.busy) { folderName.focus(); return; }
|
||||
var data = new FormData();
|
||||
data.set('_csrf', Adminx.csrf());
|
||||
data.set('dir', state.dir);
|
||||
data.set('name', name);
|
||||
setBusy(true, 'Создаём папку…');
|
||||
Adminx.Ajax.post(base + '/media/folders', data).then(responseData).then(function (response) {
|
||||
var result = response.data || {};
|
||||
folderForm.hidden = true;
|
||||
folderName.value = '';
|
||||
clearSearch();
|
||||
Adminx.Toast.show(response.message || 'Папка создана', 'success');
|
||||
load(result.path || state.dir, 1);
|
||||
}).catch(function (error) {
|
||||
setBusy(false, '');
|
||||
Adminx.Toast.show(error.message || 'Не удалось создать папку', 'error');
|
||||
folderName.focus();
|
||||
});
|
||||
}
|
||||
|
||||
function upload(files) {
|
||||
if (!files || !files.length || state.busy) { return; }
|
||||
setBusy(true, 'Подготовка к загрузке: ' + files.length + '…');
|
||||
Adminx.Upload.files(base + '/media/upload', files, function (chunk) {
|
||||
var data = new FormData();
|
||||
data.set('_csrf', Adminx.csrf());
|
||||
data.set('dir', state.dir);
|
||||
chunk.forEach(function (file) { data.append('files[]', file); });
|
||||
return data;
|
||||
}, function (processed, total) {
|
||||
status.textContent = 'Загружено: ' + processed + ' из ' + total + '…';
|
||||
}).then(function (result) {
|
||||
uploadInput.value = '';
|
||||
clearSearch();
|
||||
Adminx.Toast.show('Загружено файлов: ' + result.files.length, 'success');
|
||||
load(state.dir, 1);
|
||||
}).catch(function (error) {
|
||||
uploadInput.value = '';
|
||||
setBusy(false, '');
|
||||
var uploaded = error && error.uploaded ? error.uploaded.length : 0;
|
||||
var message = error.message || 'Не удалось загрузить файлы';
|
||||
if (uploaded) { message += '. До ошибки загружено: ' + uploaded; }
|
||||
Adminx.Toast.show(message, 'error');
|
||||
});
|
||||
}
|
||||
|
||||
function load(dir, page) {
|
||||
state.dir = dir || state.dir;
|
||||
state.page = page || 1;
|
||||
@@ -131,9 +211,10 @@
|
||||
state.parent = data.parent_dir || '';
|
||||
state.page = data.page || 1;
|
||||
state.pages = data.pages || 1;
|
||||
setBusy(false, '');
|
||||
render(data);
|
||||
})
|
||||
.catch(function () { status.textContent = 'Не удалось загрузить медиа'; status.hidden = false; });
|
||||
.catch(function () { setBusy(false, ''); status.textContent = 'Не удалось загрузить медиа'; status.hidden = false; });
|
||||
}
|
||||
|
||||
overlay.addEventListener('click', function (e) {
|
||||
@@ -146,6 +227,10 @@
|
||||
if (e.target.closest('[data-mp-prev]') && state.page > 1) { load(state.dir, state.page - 1); }
|
||||
if (e.target.closest('[data-mp-next]') && state.page < state.pages) { load(state.dir, state.page + 1); }
|
||||
if (e.target.closest('[data-mp-up]') && state.parent) { load(state.parent, 1); }
|
||||
if (e.target.closest('[data-mp-folder-toggle]')) { folderForm.hidden = !folderForm.hidden; if (!folderForm.hidden) { folderName.focus(); } return; }
|
||||
if (e.target.closest('[data-mp-folder-cancel]')) { folderForm.hidden = true; folderName.value = ''; return; }
|
||||
if (e.target.closest('[data-mp-folder-create]')) { createFolder(); return; }
|
||||
if (e.target.closest('[data-mp-upload]')) { uploadInput.click(); return; }
|
||||
if (onUrl) {
|
||||
if (e.target.closest('[data-mp-url-toggle]')) {
|
||||
var box = overlay.querySelector('[data-mp-url]');
|
||||
@@ -163,6 +248,10 @@
|
||||
window.clearTimeout(timer);
|
||||
timer = window.setTimeout(function () { state.q = search.value.trim(); load(state.dir, 1); }, 220);
|
||||
});
|
||||
folderName.addEventListener('keydown', function (e) {
|
||||
if (e.key === 'Enter') { e.preventDefault(); createFolder(); }
|
||||
});
|
||||
uploadInput.addEventListener('change', function () { upload(uploadInput.files); });
|
||||
document.addEventListener('keydown', onKey);
|
||||
load(state.dir, 1);
|
||||
search.focus();
|
||||
|
||||
@@ -290,20 +290,29 @@ var EnhancedImage = Image.extend({
|
||||
|
||||
bindForm: function (textarea, editor) {
|
||||
var form = textarea.closest('form');
|
||||
var self = this;
|
||||
if (!form) { return; }
|
||||
form.addEventListener('submit', function () {
|
||||
var root = textarea.closest('.rich-editor');
|
||||
if (root && root.classList.contains('rich-editor-source-open') && root._richSourceEditor) {
|
||||
root._richSourceEditor.save();
|
||||
textarea.value = root._richSourceEditor.getValue();
|
||||
return;
|
||||
}
|
||||
if (textarea.getAttribute('data-rich-editor-dirty') === '1') {
|
||||
textarea.value = editor.getHTML();
|
||||
}
|
||||
self.syncTextarea(textarea, editor);
|
||||
});
|
||||
},
|
||||
|
||||
syncTextarea: function (textarea, editor) {
|
||||
var root;
|
||||
if (!textarea) { return ''; }
|
||||
root = textarea.closest('.rich-editor');
|
||||
if (root && root.classList.contains('rich-editor-source-open') && root._richSourceEditor) {
|
||||
root._richSourceEditor.save();
|
||||
textarea.value = root._richSourceEditor.getValue();
|
||||
textarea.setAttribute('data-rich-editor-dirty', '1');
|
||||
return textarea.value;
|
||||
}
|
||||
if (editor && textarea.getAttribute('data-rich-editor-dirty') === '1') {
|
||||
textarea.value = editor.getHTML();
|
||||
}
|
||||
return textarea.value;
|
||||
},
|
||||
|
||||
openSource: function (editor) {
|
||||
var root = editor.view.dom.closest('.rich-editor');
|
||||
if (!root || !window.CodeMirror) { return; }
|
||||
|
||||
+22
-1
@@ -62,6 +62,7 @@
|
||||
//-- Ядро: автозагрузчик, БД, сессии, настройки, Twig, хуки.
|
||||
include BASEPATH . DS . 'system' . DS . 'bootstrap.php';
|
||||
App::init();
|
||||
\App\Common\ResponseSecurityHeaders::apply(array('http://127.0.0.1:*', 'http://localhost:*'));
|
||||
|
||||
use App\Common\AdminAssets;
|
||||
use App\Common\Auth;
|
||||
@@ -207,6 +208,20 @@
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($navFlat['modules']['children'])) {
|
||||
usort($navFlat['modules']['children'], function ($left, $right) {
|
||||
$leftRegistry = isset($left['code']) && (string) $left['code'] === 'modules_registry';
|
||||
$rightRegistry = isset($right['code']) && (string) $right['code'] === 'modules_registry';
|
||||
if ($leftRegistry !== $rightRegistry) { return $leftRegistry ? -1 : 1; }
|
||||
$leftLabel = isset($left['label']) ? (string) $left['label'] : '';
|
||||
$rightLabel = isset($right['label']) ? (string) $right['label'] : '';
|
||||
$leftCyrillic = preg_match('/^\p{Cyrillic}/u', $leftLabel) === 1;
|
||||
$rightCyrillic = preg_match('/^\p{Cyrillic}/u', $rightLabel) === 1;
|
||||
if ($leftCyrillic !== $rightCyrillic) { return $leftCyrillic ? -1 : 1; }
|
||||
return strnatcasecmp($leftLabel, $rightLabel);
|
||||
});
|
||||
}
|
||||
|
||||
$commandPaletteItems = array();
|
||||
foreach ($navigationItems as $navItem) {
|
||||
if (!isset($navItem['url']) || (string) $navItem['url'] === '#') { continue; }
|
||||
@@ -249,7 +264,9 @@
|
||||
|
||||
//-- Сводка уведомлений в шапке (новые заказы/письма) — только для админа.
|
||||
$notifications = array('total' => 0, 'orders' => 0, 'messages' => 0, 'items' => array());
|
||||
$notificationPreferences = array();
|
||||
if ($canAdmin) {
|
||||
$notificationPreferences = \App\Adminx\Support\ModuleExtensions::notificationPreferences();
|
||||
$notificationKey = 'adminx.notifications.' . (int) Auth::id() . '.' . md5((string) ADMINX_BASE);
|
||||
$notifications = Cache::remember($notificationKey, 15, function () {
|
||||
$summary = \App\Adminx\Support\Notifications::summary(ADMINX_BASE);
|
||||
@@ -257,7 +274,11 @@
|
||||
});
|
||||
}
|
||||
|
||||
Twig::addGlobal('notifications', $notifications);
|
||||
Twig::addGlobals(array(
|
||||
'notifications' => $notifications,
|
||||
'notification_preferences' => $notificationPreferences,
|
||||
'can_manage_notification_preferences' => Permission::check('manage_settings'),
|
||||
));
|
||||
|
||||
if (!$isPublic && !$canAdmin) {
|
||||
if (Request::isAjax()) {
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
<phrase data="btn_cancel">Cancel</phrase>
|
||||
<phrase data="btn_close">Close</phrase>
|
||||
<phrase data="btn_confirm">Confirm</phrase>
|
||||
<phrase data="btn_create">Create</phrase>
|
||||
<phrase data="btn_delete">Delete</phrase>
|
||||
<phrase data="btn_save">Save</phrase>
|
||||
<phrase data="btn_show">Show</phrase>
|
||||
@@ -34,6 +35,7 @@
|
||||
<phrase data="topbar_theme">Theme</phrase>
|
||||
<phrase data="ui_loading">Loading...</phrase>
|
||||
<phrase data="ui_main">General</phrase>
|
||||
<phrase data="ui_name">Name</phrase>
|
||||
<phrase data="ui_nothing_found">Nothing found</phrase>
|
||||
<phrase data="ui_remove">Remove</phrase>
|
||||
<phrase data="ui_search">Search</phrase>
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
<phrase data="btn_cancel">Отмена</phrase>
|
||||
<phrase data="btn_close">Закрыть</phrase>
|
||||
<phrase data="btn_confirm">Подтвердить</phrase>
|
||||
<phrase data="btn_create">Создать</phrase>
|
||||
<phrase data="btn_delete">Удалить</phrase>
|
||||
<phrase data="btn_save">Сохранить</phrase>
|
||||
<phrase data="btn_show">Показать</phrase>
|
||||
@@ -34,6 +35,7 @@
|
||||
<phrase data="topbar_theme">Тема</phrase>
|
||||
<phrase data="ui_loading">Загрузка...</phrase>
|
||||
<phrase data="ui_main">Основное</phrase>
|
||||
<phrase data="ui_name">Название</phrase>
|
||||
<phrase data="ui_nothing_found">Ничего не найдено</phrase>
|
||||
<phrase data="ui_remove">Убрать</phrase>
|
||||
<phrase data="ui_search">Поиск</phrase>
|
||||
|
||||
@@ -50,6 +50,7 @@
|
||||
use App\Adminx\Packages\Products\ProductCollections;
|
||||
use App\Adminx\Packages\Products\ProductDemands;
|
||||
use App\Adminx\Packages\Products\ProductDuplicator;
|
||||
use App\Adminx\Packages\Products\QualitySnapshot;
|
||||
use App\Adminx\Packages\Products\ProductReadiness;
|
||||
use App\Adminx\Packages\Products\PublicViewTemplates;
|
||||
use App\Adminx\Packages\Products\ShippingPackageTemplates;
|
||||
@@ -90,12 +91,15 @@
|
||||
'state' => Request::getStr('state', ''),
|
||||
'issue' => Request::getStr('issue', ''),
|
||||
'payment' => Request::getStr('payment', ''),
|
||||
'view' => Request::getStr('view', 'table') === 'cards' ? 'cards' : 'table',
|
||||
'page' => Request::getInt('page', 1),
|
||||
'per_page' => Request::getInt('per_page', 25),
|
||||
);
|
||||
$statsSnapshot = Model::productStatsSnapshot();
|
||||
return $this->render('@products/products.twig', array(
|
||||
'result' => Model::products($filters),
|
||||
'stats' => Model::productStats(),
|
||||
'stats' => $statsSnapshot['stats'],
|
||||
'stats_loaded' => $statsSnapshot['loaded'],
|
||||
'filters' => $filters,
|
||||
'saved_views' => SavedViews::all('catalog_products', Auth::id(), $this->savedViewFields('products')),
|
||||
'can_manage' => Permission::check('manage_products'),
|
||||
@@ -104,19 +108,27 @@
|
||||
));
|
||||
}
|
||||
|
||||
public function productStats(array $params = array())
|
||||
{
|
||||
if (!Permission::check('view_products')) { return $this->error('Недостаточно прав', array(), 403); }
|
||||
$stats = Model::productStats();
|
||||
$stats['indexed_label'] = !empty($stats['indexed_at']) ? date('d.m H:i', (int) $stats['indexed_at']) : '—';
|
||||
return $this->success('', array('data' => array('stats' => $stats)));
|
||||
}
|
||||
|
||||
public function productQuality(array $params = array())
|
||||
{
|
||||
if (!Permission::check('view_products')) { return $this->renderStatus('@adminx/404.twig', array('title' => 'Недостаточно прав'), 403); }
|
||||
if (!Model::hasCommerceCatalogs()) { return $this->renderStatus('@adminx/404.twig', array('title' => 'Товарные каталоги не настроены'), 404); }
|
||||
$this->assets();
|
||||
$stats = Model::productStats();
|
||||
$state = Request::getStr('state', 'active');
|
||||
if (!in_array($state, array('active', 'inactive', 'all'), true)) { $state = 'active'; }
|
||||
$stats = Model::productQualityStats();
|
||||
$issues = Model::productQualityIssues($stats);
|
||||
$allowed = array();
|
||||
foreach ($issues as $item) { $allowed[(string) $item['code']] = true; }
|
||||
$issue = Request::getStr('issue', '');
|
||||
if ($issue !== '' && !isset($allowed[$issue])) { $issue = ''; }
|
||||
$state = Request::getStr('state', '');
|
||||
if (!in_array($state, array('', 'active', 'inactive'), true)) { $state = ''; }
|
||||
$filters = array(
|
||||
'q' => Request::getStr('q', ''),
|
||||
'issue' => $issue,
|
||||
@@ -124,7 +136,11 @@
|
||||
'page' => Request::getInt('page', 1),
|
||||
'per_page' => Request::getInt('per_page', 25),
|
||||
'include_quality' => true,
|
||||
'quality_scope' => $state === 'active',
|
||||
);
|
||||
$aiModule = ModuleManager::get('ai_assistant');
|
||||
$aiAvailable = $aiModule && !empty($aiModule['installed']) && !empty($aiModule['enabled'])
|
||||
&& class_exists('\App\Modules\AiAssistant\Repository') && Permission::check('manage_ai_assistant');
|
||||
return $this->render('@products/product-quality.twig', array(
|
||||
'result' => Model::products($filters),
|
||||
'stats' => $stats,
|
||||
@@ -132,6 +148,30 @@
|
||||
'filters' => $filters,
|
||||
'saved_views' => SavedViews::all('catalog_quality', Auth::id(), $this->savedViewFields('quality')),
|
||||
'can_manage' => Permission::check('manage_products'),
|
||||
'can_toggle' => Permission::check('manage_products') && Permission::check('manage_documents'),
|
||||
'ai_available' => (bool) $aiAvailable,
|
||||
));
|
||||
}
|
||||
|
||||
public function refreshProductQualitySnapshot(array $params = array())
|
||||
{
|
||||
if (($error = $this->csrfGuard()) !== null) { return $error; }
|
||||
if (!Permission::check('view_products')) { return $this->error('Недостаточно прав', array(), 403); }
|
||||
|
||||
try {
|
||||
$snapshot = QualitySnapshot::refresh();
|
||||
} catch (\Throwable $e) {
|
||||
error_log('[products.quality] ' . $e->getMessage());
|
||||
return $this->error('Не удалось рассчитать качество товаров', array(), 500);
|
||||
}
|
||||
|
||||
return $this->success('Сводка качества обновлена', array(
|
||||
'data' => array(
|
||||
'generated_label' => (string) $snapshot['generated_label'],
|
||||
'quality_total' => (int) $snapshot['stats']['quality_total'],
|
||||
'required' => (int) $snapshot['required'],
|
||||
'score' => (int) $snapshot['stats']['score'],
|
||||
),
|
||||
));
|
||||
}
|
||||
|
||||
@@ -1050,6 +1090,7 @@
|
||||
$search = Request::getStr('q', '');
|
||||
return $this->render('@products/variant-group.twig', array(
|
||||
'group' => $group, 'search' => $search,
|
||||
'focus_product_id' => Request::getInt('focus', 0),
|
||||
'variant_fields' => VariantGroups::fields((int) $group['id']),
|
||||
'variant_attributes' => VariantGroups::nativeAttributes(),
|
||||
'package_templates' => ShippingPackageTemplates::all(),
|
||||
@@ -1169,6 +1210,7 @@
|
||||
public function copyVariantProduct(array $params = array())
|
||||
{
|
||||
if (($error = $this->productGuard()) !== null) { return $error; }
|
||||
if (!Request::postBool('confirmed', false)) { return $this->error('Подтвердите создание варианта', array(), 409); }
|
||||
$sourceId = (int) $params['product'];
|
||||
$newId = 0;
|
||||
try {
|
||||
@@ -1181,12 +1223,15 @@
|
||||
}
|
||||
|
||||
$this->audit('catalog.variant_copied', (int) $params['id'], array('source_id' => $sourceId, 'product_id' => $newId));
|
||||
return $this->success('Вариант создан копированием', array('redirect' => $this->base() . '/catalog/products/' . $newId . '/edit'));
|
||||
return $this->success('Вариант создан копированием', array(
|
||||
'redirect' => $this->base() . '/catalog/products/' . $newId . '/edit?variant_group=' . (int) $params['id'],
|
||||
));
|
||||
}
|
||||
|
||||
public function copyProduct(array $params = array())
|
||||
{
|
||||
if (($error = $this->guardPermission('manage_products', 'manage_documents')) !== null) { return $error; }
|
||||
if (!Request::postBool('confirmed', false)) { return $this->error('Подтвердите создание копии товара', array(), 409); }
|
||||
$sourceId = isset($params['id']) ? (int) $params['id'] : 0;
|
||||
try {
|
||||
$copy = ProductDuplicator::copy($sourceId, Auth::id());
|
||||
@@ -1269,7 +1314,23 @@
|
||||
VariantGroups::add($groupId, $productId);
|
||||
} catch (\Throwable $e) { return $this->error($e->getMessage(), array(), 422); }
|
||||
$this->audit('catalog.variant_group_created_from_product', $groupId, array('product_id' => $productId));
|
||||
return $this->success('Группа вариантов создана', array('redirect' => $this->base() . '/catalog/variant-groups/' . $groupId));
|
||||
return $this->success('Группа вариантов создана', array('redirect' => $this->variantGroupUrl($groupId, $productId)));
|
||||
}
|
||||
|
||||
public function attachProductVariantGroup(array $params = array())
|
||||
{
|
||||
if (($error = $this->productGuard()) !== null) { return $error; }
|
||||
$productId = isset($params['id']) ? (int) $params['id'] : 0;
|
||||
$groupId = Request::postInt('group_id', 0);
|
||||
if (!Model::product($productId)) { return $this->error('Товар не найден', array(), 404); }
|
||||
if ($groupId <= 0) { return $this->error('Выберите группу вариантов', array(), 422); }
|
||||
if (VariantGroups::membership($productId)) { return $this->error('Товар уже состоит в группе', array(), 422); }
|
||||
try { VariantGroups::add($groupId, $productId); }
|
||||
catch (\Throwable $e) { return $this->error($e->getMessage(), array(), 422); }
|
||||
$this->audit('catalog.variant_added_from_product', $groupId, array('product_id' => $productId));
|
||||
return $this->success('Товар добавлен в группу вариантов', array(
|
||||
'redirect' => $this->variantGroupUrl($groupId, $productId),
|
||||
));
|
||||
}
|
||||
|
||||
public function editProduct(array $params = array())
|
||||
@@ -1287,8 +1348,17 @@
|
||||
CodeEditor::useRichEditor();
|
||||
$this->attributeAssets();
|
||||
$variantGroup = VariantGroups::membership($id);
|
||||
$returnUrl = $this->base() . '/catalog/products';
|
||||
$returnLabel = 'Товары';
|
||||
$returnGroupId = Request::getInt('variant_group', 0);
|
||||
if ($variantGroup && $returnGroupId === (int) $variantGroup['id']) {
|
||||
$returnUrl = $this->variantGroupUrl((int) $variantGroup['id'], $id);
|
||||
$returnLabel = 'Группа вариантов';
|
||||
}
|
||||
|
||||
$shippingProfile = ProductShipping::profile($id);
|
||||
$nativeAttributes = Attributes::productEditor($id);
|
||||
$searchAliasesAvailable = $this->productSearchAliasesAvailable();
|
||||
$mediaDraftToken = DocumentMediaDraft::issue(Auth::id(), $id);
|
||||
return $this->render('@documents/edit.twig', array(
|
||||
'document' => $document,
|
||||
@@ -1301,14 +1371,21 @@
|
||||
'is_new' => false, 'can_manage' => true, 'quick_edit' => Request::getBool('quick_edit', false),
|
||||
'actor_id' => Auth::id(),
|
||||
'catalog_mode' => true, 'product' => $product, 'variant_group' => $variantGroup,
|
||||
'variant_groups' => $variantGroup ? array() : VariantGroups::all(),
|
||||
'shipping_profile' => $shippingProfile,
|
||||
'package_templates' => ShippingPackageTemplates::all(),
|
||||
'native_attributes' => $nativeAttributes,
|
||||
'product_context_links' => EditorContextLinks::product($document, $nativeAttributes),
|
||||
'product_readiness' => ProductReadiness::build($product, $nativeAttributes, $shippingProfile, $variantGroup),
|
||||
'product_promotions_available' => Promotions::available(),
|
||||
'product_promotions' => Promotions::forProduct($id),
|
||||
'can_manage_product_promotions' => Permission::check('manage_orders'),
|
||||
'return_url' => $this->base() . '/catalog/products',
|
||||
'product_search_aliases_available' => $searchAliasesAvailable,
|
||||
'product_search_aliases' => $searchAliasesAvailable
|
||||
? \App\Modules\Search\DocumentAliases::forDocument($id)
|
||||
: array(),
|
||||
'return_url' => $returnUrl,
|
||||
'return_label' => $returnLabel,
|
||||
'product_copy_url' => $this->base() . '/catalog/products/' . $id . '/copy',
|
||||
'submit_url' => $this->base() . '/documents/' . $id,
|
||||
));
|
||||
@@ -1419,6 +1496,47 @@
|
||||
if(($error=$this->productGuard())!==null){return $error;}$productId=isset($params['id'])?(int)$params['id']:0;if(!Model::product($productId)){return $this->error('Товар не найден',array(),404);}try{$data=Attributes::saveProductValues($productId,Request::postAll(),Auth::id());}catch(\Throwable $e){return $this->error($e->getMessage(),array(),422);}$this->audit('catalog.product_attributes_saved',$productId,$data);return $this->success('Характеристики товара сохранены',array('data'=>$data));
|
||||
}
|
||||
|
||||
public function saveProductSearchAliases(array $params = array())
|
||||
{
|
||||
if (($error = $this->productGuard()) !== null) { return $error; }
|
||||
$productId = isset($params['id']) ? (int) $params['id'] : 0;
|
||||
if (!Model::product($productId)) { return $this->error('Товар не найден', array(), 404); }
|
||||
if (!$this->productSearchAliasesAvailable()) {
|
||||
return $this->error('Обновите и включите модуль «Поиск по сайту»', array(), 409);
|
||||
}
|
||||
|
||||
try {
|
||||
$aliases = \App\Modules\Search\DocumentAliases::saveDocument(
|
||||
$productId,
|
||||
(array) Request::post('aliases', array()),
|
||||
Auth::id()
|
||||
);
|
||||
} catch (\Throwable $e) {
|
||||
return $this->error($e->getMessage(), array(), 422);
|
||||
}
|
||||
|
||||
$this->audit('catalog.product_search_aliases_saved', $productId, array('count' => count($aliases)));
|
||||
return $this->success('Поисковые названия сохранены', array('data' => array('aliases' => $aliases)));
|
||||
}
|
||||
|
||||
public function productSearchAliasSuggestions(array $params = array())
|
||||
{
|
||||
if (!Permission::check('manage_products')) {
|
||||
return $this->error('Недостаточно прав', array(), 403);
|
||||
}
|
||||
|
||||
if (!$this->productSearchAliasesAvailable()) {
|
||||
return $this->error('Обновите и включите модуль «Поиск по сайту»', array(), 409);
|
||||
}
|
||||
|
||||
$query = Request::getStr('q', '');
|
||||
$documentId = Request::getInt('document_id', 0);
|
||||
$items = mb_strlen(trim($query), 'UTF-8') >= 2
|
||||
? \App\Modules\Search\DocumentAliases::suggestions($query, $documentId, 12)
|
||||
: array();
|
||||
return $this->success('', array('data' => array('items' => $items)));
|
||||
}
|
||||
|
||||
public function copyProductShippingToVariants(array $params = array())
|
||||
{
|
||||
if (($error = $this->productGuard()) !== null) { return $error; }
|
||||
@@ -1521,14 +1639,24 @@
|
||||
|
||||
$allowed = Model::productRubrics();
|
||||
$rubricId = Request::getInt('rubric_id', 0);
|
||||
if (!in_array($rubricId, $allowed, true)) { $rubricId = !empty($allowed) ? (int) reset($allowed) : 0; }
|
||||
if ($rubricId <= 0) { return $this->renderStatus('@adminx/404.twig', array('title' => 'Товарная рубрика не настроена'), 404); }
|
||||
if (!$allowed) { return $this->renderStatus('@adminx/404.twig', array('title' => 'Товарная рубрика не настроена'), 404); }
|
||||
if (!in_array($rubricId, $allowed, true)) {
|
||||
$this->assets();
|
||||
return $this->render('@products/product-create.twig', array(
|
||||
'rubrics' => Model::productRubricOptions(),
|
||||
'return_url' => $this->base() . '/catalog/products',
|
||||
));
|
||||
}
|
||||
|
||||
$document = DocumentsModel::blank($rubricId);
|
||||
$mediaDraftToken = DocumentMediaDraft::issue(Auth::id(), 0);
|
||||
AdminAssets::addStyle($this->base() . '/modules/Documents/assets/documents.css', 50);
|
||||
AdminAssets::addScript($this->base() . '/modules/Documents/assets/documents.js', 50);
|
||||
CodeEditor::useRichEditor(); $this->assets();
|
||||
return $this->render('@documents/edit.twig', array(
|
||||
'document' => $document, 'field_groups' => DocumentsModel::fieldsForRubric($rubricId, 0),
|
||||
'document' => $document,
|
||||
'field_groups' => DocumentsModel::fieldsForRubric($rubricId, 0, $mediaDraftToken),
|
||||
'media_draft_token' => $mediaDraftToken,
|
||||
'rubrics' => array_values(array_filter(DocumentsModel::rubrics(), function ($rubric) use ($allowed) { return in_array((int) $rubric['Id'], $allowed, true); })),
|
||||
'templates' => DocumentsModel::rubricTemplates($rubricId), 'navigation_items' => DocumentsModel::navigationItems(),
|
||||
'authors' => DocumentsModel::authors(), 'is_new' => true, 'can_manage' => true,
|
||||
@@ -1573,9 +1701,12 @@
|
||||
$settings['filters_default_ids'] = $this->ids(isset($settings['filters_default']) ? $settings['filters_default'] : '');
|
||||
$styles = @unserialize(isset($settings['filters_default_settings']) ? (string) $settings['filters_default_settings'] : '', array('allowed_classes' => false));
|
||||
$settings['filter_styles'] = is_array($styles) ? $styles : array();
|
||||
$flat = Model::items($rubricId, $fieldId);
|
||||
return $this->render('@catalog/edit.twig', array(
|
||||
'catalog' => $catalog, 'settings' => $settings,
|
||||
'tree' => Model::tree($rubricId, $fieldId), 'flat' => Model::items($rubricId, $fieldId),
|
||||
'tree' => Model::tree($rubricId, $fieldId), 'flat' => $flat,
|
||||
'source_options' => Model::sourceOptions($rubricId, $fieldId),
|
||||
'source_schema_available' => Model::sourceItemsAvailable(),
|
||||
'fields' => $fields,
|
||||
'field_groups' => array_values($fieldGroups),
|
||||
'request_options' => Model::requestOptions(),
|
||||
@@ -1585,15 +1716,44 @@
|
||||
'filter_template_options' => $filterTemplatesAvailable ? FilterTemplates::options() : array(),
|
||||
'filter_templates_available' => $filterTemplatesAvailable,
|
||||
'products_available' => $productsAvailable,
|
||||
'product_roles' => $productsAvailable ? \App\Adminx\Packages\Products\ProductRoleSettings::view($rubricId, $settings, Request::getInt('product_preview', 0)) : array(),
|
||||
'can_manage' => Permission::check('manage_catalog'),
|
||||
));
|
||||
}
|
||||
|
||||
public function productPreview(array $params = array())
|
||||
{
|
||||
$rubricId = isset($params['rubric']) ? (int) $params['rubric'] : 0;
|
||||
$fieldId = isset($params['field']) ? (int) $params['field'] : 0;
|
||||
if (!Permission::check('view_catalog') || !$this->productsAvailable()
|
||||
|| !\App\Adminx\Packages\Products\ProductRoleSettings::canReadRubric($rubricId)) {
|
||||
return $this->renderStatus('@adminx/404.twig', array('title' => 'Недостаточно прав'), 403);
|
||||
}
|
||||
|
||||
$catalog = Model::catalog($rubricId, $fieldId);
|
||||
if (!$catalog) { return $this->renderStatus('@adminx/404.twig', array('title' => 'Каталог не найден'), 404); }
|
||||
$settings = Model::settings($rubricId, $fieldId);
|
||||
$selection = array();
|
||||
foreach (array('context', 'category', 'feed', 'scope', 'query', 'source', 'limit') as $key) {
|
||||
$selection[$key] = Request::getStr('selection_' . $key, $key === 'context' ? 'catalog' : ($key === 'limit' ? '8' : ''));
|
||||
}
|
||||
|
||||
return $this->partial('@catalog/_product-role-preview.twig', array(
|
||||
'catalog' => $catalog, 'settings' => $settings,
|
||||
'product_roles' => \App\Adminx\Packages\Products\ProductRoleSettings::view($rubricId, $settings,
|
||||
Request::getInt('product_preview', 0), $selection, Request::getInt('selection_check', 0) === 1),
|
||||
));
|
||||
}
|
||||
|
||||
public function item(array $params = array())
|
||||
{
|
||||
if (!Permission::check('view_catalog')) { return $this->error('Недостаточно прав', array(), 403); }
|
||||
$item = Model::item(isset($params['id']) ? (int) $params['id'] : 0);
|
||||
if ($item) { $item['condition_context'] = Model::conditionContext($item['id']); }
|
||||
if ($item) {
|
||||
$item['condition_context'] = Model::conditionContext($item['id']);
|
||||
$item['context_links'] = EditorContextLinks::section($item, $this->productsAvailable());
|
||||
}
|
||||
|
||||
return $item ? $this->success('', array('data' => $item)) : $this->error('Раздел не найден', array(), 404);
|
||||
}
|
||||
|
||||
@@ -1699,6 +1859,7 @@
|
||||
return $this->success($id > 0 ? 'Раздел сохранён' : 'Раздел создан', array('data' => array(
|
||||
'id' => $saved,
|
||||
'condition_context' => Model::conditionContext($saved),
|
||||
'context_links' => EditorContextLinks::section(Model::item($saved), $this->productsAvailable()),
|
||||
)));
|
||||
}
|
||||
|
||||
@@ -1775,7 +1936,7 @@
|
||||
{
|
||||
return $scope === 'quality'
|
||||
? array('q', 'issue', 'state', 'per_page')
|
||||
: array('q', 'state', 'issue', 'payment', 'per_page');
|
||||
: array('q', 'state', 'issue', 'payment', 'per_page', 'view');
|
||||
}
|
||||
|
||||
protected function quickEditData()
|
||||
@@ -1801,10 +1962,21 @@
|
||||
'quick_profiles_available' => QuickEditorProfiles::available());
|
||||
}
|
||||
|
||||
protected function variantGroupUrl($groupId, $productId = 0)
|
||||
{
|
||||
$url = $this->base() . '/catalog/variant-groups/' . (int) $groupId;
|
||||
if ((int) $productId > 0) {
|
||||
$url .= '?focus=' . (int) $productId . '#variant-' . (int) $productId;
|
||||
}
|
||||
|
||||
return $url;
|
||||
}
|
||||
|
||||
protected function assets()
|
||||
{
|
||||
AdminAssets::addStyle($this->base() . '/modules/Catalog/assets/catalog.css', 50);
|
||||
AdminAssets::addStyle($this->base() . '/modules/Catalog/assets/catalog-drawer.css', 51);
|
||||
AdminAssets::addStyle($this->base() . '/modules/Catalog/assets/context-links.css', 52);
|
||||
AdminAssets::addScript($this->base() . '/modules/Catalog/assets/catalog.js', 50);
|
||||
if ($this->productsAvailable()) {
|
||||
if (is_file(BASEPATH . '/modules/products/admin/assets/products.css')) {
|
||||
@@ -1827,6 +1999,16 @@
|
||||
&& is_file(BASEPATH . '/modules/products/admin/module.php');
|
||||
}
|
||||
|
||||
protected function productSearchAliasesAvailable()
|
||||
{
|
||||
$module = ModuleManager::get('search');
|
||||
return is_array($module)
|
||||
&& !empty($module['installed'])
|
||||
&& !empty($module['enabled'])
|
||||
&& class_exists('App\\Modules\\Search\\DocumentAliases')
|
||||
&& \App\Modules\Search\DocumentAliases::available();
|
||||
}
|
||||
|
||||
protected function attributeAssets()
|
||||
{
|
||||
$this->assets();
|
||||
|
||||
@@ -0,0 +1,159 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------------------
|
||||
| AVE.cms
|
||||
|--------------------------------------------------------------------------------------
|
||||
| @package AVE.cms
|
||||
| @file adminx/modules/Catalog/EditorContextLinks.php
|
||||
| @author AVE.cms <support@ave-cms.ru>
|
||||
| @copyright 2007-2026 (c) AVE.cms
|
||||
| @link https://ave-cms.ru
|
||||
| @version 3.3
|
||||
*/
|
||||
|
||||
namespace App\Adminx\Catalog;
|
||||
|
||||
defined('BASEPATH') || die('Direct access to this location is not allowed.');
|
||||
|
||||
use App\Adminx\Support\AdminLocale;
|
||||
use App\Common\AdminLocation;
|
||||
use App\Common\Permission;
|
||||
use App\Content\CatalogTables;
|
||||
use App\Content\ContentTables;
|
||||
use App\Content\Presentation\PresentationRenderer;
|
||||
use App\Helpers\Html;
|
||||
use App\Modules\Products\CardSettings;
|
||||
use App\Modules\Products\CardTemplateRepository;
|
||||
use DB;
|
||||
|
||||
/** Saved editor context, linking to HTML parent pages rather than JSON drawer endpoints. */
|
||||
class EditorContextLinks
|
||||
{
|
||||
public static function product(array $document, array $attributes)
|
||||
{
|
||||
$links = static::page($document);
|
||||
$sections = DB::query(
|
||||
'SELECT DISTINCT i.id,i.rubric_id,i.field_id,i.name,i.filter_runtime FROM %b cp JOIN %b i ON i.id=cp.catalog_item_id WHERE cp.product_id=%i ORDER BY i.name,i.id',
|
||||
CatalogTables::table('catalog_category_products'), CatalogTables::table('module_catalog_items'), (int) $document['Id']
|
||||
)->getAll() ?: array();
|
||||
$sets = array();
|
||||
foreach ($attributes['groups'] as $group) {
|
||||
$id = (int) $group['set_id'];
|
||||
if (isset($sets[$id])) { continue; }
|
||||
$sets[$id] = true;
|
||||
static::add($links, 'attribute_set', '/catalog/attribute-sets/' . $id, array(), 'view_products', $group['set_name']);
|
||||
}
|
||||
|
||||
if (!$sections) { static::card($links, (int) $document['rubric_id'], array(), array()); }
|
||||
$catalogSettings = array();
|
||||
foreach ($sections as $section) {
|
||||
$key = (int) $section['rubric_id'] . ':' . (int) $section['field_id'];
|
||||
if (!isset($catalogSettings[$key])) {
|
||||
$catalogSettings[$key] = Model::settings((int) $section['rubric_id'], (int) $section['field_id']);
|
||||
}
|
||||
|
||||
static::filters($links, $section);
|
||||
static::card($links, (int) $document['rubric_id'], $section, $catalogSettings[$key]);
|
||||
}
|
||||
|
||||
return $links;
|
||||
}
|
||||
|
||||
public static function section(array $section, $productsAvailable = true)
|
||||
{
|
||||
$document = !empty($section['document_id']) ? DB::query(
|
||||
'SELECT Id,rubric_id,rubric_tmpl_id FROM %b WHERE Id=%i LIMIT 1',
|
||||
ContentTables::table('documents'), (int) $section['document_id']
|
||||
)->getAssoc() : array();
|
||||
$links = $document ? static::page($document) : array();
|
||||
static::filters($links, $section, $productsAvailable);
|
||||
if (!$productsAvailable) { return $links; }
|
||||
$settings = Model::settings((int) $section['rubric_id'], (int) $section['field_id']);
|
||||
if (!empty($section['attribute_set_id'])) {
|
||||
static::add($links, 'attribute_set', '/catalog/attribute-sets/' . (int) $section['attribute_set_id'], array(), 'view_products', '#' . (int) $section['attribute_set_id']);
|
||||
}
|
||||
|
||||
if (isset($settings['purpose']) && $settings['purpose'] === 'commerce') {
|
||||
static::card($links, (int) $section['rubric_id'], $section, $settings);
|
||||
}
|
||||
|
||||
return $links;
|
||||
}
|
||||
|
||||
protected static function filters(array &$links, array $section, $productsAvailable = true)
|
||||
{
|
||||
$native = isset($section['filter_runtime']) && $section['filter_runtime'] === 'native';
|
||||
if ($native && !$productsAvailable) { return; }
|
||||
if ($native) {
|
||||
static::add($links, 'filters', '/catalog/attributes', array('view' => 'filters', 'section_id' => (int) $section['id']), 'view_products', $section['name']);
|
||||
} elseif (static::allowed('manage_catalog')) {
|
||||
static::add($links, 'filters', '/catalog/' . (int) $section['rubric_id'] . '/' . (int) $section['field_id'], array('item' => (int) $section['id'], 'tab' => 'filters'), 'view_catalog', $section['name']);
|
||||
}
|
||||
}
|
||||
|
||||
protected static function card(array &$links, $rubricId, array $section, array $settings)
|
||||
{
|
||||
$targets = array('rubric' => (string) $rubricId, 'module' => 'products');
|
||||
if (!empty($section['rubric_id'])) { $targets['rubric'] = (string) $section['rubric_id']; }
|
||||
if (!empty($section['id'])) { $targets['catalog'] = (string) $section['id']; }
|
||||
if (!empty($settings['request_id'])) { $targets['request'] = (string) $settings['request_id']; }
|
||||
$scope = isset($section['name']) ? $section['name'] : '';
|
||||
$presentation = static::presentation($targets);
|
||||
if ($presentation && trim((string) $presentation['published_item_markup']) !== '') {
|
||||
if (static::allowed('manage_public_presentations')) {
|
||||
static::add($links, 'card', '/public-site/presentations', array('edit' => (int) $presentation['presentation_id']), 'view_public_site', $scope);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$template = static::cardTemplate($rubricId);
|
||||
if ($template && trim((string) $template['published_markup']) !== '') {
|
||||
if (static::allowed('manage_products')) {
|
||||
static::add($links, 'card', '/catalog/card-templates', array('edit' => (int) $template['id']), 'view_products', $scope);
|
||||
}
|
||||
} else {
|
||||
static::add($links, 'card', '/catalog/public-templates', array('template' => 'product-card'), 'view_products', $scope);
|
||||
}
|
||||
}
|
||||
|
||||
protected static function page(array $document)
|
||||
{
|
||||
$links = array();
|
||||
if (!static::allowed('view_rubrics') || !static::allowed('manage_rubrics')) { return $links; }
|
||||
$query = array('templates' => (int) $document['rubric_id']);
|
||||
$alternate = !empty($document['rubric_tmpl_id']) ? static::alternate($document) : null;
|
||||
// DocumentRepository falls back to the rubric template when the alternate is empty.
|
||||
if ($alternate && trim((string) $alternate['template']) !== '') { $query['template'] = (int) $alternate['id']; }
|
||||
static::add($links, 'page', '/rubrics', $query, 'view_rubrics');
|
||||
return $links;
|
||||
}
|
||||
|
||||
protected static function alternate(array $document)
|
||||
{
|
||||
return DB::query('SELECT id,template FROM %b WHERE id=%i AND rubric_id=%i LIMIT 1', ContentTables::table('rubric_templates'), (int) $document['rubric_tmpl_id'], (int) $document['rubric_id'])->getAssoc();
|
||||
}
|
||||
|
||||
protected static function presentation(array $targets) { return PresentationRenderer::resolve('content_list', $targets); }
|
||||
|
||||
protected static function cardTemplate($rubricId)
|
||||
{
|
||||
$settings = CardSettings::forRubric($rubricId);
|
||||
return CardTemplateRepository::published((int) $settings['template_id']);
|
||||
}
|
||||
|
||||
protected static function allowed($permission) { return Permission::check($permission); }
|
||||
|
||||
protected static function add(array &$links, $kind, $path, array $query, $permission, $scope = '')
|
||||
{
|
||||
if (!static::allowed($permission)) { return; }
|
||||
$url = AdminLocation::url($path);
|
||||
$links[] = array(
|
||||
'kind' => $kind,
|
||||
'url' => $query ? Html::appendQuery($url, $query) : $url,
|
||||
'label' => AdminLocale::text('catalog_context_' . $kind),
|
||||
'scope' => (string) $scope,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -23,10 +23,14 @@
|
||||
use App\Common\DatabaseSchema;
|
||||
use App\Common\FileCacheInvalidator;
|
||||
use App\Common\ModuleManager;
|
||||
use App\Common\ModuleSettings;
|
||||
use App\Common\Registry;
|
||||
use App\Modules\Products\ProductRoles;
|
||||
use App\Content\CatalogTables;
|
||||
use App\Content\ContentTables;
|
||||
use App\Content\Fields\FieldValueCodec;
|
||||
use App\Content\Requests\RequestConditionValue;
|
||||
use App\Frontend\Feeds\Service as FeedService;
|
||||
use App\Helpers\Json;
|
||||
use App\Adminx\Rubrics\Model as RubricsModel;
|
||||
use App\Adminx\Documents\Model as DocumentsModel;
|
||||
@@ -146,8 +150,21 @@
|
||||
}
|
||||
|
||||
public static function saveSettings($rubricId, $fieldId, array $input)
|
||||
{
|
||||
if (DB::$transaction_in_progress) {
|
||||
throw new \LogicException('Catalog settings must be saved outside an existing transaction');
|
||||
}
|
||||
|
||||
$throwOnError = DB::$throw_exception_on_error;
|
||||
DB::$throw_exception_on_error = true;
|
||||
try { return self::saveSettingsOwned($rubricId, $fieldId, $input); }
|
||||
finally { DB::$throw_exception_on_error = $throwOnError; }
|
||||
}
|
||||
|
||||
protected static function saveSettingsOwned($rubricId, $fieldId, array $input)
|
||||
{
|
||||
self::requireCatalog($rubricId, $fieldId);
|
||||
$existing = self::settings($rubricId, $fieldId);
|
||||
$data = array();
|
||||
$data['purpose'] = isset($input['purpose']) && $input['purpose'] === 'commerce' ? 'commerce' : 'content';
|
||||
if ($data['purpose'] === 'commerce' && !self::productsAvailable()) {
|
||||
@@ -162,7 +179,24 @@
|
||||
throw new \InvalidArgumentException('У рубрики уже есть товарный каталог');
|
||||
}
|
||||
|
||||
foreach(array('product_title_field_id','product_article_field_id','product_price_field_id','product_old_price_field_id','product_stock_field_id','product_images_field_id') as $key){$data[$key]=isset($input[$key])?max(0,(int)$input[$key]):0;if($data[$key]&&!DB::query('SELECT Id FROM '.self::fieldsTable().' WHERE Id=%i AND rubric_id=%i LIMIT 1',$data[$key],(int)$rubricId)->getValue()){throw new \InvalidArgumentException('Коммерческое поле не принадлежит рубрике');}}
|
||||
foreach (array('product_title_field_id','product_article_field_id','product_price_field_id','product_old_price_field_id','product_stock_field_id','product_images_field_id') as $key) {
|
||||
$data[$key] = isset($input[$key]) ? max(0, (int) $input[$key]) : (int) $existing[$key];
|
||||
if (isset($input[$key]) && $data[$key] && !DB::query('SELECT Id FROM ' . self::fieldsTable() . ' WHERE Id=%i AND rubric_id=%i LIMIT 1', $data[$key], (int) $rubricId)->getValue()) {
|
||||
throw new \InvalidArgumentException('Коммерческое поле не принадлежит рубрике');
|
||||
}
|
||||
}
|
||||
|
||||
$roleInput = null;
|
||||
if ($data['purpose'] === 'commerce' && isset($input['product_roles']) && is_array($input['product_roles'])) {
|
||||
$roleFields = ProductRoles::fields($rubricId);
|
||||
$roleInput = array_replace(ProductRoles::configured($rubricId), ProductRoles::validate($input['product_roles'], $roleFields));
|
||||
$roleSettings = self::settings($rubricId, $fieldId);
|
||||
$resolved = ProductRoles::resolve($roleFields, $roleSettings, $roleInput);
|
||||
foreach (ProductRoles::definitions() as $role => $definition) {
|
||||
if (isset($definition['column'])) { $data[$definition['column']] = $resolved[$role]; }
|
||||
}
|
||||
}
|
||||
|
||||
$data['product_card_template_id'] = isset($input['product_card_template_id']) ? max(0, (int) $input['product_card_template_id']) : 0;
|
||||
if ($data['product_card_template_id'] > 0 && !DB::query(
|
||||
'SELECT id FROM ' . CatalogTables::table('catalog_card_templates') . ' WHERE id=%i LIMIT 1',
|
||||
@@ -215,30 +249,41 @@
|
||||
);
|
||||
}
|
||||
|
||||
$existing = self::settings($rubricId, $fieldId);
|
||||
if ((int) $existing['id'] > 0) {
|
||||
DB::Update(self::settingsTable(), $data, 'id = %i', (int) $existing['id']);
|
||||
if ($data['purpose'] !== $existing['purpose'] && self::productsAvailable()) {
|
||||
try { ProductIndexer::rebuild(); }
|
||||
catch (\Throwable $e) { DB::Update(self::settingsTable(), array('purpose'=>$existing['purpose']), 'id=%i', (int) $existing['id']); throw $e; }
|
||||
$reindex = $data['purpose'] !== $existing['purpose'];
|
||||
foreach ($data as $key => $value) {
|
||||
if (preg_match('/^product_.*_field_id$/', $key) && (int) $value !== (int) $existing[$key]) { $reindex = true; }
|
||||
}
|
||||
|
||||
if ($roleInput !== null && $resolved !== ProductRoles::resolve($roleFields, $existing, ProductRoles::configured($rubricId))) { $reindex = true; }
|
||||
$registrySettings = Registry::get('settings');
|
||||
DB::startTransaction();
|
||||
try {
|
||||
$settingsId = (int) $existing['id'];
|
||||
if ($settingsId > 0) {
|
||||
DB::Update(self::settingsTable(), $data, 'id=%i', $settingsId);
|
||||
} else {
|
||||
$data['rubric_id'] = (int) $rubricId;
|
||||
$data['field_id'] = (int) $fieldId;
|
||||
DB::Insert(self::settingsTable(), $data);
|
||||
$settingsId = (int) DB::insertId();
|
||||
}
|
||||
|
||||
Cache::forgetTag(CacheKey::tag('catalog'));
|
||||
FileCacheInvalidator::publicPresentation();
|
||||
return (int) $existing['id'];
|
||||
if ($roleInput !== null) { ModuleSettings::set('field_roles_' . (int) $rubricId, $roleInput, 'products', 'json'); }
|
||||
if (self::productsAvailable()) { ProductRoles::reset(); }
|
||||
if ($reindex && self::productsAvailable()) { ProductIndexer::reindexRubric($rubricId, $existing['purpose'] === 'commerce' && $data['purpose'] === 'commerce'); }
|
||||
DB::afterCommit(function () {
|
||||
DB::clearTags(array('settings'));
|
||||
Cache::forgetTag(CacheKey::tag('catalog'));
|
||||
FileCacheInvalidator::publicPresentation();
|
||||
});
|
||||
DB::commit();
|
||||
} catch (\Throwable $e) {
|
||||
DB::rollback();
|
||||
Registry::set('settings', $registrySettings);
|
||||
if (self::productsAvailable()) { ProductRoles::reset(); }
|
||||
throw $e;
|
||||
}
|
||||
|
||||
$data['rubric_id'] = (int) $rubricId;
|
||||
$data['field_id'] = (int) $fieldId;
|
||||
DB::Insert(self::settingsTable(), $data);
|
||||
$settingsId = (int) DB::insertId();
|
||||
if ($data['purpose'] === 'commerce') {
|
||||
try { ProductIndexer::rebuild(); }
|
||||
catch (\Throwable $e) { DB::Delete(self::settingsTable(), 'id=%i', $settingsId); throw $e; }
|
||||
}
|
||||
|
||||
Cache::forgetTag(CacheKey::tag('catalog'));
|
||||
FileCacheInvalidator::publicPresentation();
|
||||
return $settingsId;
|
||||
}
|
||||
|
||||
@@ -257,8 +302,8 @@
|
||||
|
||||
protected static function filterTemplateSettings(array $input, $submitted = false)
|
||||
{
|
||||
$zero = isset($input['zero_behavior']) ? (string) $input['zero_behavior'] : 'disable';
|
||||
if (!in_array($zero, array('show', 'disable', 'hide'), true)) { $zero = 'disable'; }
|
||||
$zero = isset($input['zero_behavior']) ? (string) $input['zero_behavior'] : 'hide';
|
||||
if (!in_array($zero, array('show', 'disable', 'hide'), true)) { $zero = 'hide'; }
|
||||
return array(
|
||||
'show_counts' => $submitted ? !empty($input['show_counts']) : (!array_key_exists('show_counts', $input) || !empty($input['show_counts'])),
|
||||
'zero_behavior' => $zero,
|
||||
@@ -358,6 +403,33 @@
|
||||
return $tree;
|
||||
}
|
||||
|
||||
public static function sourceOptions($rubricId, $fieldId)
|
||||
{
|
||||
$items = self::items($rubricId, $fieldId);
|
||||
$map = array();
|
||||
foreach ($items as $item) { $map[(int) $item['id']] = $item; }
|
||||
$out = array();
|
||||
foreach ($items as $item) {
|
||||
$parts = array((string) $item['name']);
|
||||
$parentId = (int) $item['parent_id'];
|
||||
$visited = array((int) $item['id'] => true);
|
||||
while ($parentId > 0 && isset($map[$parentId]) && empty($visited[$parentId])) {
|
||||
$visited[$parentId] = true;
|
||||
array_unshift($parts, (string) $map[$parentId]['name']);
|
||||
$parentId = (int) $map[$parentId]['parent_id'];
|
||||
}
|
||||
|
||||
$out[] = array(
|
||||
'id' => (int) $item['id'],
|
||||
'name' => (string) $item['name'],
|
||||
'path' => implode(' / ', $parts),
|
||||
'status' => (int) $item['status'],
|
||||
);
|
||||
}
|
||||
|
||||
return $out;
|
||||
}
|
||||
|
||||
public static function item($id)
|
||||
{
|
||||
$row = DB::query(
|
||||
@@ -385,6 +457,12 @@
|
||||
if ($documentId > 0 && !self::documentExists($documentId)) { throw new \RuntimeException('Выбранный документ не найден'); }
|
||||
$filterIds = self::ids(isset($input['filters_use']) ? $input['filters_use'] : array());
|
||||
$filterIds = self::orderedIds(isset($input['filters_order']) ? $input['filters_order'] : array(), $filterIds);
|
||||
$sourceIds = self::validSourceItemIds(
|
||||
isset($input['source_item_ids']) ? $input['source_item_ids'] : array(),
|
||||
$id,
|
||||
$rubricId,
|
||||
$fieldId
|
||||
);
|
||||
$data = array(
|
||||
'rubric_id' => (int) $rubricId, 'field_id' => (int) $fieldId,
|
||||
'name' => $name, 'parent_id' => $parentId,
|
||||
@@ -396,6 +474,12 @@
|
||||
'filters_use' => implode(',', $filterIds),
|
||||
'filters_settings' => serialize(self::filterStyles(isset($input['filter_style']) ? $input['filter_style'] : array(), $filterIds)),
|
||||
);
|
||||
if (self::sourceItemsAvailable()) {
|
||||
$data['source_item_ids'] = implode(',', $sourceIds);
|
||||
} elseif ($sourceIds) {
|
||||
throw new \RuntimeException('Сначала примените миграцию каталога для источников товаров');
|
||||
}
|
||||
|
||||
if ($id > 0) {
|
||||
DB::Update(self::itemsTable(), $data, 'id = %i', $id);
|
||||
} else {
|
||||
@@ -519,6 +603,47 @@
|
||||
return $out;
|
||||
}
|
||||
|
||||
/** Разделы каталога, доступные как родители в редакторе документа. */
|
||||
public static function searchParentDocuments($query, $limit = 30)
|
||||
{
|
||||
$query = trim((string) $query);
|
||||
$limit = max(1, min(50, (int) $limit));
|
||||
$sql = 'SELECT i.id AS catalog_item_id,i.name,i.status AS catalog_status,i.document_id,d.rubric_id,'
|
||||
. ' d.document_title,d.document_alias,r.rubric_title'
|
||||
. ' FROM ' . self::itemsTable() . ' i'
|
||||
. ' INNER JOIN ' . self::documentsTable() . ' d ON d.Id=i.document_id'
|
||||
. ' LEFT JOIN ' . self::rubricsTable() . ' r ON r.Id=d.rubric_id'
|
||||
. " WHERE i.document_id>0 AND d.document_deleted!='1'";
|
||||
$args = array();
|
||||
if ($query !== '') {
|
||||
$sql .= ' AND (i.name LIKE %ss OR d.document_title LIKE %ss'
|
||||
. ' OR d.document_alias LIKE %ss OR d.Id=%i)';
|
||||
$args[] = $query;
|
||||
$args[] = $query;
|
||||
$args[] = $query;
|
||||
$args[] = (int) $query;
|
||||
}
|
||||
|
||||
$sql .= ' ORDER BY i.level ASC,i.position ASC,i.name ASC LIMIT ' . $limit;
|
||||
$rows = call_user_func_array(array('DB', 'query'), array_merge(array($sql), $args))->getAll();
|
||||
$out = array();
|
||||
foreach ($rows ?: array() as $row) {
|
||||
$out[] = array(
|
||||
'id' => (int) $row['document_id'],
|
||||
'rubric_id' => (int) $row['rubric_id'],
|
||||
'title' => self::decode($row['name']),
|
||||
'alias' => (string) $row['document_alias'],
|
||||
'status' => (int) $row['catalog_status'],
|
||||
'rubric_title' => 'Раздел каталога'
|
||||
. ((int) $row['catalog_status'] === 1 ? '' : ' · выключен')
|
||||
. ' · ' . self::decode($row['rubric_title']),
|
||||
'catalog_item_id' => (int) $row['catalog_item_id'],
|
||||
);
|
||||
}
|
||||
|
||||
return $out;
|
||||
}
|
||||
|
||||
public static function parseValue($value)
|
||||
{
|
||||
$data = FieldValueCodec::decodeStructured($value, array());
|
||||
@@ -543,7 +668,35 @@
|
||||
{
|
||||
return self::productsAvailable()
|
||||
? ProductIndexer::stats()
|
||||
: array('total' => 0, 'active' => 0, 'inactive' => 0, 'categories' => 0);
|
||||
: self::emptyProductStats();
|
||||
}
|
||||
|
||||
public static function productQualityStats()
|
||||
{
|
||||
return self::productsAvailable()
|
||||
? ProductIndexer::qualityStats()
|
||||
: self::emptyProductStats();
|
||||
}
|
||||
|
||||
public static function productStatsSnapshot()
|
||||
{
|
||||
$stats = self::productsAvailable() ? ProductIndexer::cachedStats() : self::emptyProductStats();
|
||||
return array(
|
||||
'loaded' => is_array($stats),
|
||||
'stats' => array_merge(self::emptyProductStats(), is_array($stats) ? $stats : array()),
|
||||
);
|
||||
}
|
||||
|
||||
protected static function emptyProductStats()
|
||||
{
|
||||
return array(
|
||||
'total'=>0,'quality_total'=>0,'active'=>0,'inactive'=>0,'without_category'=>0,
|
||||
'without_image'=>0,'without_article'=>0,'without_price'=>0,'without_stock'=>0,
|
||||
'without_description'=>0,'without_seo'=>0,'stale'=>0,'shipping_incomplete'=>0,
|
||||
'shipping_disabled'=>0,'duplicate_articles'=>0,'legacy_attributes'=>0,
|
||||
'filter_index_errors'=>0,'registration_incomplete'=>0,'without_video'=>0,
|
||||
'variant_errors'=>0,'description_markup'=>0,'sfr'=>0,'issues'=>0,'recommendations'=>0,'indexed_at'=>0,
|
||||
);
|
||||
}
|
||||
|
||||
public static function productQualityIssues(array $stats)
|
||||
@@ -561,6 +714,14 @@
|
||||
return self::productsAvailable() ? ProductIndexer::productRubrics() : array();
|
||||
}
|
||||
|
||||
public static function productRubricOptions()
|
||||
{
|
||||
$allowed = array_flip(self::productRubrics());
|
||||
return array_values(array_filter(self::rubricOptions(), function ($rubric) use ($allowed) {
|
||||
return isset($allowed[(int) $rubric['id']]);
|
||||
}));
|
||||
}
|
||||
|
||||
public static function reindexProducts($limit = 0)
|
||||
{
|
||||
return self::productsAvailable()
|
||||
@@ -1007,6 +1168,7 @@
|
||||
protected static function clearCache()
|
||||
{
|
||||
DB::clearTags(array('documents', 'requests', 'modules', 'catalog'));
|
||||
(new FeedService())->clearAll();
|
||||
Cache::forgetTag(CacheKey::tag('catalog'));
|
||||
}
|
||||
|
||||
@@ -1047,6 +1209,28 @@
|
||||
|
||||
protected static function idsString($value) { return implode(',', self::ids($value)); }
|
||||
|
||||
public static function sourceItemsAvailable()
|
||||
{
|
||||
return DatabaseSchema::columnExists(self::itemsTable(), 'source_item_ids');
|
||||
}
|
||||
|
||||
protected static function validSourceItemIds($value, $itemId, $rubricId, $fieldId)
|
||||
{
|
||||
$ids = array_values(array_diff(self::ids($value), array((int) $itemId)));
|
||||
if (!$ids) { return array(); }
|
||||
$rows = DB::query(
|
||||
'SELECT id FROM ' . self::itemsTable()
|
||||
. ' WHERE rubric_id=%i AND field_id=%i AND id IN (' . implode(',', $ids) . ')',
|
||||
(int) $rubricId,
|
||||
(int) $fieldId
|
||||
)->getAll() ?: array();
|
||||
$allowed = array();
|
||||
foreach ($rows as $row) { $allowed[(int) $row['id']] = true; }
|
||||
return array_values(array_filter($ids, function ($id) use ($allowed) {
|
||||
return isset($allowed[(int) $id]);
|
||||
}));
|
||||
}
|
||||
|
||||
protected static function orderedIds($order, array $selected)
|
||||
{
|
||||
$selectedMap = array_fill_keys($selected, true); $out = array();
|
||||
@@ -1087,6 +1271,7 @@
|
||||
'level' => (int) $row['level'], 'position' => (int) $row['position'],
|
||||
'fields_use' => self::ids(isset($row['fields_use']) ? $row['fields_use'] : ''),
|
||||
'filters_use' => self::ids(isset($row['filters_use']) ? $row['filters_use'] : ''),
|
||||
'source_item_ids' => self::ids(isset($row['source_item_ids']) ? $row['source_item_ids'] : ''),
|
||||
'filter_styles' => is_array($styles) ? $styles : array(),
|
||||
'attribute_set_id' => isset($row['attribute_set_id']) ? (int) $row['attribute_set_id'] : 0,
|
||||
'attributes_runtime' => isset($row['attributes_runtime']) ? (string) $row['attributes_runtime'] : 'legacy',
|
||||
|
||||
@@ -739,6 +739,45 @@
|
||||
grid-template-columns: minmax(0, 1fr) 40px;
|
||||
gap: 6px;
|
||||
}
|
||||
.catalog-source-picker {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(0, 1fr) 40px;
|
||||
gap: 6px;
|
||||
}
|
||||
.catalog-source-picker [data-catalog-source-inputs] {
|
||||
display: none;
|
||||
}
|
||||
.catalog-source-value {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 9px;
|
||||
min-width: 0;
|
||||
min-height: 40px;
|
||||
padding: 8px 11px;
|
||||
border: 1px solid var(--border-default);
|
||||
border-radius: var(--radius-md);
|
||||
background: var(--background-card);
|
||||
color: var(--text-primary);
|
||||
text-align: left;
|
||||
cursor: pointer;
|
||||
}
|
||||
.catalog-source-value:hover:not(:disabled) {
|
||||
border-color: var(--blue-300);
|
||||
background: var(--blue-50);
|
||||
}
|
||||
.catalog-source-value:disabled {
|
||||
opacity: 0.6;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
.catalog-source-value i {
|
||||
flex: 0 0 auto;
|
||||
color: var(--blue-600);
|
||||
}
|
||||
.catalog-source-value span {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.catalog-document-value {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -832,6 +871,74 @@
|
||||
font-size: 11px;
|
||||
font-style: normal;
|
||||
}
|
||||
.catalog-source-modal {
|
||||
width: min(66.666vw, 1000px);
|
||||
height: min(72vh, 760px);
|
||||
max-height: calc(100vh - 40px);
|
||||
}
|
||||
.catalog-source-modal .modal-body {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-height: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
.catalog-source-modal .modal-header > div {
|
||||
flex: 1 1 auto;
|
||||
min-width: 0;
|
||||
}
|
||||
.catalog-source-modal .modal-header p {
|
||||
margin: 3px 0 0;
|
||||
}
|
||||
.catalog-source-options {
|
||||
display: grid;
|
||||
flex: 1 1 auto;
|
||||
align-content: start;
|
||||
gap: 6px;
|
||||
min-height: 0;
|
||||
margin-top: 12px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
.catalog-source-option {
|
||||
display: grid;
|
||||
grid-template-columns: 20px minmax(0, 1fr) auto;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
min-height: 54px;
|
||||
padding: 8px 11px;
|
||||
border: 1px solid var(--border-default);
|
||||
border-radius: var(--radius-md);
|
||||
background: var(--background-card);
|
||||
cursor: pointer;
|
||||
}
|
||||
.catalog-source-option:hover {
|
||||
border-color: var(--blue-300);
|
||||
background: var(--blue-50);
|
||||
}
|
||||
.catalog-source-option[hidden] {
|
||||
display: none;
|
||||
}
|
||||
.catalog-source-option > span {
|
||||
display: grid;
|
||||
min-width: 0;
|
||||
}
|
||||
.catalog-source-option b,
|
||||
.catalog-source-option small {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.catalog-source-option small {
|
||||
color: var(--text-secondary);
|
||||
font-size: 11px;
|
||||
}
|
||||
.catalog-source-option em {
|
||||
font-style: normal;
|
||||
}
|
||||
.catalog-source-empty {
|
||||
padding: 28px 0;
|
||||
color: var(--text-secondary);
|
||||
text-align: center;
|
||||
}
|
||||
@media (max-width: 640px) {
|
||||
.catalog-condition-toolbar {
|
||||
align-items: stretch;
|
||||
@@ -885,6 +992,16 @@
|
||||
.catalog-document-result em {
|
||||
display: none;
|
||||
}
|
||||
.catalog-source-modal {
|
||||
width: calc(100vw - 20px);
|
||||
height: calc(100vh - 20px);
|
||||
}
|
||||
.catalog-source-option {
|
||||
grid-template-columns: 20px minmax(0, 1fr);
|
||||
}
|
||||
.catalog-source-option em {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
@media (max-width: 1100px) {
|
||||
.catalog-behavior-grid {
|
||||
@@ -956,3 +1073,123 @@
|
||||
height: 40px;
|
||||
}
|
||||
}
|
||||
.catalog-role-preview {
|
||||
margin-top: 24px;
|
||||
min-width: 0;
|
||||
}
|
||||
.catalog-role-preview .catalog-selection-preview {
|
||||
margin: 20px 0;
|
||||
padding: 16px 0;
|
||||
border-top: 1px solid var(--border-color, #e3e5e8);
|
||||
border-bottom: 1px solid var(--border-color, #e3e5e8);
|
||||
}
|
||||
.catalog-role-preview .catalog-selection-preview h4 {
|
||||
margin: 0 0 12px;
|
||||
font-size: 15px;
|
||||
}
|
||||
.catalog-role-preview .catalog-selection-preview [hidden] {
|
||||
display: none !important;
|
||||
}
|
||||
.catalog-role-preview .catalog-selection-controls {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
|
||||
align-items: end;
|
||||
gap: 12px;
|
||||
}
|
||||
.catalog-role-preview .catalog-selection-controls .field {
|
||||
min-width: 0;
|
||||
margin: 0;
|
||||
}
|
||||
.catalog-role-preview .catalog-selection-controls .select,
|
||||
.catalog-role-preview .catalog-selection-controls .input {
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
min-height: 40px;
|
||||
}
|
||||
.catalog-role-preview .catalog-selection-controls .btn {
|
||||
min-height: 40px;
|
||||
}
|
||||
.catalog-role-preview .catalog-selection-result {
|
||||
margin-top: 16px;
|
||||
}
|
||||
.catalog-role-preview .catalog-selection-result ul {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
margin: 0 0 12px;
|
||||
}
|
||||
.catalog-role-preview .catalog-selection-result li {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
gap: 8px;
|
||||
margin: 6px 0;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
.catalog-role-preview .catalog-selection-result li .ti {
|
||||
flex: 0 0 16px;
|
||||
}
|
||||
.catalog-role-preview .catalog-selection-result li span {
|
||||
min-width: 0;
|
||||
}
|
||||
.catalog-role-preview .catalog-selection-result b {
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
.catalog-role-preview h3,
|
||||
.catalog-role-preview p {
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
.catalog-role-preview .table {
|
||||
table-layout: fixed;
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
}
|
||||
.catalog-role-preview th:first-child {
|
||||
width: 24%;
|
||||
}
|
||||
.catalog-role-preview th:nth-child(2) {
|
||||
width: 32%;
|
||||
}
|
||||
.catalog-role-preview td {
|
||||
white-space: normal;
|
||||
overflow-wrap: anywhere;
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
.catalog-role-preview .btn-group {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 8px;
|
||||
margin-top: 12px;
|
||||
}
|
||||
.catalog-role-preview .btn {
|
||||
white-space: normal;
|
||||
min-height: 40px;
|
||||
}
|
||||
@media (max-width: 760px) {
|
||||
.catalog-role-preview .table-wrap {
|
||||
overflow: visible;
|
||||
}
|
||||
.catalog-role-preview .table,
|
||||
.catalog-role-preview tbody,
|
||||
.catalog-role-preview tr,
|
||||
.catalog-role-preview td {
|
||||
display: block;
|
||||
width: 100%;
|
||||
}
|
||||
.catalog-role-preview thead {
|
||||
display: none;
|
||||
}
|
||||
.catalog-role-preview tr {
|
||||
padding: 12px 0;
|
||||
border-bottom: 1px solid var(--border);
|
||||
}
|
||||
.catalog-role-preview td {
|
||||
padding: 4px 8px;
|
||||
border: 0;
|
||||
}
|
||||
.catalog-role-preview td:first-child {
|
||||
font-weight: 600;
|
||||
}
|
||||
.catalog-role-preview td[data-label]::before {
|
||||
content: attr(data-label) ': ';
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,12 +2,14 @@
|
||||
'use strict';
|
||||
var Adminx = window.Adminx || (window.Adminx = {});
|
||||
Adminx.Catalog = {
|
||||
itemForm: null, settingsForm: null, dragItem: null, dragGroup: [], dragPlaceholder: null, dragGhost: null, dragPointerId: null, dragStartX: 0, dragStartY: 0, dragStarted: false, dragOrderSnapshot: '', orderSaving: false, filterOrder: [], itemSaveTimer: null, settingsSaveTimer: null, conditionContext: null,
|
||||
itemForm: null, settingsForm: null, dragItem: null, dragGroup: [], dragPlaceholder: null, dragGhost: null, dragPointerId: null, dragStartX: 0, dragStartY: 0, dragStarted: false, dragOrderSnapshot: '', orderSaving: false, filterOrder: [], sourceItemIds: [], sourceOptionsData: null, itemSaveTimer: null, settingsSaveTimer: null, conditionContext: null,
|
||||
init: function () {
|
||||
this.itemForm = document.getElementById('catalogItemForm');
|
||||
this.settingsForm = document.getElementById('catalogSettingsForm');
|
||||
var self = this;
|
||||
document.addEventListener('click', function (e) {
|
||||
if (e.target.closest('[data-product-role-refresh]')) { self.refreshRolePreview(false); return; }
|
||||
if (e.target.closest('[data-product-selection-check]')) { self.refreshRolePreview(true); return; }
|
||||
var pageTab = e.target.closest('[data-catalog-page-tab]');
|
||||
if (pageTab) { self.tab('[data-catalog-page-tab]', '[data-catalog-page-panel]', pageTab.getAttribute('data-catalog-page-tab')); }
|
||||
var drawerTab = e.target.closest('[data-catalog-drawer-tab]');
|
||||
@@ -27,6 +29,8 @@
|
||||
if (treeRow && !e.target.closest('button, input, label, a, select')) { self.editItem(treeRow.getAttribute('data-catalog-builder-item')); return; }
|
||||
if (e.target.closest('[data-catalog-document-pick]')) { self.openDocumentPicker(); }
|
||||
if (e.target.closest('[data-catalog-document-clear]')) { self.setDocument(null); self.scheduleItemSave(); }
|
||||
if (e.target.closest('[data-catalog-source-open]')) { self.openSourcePicker(); }
|
||||
if (e.target.closest('[data-catalog-source-clear]')) { self.setSources([]); self.scheduleItemSave(); }
|
||||
var conditionView = e.target.closest('[data-catalog-condition-view]');
|
||||
if (conditionView) { self.showCondition(conditionView.getAttribute('data-catalog-condition-view')); }
|
||||
var conditionSync = e.target.closest('[data-catalog-condition-sync]');
|
||||
@@ -37,9 +41,11 @@
|
||||
if (e.target.closest('[data-catalog-recompile-all]')) { self.recompileAll(); }
|
||||
});
|
||||
document.addEventListener('input', function (e) {
|
||||
if (e.target.closest('[data-product-role-preview]')) { self.selectionChanged(); return; }
|
||||
if (e.target.matches('[data-catalog-tree-search]')) { self.search(e.target.value); }
|
||||
});
|
||||
document.addEventListener('change', function (e) {
|
||||
if (e.target.closest('[data-product-role-preview]')) { self.selectionChanged(); return; }
|
||||
if (e.target.matches('[data-catalog-item-status]')) { self.setTreeStatus(e.target); return; }
|
||||
if (self.itemForm && e.target.closest('#catalogItemForm')) {
|
||||
if (e.target.matches('[name="filters_use[]"]')) { self.syncFilterOrderSelection(); }
|
||||
@@ -59,6 +65,44 @@
|
||||
document.addEventListener('pointercancel', function () { self.treeDragEnd(); });
|
||||
this.normalizeTreeHierarchy();
|
||||
this.openRequestedItem();
|
||||
if (window.location.hash === '#settings') { this.tab('[data-catalog-page-tab]', '[data-catalog-page-panel]', 'settings'); }
|
||||
},
|
||||
selectionChanged: function () {
|
||||
this.rolePreviewSequence = (this.rolePreviewSequence || 0) + 1;
|
||||
var root = document.querySelector('[data-product-role-preview]');
|
||||
if (!root) { return; }
|
||||
var context = root.querySelector('[data-selection="context"]');
|
||||
root.querySelectorAll('[data-selection-context]').forEach(function (el) { el.hidden = !context || el.getAttribute('data-selection-context') !== context.value; });
|
||||
var result = root.querySelector('[data-selection-result]'), stale = root.querySelector('[data-selection-stale]');
|
||||
if (result) { result.hidden = true; if (stale) { stale.hidden = false; } }
|
||||
},
|
||||
refreshRolePreview: function (check) {
|
||||
var input = document.querySelector('[data-product-role-document]');
|
||||
if (!input || !input.checkValidity()) { if (input) { input.reportValidity(); } return; }
|
||||
var root = input.closest('[data-product-role-preview]');
|
||||
var invalid = Array.prototype.find.call(root.querySelectorAll('[data-selection-context]:not([hidden]) input'), function (el) { return !el.checkValidity(); });
|
||||
if (invalid) { invalid.reportValidity(); return; }
|
||||
var self = this, sequence = (this.rolePreviewSequence || 0) + 1;
|
||||
var errorMessage = root.getAttribute('data-error');
|
||||
this.rolePreviewSequence = sequence;
|
||||
var url = new URL(this.url() + '/product-preview', window.location.origin);
|
||||
url.searchParams.set('product_preview', input.value || '0');
|
||||
url.searchParams.set('selection_check', check === true ? '1' : '0');
|
||||
root.querySelectorAll('[data-selection]').forEach(function (el) { url.searchParams.set('selection_' + el.getAttribute('data-selection'), el.value); });
|
||||
root.setAttribute('aria-busy', 'true');
|
||||
root.querySelectorAll('button').forEach(function (el) { el.disabled = true; });
|
||||
fetch(url.toString(), { credentials: 'same-origin' }).then(function (response) {
|
||||
if (!response.ok) { throw new Error(errorMessage); }
|
||||
return response.text();
|
||||
}).then(function (html) {
|
||||
if (sequence !== self.rolePreviewSequence) { return; }
|
||||
var preview = new DOMParser().parseFromString(html, 'text/html').querySelector('[data-product-role-preview]');
|
||||
var current = document.querySelector('[data-product-role-preview]');
|
||||
if (!preview || !current) { throw new Error(errorMessage); }
|
||||
current.replaceWith(preview);
|
||||
}).catch(function (error) { if (sequence === self.rolePreviewSequence) { Adminx.Toast.show(error.message, 'error'); } }).finally(function () {
|
||||
root.removeAttribute('aria-busy'); root.querySelectorAll('button').forEach(function (el) { el.disabled = false; });
|
||||
});
|
||||
},
|
||||
base: function () { return (this.itemForm || this.settingsForm).getAttribute('data-base'); },
|
||||
rubric: function () { return (this.itemForm || this.settingsForm).getAttribute('data-rubric'); },
|
||||
@@ -76,6 +120,7 @@
|
||||
document.querySelectorAll(panels).forEach(function (el) { el.hidden = el.getAttribute(panels.indexOf('drawer') >= 0 ? 'data-catalog-drawer-panel' : 'data-catalog-page-panel') !== value; });
|
||||
},
|
||||
newItem: function (parentId) {
|
||||
this.renderContextLinks([]);
|
||||
this.itemForm.reset(); this.itemForm.querySelector('[name="id"]').value = ''; this.itemForm.querySelector('[name="status"]').checked = true;
|
||||
this.itemForm.querySelectorAll('[name="parent_id"] option').forEach(function (option) { option.disabled = false; });
|
||||
var parent = this.itemForm.querySelector('[name="parent_id"]');
|
||||
@@ -84,7 +129,7 @@
|
||||
this.checkValues('fields_use[]', defaultFields); this.checkValues('filters_use[]', defaultFilters);
|
||||
defaultFilters.forEach(function (id) { var source = this.settingsForm.querySelector('[name="filter_style[' + id + ']"]'), target = this.itemForm.querySelector('[name="filter_style[' + id + ']"]'); if (source && target) { target.value = source.value; } }, this);
|
||||
this.filterOrder = defaultFilters.slice(); this.syncFilterOrderInput();
|
||||
this.setDocument(null); this.setState('item', ''); this.renderConditionContext(null);
|
||||
this.setDocument(null); this.setSources([]); this.setState('item', ''); this.renderConditionContext(null);
|
||||
document.querySelector('[data-catalog-drawer-title]').textContent = 'Новый раздел'; this.tab('[data-catalog-drawer-tab]', '[data-catalog-drawer-panel]', 'main'); this.updateCounts();
|
||||
Adminx.Drawer.open('catalogItemDrawer');
|
||||
},
|
||||
@@ -105,10 +150,12 @@
|
||||
this.editItem(itemId, params.get('tab') || 'main');
|
||||
},
|
||||
fill: function (item) {
|
||||
this.renderContextLinks(item.context_links || []);
|
||||
this.itemForm.reset(); this.itemForm.querySelector('[name="id"]').value = item.id || ''; this.itemForm.querySelector('[name="name"]').value = item.name || '';
|
||||
this.itemForm.querySelectorAll('[name="parent_id"] option').forEach(function (option) { option.disabled = false; });
|
||||
this.itemForm.querySelector('[name="parent_id"]').value = item.parent_id || 0; this.itemForm.querySelector('[name="status"]').checked = Number(item.status) === 1;
|
||||
this.setDocument(item.document_id ? { id: item.document_id, title: item.document_title || '', alias: item.document_alias || '' } : null);
|
||||
this.setSources(item.source_item_ids || []);
|
||||
this.filterOrder = (item.filters_use || []).map(function (id) { return String(id); }); this.syncFilterOrderInput(); this.checkValues('fields_use[]', item.fields_use || []); this.checkValues('filters_use[]', item.filters_use || []);
|
||||
Object.keys(item.filter_styles || {}).forEach(function (id) { var select = this.itemForm.querySelector('[name="filter_style[' + id + ']"]'); if (select) { select.value = item.filter_styles[id]; } }, this);
|
||||
var own = this.itemForm.querySelector('[name="parent_id"] option[value="' + item.id + '"]'); if (own) { own.disabled = true; }
|
||||
@@ -125,6 +172,20 @@
|
||||
syncFilterOrderSelection: function () { var selected = {}, next = []; this.itemForm.querySelectorAll('[name="filters_use[]"]:checked').forEach(function (input) { selected[input.value] = true; }); this.filterOrder.forEach(function (id) { if (selected[id]) { next.push(id); delete selected[id]; } }); this.itemForm.querySelectorAll('[name="filters_use[]"]:checked').forEach(function (input) { if (selected[input.value]) { next.push(input.value); delete selected[input.value]; } }); this.filterOrder = next; this.syncFilterOrderInput(); },
|
||||
syncFilterOrderInput: function () { var input = this.itemForm && this.itemForm.querySelector('[name="filters_order"]'); if (input) { input.value = this.filterOrder.join(','); } },
|
||||
openFilterOrder: function () { var self = this; this.syncFilterOrderSelection(); if (this.filterOrder.length < 2) { return; } var overlay = document.createElement('div'), rows = ''; this.filterOrder.forEach(function (id) { var input = self.itemForm.querySelector('[name="filters_use[]"][value="' + id + '"]'), row = input.closest('.catalog-filter-row'), title = row.querySelector('.catalog-choice-copy b').textContent.trim(), type = row.querySelector('.catalog-field-type b').textContent.trim(); rows += '<div class="catalog-filter-order-row" data-filter-order-id="' + self.esc(id) + '"><button class="catalog-filter-order-handle" type="button" draggable="true" aria-label="Перетащить"><i class="ti ti-grip-vertical"></i></button><span><b>' + self.esc(title) + '</b><small>' + self.esc(type) + ' · #' + self.esc(id) + '</small></span></div>'; }); overlay.className = 'overlay catalog-filter-order-overlay'; overlay.innerHTML = '<div class="modal catalog-filter-order-modal" role="dialog" aria-modal="true"><div class="modal-header"><span class="dialog-icon info"><i class="ti ti-arrows-sort"></i></span><div><h3>Порядок фильтров</h3><p class="text-secondary">' + this.filterOrder.length + ' включённых фильтров.</p></div><button class="modal-close" type="button" data-filter-order-close aria-label="Закрыть"><i class="ti ti-x"></i></button></div><div class="modal-body"><div class="catalog-filter-order-list">' + rows + '</div></div><div class="modal-footer"><button class="btn btn-ghost" type="button" data-filter-order-close>Закрыть</button><button class="btn btn-primary" type="button" data-filter-order-save><i class="ti ti-device-floppy"></i>Сохранить порядок</button></div></div>'; document.body.appendChild(overlay); requestAnimationFrame(function () { overlay.classList.add('show'); }); var dragged = null, close = function () { overlay.classList.remove('show'); setTimeout(function () { overlay.remove(); }, 160); }; overlay.addEventListener('dragstart', function (e) { var handle = e.target.closest('.catalog-filter-order-handle'), row = handle ? handle.closest('[data-filter-order-id]') : null; if (!row) { e.preventDefault(); return; } dragged = row; row.classList.add('is-dragging'); e.dataTransfer.effectAllowed = 'move'; e.dataTransfer.setData('text/plain', row.getAttribute('data-filter-order-id')); }); overlay.addEventListener('dragover', function (e) { var target = e.target.closest('[data-filter-order-id]'); if (!dragged || !target || target === dragged) { return; } e.preventDefault(); var rect = target.getBoundingClientRect(), reference = e.clientY < rect.top + rect.height / 2 ? target : target.nextSibling; if (reference !== dragged && dragged.nextSibling !== reference) { target.parentNode.insertBefore(dragged, reference); } }); overlay.addEventListener('dragend', function () { if (dragged) { dragged.classList.remove('is-dragging'); dragged = null; } }); overlay.addEventListener('click', function (e) { if (e.target === overlay || e.target.closest('[data-filter-order-close]')) { close(); return; } if (e.target.closest('[data-filter-order-save]')) { self.filterOrder = Array.prototype.map.call(overlay.querySelectorAll('[data-filter-order-id]'), function (row) { return row.getAttribute('data-filter-order-id'); }); self.syncFilterOrderInput(); self.scheduleItemSave(); close(); } }); },
|
||||
renderContextLinks: function (links) {
|
||||
var panel = this.itemForm && this.itemForm.querySelector('[data-catalog-context-links]');
|
||||
if (!panel) { return; }
|
||||
var list = panel.querySelector('nav');
|
||||
list.textContent = '';
|
||||
(links || []).forEach(function (link) {
|
||||
var anchor = document.createElement('a'), icon = document.createElement('i'), label = document.createElement('span');
|
||||
anchor.href = link.url; anchor.target = '_blank'; anchor.rel = 'noopener'; anchor.setAttribute('data-context-kind', link.kind);
|
||||
icon.className = 'ti ti-external-link'; icon.setAttribute('aria-hidden', 'true'); label.textContent = link.label;
|
||||
if (link.scope) { var scope = document.createElement('small'); scope.textContent = link.scope; label.appendChild(scope); }
|
||||
anchor.appendChild(icon); anchor.appendChild(label); list.appendChild(anchor);
|
||||
});
|
||||
panel.hidden = !list.children.length;
|
||||
},
|
||||
renderConditionContext: function (context) {
|
||||
this.conditionContext = context || { request: { id: 0, title: '' }, states: {}, summary: { synced: 0, staged: 0, missing: 0, different: 0, unsupported: 0 } };
|
||||
var request = this.conditionContext.request || {}, summary = this.conditionContext.summary || {}, requestEl = document.querySelector('[data-catalog-condition-request]'), summaryEl = document.querySelector('[data-catalog-condition-summary]'), bulk = document.querySelector('[data-catalog-conditions-sync]');
|
||||
@@ -172,16 +233,61 @@
|
||||
saveItem: function (auto) {
|
||||
var id = this.itemForm.querySelector('[name="id"]').value; var self = this;
|
||||
this.ajax(this.url() + '/items' + (id ? '/' + id : ''), new FormData(this.itemForm), function (payload) {
|
||||
if (payload.data && payload.data.context_links) { self.renderContextLinks(payload.data.context_links); }
|
||||
if (auto) { self.setState('item', 'Сохранено', 'ok'); self.syncTreeRow(id); if (payload.data && payload.data.condition_context) { self.renderConditionContext(payload.data.condition_context); } return; }
|
||||
Adminx.Toast.show(payload.message, 'success'); if (Adminx.Drawer) { Adminx.Drawer.close('catalogItemDrawer'); } window.location.reload();
|
||||
}, { quiet: !!auto, fail: function () { self.setState('item', 'Не сохранено', 'error'); } });
|
||||
},
|
||||
saveSettings: function (auto) { var self = this; this.ajax(this.url() + '/settings', new FormData(this.settingsForm), function (payload) { if (auto) { self.setState('settings', 'Сохранено', 'ok'); } else { self.setState('settings', 'Сохранено', 'ok'); Adminx.Toast.show(payload.message, 'success'); } }, { quiet: !!auto, fail: function () { self.setState('settings', 'Не сохранено', 'error'); } }); },
|
||||
saveSettings: function (auto) { var self = this; this.ajax(this.url() + '/settings', new FormData(this.settingsForm), function (payload) { self.refreshRolePreview(); if (auto) { self.setState('settings', 'Сохранено', 'ok'); } else { self.setState('settings', 'Сохранено', 'ok'); Adminx.Toast.show(payload.message, 'success'); } }, { quiet: !!auto, fail: function () { self.setState('settings', 'Не сохранено', 'error'); } }); },
|
||||
setState: function (type, message, state) { var el = document.querySelector('[data-catalog-' + type + '-state]'); if (!el) { return; } el.textContent = message || ''; el.classList.toggle('is-ok', state === 'ok'); el.classList.toggle('is-error', state === 'error'); },
|
||||
syncTreeRow: function (id) { var row = document.querySelector('[data-catalog-item][data-id="' + id + '"]'); if (!row) { return; } var toggle = row.querySelector('[data-catalog-item-status]'), active = this.itemForm.querySelector('[name="status"]').checked, filterCount = this.itemForm.querySelectorAll('[name="filters_use[]"]:checked').length, name = row.querySelector('.catalog-tree-name b'); if (toggle) { toggle.checked = active; this.updateTreeStatus(toggle); } if (name) { name.textContent = this.itemForm.querySelector('[name="name"]').value || 'Без названия'; } row.setAttribute('data-filter-count', String(filterCount)); var count = row.querySelector('.catalog-tree-count'); if (count) { count.textContent = this.itemForm.querySelectorAll('[name="fields_use[]"]:checked').length + ' / ' + filterCount; } },
|
||||
updateTreeStatus: function (input) { var item = input.closest('[data-catalog-item]'), active = input.checked, label = item.querySelector('[data-catalog-item-status-label]'), control = input.closest('.switch'); item.classList.toggle('is-inactive', !active); if (label) { label.textContent = active ? 'активен' : 'скрыт'; } input.setAttribute('aria-label', active ? 'Скрыть раздел' : 'Включить раздел'); if (control) { control.setAttribute('data-tooltip', active ? 'Скрыть раздел' : 'Включить раздел'); } },
|
||||
setTreeStatus: function (input) { var self = this, id = input.getAttribute('data-catalog-item-status'), previous = !input.checked, data = new FormData(); this.updateTreeStatus(input); input.disabled = true; data.append('_csrf', this.csrf()); data.append('status', input.checked ? '1' : '0'); this.ajax(this.url() + '/items/' + encodeURIComponent(id) + '/status', data, function (payload) { input.checked = Number(payload.data.status) === 1; input.disabled = false; self.updateTreeStatus(input); }, { quiet: true, fail: function () { input.checked = previous; input.disabled = false; self.updateTreeStatus(input); } }); },
|
||||
setDocument: function (item) { if (!this.itemForm) { return; } var input = this.itemForm.querySelector('[name="document_id"]'); var label = this.itemForm.querySelector('[data-catalog-document-label]'); var clear = this.itemForm.querySelector('[data-catalog-document-clear]'); var id = item && item.id ? Number(item.id) : 0; input.value = id || ''; if (label) { label.textContent = id ? ('#' + id + ' · ' + (item.title || item.alias || 'Без названия')) : 'Документ не выбран'; } if (clear) { clear.disabled = !id; } },
|
||||
sourceOptions: function () {
|
||||
if (this.sourceOptionsData !== null) { return this.sourceOptionsData; }
|
||||
var node = document.querySelector('[data-catalog-source-options]');
|
||||
try { this.sourceOptionsData = node ? JSON.parse(node.textContent || '[]') : []; }
|
||||
catch (e) { this.sourceOptionsData = []; }
|
||||
return this.sourceOptionsData;
|
||||
},
|
||||
setSources: function (values) {
|
||||
if (!this.itemForm) { return; }
|
||||
var ownId = Number(this.itemForm.querySelector('[name="id"]').value) || 0, allowed = {}, selected = [];
|
||||
this.sourceOptions().forEach(function (item) { if (Number(item.id) !== ownId) { allowed[String(item.id)] = item; } });
|
||||
(values || []).forEach(function (id) { id = String(Number(id) || 0); if (allowed[id] && selected.indexOf(id) === -1) { selected.push(id); } });
|
||||
this.sourceItemIds = selected;
|
||||
var inputs = this.itemForm.querySelector('[data-catalog-source-inputs]'), label = this.itemForm.querySelector('[data-catalog-source-label]'), clear = this.itemForm.querySelector('[data-catalog-source-clear]');
|
||||
if (inputs) {
|
||||
inputs.innerHTML = '';
|
||||
selected.forEach(function (id) { var input = document.createElement('input'); input.type = 'hidden'; input.name = 'source_item_ids[]'; input.value = id; inputs.appendChild(input); });
|
||||
}
|
||||
if (label) {
|
||||
var names = selected.map(function (id) { return allowed[id].name; });
|
||||
label.textContent = names.length === 0 ? 'Товары только из этого раздела' : (names.slice(0, 2).join(', ') + (names.length > 2 ? ' · ещё ' + (names.length - 2) : ''));
|
||||
}
|
||||
if (clear) { clear.disabled = selected.length === 0; }
|
||||
},
|
||||
openSourcePicker: function () {
|
||||
var self = this, ownId = Number(this.itemForm.querySelector('[name="id"]').value) || 0;
|
||||
var options = this.sourceOptions().filter(function (item) { return Number(item.id) !== ownId; });
|
||||
var selected = {}; this.sourceItemIds.forEach(function (id) { selected[String(id)] = true; });
|
||||
var overlay = document.createElement('div'), rows = '';
|
||||
options.forEach(function (item) {
|
||||
var id = String(item.id), search = (id + ' ' + (item.path || item.name || '')).toLowerCase();
|
||||
rows += '<label class="catalog-source-option" data-catalog-source-option data-search="' + self.esc(search) + '"><input type="checkbox" value="' + self.esc(id) + '"' + (selected[id] ? ' checked' : '') + '><span><b>' + self.esc(item.name || 'Без названия') + '</b><small>' + self.esc(item.path || ('Раздел #' + id)) + '</small></span><em class="badge ' + (Number(item.status) === 1 ? 'badge-green' : 'badge-gray') + '">' + (Number(item.status) === 1 ? 'активен' : 'скрыт') + '</em></label>';
|
||||
});
|
||||
overlay.className = 'overlay catalog-source-overlay';
|
||||
overlay.innerHTML = '<div class="modal catalog-source-modal" role="dialog" aria-modal="true"><div class="modal-header"><span class="dialog-icon info"><i class="ti ti-folders"></i></span><div><h3>Источники товаров</h3><p class="text-secondary">Товары выбранных разделов появятся на текущей странице.</p></div><button class="modal-close" type="button" data-catalog-source-close aria-label="Закрыть"><i class="ti ti-x"></i></button></div><div class="modal-body"><label class="input-wrap"><i class="ti ti-search"></i><input class="input" type="search" placeholder="Найти раздел по названию или ID" data-catalog-source-search></label><div class="catalog-source-options">' + rows + '</div><div class="catalog-source-empty" data-catalog-source-empty' + (options.length ? ' hidden' : '') + '>Подходящих разделов нет</div></div><div class="modal-footer"><span class="mf-left text-secondary text-sm" data-catalog-source-count></span><button class="btn btn-ghost" type="button" data-catalog-source-close>Закрыть</button><button class="btn btn-primary" type="button" data-catalog-source-save><i class="ti ti-check"></i>Применить</button></div></div>';
|
||||
document.body.appendChild(overlay); requestAnimationFrame(function () { overlay.classList.add('show'); });
|
||||
var search = overlay.querySelector('[data-catalog-source-search]'), count = overlay.querySelector('[data-catalog-source-count]'), empty = overlay.querySelector('[data-catalog-source-empty]');
|
||||
var update = function () { var checked = overlay.querySelectorAll('[data-catalog-source-option] input:checked').length; count.textContent = checked ? ('Выбрано: ' + checked) : 'Источники не выбраны'; };
|
||||
var filter = function () { var query = (search.value || '').trim().toLowerCase(), visible = 0; overlay.querySelectorAll('[data-catalog-source-option]').forEach(function (row) { var show = !query || row.getAttribute('data-search').indexOf(query) !== -1; row.hidden = !show; if (show) { visible++; } }); empty.hidden = visible > 0; };
|
||||
var close = function () { overlay.classList.remove('show'); setTimeout(function () { overlay.remove(); }, 160); };
|
||||
overlay.addEventListener('change', update);
|
||||
overlay.addEventListener('click', function (e) { if (e.target === overlay || e.target.closest('[data-catalog-source-close]')) { close(); return; } if (e.target.closest('[data-catalog-source-save]')) { self.setSources(Array.prototype.map.call(overlay.querySelectorAll('[data-catalog-source-option] input:checked'), function (input) { return input.value; })); self.scheduleItemSave(); close(); } });
|
||||
search.addEventListener('input', filter); update(); search.focus();
|
||||
},
|
||||
openDocumentPicker: function () {
|
||||
var self = this, overlay = document.createElement('div');
|
||||
overlay.className = 'overlay catalog-document-overlay';
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
.catalog-context-links {
|
||||
padding: 16px 0;
|
||||
border-bottom: 1px solid var(--border-default);
|
||||
min-width: 0;
|
||||
}
|
||||
.catalog-context-links h3 {
|
||||
margin: 0 0 10px;
|
||||
font-size: 14px;
|
||||
}
|
||||
.catalog-context-links nav {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 10px 24px;
|
||||
}
|
||||
.catalog-context-links a {
|
||||
display: inline-flex;
|
||||
align-items: flex-start;
|
||||
gap: 6px;
|
||||
max-width: 100%;
|
||||
min-width: 0;
|
||||
font-size: 13px;
|
||||
}
|
||||
.catalog-context-links a > i {
|
||||
flex: none;
|
||||
margin-top: 2px;
|
||||
}
|
||||
.catalog-context-links a > span {
|
||||
min-width: 0;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
.catalog-context-links small {
|
||||
display: block;
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
.catalog-item-form > .catalog-context-links {
|
||||
padding: 16px 20px;
|
||||
}
|
||||
@@ -20,6 +20,7 @@
|
||||
<phrase data="auto_944019ea5d01e63a">hidden</phrase>
|
||||
<phrase data="auto_9729bca62f6c558e">Request Error</phrase>
|
||||
<phrase data="auto_99d406eeba4f9acb">Section</phrase>
|
||||
<phrase data="auto_9b62723a4333bb4a">Find section</phrase>
|
||||
<phrase data="auto_9f8bfc6bf2339426"><div class="alert alert-error"><i class="ti ti-alert-triangle"></i><div>Errors:</phrase>
|
||||
<phrase data="auto_a456fd20d54a422c"></p></div><button class="modal-close" type="button" data-catalog-recompile-close aria-label="Close" disabled><i class="ti ti-x"></i></button></div><div class="modal-body"><div class="catalog-recompile-status" data-catalog-recompile-status>Preparing...</div><div class="progress"><div class="progress-bar" data-catalog-recompile-progress style="width:0%;--progress-color:var(--blue-500)"></div></div><div class="catalog-recompile-errors" data-catalog-recompile-errors></div></div><div class="modal-footer"><button class="btn btn-ghost" type="button" data-catalog-recompile-stop>Stop</button><button class="btn btn-primary" type="button" data-catalog-recompile-close disabled>Close</button></div></div></phrase>
|
||||
<phrase data="auto_a4c0ae2fa076f2fd">Hide section</phrase>
|
||||
@@ -36,6 +37,11 @@
|
||||
<phrase data="auto_f61de80bf0ca15a4">No document selected</phrase>
|
||||
<phrase data="auto_f6bde2876efe2658">Not included</phrase>
|
||||
<phrase data="auto_fda18205701b609b">Replace condition?</phrase>
|
||||
<phrase data="catalog_roles_more">more</phrase>
|
||||
<phrase data="catalog_roles_no">No</phrase>
|
||||
<phrase data="catalog_selection_catalog">Catalog</phrase>
|
||||
<phrase data="catalog_selection_category">Category</phrase>
|
||||
<phrase data="catalog_selection_search">Search</phrase>
|
||||
<phrase data="runtime_6291ecb1784ea2de">Catalog created</phrase>
|
||||
<phrase data="runtime_6b3607219bc8c7f0">different</phrase>
|
||||
<phrase data="runtime_d0ef3540b088bbf6">Catalog</phrase>
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<language>
|
||||
<phrase data="catalog_context_title">Related Settings</phrase>
|
||||
<phrase data="catalog_context_filters">Section Filters</phrase>
|
||||
<phrase data="catalog_context_attribute_set">Attribute Set</phrase>
|
||||
<phrase data="catalog_context_card">Catalog Card Template</phrase>
|
||||
<phrase data="catalog_context_page">Page Template</phrase>
|
||||
</language>
|
||||
@@ -0,0 +1,63 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<language>
|
||||
<phrase data="catalog_roles_description">Product Description</phrase>
|
||||
<phrase data="catalog_roles_warranty">Warranty</phrase>
|
||||
<phrase data="catalog_roles_registration_text">Registration Document Text</phrase>
|
||||
<phrase data="catalog_roles_registration_number">Registration Document Number</phrase>
|
||||
<phrase data="catalog_roles_title">Product Field Roles</phrase>
|
||||
<phrase data="catalog_roles_saved">Saved Mapping</phrase>
|
||||
<phrase data="catalog_roles_document">Document #</phrase>
|
||||
<phrase data="catalog_roles_sample">Sample Product</phrase>
|
||||
<phrase data="catalog_roles_check">Check</phrase>
|
||||
<phrase data="catalog_roles_optional">Optional Project Fields</phrase>
|
||||
<phrase data="catalog_roles_auto">Automatic:</phrase>
|
||||
<phrase data="catalog_roles_unassigned">Not Assigned</phrase>
|
||||
<phrase data="catalog_roles_name">Name</phrase>
|
||||
<phrase data="catalog_roles_article">SKU</phrase>
|
||||
<phrase data="catalog_roles_price">Price</phrase>
|
||||
<phrase data="catalog_roles_old_price">Old Price</phrase>
|
||||
<phrase data="catalog_roles_stock">Stock Quantity</phrase>
|
||||
<phrase data="catalog_roles_images">Images</phrase>
|
||||
<phrase data="catalog_roles_manufacturer">Manufacturer</phrase>
|
||||
<phrase data="catalog_roles_caption">Card Caption</phrase>
|
||||
<phrase data="catalog_roles_hide_price">Hide Price</phrase>
|
||||
<phrase data="catalog_roles_exclude">Exclude From Price List</phrase>
|
||||
<phrase data="catalog_roles_new">New Product</phrase>
|
||||
<phrase data="catalog_roles_discount">Discount</phrase>
|
||||
<phrase data="catalog_roles_gift">Gift</phrase>
|
||||
<phrase data="catalog_roles_video">Video</phrase>
|
||||
<phrase data="catalog_roles_instruction">Video Instructions</phrase>
|
||||
<phrase data="catalog_roles_square">Square Image</phrase>
|
||||
<phrase data="catalog_roles_banner">Cover Image</phrase>
|
||||
<phrase data="catalog_roles_registration">Registration Document</phrase>
|
||||
<phrase data="catalog_roles_program">Payment Program Eligibility</phrase>
|
||||
<phrase data="catalog_roles_program_code">Payment Program Code</phrase>
|
||||
<phrase data="catalog_roles_published">Published</phrase>
|
||||
<phrase data="catalog_roles_not_public">Not Publicly Available</phrase>
|
||||
<phrase data="catalog_roles_orderable">Available to Order</phrase>
|
||||
<phrase data="catalog_roles_not_orderable">Not Available to Order</phrase>
|
||||
<phrase data="catalog_roles_unpublished">Not Published</phrase>
|
||||
<phrase data="catalog_roles_deleted">Deleted</phrase>
|
||||
<phrase data="catalog_roles_technical">Technical Document or Rubric</phrase>
|
||||
<phrase data="catalog_roles_scheduled">Publication Has Not Started</phrase>
|
||||
<phrase data="catalog_roles_expired">Publication Has Ended</phrase>
|
||||
<phrase data="catalog_roles_missing_price">No Positive Price</phrase>
|
||||
<phrase data="catalog_roles_hidden_price">Price Is Hidden</phrase>
|
||||
<phrase data="catalog_roles_excluded">Price List Exclusion Is Enabled.</phrase>
|
||||
<phrase data="catalog_roles_role">Role</phrase>
|
||||
<phrase data="catalog_roles_field">Field</phrase>
|
||||
<phrase data="catalog_roles_value">Value</phrase>
|
||||
<phrase data="catalog_roles_yes">Yes</phrase>
|
||||
<phrase data="catalog_roles_no">No</phrase>
|
||||
<phrase data="catalog_roles_empty">Not Filled</phrase>
|
||||
<phrase data="catalog_roles_more">more</phrase>
|
||||
<phrase data="catalog_roles_missing_document">No Document Found in This Rubric.</phrase>
|
||||
<phrase data="catalog_roles_request">Request Conditions</phrase>
|
||||
<phrase data="catalog_roles_template">Page Template</phrase>
|
||||
<phrase data="catalog_roles_card">Product Card</phrase>
|
||||
<phrase data="catalog_roles_filters">filters</phrase>
|
||||
<phrase data="catalog_roles_set">Attribute Set</phrase>
|
||||
<phrase data="catalog_roles_error">Could Not Check the Mapping</phrase>
|
||||
<phrase data="catalog_roles_invalid">Invalid Field Role</phrase>
|
||||
<phrase data="catalog_roles_wrong_rubric">Role Field Does Not Belong to the Product Rubric</phrase>
|
||||
</language>
|
||||
@@ -0,0 +1,52 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<language>
|
||||
<phrase data="catalog_selection_check_title">Selection Check</phrase>
|
||||
<phrase data="catalog_selection_selection">Selection</phrase>
|
||||
<phrase data="catalog_selection_catalog">Catalog</phrase>
|
||||
<phrase data="catalog_selection_recommendation">Recommendations</phrase>
|
||||
<phrase data="catalog_selection_search">Search</phrase>
|
||||
<phrase data="catalog_selection_feed">Feed</phrase>
|
||||
<phrase data="catalog_selection_category">Category</phrase>
|
||||
<phrase data="catalog_selection_none">Not Selected</phrase>
|
||||
<phrase data="catalog_selection_scope">Search Scope</phrase>
|
||||
<phrase data="catalog_selection_everywhere">Everywhere</phrase>
|
||||
<phrase data="catalog_selection_query">Search Query</phrase>
|
||||
<phrase data="catalog_selection_source">Source Product #</phrase>
|
||||
<phrase data="catalog_selection_limit">Limit</phrase>
|
||||
<phrase data="catalog_selection_check">Check Selection</phrase>
|
||||
<phrase data="catalog_selection_stale">Parameters Changed; Result Is Outdated</phrase>
|
||||
<phrase data="catalog_selection_yes">Included in Selection</phrase>
|
||||
<phrase data="catalog_selection_no">Not Included in Selection</phrase>
|
||||
<phrase data="catalog_selection_unknown">Check Incomplete</phrase>
|
||||
<phrase data="catalog_selection_denied">Insufficient Permissions</phrase>
|
||||
<phrase data="catalog_selection_unknown_context">Unknown Selection</phrase>
|
||||
<phrase data="catalog_selection_error">Check Unavailable: Review Settings and Index Health</phrase>
|
||||
<phrase data="catalog_selection_catalog_note">Eligibility Before Grouping and Pagination, Without Visitor Filters</phrase>
|
||||
<phrase data="catalog_selection_category_missing">Category Not Found</phrase>
|
||||
<phrase data="catalog_selection_category_page">Published Category Page</phrase>
|
||||
<phrase data="catalog_selection_request_denied">Insufficient Permissions for Request Conditions</phrase>
|
||||
<phrase data="catalog_selection_catalog_base">Index, Publication, Category Sources and Variant Status</phrase>
|
||||
<phrase data="catalog_selection_conditions">Saved Request Conditions</phrase>
|
||||
<phrase data="catalog_selection_group">Product or Its Group Is Eligible</phrase>
|
||||
<phrase data="catalog_selection_search_note">Search Before Pagination Using the Effective Query, Including Synonyms and Typo Correction</phrase>
|
||||
<phrase data="catalog_selection_effective_query">Effective Search Query</phrase>
|
||||
<phrase data="catalog_selection_ambiguous_query">Ambiguous Correction: No Replacement Selected</phrase>
|
||||
<phrase data="catalog_selection_missing_plan">Search Handler Did Not Return a Verification Plan</phrase>
|
||||
<phrase data="catalog_selection_pipeline_results">Search Pipeline Returned Results</phrase>
|
||||
<phrase data="catalog_selection_search_unavailable">Search Unavailable</phrase>
|
||||
<phrase data="catalog_selection_scope_missing">Search Scope Not Found</phrase>
|
||||
<phrase data="catalog_selection_short_query">Search Query Is Too Short</phrase>
|
||||
<phrase data="catalog_selection_search_base">Search Index, Text and Public Visibility</phrase>
|
||||
<phrase data="catalog_selection_search_rubrics">Search Scope Rubrics</phrase>
|
||||
<phrase data="catalog_selection_search_conditions">Search Scope Conditions</phrase>
|
||||
<phrase data="catalog_selection_feed_note">Export Eligibility Under Saved Settings, Without File Generation</phrase>
|
||||
<phrase data="catalog_selection_feed_missing">Feed Not Found</phrase>
|
||||
<phrase data="catalog_selection_feed_active">Feed Is Enabled</phrase>
|
||||
<phrase data="catalog_selection_feed_categories">Allowed Feed Categories</phrase>
|
||||
<phrase data="catalog_selection_feed_base">Index, Publication, Price Visibility and Feed Categories</phrase>
|
||||
<phrase data="catalog_selection_feed_conditions">Price and Price List Inclusion Under Feed Settings</phrase>
|
||||
<phrase data="catalog_selection_rec_note">Actual Recommendations Including Limit, Ranking and Cache</phrase>
|
||||
<phrase data="catalog_selection_source_missing">Source Product Unavailable</phrase>
|
||||
<phrase data="catalog_selection_rec_result">Native Recommendation Result</phrase>
|
||||
<phrase data="catalog_selection_rec_policy">Source Categories, Active Status, Primary Variant, Price, Stock and Limit Apply</phrase>
|
||||
</language>
|
||||
@@ -20,6 +20,7 @@
|
||||
<phrase data="auto_944019ea5d01e63a">скрыт</phrase>
|
||||
<phrase data="auto_9729bca62f6c558e">Ошибка запроса</phrase>
|
||||
<phrase data="auto_99d406eeba4f9acb">Раздел</phrase>
|
||||
<phrase data="auto_9b62723a4333bb4a">Найти раздел</phrase>
|
||||
<phrase data="auto_9f8bfc6bf2339426"><div class="alert alert-error"><i class="ti ti-alert-triangle"></i><div>Ошибки:</phrase>
|
||||
<phrase data="auto_a456fd20d54a422c"></p></div><button class="modal-close" type="button" data-catalog-recompile-close aria-label="Закрыть" disabled><i class="ti ti-x"></i></button></div><div class="modal-body"><div class="catalog-recompile-status" data-catalog-recompile-status>Подготовка...</div><div class="progress"><div class="progress-bar" data-catalog-recompile-progress style="width:0%;--progress-color:var(--blue-500)"></div></div><div class="catalog-recompile-errors" data-catalog-recompile-errors></div></div><div class="modal-footer"><button class="btn btn-ghost" type="button" data-catalog-recompile-stop>Остановить</button><button class="btn btn-primary" type="button" data-catalog-recompile-close disabled>Закрыть</button></div></div></phrase>
|
||||
<phrase data="auto_a4c0ae2fa076f2fd">Скрыть раздел</phrase>
|
||||
@@ -36,6 +37,11 @@
|
||||
<phrase data="auto_f61de80bf0ca15a4">Документ не выбран</phrase>
|
||||
<phrase data="auto_f6bde2876efe2658">Не включён</phrase>
|
||||
<phrase data="auto_fda18205701b609b">Заменить условие?</phrase>
|
||||
<phrase data="catalog_roles_more">ещё</phrase>
|
||||
<phrase data="catalog_roles_no">Нет</phrase>
|
||||
<phrase data="catalog_selection_catalog">Каталог</phrase>
|
||||
<phrase data="catalog_selection_category">Раздел</phrase>
|
||||
<phrase data="catalog_selection_search">Поиск</phrase>
|
||||
<phrase data="runtime_6291ecb1784ea2de">Каталог создан</phrase>
|
||||
<phrase data="runtime_6b3607219bc8c7f0">отличается</phrase>
|
||||
<phrase data="runtime_d0ef3540b088bbf6">Каталог</phrase>
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<language>
|
||||
<phrase data="catalog_context_title">Связанные настройки</phrase>
|
||||
<phrase data="catalog_context_filters">Фильтры раздела</phrase>
|
||||
<phrase data="catalog_context_attribute_set">Набор характеристик</phrase>
|
||||
<phrase data="catalog_context_card">Шаблон карточки в каталоге</phrase>
|
||||
<phrase data="catalog_context_page">Шаблон страницы</phrase>
|
||||
</language>
|
||||
@@ -0,0 +1,63 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<language>
|
||||
<phrase data="catalog_roles_description">Описание товара</phrase>
|
||||
<phrase data="catalog_roles_warranty">Гарантия</phrase>
|
||||
<phrase data="catalog_roles_registration_text">Текст регистрационного документа</phrase>
|
||||
<phrase data="catalog_roles_registration_number">Номер регистрационного документа</phrase>
|
||||
<phrase data="catalog_roles_title">Назначение полей товара</phrase>
|
||||
<phrase data="catalog_roles_saved">Сохранённое сопоставление</phrase>
|
||||
<phrase data="catalog_roles_document">Документ #</phrase>
|
||||
<phrase data="catalog_roles_sample">Образец товара</phrase>
|
||||
<phrase data="catalog_roles_check">Проверить</phrase>
|
||||
<phrase data="catalog_roles_optional">Дополнительные поля проекта</phrase>
|
||||
<phrase data="catalog_roles_auto">Автоматически:</phrase>
|
||||
<phrase data="catalog_roles_unassigned">Не назначено</phrase>
|
||||
<phrase data="catalog_roles_name">Название</phrase>
|
||||
<phrase data="catalog_roles_article">Артикул</phrase>
|
||||
<phrase data="catalog_roles_price">Цена</phrase>
|
||||
<phrase data="catalog_roles_old_price">Старая цена</phrase>
|
||||
<phrase data="catalog_roles_stock">Остаток</phrase>
|
||||
<phrase data="catalog_roles_images">Изображения</phrase>
|
||||
<phrase data="catalog_roles_manufacturer">Производитель</phrase>
|
||||
<phrase data="catalog_roles_caption">Подпись карточки</phrase>
|
||||
<phrase data="catalog_roles_hide_price">Скрывать цену</phrase>
|
||||
<phrase data="catalog_roles_exclude">Исключить из прайса</phrase>
|
||||
<phrase data="catalog_roles_new">Новинка</phrase>
|
||||
<phrase data="catalog_roles_discount">Скидка</phrase>
|
||||
<phrase data="catalog_roles_gift">Подарок</phrase>
|
||||
<phrase data="catalog_roles_video">Видео</phrase>
|
||||
<phrase data="catalog_roles_instruction">Видеоинструкция</phrase>
|
||||
<phrase data="catalog_roles_square">Квадратное изображение</phrase>
|
||||
<phrase data="catalog_roles_banner">Обложка</phrase>
|
||||
<phrase data="catalog_roles_registration">Регистрационный документ</phrase>
|
||||
<phrase data="catalog_roles_program">Участие в программе оплаты</phrase>
|
||||
<phrase data="catalog_roles_program_code">Код программы оплаты</phrase>
|
||||
<phrase data="catalog_roles_published">Опубликован</phrase>
|
||||
<phrase data="catalog_roles_not_public">Не доступен публично</phrase>
|
||||
<phrase data="catalog_roles_orderable">Доступен к покупке</phrase>
|
||||
<phrase data="catalog_roles_not_orderable">Покупка недоступна</phrase>
|
||||
<phrase data="catalog_roles_unpublished">Не опубликован</phrase>
|
||||
<phrase data="catalog_roles_deleted">Удалён</phrase>
|
||||
<phrase data="catalog_roles_technical">Служебный документ или рубрика</phrase>
|
||||
<phrase data="catalog_roles_scheduled">Публикация ещё не началась</phrase>
|
||||
<phrase data="catalog_roles_expired">Публикация завершена</phrase>
|
||||
<phrase data="catalog_roles_missing_price">Нет положительной цены</phrase>
|
||||
<phrase data="catalog_roles_hidden_price">Цена скрыта</phrase>
|
||||
<phrase data="catalog_roles_excluded">Исключение из прайса включено.</phrase>
|
||||
<phrase data="catalog_roles_role">Назначение</phrase>
|
||||
<phrase data="catalog_roles_field">Поле</phrase>
|
||||
<phrase data="catalog_roles_value">Значение</phrase>
|
||||
<phrase data="catalog_roles_yes">Да</phrase>
|
||||
<phrase data="catalog_roles_no">Нет</phrase>
|
||||
<phrase data="catalog_roles_empty">Не заполнено</phrase>
|
||||
<phrase data="catalog_roles_more">ещё</phrase>
|
||||
<phrase data="catalog_roles_missing_document">Документ этой рубрики не найден.</phrase>
|
||||
<phrase data="catalog_roles_request">Условия запроса</phrase>
|
||||
<phrase data="catalog_roles_template">Шаблон страницы</phrase>
|
||||
<phrase data="catalog_roles_card">Карточка товара</phrase>
|
||||
<phrase data="catalog_roles_filters">фильтры</phrase>
|
||||
<phrase data="catalog_roles_set">Набор характеристик</phrase>
|
||||
<phrase data="catalog_roles_error">Не удалось проверить сопоставление</phrase>
|
||||
<phrase data="catalog_roles_invalid">Некорректное назначение поля</phrase>
|
||||
<phrase data="catalog_roles_wrong_rubric">Поле роли не принадлежит рубрике товара</phrase>
|
||||
</language>
|
||||
@@ -0,0 +1,52 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<language>
|
||||
<phrase data="catalog_selection_check_title">Проверка выборки</phrase>
|
||||
<phrase data="catalog_selection_selection">Выборка</phrase>
|
||||
<phrase data="catalog_selection_catalog">Каталог</phrase>
|
||||
<phrase data="catalog_selection_recommendation">Рекомендации</phrase>
|
||||
<phrase data="catalog_selection_search">Поиск</phrase>
|
||||
<phrase data="catalog_selection_feed">Фид</phrase>
|
||||
<phrase data="catalog_selection_category">Раздел</phrase>
|
||||
<phrase data="catalog_selection_none">Не выбран</phrase>
|
||||
<phrase data="catalog_selection_scope">Область поиска</phrase>
|
||||
<phrase data="catalog_selection_everywhere">Везде</phrase>
|
||||
<phrase data="catalog_selection_query">Поисковая строка</phrase>
|
||||
<phrase data="catalog_selection_source">Исходный товар #</phrase>
|
||||
<phrase data="catalog_selection_limit">Лимит</phrase>
|
||||
<phrase data="catalog_selection_check">Проверить выборку</phrase>
|
||||
<phrase data="catalog_selection_stale">Параметры изменены, результат не актуален</phrase>
|
||||
<phrase data="catalog_selection_yes">Входит в выборку</phrase>
|
||||
<phrase data="catalog_selection_no">Не входит в выборку</phrase>
|
||||
<phrase data="catalog_selection_unknown">Проверка не завершена</phrase>
|
||||
<phrase data="catalog_selection_denied">Недостаточно прав</phrase>
|
||||
<phrase data="catalog_selection_unknown_context">Неизвестная выборка</phrase>
|
||||
<phrase data="catalog_selection_error">Проверка недоступна: проверьте настройки и состояние индексов</phrase>
|
||||
<phrase data="catalog_selection_catalog_note">Допуск до группировки и страниц, без выбранных посетителем фильтров</phrase>
|
||||
<phrase data="catalog_selection_category_missing">Раздел не найден</phrase>
|
||||
<phrase data="catalog_selection_category_page">Опубликованная страница раздела</phrase>
|
||||
<phrase data="catalog_selection_request_denied">Недостаточно прав для условий запроса</phrase>
|
||||
<phrase data="catalog_selection_catalog_base">Индекс, публикация, источники раздела и активность варианта</phrase>
|
||||
<phrase data="catalog_selection_conditions">Сохранённые условия запроса</phrase>
|
||||
<phrase data="catalog_selection_group">Допуск товара или его группы в выдачу</phrase>
|
||||
<phrase data="catalog_selection_search_note">Поиск до пагинации по фактической строке, с синонимами и исправлением опечаток</phrase>
|
||||
<phrase data="catalog_selection_effective_query">Фактическая поисковая строка</phrase>
|
||||
<phrase data="catalog_selection_ambiguous_query">Неоднозначное исправление: поиск не выбрал замену</phrase>
|
||||
<phrase data="catalog_selection_missing_plan">Поисковый обработчик не вернул план проверки</phrase>
|
||||
<phrase data="catalog_selection_pipeline_results">Поисковый pipeline вернул результаты</phrase>
|
||||
<phrase data="catalog_selection_search_unavailable">Поиск недоступен</phrase>
|
||||
<phrase data="catalog_selection_scope_missing">Область поиска не найдена</phrase>
|
||||
<phrase data="catalog_selection_short_query">Поисковый запрос слишком короткий</phrase>
|
||||
<phrase data="catalog_selection_search_base">Поисковый индекс, текст и публичная доступность</phrase>
|
||||
<phrase data="catalog_selection_search_rubrics">Рубрики области поиска</phrase>
|
||||
<phrase data="catalog_selection_search_conditions">Условия области поиска</phrase>
|
||||
<phrase data="catalog_selection_feed_note">Допуск в экспорт по сохранённым настройкам, без генерации файла</phrase>
|
||||
<phrase data="catalog_selection_feed_missing">Фид не найден</phrase>
|
||||
<phrase data="catalog_selection_feed_active">Фид включён</phrase>
|
||||
<phrase data="catalog_selection_feed_categories">Разрешённые разделы фида</phrase>
|
||||
<phrase data="catalog_selection_feed_base">Индекс, публикация, видимость цены и разделы фида</phrase>
|
||||
<phrase data="catalog_selection_feed_conditions">Цена и включение в прайс по настройкам фида</phrase>
|
||||
<phrase data="catalog_selection_rec_note">Фактическая выдача рекомендаций с учётом лимита, ранжирования и кеша</phrase>
|
||||
<phrase data="catalog_selection_source_missing">Исходный товар недоступен</phrase>
|
||||
<phrase data="catalog_selection_rec_result">Результат штатных рекомендаций</phrase>
|
||||
<phrase data="catalog_selection_rec_policy">Учитываются категории исходного товара, активность, основной вариант, цена, остаток и лимит</phrase>
|
||||
</language>
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------------------
|
||||
| AVE.cms
|
||||
|--------------------------------------------------------------------------------------
|
||||
| @package AVE.cms
|
||||
| @file adminx/modules/Catalog/migrations/006_add_item_sources.php
|
||||
| @author AVE.cms <support@ave-cms.ru>
|
||||
| @copyright 2007-2026 (c) AVE.cms
|
||||
| @link https://ave-cms.ru
|
||||
| @version 3.3
|
||||
*/
|
||||
|
||||
defined('BASEPATH') || die('Direct access to this location is not allowed.');
|
||||
|
||||
use App\Common\DatabaseSchema;
|
||||
use App\Content\CatalogTables;
|
||||
|
||||
return function () {
|
||||
$table = CatalogTables::table('module_catalog_items');
|
||||
if (!DatabaseSchema::tableExists($table) || DatabaseSchema::columnExists($table, 'source_item_ids')) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
DB::query('ALTER TABLE %b ADD COLUMN `source_item_ids` TEXT NULL AFTER `filters_settings`', $table);
|
||||
return 1;
|
||||
};
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
defined('BASEPATH') || die('Direct access to this location is not allowed.');
|
||||
return array(
|
||||
'code' => 'catalog', 'name' => 'Каталог', 'version' => '0.3.2',
|
||||
'code' => 'catalog', 'name' => 'Каталог', 'version' => '0.3.9',
|
||||
'permissions' => array('key' => 'catalog', 'items' => array(
|
||||
array(
|
||||
'code' => 'view_catalog',
|
||||
@@ -51,6 +51,7 @@
|
||||
array('GET', '/catalog/documents', array(\App\Adminx\Catalog\Controller::class, 'documents')),
|
||||
array('GET', '/catalog/items/{id}', array(\App\Adminx\Catalog\Controller::class, 'item')),
|
||||
array('GET', '/catalog/{rubric}/{field}', array(\App\Adminx\Catalog\Controller::class, 'edit')),
|
||||
array('GET', '/catalog/{rubric}/{field}/product-preview', array(\App\Adminx\Catalog\Controller::class, 'productPreview'), array('permission' => 'view_products')),
|
||||
array('POST', '/catalog/{rubric}/{field}/items', array(\App\Adminx\Catalog\Controller::class, 'storeItem')),
|
||||
array('POST', '/catalog/{rubric}/{field}/items/{id}', array(\App\Adminx\Catalog\Controller::class, 'updateItem')),
|
||||
array('POST', '/catalog/{rubric}/{field}/items/{id}/conditions/sync', array(\App\Adminx\Catalog\Controller::class, 'syncMissingConditions')),
|
||||
@@ -63,6 +64,7 @@
|
||||
),
|
||||
'migrations' => array(
|
||||
array('id' => '005_add_catalog_purpose', 'file' => 'migrations/005_add_catalog_purpose.sql'),
|
||||
array('id' => '006_add_item_sources', 'file' => 'migrations/006_add_item_sources.php'),
|
||||
),
|
||||
'view_globals' => array('module_code' => 'catalog'),
|
||||
);
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
<section class="catalog-context-links" data-catalog-context-links{{ context_links ? '' : ' hidden' }} aria-label="{{ lang.catalog_context_title|default('Связанные настройки') }}">
|
||||
<h3>{{ lang.catalog_context_title|default('Связанные настройки') }}</h3>
|
||||
<nav>{% for link in context_links %}<a href="{{ link.url }}" target="_blank" rel="noopener" data-context-kind="{{ link.kind }}"><i class="ti ti-external-link" aria-hidden="true"></i><span>{{ link.label }}{% if link.scope %}<small>{{ link.scope }}</small>{% endif %}</span></a>{% endfor %}</nav>
|
||||
</section>
|
||||
@@ -0,0 +1,28 @@
|
||||
<div class="catalog-role-preview" data-product-role-preview data-error="{{ 'Не удалось проверить сопоставление'|admin_trans }}" aria-live="polite">
|
||||
<h3>{{ 'Сохранённое сопоставление'|admin_trans }}</h3>
|
||||
{% if product_roles.denied %}<p class="text-secondary">{{ 'Недостаточно прав'|admin_trans }}</p>{% else %}
|
||||
<div class="form-grid">
|
||||
<label class="field col-4"><span class="field-label">{{ 'Документ #'|admin_trans }}</span><input class="input" type="number" min="1" value="{{ product_roles.document_id ?: '' }}" data-product-role-document></label>
|
||||
<div class="field col-4"><span class="field-label">{{ 'Образец товара'|admin_trans }}</span><button type="button" class="btn btn-secondary" data-product-role-refresh><i class="ti ti-refresh"></i>{{ 'Проверить'|admin_trans }}</button></div>
|
||||
</div>
|
||||
{% include '@catalog/_product-selection-preview.twig' %}
|
||||
{% if product_roles.snapshot %}
|
||||
{% set sample = product_roles.snapshot %}
|
||||
<p>{% if product_roles.can_edit_product %}<a href="{{ ADMINX_BASE }}/catalog/products/{{ sample.id }}/edit">{{ sample.title }} · #{{ sample.id }}</a>{% else %}{{ sample.title }} · #{{ sample.id }}{% endif %}</p>
|
||||
<p><span class="badge {{ sample.published ? 'badge-green' : 'badge-gray' }}">{{ (sample.published ? 'Опубликован' : 'Не доступен публично')|admin_trans }}</span> <span class="badge {{ sample.orderable ? 'badge-green' : 'badge-gray' }}">{{ (sample.orderable ? 'Доступен к покупке' : 'Покупка недоступна')|admin_trans }}</span></p>
|
||||
{% for reason in product_roles.reasons %}<p class="text-secondary">{{ reason|admin_trans }}</p>{% endfor %}
|
||||
{% if sample.exclude_from_price %}<p class="text-secondary">{{ 'Исключение из прайса включено.'|admin_trans }}</p>{% endif %}
|
||||
<div class="table-wrap"><table class="table"><thead><tr><th>{{ 'Назначение'|admin_trans }}</th><th>{{ 'Поле'|admin_trans }}</th><th>{{ 'Значение'|admin_trans }}</th></tr></thead><tbody>
|
||||
{% for role,definition in product_roles.definitions %}{% if not definition.optional or definition.field_id %}
|
||||
<tr><td>{{ definition.label|admin_trans }}</td><td data-label="{{ 'Поле'|admin_trans }}">{% if definition.field %}<a href="{{ ADMINX_BASE }}/rubrics?fields={{ catalog.rubric_id }}&field={{ definition.field_id }}">{{ definition.field.title ?: definition.field.alias }} · #{{ definition.field_id }}</a>{% else %}{{ 'Не назначено'|admin_trans }}{% endif %}</td><td data-label="{{ 'Значение'|admin_trans }}">{% set value = attribute(sample,role) %}{% if value is same as(true) %}{{ 'Да'|admin_trans }}{% elseif value is same as(false) %}{{ 'Нет'|admin_trans }}{% elseif value is iterable %}{% if value is empty %}{{ 'Не заполнено'|admin_trans }}{% else %}{{ value|slice(0, 3)|join(', ') }}{% if value|length > 3 %} · {{ 'ещё'|admin_trans }} {{ value|length - 3 }}{% endif %}{% endif %}{% elseif value is same as('') %}{{ 'Не заполнено'|admin_trans }}{% else %}{{ value }}{% endif %}</td></tr>
|
||||
{% endif %}{% endfor %}
|
||||
</tbody></table></div>
|
||||
{% else %}<p class="text-secondary">{{ 'Документ этой рубрики не найден.'|admin_trans }}</p>{% endif %}
|
||||
<div class="btn-group">
|
||||
{% if settings.request_id and product_roles.can_requests %}<a class="btn btn-ghost" href="{{ ADMINX_BASE }}/requests/{{ settings.request_id }}"><i class="ti ti-filter"></i>{{ 'Условия запроса'|admin_trans }}</a>{% endif %}
|
||||
{% if product_roles.can_rubrics %}<a class="btn btn-ghost" href="{{ ADMINX_BASE }}/rubrics?templates={{ catalog.rubric_id }}{% if product_roles.snapshot.document.rubric_tmpl_id %}&template={{ product_roles.snapshot.document.rubric_tmpl_id }}{% endif %}"><i class="ti ti-template"></i>{{ 'Шаблон страницы'|admin_trans }}</a>{% endif %}
|
||||
<a class="btn btn-ghost" href="{{ ADMINX_BASE }}/catalog/{% if product_roles.card_template_id %}card-templates?edit={{ product_roles.card_template_id }}{% else %}public-templates?template=product-card{% endif %}"><i class="ti ti-layout-cards"></i>{{ 'Карточка товара'|admin_trans }}</a>
|
||||
</div>
|
||||
{% for section in product_roles.sections %}<p><a href="{{ ADMINX_BASE }}/catalog/{{ section.rubric_id }}/{{ section.field_id }}?item={{ section.id }}&tab=filters">{{ section.name }}: {{ 'фильтры'|admin_trans }}</a>{% if section.attribute_set_id %} · <a href="{{ ADMINX_BASE }}/catalog/attribute-sets/{{ section.attribute_set_id }}">{{ 'Набор характеристик'|admin_trans }} #{{ section.attribute_set_id }}</a>{% endif %}</p>{% endfor %}
|
||||
{% endif %}
|
||||
</div>
|
||||
@@ -0,0 +1,20 @@
|
||||
<section class="catalog-commerce-fields" data-catalog-commerce-fields>
|
||||
<div class="catalog-behavior-head"><span class="icon-tile catalog-behavior-icon is-green"><i class="ti ti-shopping-bag"></i></span><h3>{{ 'Назначение полей товара'|admin_trans }}</h3></div>
|
||||
<div class="form-grid">
|
||||
{% for role,definition in product_roles.definitions %}{% if not definition.optional %}
|
||||
<label class="field col-4"><span class="field-label">{{ definition.label|admin_trans }}</span><select class="select" name="product_roles[{{ role }}]">
|
||||
<option value="-1"{{ definition.selected == -1 ? ' selected' : '' }}>{{ 'Автоматически:'|admin_trans }} {{ definition.alias }}</option><option value="0"{{ definition.selected == 0 ? ' selected' : '' }}>{{ 'Не назначено'|admin_trans }}</option>
|
||||
{% for group in field_groups %}{% for field in group.items %}<option value="{{ field.id }}"{{ definition.selected == field.id ? ' selected' : '' }}>{{ field.title ?: field.alias }} · #{{ field.id }}</option>{% endfor %}{% endfor %}
|
||||
</select></label>
|
||||
{% endif %}{% endfor %}
|
||||
</div>
|
||||
<details><summary>{{ 'Дополнительные поля проекта'|admin_trans }}</summary><div class="form-grid">
|
||||
{% for role,definition in product_roles.definitions %}{% if definition.optional %}
|
||||
<label class="field col-4"><span class="field-label">{{ definition.label|admin_trans }}</span><select class="select" name="product_roles[{{ role }}]">
|
||||
<option value="-1"{{ definition.selected == -1 ? ' selected' : '' }}>{{ 'Автоматически:'|admin_trans }} {{ definition.alias }}</option><option value="0"{{ definition.selected == 0 ? ' selected' : '' }}>{{ 'Не назначено'|admin_trans }}</option>
|
||||
{% for group in field_groups %}{% for field in group.items %}<option value="{{ field.id }}"{{ definition.selected == field.id ? ' selected' : '' }}>{{ field.title ?: field.alias }} · #{{ field.id }}</option>{% endfor %}{% endfor %}
|
||||
</select></label>
|
||||
{% endif %}{% endfor %}
|
||||
</div></details>
|
||||
{% include '@catalog/_product-role-preview.twig' %}
|
||||
</section>
|
||||
@@ -0,0 +1,24 @@
|
||||
{% set selection = product_roles.selection %}
|
||||
{% set options = product_roles.selection_options %}
|
||||
<section class="catalog-selection-preview" data-product-selection>
|
||||
<h4>{{ 'Проверка выборки'|admin_trans }}</h4>
|
||||
<div class="catalog-selection-controls">
|
||||
<label class="field"><span class="field-label">{{ 'Выборка'|admin_trans }}</span><select class="select" data-selection="context">{% for code,label in options.contexts %}<option value="{{ code }}"{{ selection.context == code ? ' selected' : '' }}>{{ label|admin_trans }}</option>{% endfor %}</select></label>
|
||||
<label class="field" data-selection-context="catalog"{{ selection.context != 'catalog' ? ' hidden' : '' }}><span class="field-label">{{ 'Раздел'|admin_trans }}</span><select class="select" data-selection="category"><option value="0">{{ 'Не выбран'|admin_trans }}</option>{% for item in options.categories %}<option value="{{ item.id }}"{{ selection.category == item.id ? ' selected' : '' }}>{{ item.name }} #{{ item.id }}</option>{% endfor %}</select></label>
|
||||
<label class="field" data-selection-context="feed"{{ selection.context != 'feed' ? ' hidden' : '' }}><span class="field-label">{{ 'Фид'|admin_trans }}</span><select class="select" data-selection="feed"><option value="0">{{ 'Не выбран'|admin_trans }}</option>{% for item in options.feeds %}<option value="{{ item.id }}"{{ selection.feed == item.id ? ' selected' : '' }}>{{ item.name }} #{{ item.id }}</option>{% endfor %}</select></label>
|
||||
<label class="field" data-selection-context="search"{{ selection.context != 'search' ? ' hidden' : '' }}><span class="field-label">{{ 'Область поиска'|admin_trans }}</span><select class="select" data-selection="scope">{% for item in options.scopes %}<option value="{{ item.code }}"{{ selection.scope == item.code ? ' selected' : '' }}>{{ item.label|admin_trans }}</option>{% endfor %}</select></label>
|
||||
<label class="field" data-selection-context="search"{{ selection.context != 'search' ? ' hidden' : '' }}><span class="field-label">{{ 'Поисковая строка'|admin_trans }}</span><input class="input" type="search" maxlength="200" value="{{ selection.query }}" data-selection="query"></label>
|
||||
<label class="field" data-selection-context="recommendation"{{ selection.context != 'recommendation' ? ' hidden' : '' }}><span class="field-label">{{ 'Исходный товар #'|admin_trans }}</span><input class="input" type="number" min="1" value="{{ selection.source ?: '' }}" data-selection="source"></label>
|
||||
<label class="field" data-selection-context="recommendation"{{ selection.context != 'recommendation' ? ' hidden' : '' }}><span class="field-label">{{ 'Лимит'|admin_trans }}</span><input class="input" type="number" min="1" max="24" value="{{ selection.limit ?: 8 }}" data-selection="limit"></label>
|
||||
<button class="btn btn-secondary" type="button" data-product-selection-check><i class="ti ti-list-search" aria-hidden="true"></i>{{ 'Проверить выборку'|admin_trans }}</button>
|
||||
</div>
|
||||
<p class="text-secondary" data-selection-stale hidden>{{ 'Параметры изменены, результат не актуален'|admin_trans }}</p>
|
||||
{% if product_roles.selection_result %}
|
||||
{% set result = product_roles.selection_result %}
|
||||
<div class="catalog-selection-result" data-selection-result>
|
||||
<p><span class="badge {{ result.matched is same as(true) ? 'badge-green' : 'badge-gray' }}">{{ (result.matched is same as(true) ? 'Входит в выборку' : (result.matched is same as(false) ? 'Не входит в выборку' : 'Проверка не завершена'))|admin_trans }}</span></p>
|
||||
<ul>{% for step in result.steps %}<li data-selection-step="{{ step.code }}"><i class="ti {{ step.pass is same as(true) ? 'ti-check text-success' : (step.pass is same as(false) ? 'ti-x text-danger' : 'ti-info-circle') }}" aria-hidden="true"></i><span>{{ step.label|admin_trans }}{% if step.detail != '' %}: <b>{{ step.detail }}</b>{% endif %}<span class="sr-only"> {{ (step.pass is same as(true) ? 'Да' : (step.pass is same as(false) ? 'Нет' : ''))|admin_trans }}</span></span></li>{% endfor %}</ul>
|
||||
{% if result.note %}<p class="text-secondary text-sm">{{ result.note|admin_trans }}</p>{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</section>
|
||||
@@ -42,12 +42,12 @@
|
||||
<label class="field col-3"><span class="field-label">Навигация в шапке</span><select class="select" name="navi_id"><option value="0">Не связана</option>{% for item in navigation_options %}<option value="{{ item.id }}"{{ settings.navi_id == item.id ? ' selected' : '' }}>{{ item.title ?: item.alias }}{% if item.alias and item.alias != item.title %} · {{ item.alias }}{% endif %} (#{{ item.id }})</option>{% endfor %}</select><span class="field-hint">Дополнительные ссылки и подборки перед разделами каталога.</span></label>
|
||||
<label class="field col-3"><span class="field-label">Рубрика разделов</span><select class="select" name="rub_cat_id"><option value="0">Не выбрана</option>{% for item in rubric_options %}<option value="{{ item.id }}"{{ settings.rub_cat_id == item.id ? ' selected' : '' }}>{{ item.title ?: item.alias }}{% if item.alias and item.alias != item.title %} · {{ item.alias }}{% endif %} (#{{ item.id }})</option>{% endfor %}</select><span class="field-hint">Рубрика документов, связанных с разделами каталога.</span></label>
|
||||
</div>
|
||||
{% if products_available %}<section class="catalog-commerce-fields" data-catalog-commerce-fields><div class="catalog-behavior-head"><span class="icon-tile catalog-behavior-icon is-green"><i class="ti ti-shopping-bag"></i></span><h3>Поля товарного представления</h3></div><div class="form-grid">{% set commerce_fields={'product_title_field_id':'Название товара','product_article_field_id':'Артикул','product_price_field_id':'Цена','product_old_price_field_id':'Старая цена','product_stock_field_id':'Остаток','product_images_field_id':'Изображения'} %}{% for key,label in commerce_fields %}<label class="field col-4"><span class="field-label">{{ label }}</span><select class="select" name="{{ key }}"><option value="0">Не назначено</option>{% for group in field_groups %}{% for field in group.items %}<option value="{{ field.id }}"{{ attribute(settings,key) == field.id ? ' selected' : '' }}>{{ field.title ?: field.alias }} · #{{ field.id }}</option>{% endfor %}{% endfor %}</select></label>{% endfor %}</div></section>
|
||||
{% if products_available %}{% include '@catalog/_product-roles.twig' %}
|
||||
<section class="catalog-product-card-settings" data-catalog-commerce-fields>
|
||||
<div class="catalog-behavior-head"><span class="icon-tile catalog-behavior-icon is-blue"><i class="ti ti-layout-cards"></i></span><div><h3>Карточка товара</h3><p class="text-secondary text-sm">Единый вид для главной страницы и разделов товарного каталога.</p></div></div>
|
||||
<div class="catalog-product-card-layout">
|
||||
<div class="form-grid catalog-product-card-values">
|
||||
<label class="field col-12"><span class="field-label">Представление</span><select class="select" name="product_card_template_id"><option value="0">Стандартное файловое</option>{% for template in card_template_options %}<option value="{{ template.id }}"{{ settings.product_card_template_id == template.id ? ' selected' : '' }}>{{ template.title }} · {{ template.code }}{% if not template.is_published %} · черновик{% else %} · v{{ template.version }}{% endif %}</option>{% endfor %}</select><span class="field-hint"><a href="{{ ADMINX_BASE }}/catalog/card-templates">Редактировать представления карточек</a>. На сайте используется только опубликованная версия.</span></label>
|
||||
<label class="field col-12"><span class="field-label">Представление</span><select class="select" name="product_card_template_id"><option value="0">Общая «Стандартная карточка»</option>{% for template in card_template_options %}{% if template.id != 1 %}<option value="{{ template.id }}"{{ settings.product_card_template_id == template.id ? ' selected' : '' }}>{{ template.title }} · {{ template.code }}{% if not template.is_published %} · черновик{% else %} · v{{ template.version }}{% endif %}</option>{% endif %}{% endfor %}</select><span class="field-hint"><a href="{{ ADMINX_BASE }}/catalog/card-templates">Редактировать представления карточек</a>. Значение по умолчанию использует опубликованную «Стандартную карточку»; файловый шаблон остаётся резервом, пока её разметка пуста.</span></label>
|
||||
<label class="field col-6"><span class="field-label">Фотографий в слайдере</span><select class="select" name="product_card[max_images]">{% for count in 1..5 %}<option value="{{ count }}"{{ settings.product_card.max_images == count ? ' selected' : '' }}>{{ count }}</option>{% endfor %}</select></label>
|
||||
<label class="field col-6"><span class="field-label">Бесплатная доставка от</span><div class="catalog-product-card-price"><input class="input" type="number" min="0" step="1000" name="product_card[delivery_threshold]" value="{{ settings.product_card.delivery_threshold|number_format(0, '.', '') }}"><span>₽</span></div></label>
|
||||
</div>
|
||||
@@ -66,7 +66,7 @@
|
||||
<div class="form-grid">
|
||||
<label class="field col-5"><span class="field-label">Шаблон</span><select class="select" name="filter_template_id"><option value="0">Не выбран</option>{% for template in filter_template_options %}<option value="{{ template.id }}"{{ settings.filter_template_id == template.id ? ' selected' : '' }}>{{ template.title }} · {{ template.code }}{% if template.is_published %} · v{{ template.version }}{% else %} · черновик{% endif %}</option>{% endfor %}</select><span class="field-hint"><a href="{{ ADMINX_BASE }}/catalog/filter-templates">Редактировать шаблоны фильтров</a></span></label>
|
||||
<label class="field col-4"><span class="field-label">Режим вывода</span><select class="select" name="filter_template_mode"><option value="legacy"{{ settings.filter_template_mode == 'legacy' ? ' selected' : '' }}>Текущий публичный вывод</option><option value="preview"{{ settings.filter_template_mode == 'preview' ? ' selected' : '' }}>Только предпросмотр</option><option value="native"{{ settings.filter_template_mode == 'native' ? ' selected' : '' }}>Опубликованный Twig</option></select><span class="field-hint">«Предпросмотр» не меняет сайт.</span></label>
|
||||
<label class="field col-3"><span class="field-label">Нулевые значения</span><select class="select" name="filter_template[zero_behavior]"><option value="show"{{ settings.filter_template.zero_behavior == 'show' ? ' selected' : '' }}>Показывать</option><option value="disable"{{ settings.filter_template.zero_behavior == 'disable' ? ' selected' : '' }}>Отключать</option><option value="hide"{{ settings.filter_template.zero_behavior == 'hide' ? ' selected' : '' }}>Скрывать</option></select></label>
|
||||
<label class="field col-3"><span class="field-label">Нулевые значения</span><select class="select" name="filter_template[zero_behavior]"><option value="hide"{{ settings.filter_template.zero_behavior == 'hide' ? ' selected' : '' }}>Скрывать</option><option value="disable"{{ settings.filter_template.zero_behavior == 'disable' ? ' selected' : '' }}>Показывать неактивными</option><option value="show"{{ settings.filter_template.zero_behavior == 'show' ? ' selected' : '' }}>Показывать активными</option></select><span class="field-hint">Выбранное значение не скрывается, чтобы фильтр можно было снять.</span></label>
|
||||
<div class="field col-12 catalog-toggle-row"><span><b>Показывать количество товаров</b><small>В Twig значение доступно как <code>option.count</code>.</small></span><label class="switch"><input type="checkbox" name="filter_template[show_counts]" value="1"{{ settings.filter_template.show_counts ? ' checked' : '' }} aria-label="Показывать количество товаров"></label></div>
|
||||
</div>
|
||||
</section>{% endif %}
|
||||
@@ -95,11 +95,12 @@
|
||||
</form>
|
||||
</section>
|
||||
|
||||
{% if can_manage %}<aside class="drawer drawer-right drawer-xl catalog-drawer" id="catalogItemDrawer" role="dialog" aria-modal="true" hidden>
|
||||
{% if can_manage %}<script type="application/json" data-catalog-source-options>{{ source_options|json_encode|raw }}</script><aside class="drawer drawer-right drawer-xl catalog-drawer" id="catalogItemDrawer" role="dialog" aria-modal="true" hidden>
|
||||
<div class="drawer-header"><div><h3 data-catalog-drawer-title>Раздел каталога</h3><p class="text-secondary text-sm">Свойства, поля документа и фильтры.</p></div><button class="btn btn-ghost btn-icon" type="button" data-close-drawer aria-label="Закрыть"><i class="ti ti-x"></i></button></div>
|
||||
<form id="catalogItemForm" class="drawer-body catalog-item-form" data-base="{{ ADMINX_BASE }}" data-rubric="{{ catalog.rubric_id }}" data-field="{{ catalog.field_id }}"><input type="hidden" name="_csrf" value="{{ csrf_token }}"><input type="hidden" name="id" value=""><input type="hidden" name="filters_order" value="">
|
||||
<div class="tabs catalog-drawer-tabs"><button class="tab is-active" type="button" data-catalog-drawer-tab="main">Основное</button><button class="tab" type="button" data-catalog-drawer-tab="fields">Поля <span class="tab-count" data-catalog-fields-count>0</span></button><button class="tab" type="button" data-catalog-drawer-tab="filters">Фильтры <span class="tab-count" data-catalog-filters-count>0</span></button></div>
|
||||
<section data-catalog-drawer-panel="main"><div class="form-grid"><label class="field col-12"><span class="field-label">Название</span><input class="input" type="text" name="name" maxlength="255" required><span class="field-error" data-error="name"></span></label><label class="field col-6"><span class="field-label">Родитель</span><select class="select" name="parent_id"><option value="0">Верхний уровень</option>{% for item in flat %}<option value="{{ item.id }}" data-level="{{ item.level }}">{{ item.name }}</option>{% endfor %}</select></label><div class="field col-6"><span class="field-label">Связанный документ</span><input type="hidden" name="document_id" value=""><div class="catalog-document-picker"><button class="catalog-document-value" type="button" data-catalog-document-pick><i class="ti ti-file-search"></i><span data-catalog-document-label>Документ не выбран</span></button><button class="btn btn-ghost btn-icon" type="button" data-catalog-document-clear data-tooltip="Убрать связь" aria-label="Убрать связанный документ"><i class="ti ti-x"></i></button></div></div><div class="field col-12 catalog-toggle-row"><span><b>Раздел активен</b><small>Доступен в поле документа и на сайте.</small></span><label class="switch"><input type="checkbox" name="status" value="1" aria-label="Раздел активен"></label></div></div></section>
|
||||
<section data-catalog-drawer-panel="main"><div class="form-grid"><label class="field col-12"><span class="field-label">Название</span><input class="input" type="text" name="name" maxlength="255" required><span class="field-error" data-error="name"></span></label><label class="field col-6"><span class="field-label">Родитель</span><select class="select" name="parent_id"><option value="0">Верхний уровень</option>{% for item in flat %}<option value="{{ item.id }}" data-level="{{ item.level }}">{{ item.name }}</option>{% endfor %}</select></label><div class="field col-6"><span class="field-label">Связанный документ</span><input type="hidden" name="document_id" value=""><div class="catalog-document-picker"><button class="catalog-document-value" type="button" data-catalog-document-pick><i class="ti ti-file-search"></i><span data-catalog-document-label>Документ не выбран</span></button><button class="btn btn-ghost btn-icon" type="button" data-catalog-document-clear data-tooltip="Убрать связь" aria-label="Убрать связанный документ"><i class="ti ti-x"></i></button></div></div><div class="field col-12"><span class="field-label">Источники товаров</span><div class="catalog-source-picker" data-catalog-source-picker><div data-catalog-source-inputs></div><button class="catalog-source-value" type="button" data-catalog-source-open{{ not source_schema_available ? ' disabled' : '' }}><i class="ti ti-folders"></i><span data-catalog-source-label>Товары только из этого раздела</span></button><button class="btn btn-ghost btn-icon" type="button" data-catalog-source-clear data-tooltip="Очистить источники" aria-label="Очистить источники" disabled><i class="ti ti-x"></i></button></div><span class="field-hint">Выберите другие разделы, если эта страница должна объединять их товары. Сами разделы и их место в каталоге не изменятся.</span>{% if not source_schema_available %}<span class="field-hint text-danger">Примените миграцию модуля «Каталог», чтобы включить эту настройку.</span>{% endif %}</div><div class="field col-12 catalog-toggle-row"><span><b>Раздел активен</b><small>Включённый раздел доступен в списках и меню; связанный документ можно открыть по прямому адресу независимо от этой настройки.</small></span><label class="switch"><input type="checkbox" name="status" value="1" aria-label="Раздел активен"></label></div></div></section>
|
||||
{% include '@catalog/_context-links.twig' with {context_links: []} %}
|
||||
<section data-catalog-drawer-panel="fields" hidden>
|
||||
<div class="catalog-choice-head catalog-fields-grid"><span>Поле</span><span>Тип</span><span>Включено</span></div>
|
||||
<div class="catalog-field-groups">{% for group in field_groups %}<section class="catalog-field-group" data-catalog-field-group="fields"><div class="catalog-field-group-head"><div class="catalog-field-group-title"><span class="icon-tile catalog-field-group-icon"><i class="ti ti-category-2"></i></span><span class="catalog-field-group-copy"><small>Группа полей</small><b>{{ group.title }}</b></span></div><div class="catalog-field-group-meta"><span>Всего: {{ group.items|length }}</span><span class="badge badge-blue" data-catalog-group-selected>Включено: 0</span></div></div><div class="catalog-check-list">{% for field in group.items %}<div class="catalog-choice-row catalog-fields-grid"><span class="catalog-choice-copy"><b>{{ field.title ?: field.alias }}</b><small>{{ field.alias ?: 'field_' ~ field.id }} · #{{ field.id }}</small></span><span class="catalog-field-type"><b>{{ field.type_title }}</b><small>{{ field.type }}</small></span><label class="switch"><input type="checkbox" name="fields_use[]" value="{{ field.id }}" aria-label="Использовать поле {{ field.title ?: field.alias }}"></label></div>{% endfor %}</div></section>{% endfor %}</div>
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
defined('BASEPATH') || die('Direct access to this location is not allowed.');
|
||||
|
||||
use App\Adminx\Support\PhpCode;
|
||||
use App\Common\PublicConfiguration;
|
||||
use App\Common\TemporaryDirectory;
|
||||
|
||||
class Runner
|
||||
@@ -31,7 +32,8 @@
|
||||
return filter_var($value, FILTER_VALIDATE_BOOLEAN);
|
||||
}
|
||||
|
||||
return false;
|
||||
$config = PublicConfiguration::value('admin_console', array());
|
||||
return is_array($config) && !empty($config['enabled']);
|
||||
}
|
||||
|
||||
public static function execute($code)
|
||||
@@ -144,6 +146,11 @@
|
||||
$candidates[] = $configured;
|
||||
}
|
||||
|
||||
$config = PublicConfiguration::value('admin_console', array());
|
||||
if (is_array($config) && !empty($config['php_binary'])) {
|
||||
$candidates[] = trim((string) $config['php_binary']);
|
||||
}
|
||||
|
||||
if (defined('PHP_BINDIR') && PHP_BINDIR !== '') {
|
||||
$candidates[] = rtrim(PHP_BINDIR, '/\\') . DIRECTORY_SEPARATOR . 'php';
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
return array(
|
||||
'code' => 'console',
|
||||
'name' => 'PHP-консоль',
|
||||
'version' => '0.1.1',
|
||||
'version' => '0.1.2',
|
||||
'registry' => array('dynamic' => true),
|
||||
);
|
||||
}
|
||||
@@ -28,7 +28,7 @@
|
||||
return array(
|
||||
'code' => 'console',
|
||||
'name' => 'PHP-консоль',
|
||||
'version' => '0.1.1',
|
||||
'version' => '0.1.2',
|
||||
'registry' => array('dynamic' => true),
|
||||
'permissions' => array(
|
||||
'key' => 'console',
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<h1>PHP-консоль</h1>
|
||||
<p class="text-secondary">Системный инструмент · изолированный PHP-процесс</p>
|
||||
</div>
|
||||
<span class="badge badge-{{ runner_enabled ? 'orange' : 'red' }} badge-dot">{{ runner_enabled ? 'Локальное выполнение' : 'Выполнение отключено' }}</span>
|
||||
<span class="badge badge-{{ runner_enabled ? 'orange' : 'red' }} badge-dot">{{ runner_enabled ? 'Выполнение включено' : 'Выполнение отключено' }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -102,7 +102,9 @@
|
||||
public function toggle(array $params=array())
|
||||
{
|
||||
if(($e=$this->guard())!==null){return $e;}
|
||||
try{$active=Model::toggle(isset($params['id'])?$params['id']:0,Auth::id());}catch(\InvalidArgumentException $e){return $this->error($e->getMessage(),array(),422);}
|
||||
$id=isset($params['id'])?(int)$params['id']:0;
|
||||
try{$active=Model::toggle($id,Auth::id());}catch(\InvalidArgumentException $e){return $this->error($e->getMessage(),array(),422);}
|
||||
AuditLog::record('customers.status_changed',array('actor_id'=>Auth::id(),'target_type'=>'public_user','target_id'=>$id,'meta'=>array('active'=>$active)));
|
||||
return $this->success($active?'Пользователь включён':'Пользователь отключён');
|
||||
}
|
||||
|
||||
@@ -119,6 +121,7 @@
|
||||
$id=isset($params['id'])?(int)$params['id']:0;$input=Request::postAll();
|
||||
if(!Permission::check('manage_users')){$current=Model::customer($id,Auth::id());$input['admin_access']=!empty($current['system']['is_active'])?'1':'';$input['admin_role']=!empty($current['system']['role'])?(string)$current['system']['role']:'manager';}
|
||||
try{$customer=Model::updateCustomer($id,$input,Auth::id());}catch(\InvalidArgumentException $e){return $this->error($e->getMessage(),array(),422);}catch(\Throwable $e){return $this->error('Не удалось сохранить пользователя',array(),500);}
|
||||
AuditLog::record('customers.updated',array('actor_id'=>Auth::id(),'target_type'=>'public_user','target_id'=>$id));
|
||||
return $this->success('Профиль пользователя сохранён',array('data'=>$customer));
|
||||
}
|
||||
|
||||
@@ -128,14 +131,17 @@
|
||||
return $e;
|
||||
}
|
||||
|
||||
$id = isset($params['id']) ? (int) $params['id'] : 0;
|
||||
try {
|
||||
Model::deleteCustomer(isset($params['id']) ? $params['id'] : 0, Auth::id());
|
||||
Model::deleteCustomer($id, Auth::id());
|
||||
} catch (\InvalidArgumentException $e) {
|
||||
return $this->error($e->getMessage(), array(), 422);
|
||||
} catch (\Throwable $e) {
|
||||
return $this->error('Не удалось удалить пользователя', array(), 500);
|
||||
}
|
||||
|
||||
AuditLog::record('customers.deleted', array('actor_id' => Auth::id(), 'target_type' => 'public_user', 'target_id' => $id));
|
||||
|
||||
return $this->success('Пользователь удалён', array('reload' => true));
|
||||
}
|
||||
|
||||
@@ -143,10 +149,10 @@
|
||||
public function deleteField(array $params=array()){if(($e=$this->guard())!==null){return $e;}Model::deleteField(isset($params['id'])?$params['id']:0);return $this->success('Поле удалено',array('reload'=>true));}
|
||||
public function toggleField(array $params=array()){if(($e=$this->guard())!==null){return $e;}$active=Model::toggleField(isset($params['id'])?$params['id']:0);return $this->success($active?'Поле включено':'Поле скрыто',array('data'=>array('is_active'=>$active?1:0)));}
|
||||
public function reorderFields(array $params=array()){if(($e=$this->guard())!==null){return $e;}$ids=json_decode(Request::postStr('order','[]'),true);if(!is_array($ids)){return $this->error('Некорректный порядок полей',array(),422);}$count=Model::reorderFields($ids);return $this->success('Порядок полей сохранён',array('data'=>array('count'=>$count)));}
|
||||
public function saveAuthSettings(array $params=array()){if(($e=$this->guard())!==null){return $e;}try{$settings=Model::saveAuthSettings(Request::postAll());}catch(\Throwable $e){return $this->error($e->getMessage(),array(),422);}return $this->success('Настройки регистрации сохранены',array('data'=>array('settings'=>$settings)));}
|
||||
public function saveAuthPages(array $params=array()){if(($e=$this->guard())!==null){return $e;}try{$settings=Model::saveAuthPages(Request::postAll());}catch(\Throwable $e){return $this->error($e->getMessage(),array(),422);}return $this->success('Страницы входа сохранены',array('data'=>array('settings'=>$settings)));}
|
||||
public function saveAuthSettings(array $params=array()){if(($e=$this->guard())!==null){return $e;}try{$settings=Model::saveAuthSettings(Request::postAll());}catch(\Throwable $e){return $this->error($e->getMessage(),array(),422);}AuditLog::record('customers.auth_settings_updated',array('actor_id'=>Auth::id(),'target_type'=>'public_auth'));return $this->success('Настройки регистрации сохранены',array('data'=>array('settings'=>$settings)));}
|
||||
public function saveAuthPages(array $params=array()){if(($e=$this->guard())!==null){return $e;}try{$settings=Model::saveAuthPages(Request::postAll());}catch(\Throwable $e){return $this->error($e->getMessage(),array(),422);}AuditLog::record('customers.auth_pages_updated',array('actor_id'=>Auth::id(),'target_type'=>'public_auth'));return $this->success('Страницы входа сохранены',array('data'=>array('settings'=>$settings)));}
|
||||
public function authForm(array $params=array()){if(!Permission::check('view_customers')){return $this->error('Недостаточно прав',array(),403);}try{$form=Model::authForm(isset($params['key'])?(string)$params['key']:'');}catch(\Throwable $e){return $this->error($e->getMessage(),array(),404);}return $this->success('',array('data'=>$form));}
|
||||
public function saveAuthForm(array $params=array()){if(($e=$this->guard())!==null){return $e;}try{$template=Model::saveAuthForm(isset($params['key'])?(string)$params['key']:'',Request::postStr('template',''),Auth::id());}catch(\Throwable $e){return $this->error($e->getMessage(),array('template'=>$e->getMessage()),422);}return $this->success('Шаблон формы сохранён',array('data'=>array('template'=>$template,'customized'=>1)));}
|
||||
public function resetAuthForm(array $params=array()){if(($e=$this->guard())!==null){return $e;}try{$template=Model::resetAuthForm(isset($params['key'])?(string)$params['key']:'');}catch(\Throwable $e){return $this->error($e->getMessage(),array(),422);}return $this->success('Восстановлен штатный шаблон формы',array('data'=>array('template'=>$template,'customized'=>0)));}
|
||||
public function saveAuthForm(array $params=array()){if(($e=$this->guard())!==null){return $e;}$key=isset($params['key'])?(string)$params['key']:'';try{$template=Model::saveAuthForm($key,Request::postStr('template',''),Auth::id());}catch(\Throwable $e){return $this->error($e->getMessage(),array('template'=>$e->getMessage()),422);}AuditLog::record('customers.auth_form_updated',array('actor_id'=>Auth::id(),'target_type'=>'public_auth_form','meta'=>array('form'=>$key)));return $this->success('Шаблон формы сохранён',array('data'=>array('template'=>$template,'customized'=>1)));}
|
||||
public function resetAuthForm(array $params=array()){if(($e=$this->guard())!==null){return $e;}$key=isset($params['key'])?(string)$params['key']:'';try{$template=Model::resetAuthForm($key);}catch(\Throwable $e){return $this->error($e->getMessage(),array(),422);}AuditLog::record('customers.auth_form_reset',array('actor_id'=>Auth::id(),'target_type'=>'public_auth_form','meta'=>array('form'=>$key)));return $this->success('Восстановлен штатный шаблон формы',array('data'=>array('template'=>$template,'customized'=>0)));}
|
||||
protected function guard(){return $this->guardPermission('manage_customers');}
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
. ($orderJoin !== '' ? 'COALESCE(orders.orders_count,0)' : '0') . ' orders_count,'
|
||||
. ($orderJoin !== '' ? 'COALESCE(orders.orders_total,0)' : '0') . ' orders_total,'
|
||||
. ($orderJoin !== '' ? 'COALESCE(orders.last_order_at,0)' : '0') . ' last_order_at'
|
||||
. ' FROM ' . $users . ' u' . $orderJoin . ' WHERE u.deleted!=%s';
|
||||
. ' FROM ' . $users . ' u' . $orderJoin . ' WHERE COALESCE(u.deleted,0)!=%s';
|
||||
$args = array('1');
|
||||
if ($query !== '') {
|
||||
$sql .= ' AND (u.email LIKE %ss OR u.firstname LIKE %ss OR u.lastname LIKE %ss OR u.user_name LIKE %ss OR u.phone LIKE %ss OR u.company LIKE %ss';
|
||||
@@ -78,7 +78,7 @@
|
||||
$users = PublicUserTables::table('users');
|
||||
$orders = BasketTables::table('module_basket_history');
|
||||
$result = array(
|
||||
'total' => (int) DB::query('SELECT COUNT(*) FROM ' . $users . ' WHERE deleted!=%s', '1')->getValue(),
|
||||
'total' => (int) DB::query('SELECT COUNT(*) FROM ' . $users . ' WHERE COALESCE(deleted,0)!=%s', '1')->getValue(),
|
||||
'buyers' => 0, 'repeat' => 0, 'duplicates' => count(self::duplicateGroups()),
|
||||
);
|
||||
if (DatabaseSchema::tableExists($orders)) {
|
||||
@@ -169,10 +169,10 @@
|
||||
{
|
||||
$table = PublicUserTables::table('users'); $groups = array();
|
||||
$queries = array(
|
||||
'email' => "SELECT LOWER(TRIM(email)) duplicate_value,GROUP_CONCAT(Id ORDER BY Id) ids,COUNT(*) amount FROM $table WHERE deleted!='1' AND email!='' GROUP BY LOWER(TRIM(email)) HAVING COUNT(*)>1 LIMIT 30",
|
||||
'email' => "SELECT LOWER(TRIM(email)) duplicate_value,GROUP_CONCAT(Id ORDER BY Id) ids,COUNT(*) amount FROM $table WHERE COALESCE(deleted,0)!='1' AND email!='' GROUP BY LOWER(TRIM(email)) HAVING COUNT(*)>1 LIMIT 30",
|
||||
);
|
||||
if (DatabaseSchema::columnExists($table, 'phone_normalized')) {
|
||||
$queries['phone'] = "SELECT phone_normalized duplicate_value,GROUP_CONCAT(Id ORDER BY Id) ids,COUNT(*) amount FROM $table WHERE deleted!='1' AND phone_normalized IS NOT NULL GROUP BY phone_normalized HAVING COUNT(*)>1 LIMIT 30";
|
||||
$queries['phone'] = "SELECT phone_normalized duplicate_value,GROUP_CONCAT(Id ORDER BY Id) ids,COUNT(*) amount FROM $table WHERE COALESCE(deleted,0)!='1' AND phone_normalized IS NOT NULL GROUP BY phone_normalized HAVING COUNT(*)>1 LIMIT 30";
|
||||
}
|
||||
|
||||
foreach ($queries as $kind => $sql) {
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
{
|
||||
$query = trim((string) $query); if ($query === '') { return array(); }
|
||||
$sql = 'SELECT Id,email,firstname,lastname,user_name,phone,company,status FROM ' . PublicUserTables::table('users')
|
||||
. ' WHERE deleted!=%s AND (email LIKE %ss OR firstname LIKE %ss OR lastname LIKE %ss OR user_name LIKE %ss OR phone LIKE %ss OR company LIKE %ss';
|
||||
. ' WHERE COALESCE(deleted,0)!=%s AND (email LIKE %ss OR firstname LIKE %ss OR lastname LIKE %ss OR user_name LIKE %ss OR phone LIKE %ss OR company LIKE %ss';
|
||||
$args = array('1', $query, $query, $query, $query, $query, $query);
|
||||
if (ctype_digit($query)) { $sql .= ' OR Id=%i'; $args[] = (int) $query; }
|
||||
$sql .= ') ORDER BY status DESC,Id DESC LIMIT ' . max(1, min(12, (int) $limit));
|
||||
|
||||
@@ -35,15 +35,15 @@
|
||||
{
|
||||
public static function customers($q='')
|
||||
{
|
||||
$sql='SELECT Id AS id,email,firstname,lastname,user_name,phone,company,status,reg_time,last_visit FROM '.self::table('users').' WHERE deleted!=%s';$args=array('1');$q=trim((string)$q);
|
||||
if($q!==''){$sql.=' AND (email LIKE %ss OR firstname LIKE %ss OR lastname LIKE %ss OR phone LIKE %ss OR company LIKE %ss)';for($i=0;$i<5;$i++){$args[]=$q;}}$sql.=' ORDER BY Id DESC LIMIT 500';return call_user_func_array(array('DB','query'),array_merge(array($sql),$args))->getAll()?:array();
|
||||
$sql='SELECT Id AS id,email,firstname,lastname,user_name,phone,company,status,reg_time,last_visit FROM '.self::table('users').' WHERE COALESCE(deleted,0)!=%s';$args=array('1');$q=trim((string)$q);
|
||||
if($q!==''){$sql.=' AND (email LIKE %ss OR firstname LIKE %ss OR lastname LIKE %ss OR user_name LIKE %ss OR phone LIKE %ss OR company LIKE %ss';for($i=0;$i<6;$i++){$args[]=$q;}if(ctype_digit($q)){$sql.=' OR Id=%i';$args[]=(int)$q;}$sql.=')';}$sql.=' ORDER BY Id DESC LIMIT 500';return call_user_func_array(array('DB','query'),array_merge(array($sql),$args))->getAll()?:array();
|
||||
}
|
||||
|
||||
public static function exportChunk($q, $beforeId, $limit = 500)
|
||||
{
|
||||
$sql = 'SELECT Id AS id,email,firstname,lastname,user_name,phone,company,status,reg_time,last_visit FROM ' . self::table('users') . ' WHERE deleted!=%s';
|
||||
$sql = 'SELECT Id AS id,email,firstname,lastname,user_name,phone,company,status,reg_time,last_visit FROM ' . self::table('users') . ' WHERE COALESCE(deleted,0)!=%s';
|
||||
$args = array('1'); $q = trim((string) $q);
|
||||
if ($q !== '') { $sql .= ' AND (email LIKE %ss OR firstname LIKE %ss OR lastname LIKE %ss OR phone LIKE %ss OR company LIKE %ss)'; for ($i = 0; $i < 5; $i++) { $args[] = $q; } }
|
||||
if ($q !== '') { $sql .= ' AND (email LIKE %ss OR firstname LIKE %ss OR lastname LIKE %ss OR user_name LIKE %ss OR phone LIKE %ss OR company LIKE %ss)'; for ($i = 0; $i < 6; $i++) { $args[] = $q; } }
|
||||
if ((int) $beforeId > 0) { $sql .= ' AND Id<%i'; $args[] = (int) $beforeId; }
|
||||
$sql .= ' ORDER BY Id DESC LIMIT ' . max(1, min(1000, (int) $limit));
|
||||
return call_user_func_array(array('DB', 'query'), array_merge(array($sql), $args))->getAll() ?: array();
|
||||
@@ -51,7 +51,7 @@
|
||||
|
||||
public static function stats()
|
||||
{
|
||||
$table=self::table('users');return array('total'=>(int)DB::query('SELECT COUNT(*) FROM '.$table.' WHERE deleted!=%s','1')->getValue(),'active'=>(int)DB::query('SELECT COUNT(*) FROM '.$table.' WHERE deleted!=%s AND status=%s','1','1')->getValue(),'verified'=>(int)DB::query('SELECT COUNT(*) FROM '.$table.' WHERE deleted!=%s AND (email_verified_at>0 OR phone_verified_at>0)','1')->getValue(),'fields'=>count(self::fields()));
|
||||
$table=self::table('users');return array('total'=>(int)DB::query('SELECT COUNT(*) FROM '.$table.' WHERE COALESCE(deleted,0)!=%s','1')->getValue(),'active'=>(int)DB::query('SELECT COUNT(*) FROM '.$table.' WHERE COALESCE(deleted,0)!=%s AND status=%s','1','1')->getValue(),'verified'=>(int)DB::query('SELECT COUNT(*) FROM '.$table.' WHERE COALESCE(deleted,0)!=%s AND (email_verified_at>0 OR phone_verified_at>0)','1')->getValue(),'fields'=>count(self::fields()));
|
||||
}
|
||||
|
||||
public static function toggle($id, $currentSystemId = 0)
|
||||
@@ -65,7 +65,7 @@
|
||||
throw new \InvalidArgumentException('Нельзя отключить собственную учётную запись');
|
||||
}
|
||||
|
||||
DB::query('UPDATE '.self::table('users')." SET status=IF(status='1','0','1') WHERE Id=%i AND deleted!=%s",(int)$id,'1');
|
||||
DB::query('UPDATE '.self::table('users')." SET status=IF(status='1','0','1') WHERE Id=%i AND COALESCE(deleted,0)!=%s",(int)$id,'1');
|
||||
$active=(string)DB::query('SELECT status FROM '.self::table('users').' WHERE Id=%i',(int)$id)->getValue()==='1';
|
||||
if(!$active){self::invalidateCustomerSessions((int)$id);}
|
||||
return $active;
|
||||
@@ -73,9 +73,25 @@
|
||||
|
||||
public static function customer($id, $currentSystemId = 0)
|
||||
{
|
||||
$row=DB::query('SELECT Id AS id,email,email_verified_at,firstname,lastname,user_name,phone,phone_normalized,phone_verified_at,company,city,street,street_nr,zipcode,birthday,description,user_group,status,reg_time,last_visit FROM '.self::table('users').' WHERE Id=%i AND deleted!=%s LIMIT 1',(int)$id,'1')->getAssoc();
|
||||
if(!$row){return null;}
|
||||
$row=(array)$row;
|
||||
$source = (new UserRepository())->find((int) $id);
|
||||
if (!$source) { return null; }
|
||||
|
||||
$defaults = array(
|
||||
'email' => null, 'email_verified_at' => 0, 'firstname' => '', 'lastname' => '',
|
||||
'user_name' => '', 'phone' => '', 'phone_normalized' => null, 'phone_verified_at' => 0,
|
||||
'company' => '', 'city' => '', 'street' => '', 'street_nr' => '', 'zipcode' => '',
|
||||
'birthday' => '', 'description' => '', 'user_group' => 0, 'status' => '0',
|
||||
'reg_time' => 0, 'last_visit' => 0,
|
||||
);
|
||||
$row = array('id' => (int) $source['Id']);
|
||||
foreach ($defaults as $key => $default) {
|
||||
$row[$key] = array_key_exists($key, $source) ? $source[$key] : $default;
|
||||
}
|
||||
|
||||
if (empty($row['phone_normalized']) && !empty($row['phone'])) {
|
||||
$row['phone_normalized'] = Phone::normalize($row['phone']);
|
||||
}
|
||||
|
||||
$row['birthday']=(int)$row['birthday']>0?date('Y-m-d',(int)$row['birthday']):'';
|
||||
$values=DB::query('SELECT field_id,value FROM '.self::table('user_profile_values').' WHERE user_id=%i',(int)$id)->getAll()?:array();
|
||||
$extra=array();
|
||||
@@ -137,9 +153,9 @@
|
||||
if($email===''&&$phone===''){throw new \InvalidArgumentException('Укажите email или телефон');}
|
||||
if($adminAccess&&$email===''){throw new \InvalidArgumentException('Для доступа в панель управления укажите email');}
|
||||
if(mb_strlen($email)>100||mb_strlen($userName)>50||mb_strlen($firstName)>50||mb_strlen($lastName)>50){throw new \InvalidArgumentException('Имя, email или логин превышают допустимую длину');}
|
||||
if($email!==''&&DB::query('SELECT Id FROM '.self::table('users').' WHERE LOWER(email)=LOWER(%s) AND Id!=%i AND deleted!=%s LIMIT 1',$email,$id,'1')->getValue()){throw new \InvalidArgumentException('Этот email уже используется');}
|
||||
if($phone!==''&&DB::query('SELECT Id FROM '.self::table('users').' WHERE phone_normalized=%s AND Id!=%i AND deleted!=%s LIMIT 1',$phone,$id,'1')->getValue()){throw new \InvalidArgumentException('Этот телефон уже используется');}
|
||||
if(DB::query('SELECT Id FROM '.self::table('users').' WHERE LOWER(user_name)=LOWER(%s) AND Id!=%i AND deleted!=%s LIMIT 1',$userName,$id,'1')->getValue()){throw new \InvalidArgumentException('Этот логин уже используется');}
|
||||
if($email!==''&&DB::query('SELECT Id FROM '.self::table('users').' WHERE LOWER(email)=LOWER(%s) AND Id!=%i AND COALESCE(deleted,0)!=%s LIMIT 1',$email,$id,'1')->getValue()){throw new \InvalidArgumentException('Этот email уже используется');}
|
||||
if($phone!==''&&DB::query('SELECT Id FROM '.self::table('users').' WHERE phone_normalized=%s AND Id!=%i AND COALESCE(deleted,0)!=%s LIMIT 1',$phone,$id,'1')->getValue()){throw new \InvalidArgumentException('Этот телефон уже используется');}
|
||||
if(DB::query('SELECT Id FROM '.self::table('users').' WHERE LOWER(user_name)=LOWER(%s) AND Id!=%i AND COALESCE(deleted,0)!=%s LIMIT 1',$userName,$id,'1')->getValue()){throw new \InvalidArgumentException('Этот логин уже используется');}
|
||||
$groupIds=array_map(function($item){return (int)$item['id'];},self::groups());
|
||||
if(!in_array($group,$groupIds,true)){throw new \InvalidArgumentException('Выберите активную группу публичных пользователей');}
|
||||
$authSettings=PublicAuthSettings::all();
|
||||
@@ -175,7 +191,10 @@
|
||||
self::saveExtraValues($id,$extra);
|
||||
if($password!==''){(new UserRepository())->setPassword($id,$password);}
|
||||
IdentityLinker::setAdminAccess($id,$adminAccess,$adminRole,(int)$currentSystemId);
|
||||
if($password!==''||$active!=='1'){self::invalidateCustomerSessions($id);}
|
||||
$securityChanged=$password!==''||$active!==(string)$current['user']['status']
|
||||
||$group!==(int)$current['user']['user_group']||$email!==mb_strtolower(trim((string)$current['user']['email']))
|
||||
||$phone!==(string)$current['user']['phone_normalized']||$userName!==(string)$current['user']['user_name'];
|
||||
if($securityChanged){self::invalidateCustomerSessions($id);}
|
||||
DB::commit();
|
||||
}catch(\Throwable $e){DB::rollback();throw $e;}
|
||||
return self::customer($id);
|
||||
|
||||
@@ -398,6 +398,7 @@
|
||||
syncRegistrationGate: function () {
|
||||
var gate = document.querySelector('[data-registration-gate]');
|
||||
var hasEmail = gate && gate.value !== 'phone';
|
||||
var phoneOnly = gate && gate.value === 'phone';
|
||||
var emailAndPhone = gate && gate.value === 'email_phone';
|
||||
var description = document.querySelector('[data-auth-email-field-description]');
|
||||
var visibility = document.querySelector('[data-auth-email-visibility]');
|
||||
@@ -406,12 +407,16 @@
|
||||
document.querySelectorAll('[data-auth-email-registration], [data-auth-email-form-fields], [data-auth-email-settings]').forEach(function (section) {
|
||||
section.hidden = !hasEmail;
|
||||
});
|
||||
if (description) { description.textContent = emailAndPhone ? 'Запрашивается только при выборе регистрации по email' : 'Логин и канал подтверждения регистрации по email'; }
|
||||
if (visibility) { visibility.textContent = emailAndPhone ? 'В email-форме' : 'Показывается'; }
|
||||
if (description) { description.textContent = phoneOnly ? 'Не используется для входа; можно добавить в профиле как контакт' : (emailAndPhone ? 'Запрашивается только при выборе регистрации по email' : 'Логин и канал подтверждения регистрации по email'); }
|
||||
if (visibility) {
|
||||
visibility.textContent = phoneOnly ? 'Только в профиле' : (emailAndPhone ? 'В email-форме' : 'Показывается');
|
||||
visibility.classList.toggle('badge-blue', !phoneOnly);
|
||||
visibility.classList.toggle('badge-gray', phoneOnly);
|
||||
}
|
||||
if (required) {
|
||||
required.textContent = emailAndPhone ? 'По выбору способа' : 'Обязательно';
|
||||
required.classList.toggle('badge-blue', !emailAndPhone);
|
||||
required.classList.toggle('badge-gray', emailAndPhone);
|
||||
required.textContent = phoneOnly ? 'Необязательно' : (emailAndPhone ? 'По выбору способа' : 'Обязательно');
|
||||
required.classList.toggle('badge-blue', !phoneOnly && !emailAndPhone);
|
||||
required.classList.toggle('badge-gray', phoneOnly || emailAndPhone);
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
use App\Adminx\Customers\GlobalSearchProvider;
|
||||
|
||||
return array(
|
||||
'code' => 'customers', 'name' => 'Пользователи сайта', 'version' => '0.10.2',
|
||||
'code' => 'customers', 'name' => 'Пользователи сайта', 'version' => '0.10.4',
|
||||
'permissions' => array('key' => 'customers', 'items' => array(
|
||||
array(
|
||||
'code' => 'view_customers',
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
<section class="card customers-auth-section">
|
||||
<div class="ax-list-head"><div class="ax-list-title"><span class="icon-tile" style="--tile-bg:var(--green-100);--tile-fg:var(--green-600)"><i class="ti ti-user-plus"></i></span><div><h2>Создание аккаунта</h2><p class="text-secondary">Кто может зарегистрироваться и когда станет доступен вход.</p></div></div><label class="switch" data-tooltip="Разрешить регистрацию"><input type="checkbox" name="registration_enabled" value="1"{{ auth_settings.registration_enabled ? ' checked' : '' }}{{ can_manage ? '' : ' disabled' }}><span></span></label></div>
|
||||
<div class="customers-auth-settings-grid">
|
||||
<label class="field"><span class="field-label">Способы регистрации</span><select class="select" name="registration_gate" data-registration-gate{{ can_manage ? '' : ' disabled' }}><option value="email"{{ auth_settings.registration_gate=='email' ? ' selected' : '' }}>По email</option><option value="phone"{{ auth_settings.registration_gate=='phone' ? ' selected' : '' }}>По телефону</option><option value="email_phone"{{ auth_settings.registration_gate=='email_phone' ? ' selected' : '' }}>По email или телефону</option></select><span class="field-hint">Телефонная регистрация появится после подключения SMS-провайдера. Email для такого аккаунта не требуется.</span></label>
|
||||
<label class="field"><span class="field-label">Способ входа и регистрации</span><select class="select" name="registration_gate" data-registration-gate{{ can_manage ? '' : ' disabled' }}><option value="email"{{ auth_settings.registration_gate=='email' ? ' selected' : '' }}>По email и паролю</option><option value="phone"{{ auth_settings.registration_gate=='phone' ? ' selected' : '' }}>По телефону и SMS-коду</option><option value="email_phone"{{ auth_settings.registration_gate=='email_phone' ? ' selected' : '' }}>Оба способа</option></select><span class="field-hint">В телефонном режиме email остаётся необязательным контактом профиля и не используется для публичного входа.</span></label>
|
||||
<label class="field" data-auth-email-registration><span class="field-label">Активация регистрации по email</span><select class="select" name="registration_mode" data-registration-mode{{ can_manage ? '' : ' disabled' }}><option value="email"{{ auth_settings.registration_mode=='email' ? ' selected' : '' }}>После подтверждения email</option><option value="now"{{ auth_settings.registration_mode=='now' ? ' selected' : '' }}>Сразу после регистрации</option><option value="byadmin"{{ auth_settings.registration_mode=='byadmin' ? ' selected' : '' }}>После одобрения администратором</option></select><span class="field-hint">Телефон уже подтверждается одноразовым SMS-кодом.</span></label>
|
||||
<label class="field"><span class="field-label">Группа после регистрации</span><select class="select" name="default_group"{{ can_manage ? '' : ' disabled' }}>{% for group in customer_groups %}<option value="{{ group.id }}"{{ auth_settings.default_group==group.id ? ' selected' : '' }}>#{{ group.id }} · {{ group.name }} · {{ group.permissions_count }} разрешений</option>{% endfor %}</select><span class="field-hint">Вы сами выбираете группу, которая будет назначаться новым пользователям сайта.</span></label>
|
||||
</div>
|
||||
@@ -83,7 +83,7 @@
|
||||
<div class="ax-list-head"><div class="ax-list-title"><span class="icon-tile" style="--tile-bg:var(--cyan-100);--tile-fg:var(--cyan-600)"><i class="ti ti-forms"></i></span><div><h2>Поля регистрации по email</h2><p class="text-secondary">Для регистрации по телефону достаточно номера и SMS-кода. Остальные данные пользователь заполнит в профиле.</p></div></div></div>
|
||||
<div class="customers-auth-fields" data-auth-fields>
|
||||
<div class="customers-auth-fields-head"><span>Поле</span><span>Показывать</span><span>Обязательное</span></div>
|
||||
<div class="customers-auth-field-row"><span><i class="ti ti-mail"></i><span><b>Email</b><small data-auth-email-field-description>{{ auth_settings.registration_gate == 'email_phone' ? 'Запрашивается только при выборе регистрации по email' : 'Логин и канал подтверждения регистрации по email' }}</small></span></span><span class="badge badge-blue" data-auth-email-visibility>{{ auth_settings.registration_gate == 'email_phone' ? 'В email-форме' : 'Показывается' }}</span><span class="badge {{ auth_settings.registration_gate == 'email_phone' ? 'badge-gray' : 'badge-blue' }}" data-auth-email-required>{{ auth_settings.registration_gate == 'email_phone' ? 'По выбору способа' : 'Обязательно' }}</span></div>
|
||||
<div class="customers-auth-field-row"><span><i class="ti ti-mail"></i><span><b>Email</b><small data-auth-email-field-description>{{ auth_settings.registration_gate == 'phone' ? 'Не используется для входа; можно добавить в профиле как контакт' : (auth_settings.registration_gate == 'email_phone' ? 'Запрашивается только при выборе регистрации по email' : 'Логин и канал подтверждения регистрации по email') }}</small></span></span><span class="badge {{ auth_settings.registration_gate == 'phone' ? 'badge-gray' : 'badge-blue' }}" data-auth-email-visibility>{{ auth_settings.registration_gate == 'phone' ? 'Только в профиле' : (auth_settings.registration_gate == 'email_phone' ? 'В email-форме' : 'Показывается') }}</span><span class="badge {{ auth_settings.registration_gate == 'email' ? 'badge-blue' : 'badge-gray' }}" data-auth-email-required>{{ auth_settings.registration_gate == 'phone' ? 'Необязательно' : (auth_settings.registration_gate == 'email_phone' ? 'По выбору способа' : 'Обязательно') }}</span></div>
|
||||
<div class="customers-auth-field-row"><span><i class="ti ti-user"></i><span><b>Имя</b><small>Основное имя пользователя</small></span></span><span class="badge badge-blue">Всегда</span><label class="switch"><input type="checkbox" name="require_firstname" value="1"{{ auth_settings.require_firstname ? ' checked' : '' }}{{ can_manage ? '' : ' disabled' }}><span></span></label></div>
|
||||
<div class="customers-auth-field-row" data-auth-field-row><span><i class="ti ti-id"></i><span><b>Фамилия</b><small>Дополняет отображаемое имя</small></span></span><label class="switch"><input type="checkbox" name="show_lastname" value="1" data-auth-show{{ auth_settings.show_lastname ? ' checked' : '' }}{{ can_manage ? '' : ' disabled' }}><span></span></label><label class="switch"><input type="checkbox" name="require_lastname" value="1" data-auth-required{{ auth_settings.require_lastname ? ' checked' : '' }}{{ can_manage ? '' : ' disabled' }}><span></span></label></div>
|
||||
<div class="customers-auth-field-row" data-auth-field-row><span><i class="ti ti-phone"></i><span><b>Телефон</b><small>Контакт для заказов и доставки</small></span></span><label class="switch"><input type="checkbox" name="show_phone" value="1" data-auth-show{{ auth_settings.show_phone ? ' checked' : '' }}{{ can_manage ? '' : ' disabled' }}><span></span></label><label class="switch"><input type="checkbox" name="require_phone" value="1" data-auth-required{{ auth_settings.require_phone ? ' checked' : '' }}{{ can_manage ? '' : ' disabled' }}><span></span></label></div>
|
||||
@@ -177,7 +177,7 @@
|
||||
<div class="drawer-body">
|
||||
<div class="customers-editor-meta"><span><i class="ti ti-id"></i><b data-customer-meta-id>#—</b></span><span><i class="ti ti-user-plus"></i><b data-customer-meta-created>—</b><small>Регистрация</small></span><span><i class="ti ti-clock"></i><b data-customer-meta-visit>—</b><small>Последний вход</small></span></div>
|
||||
<div class="customers-editor-sections">
|
||||
<section class="customers-form-section"><div class="customers-form-section-head"><span class="icon-tile" style="--tile-bg:var(--blue-100);--tile-fg:var(--blue-600)"><i class="ti ti-user"></i></span><div><b>Основные данные</b><span>Имя, контакты и данные организации.</span></div></div><div class="form-grid"><label class="field col-6"><span class="field-label">Имя</span><span class="input-wrap customers-editor-input"><i class="ti ti-user"></i><input class="input" name="firstname" maxlength="50"></span></label><label class="field col-6"><span class="field-label">Фамилия</span><span class="input-wrap customers-editor-input"><i class="ti ti-user"></i><input class="input" name="lastname" maxlength="50"></span></label><label class="field col-6"><span class="field-label">Email</span><span class="input-wrap customers-editor-input"><i class="ti ti-mail"></i><input class="input" type="email" name="email" maxlength="100" required></span></label><label class="field col-6"><span class="field-label">Логин</span><span class="input-wrap customers-editor-input"><i class="ti ti-at"></i><input class="input mono" name="user_name" maxlength="50" required></span><span class="field-hint">Можно использовать для входа наравне с email.</span></label><label class="field col-6"><span class="field-label">Телефон</span><span class="input-wrap customers-editor-input"><i class="ti ti-phone"></i><input class="input" type="tel" name="phone" maxlength="50"></span></label><label class="field col-6"><span class="field-label">Компания</span><span class="input-wrap customers-editor-input"><i class="ti ti-building"></i><input class="input" name="company" maxlength="255"></span></label><label class="field col-4"><span class="field-label">Дата рождения</span><span class="input-wrap customers-editor-input"><i class="ti ti-calendar"></i><input class="input" type="date" name="birthday"></span></label><label class="field col-8"><span class="field-label">О пользователе</span><textarea class="textarea" name="description" rows="2"></textarea></label></div></section>
|
||||
<section class="customers-form-section"><div class="customers-form-section-head"><span class="icon-tile" style="--tile-bg:var(--blue-100);--tile-fg:var(--blue-600)"><i class="ti ti-user"></i></span><div><b>Основные данные</b><span>Имя, контакты и данные организации.</span></div></div><div class="form-grid"><label class="field col-6"><span class="field-label">Имя</span><span class="input-wrap customers-editor-input"><i class="ti ti-user"></i><input class="input" name="firstname" maxlength="50"></span></label><label class="field col-6"><span class="field-label">Фамилия</span><span class="input-wrap customers-editor-input"><i class="ti ti-user"></i><input class="input" name="lastname" maxlength="50"></span></label><label class="field col-6"><span class="field-label">Email</span><span class="input-wrap customers-editor-input"><i class="ti ti-mail"></i><input class="input" type="email" name="email" maxlength="100"></span><span class="field-hint">Для аккаунта с подтверждённым телефоном необязателен.</span></label><label class="field col-6"><span class="field-label">Логин</span><span class="input-wrap customers-editor-input"><i class="ti ti-at"></i><input class="input mono" name="user_name" maxlength="50" required></span><span class="field-hint">Системный идентификатор аккаунта; при регистрации по телефону заполняется номером.</span></label><label class="field col-6"><span class="field-label">Телефон</span><span class="input-wrap customers-editor-input"><i class="ti ti-phone"></i><input class="input" type="tel" name="phone" maxlength="50"></span></label><label class="field col-6"><span class="field-label">Компания</span><span class="input-wrap customers-editor-input"><i class="ti ti-building"></i><input class="input" name="company" maxlength="255"></span></label><label class="field col-4"><span class="field-label">Дата рождения</span><span class="input-wrap customers-editor-input"><i class="ti ti-calendar"></i><input class="input" type="date" name="birthday"></span></label><label class="field col-8"><span class="field-label">О пользователе</span><textarea class="textarea" name="description" rows="2"></textarea></label></div></section>
|
||||
<section class="customers-form-section"><div class="customers-form-section-head"><span class="icon-tile" style="--tile-bg:var(--cyan-100);--tile-fg:var(--cyan-600)"><i class="ti ti-map-pin"></i></span><div><b>Адрес</b><span>Данные для профиля и предзаполнения заказов.</span></div></div><div class="form-grid"><label class="field col-4"><span class="field-label">Город</span><span class="input-wrap customers-editor-input"><i class="ti ti-building-community"></i><input class="input" name="city"></span></label><label class="field col-4"><span class="field-label">Улица</span><span class="input-wrap customers-editor-input"><i class="ti ti-road"></i><input class="input" name="street"></span></label><label class="field col-2"><span class="field-label">Дом</span><span class="input-wrap customers-editor-input"><i class="ti ti-home"></i><input class="input" name="street_nr"></span></label><label class="field col-2"><span class="field-label">Индекс</span><span class="input-wrap customers-editor-input"><i class="ti ti-mailbox"></i><input class="input" name="zipcode"></span></label></div></section>
|
||||
<section class="customers-form-section">
|
||||
<div class="customers-form-section-head"><span class="icon-tile" style="--tile-bg:var(--green-100);--tile-fg:var(--green-600)"><i class="ti ti-shield-check"></i></span><div><b>Доступ</b><span>Публичная группа, состояние аккаунта и роль в панели управления.</span></div></div>
|
||||
@@ -189,11 +189,11 @@
|
||||
<label class="customers-switch-card" data-customer-account-card><span><b>Аккаунт включён</b><small data-customer-account-hint>Может входить на сайт и в личный кабинет.</small></span><span class="switch"><input type="checkbox" name="status" value="1"><span></span></span></label>
|
||||
<label class="customers-switch-card" data-customer-admin-card><span><b>Доступ в панель управления</b><small data-customer-admin-hint>{{ can_manage_admin_access ? 'Та же учётная запись сможет работать в административном интерфейсе.' : 'Изменение требует права управления системными пользователями.' }}</small></span><span class="switch"><input type="checkbox" name="admin_access" value="1" data-customer-admin-access{{ can_manage_admin_access ? '' : ' disabled' }}><span></span></span></label>
|
||||
<label class="customers-switch-card"><span><b>Email подтверждён</b><small>Администратор может изменить статус вручную.</small></span><span class="switch"><input type="checkbox" name="email_verified" value="1"><span></span></span></label>
|
||||
<label class="customers-switch-card"><span><b>Телефон подтверждён</b><small>Подготовлено для будущего SMS-гейта.</small></span><span class="switch"><input type="checkbox" name="phone_verified" value="1"><span></span></span></label>
|
||||
<label class="customers-switch-card"><span><b>Телефон подтверждён</b><small>Подтверждается кодом из SMS; администратор может изменить статус вручную.</small></span><span class="switch"><input type="checkbox" name="phone_verified" value="1"><span></span></span></label>
|
||||
</div>
|
||||
</section>
|
||||
{% if fields %}<section class="customers-form-section"><div class="customers-form-section-head"><span class="icon-tile" style="--tile-bg:var(--violet-100);--tile-fg:var(--violet-600)"><i class="ti ti-forms"></i></span><div><b>Дополнительные поля</b><span>Активные поля из конструктора публичного профиля.</span></div></div><div class="form-grid">{% for field in fields %}{% if field.is_active %}<label class="field col-6"><span class="field-label">{{ field.name }}{% if field.is_required %} <span class="text-danger">*</span>{% endif %}</span>{% if field.type=='textarea' %}<textarea class="textarea" name="extra[{{ field.id }}]" rows="3"{{ field.is_required?' required':'' }}></textarea>{% elseif field.type=='select' %}<select class="select" name="extra[{{ field.id }}]"{{ field.is_required?' required':'' }}><option value="">Выберите значение</option>{% for choice in field.choices %}<option value="{{ choice|e('html_attr') }}">{{ choice }}</option>{% endfor %}</select>{% elseif field.type=='checkbox' %}<span class="customers-editor-checkbox"><span class="switch"><input type="checkbox" name="extra[{{ field.id }}]" value="1"><span></span></span><span>Да / нет</span></span>{% else %}<input class="input" type="{{ field.type in ['date','number','email','tel'] ? field.type : 'text' }}" name="extra[{{ field.id }}]"{{ field.is_required?' required':'' }}>{% endif %}<span class="field-hint mono">{{ field.code }}</span></label>{% endif %}{% endfor %}</div></section>{% endif %}
|
||||
<section class="customers-form-section"><div class="customers-form-section-head"><span class="icon-tile" style="--tile-bg:var(--red-100);--tile-fg:var(--red-600)"><i class="ti ti-key"></i></span><div><b>Безопасность</b><span>Пароль изменится, только если заполнить поле.</span></div></div><label class="field customers-editor-password"><span class="field-label">Новый пароль</span><span class="input-wrap customers-editor-input"><i class="ti ti-lock"></i><input class="input" type="password" name="password" autocomplete="new-password" placeholder="Оставьте пустым, чтобы не менять"></span><span class="field-hint">При смене пароля будут отозваны remember-сессии и ссылки восстановления.</span></label></section>
|
||||
<section class="customers-form-section"><div class="customers-form-section-head"><span class="icon-tile" style="--tile-bg:var(--red-100);--tile-fg:var(--red-600)"><i class="ti ti-key"></i></span><div><b>Безопасность</b><span>Пароль изменится, только если заполнить поле.</span></div></div><label class="field customers-editor-password"><span class="field-label">Новый пароль</span><span class="input-wrap customers-editor-input"><i class="ti ti-lock"></i><input class="input" type="password" name="password" autocomplete="new-password" placeholder="Оставьте пустым, чтобы не менять"></span><span class="field-hint">Используется только при разрешённом входе по паролю; активные ссылки и сессии будут отозваны.</span></label></section>
|
||||
</div>
|
||||
</div>
|
||||
<footer class="drawer-footer"><button class="btn btn-secondary" type="button" data-close-drawer>Закрыть</button><button class="btn btn-primary" type="submit"><i class="ti ti-device-floppy"></i>Сохранить</button></footer>
|
||||
|
||||
@@ -337,9 +337,13 @@
|
||||
/** Заменяет префикс только внутри SQL-идентификаторов, не затрагивая данные строк. */
|
||||
protected static function portableDdl($ddl)
|
||||
{
|
||||
$ddl = preg_replace_callback('/\bCONSTRAINT\s+`([^`]+)`/i', function ($match) {
|
||||
return 'CONSTRAINT `{{prefix}}_fk_' . substr(hash('sha256', (string) $match[1]), 0, 16) . '`';
|
||||
}, (string) $ddl);
|
||||
|
||||
$ddl = preg_replace_callback('/`([^`]+)`/', function ($match) {
|
||||
return '`' . Model::portableTableName($match[1]) . '`';
|
||||
}, (string) $ddl);
|
||||
}, $ddl);
|
||||
|
||||
//-- MariaDB выводит DEFAULT NULL у TEXT/BLOB, тогда как MySQL 5.7
|
||||
//-- запрещает default для этих типов. NULL и без clause остаётся default.
|
||||
|
||||
@@ -96,7 +96,7 @@
|
||||
throw new \RuntimeException('SQL-дамп оборван или содержит незавершённую команду');
|
||||
}
|
||||
|
||||
if ($meta['format'] !== 'adminx full dump') {
|
||||
if ($meta['format'] !== 'ave.cms full dump') {
|
||||
throw new \RuntimeException('Файл не является полным дампом AVE.cms');
|
||||
}
|
||||
|
||||
@@ -309,8 +309,9 @@
|
||||
protected static function readMetadata($line, array &$meta)
|
||||
{
|
||||
$value = trim(substr(ltrim((string) $line), 2));
|
||||
if (strcasecmp($value, 'adminx full dump') === 0) {
|
||||
$meta['format'] = 'adminx full dump';
|
||||
if (strcasecmp($value, 'AVE.cms full dump') === 0
|
||||
|| strcasecmp($value, 'adminx full dump') === 0) {
|
||||
$meta['format'] = 'ave.cms full dump';
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
return [
|
||||
'code' => 'database',
|
||||
'name' => 'База данных',
|
||||
'version' => '0.2.0',
|
||||
'version' => '0.2.2',
|
||||
|
||||
'permissions' => [
|
||||
'key' => 'database',
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
*/
|
||||
class BulkEditor
|
||||
{
|
||||
const VERSION = 1;
|
||||
const VERSION = 2;
|
||||
const MAX_DOCUMENTS = 5000;
|
||||
const CHUNK_SIZE = 20;
|
||||
const EXPIRES_AFTER = 7200;
|
||||
@@ -52,6 +52,19 @@
|
||||
'document_property' => array('label' => 'Свойство / артикул', 'payload' => 'property'),
|
||||
);
|
||||
|
||||
protected static $stateOperations = array(
|
||||
'search_include' => array('column'=>'document_in_search','payload'=>'in_search','value'=>'1','before'=>array('0'=>'Вне поиска','1'=>'В поиске')),
|
||||
'search_exclude' => array('column'=>'document_in_search','payload'=>'in_search','value'=>'0','before'=>array('0'=>'Вне поиска','1'=>'В поиске')),
|
||||
'robots_index' => array('column'=>'document_meta_robots','payload'=>'meta_robots','value'=>'index,follow','before'=>array()),
|
||||
'robots_noindex' => array('column'=>'document_meta_robots','payload'=>'meta_robots','value'=>'noindex,nofollow','before'=>array()),
|
||||
'sitemap_include' => array('column'=>'document_in_sitemap','payload'=>'in_sitemap','value'=>'1','before'=>array('0'=>'Не добавляется','1'=>'Добавляется')),
|
||||
'sitemap_exclude' => array('column'=>'document_in_sitemap','payload'=>'in_sitemap','value'=>'0','before'=>array('0'=>'Не добавляется','1'=>'Добавляется')),
|
||||
'technical' => array('column'=>'document_is_technical','payload'=>'is_technical','value'=>'1','before'=>array('0'=>'Обычный','1'=>'Служебный')),
|
||||
'public' => array('column'=>'document_is_technical','payload'=>'is_technical','value'=>'0','before'=>array('0'=>'Обычный','1'=>'Служебный')),
|
||||
'sitemap_frequency' => array('column'=>'document_sitemap_freq','payload'=>'sitemap_frequency','value_input'=>'sitemap_frequency','before'=>array('0'=>'always','1'=>'hourly','2'=>'daily','3'=>'weekly','4'=>'monthly','5'=>'yearly','6'=>'never')),
|
||||
'sitemap_priority' => array('column'=>'document_sitemap_pr','payload'=>'sitemap_priority','value_input'=>'sitemap_priority','before'=>array()),
|
||||
);
|
||||
|
||||
public static function options()
|
||||
{
|
||||
return array(
|
||||
@@ -198,6 +211,14 @@
|
||||
if (!$row) { return false; }
|
||||
|
||||
$type = $operation['type'];
|
||||
if (isset($operation['target_type']) && $operation['target_type'] === 'state') {
|
||||
if ($type === 'technical' && Model::isProtectedDocument($documentId)) { return false; }
|
||||
$current = (string) $row[$operation['target']];
|
||||
if ($current === (string) $operation['value']) { return false; }
|
||||
$service->save($documentId, array($operation['payload'] => $operation['value']), $actorId, 'bulk_editor');
|
||||
return true;
|
||||
}
|
||||
|
||||
if ($type === 'publish' || $type === 'unpublish') {
|
||||
if (Model::isProtectedDocument($documentId)) { return false; }
|
||||
$status = $type === 'publish' ? 1 : 0;
|
||||
@@ -250,12 +271,32 @@
|
||||
protected static function operation(array $input, array $filters)
|
||||
{
|
||||
$type = isset($input['operation']) ? (string) $input['operation'] : '';
|
||||
$allowed = array('fill', 'set', 'clear', 'replace', 'move', 'publish', 'unpublish', 'recalculate');
|
||||
$allowed = array_merge(
|
||||
array('fill', 'set', 'clear', 'replace', 'move', 'publish', 'unpublish', 'recalculate'),
|
||||
array_keys(self::$stateOperations)
|
||||
);
|
||||
if (!in_array($type, $allowed, true)) {
|
||||
throw new \InvalidArgumentException('Выберите действие');
|
||||
}
|
||||
|
||||
$operation = array('type' => $type, 'label' => self::operationLabel($type));
|
||||
if (isset(self::$stateOperations[$type])) {
|
||||
$config = self::$stateOperations[$type];
|
||||
$value = isset($config['value']) ? (string) $config['value'] : trim(isset($input[$config['value_input']]) ? (string) $input[$config['value_input']] : '');
|
||||
if ($type === 'sitemap_frequency' && !array_key_exists($value, $config['before'])) {
|
||||
throw new \InvalidArgumentException('Выберите частоту обновления sitemap');
|
||||
}
|
||||
|
||||
if ($type === 'sitemap_priority' && (!is_numeric($value) || (float) $value < 0 || (float) $value > 1)) {
|
||||
throw new \InvalidArgumentException('Приоритет sitemap должен быть от 0 до 1');
|
||||
}
|
||||
|
||||
return array_merge($operation, $config, array(
|
||||
'target_type' => 'state', 'target' => $config['column'], 'value' => $value,
|
||||
'target_label' => self::operationTargetLabel($type),
|
||||
));
|
||||
}
|
||||
|
||||
if (in_array($type, array('move', 'publish', 'unpublish', 'recalculate'), true)) {
|
||||
if ($type === 'move') {
|
||||
$targetRubricId = isset($input['target_rubric_id']) ? (int) $input['target_rubric_id'] : 0;
|
||||
@@ -346,9 +387,9 @@
|
||||
$currentValues = array();
|
||||
$ids = array();
|
||||
foreach ($rows as $row) { $ids[] = (int) $row['Id']; }
|
||||
if (isset($operation['target_type']) && $operation['target_type'] === 'document') {
|
||||
if (isset($operation['target_type']) && in_array($operation['target_type'], array('document', 'state'), true)) {
|
||||
$column = (string) $operation['target'];
|
||||
if (!isset(self::$documentFields[$column])) {
|
||||
if ($operation['target_type'] === 'document' && !isset(self::$documentFields[$column])) {
|
||||
throw new \InvalidArgumentException('Поле документа недоступно для массового изменения');
|
||||
}
|
||||
|
||||
@@ -406,6 +447,17 @@
|
||||
return array('before' => (string) $row['rubric_title'], 'after' => (string) $operation['target_rubric_title'], 'changed' => (int) $row['rubric_id'] !== (int) $operation['target_rubric_id'], 'note' => 'Совпадающие поля переносятся по системному имени');
|
||||
}
|
||||
|
||||
if ($operation['target_type'] === 'state') {
|
||||
if ($operation['type'] === 'technical' && Model::isProtectedDocument((int) $row['Id'])) {
|
||||
return array('before'=>'Системный документ','after'=>'Без изменений','changed'=>false,'note'=>'Главную и страницу 404 нельзя сделать служебными');
|
||||
}
|
||||
|
||||
$current = self::currentValue($row, $operation);
|
||||
$before = isset($operation['before'][$current]) ? $operation['before'][$current] : $current;
|
||||
$after = isset($operation['before'][(string) $operation['value']]) ? $operation['before'][(string) $operation['value']] : (string) $operation['value'];
|
||||
return array('before'=>$before,'after'=>$after,'changed'=>$current !== (string) $operation['value'],'note'=>'');
|
||||
}
|
||||
|
||||
$current = self::currentValue($row, $operation);
|
||||
$next = self::changedValue($current, $operation);
|
||||
return array('before' => $current, 'after' => $next['value'], 'changed' => $next['changed'], 'note' => $next['changed'] ? '' : 'Значение уже соответствует действию');
|
||||
@@ -417,7 +469,7 @@
|
||||
return (string) $row['__bulk_current'];
|
||||
}
|
||||
|
||||
if ($operation['target_type'] === 'document') {
|
||||
if ($operation['target_type'] === 'document' || $operation['target_type'] === 'state') {
|
||||
if (!array_key_exists($operation['target'], $row)) {
|
||||
$value = DB::query(
|
||||
'SELECT `' . $operation['target'] . '` FROM ' . ContentTables::table('documents') . ' WHERE Id=%i',
|
||||
@@ -537,12 +589,29 @@
|
||||
$labels = array(
|
||||
'fill' => 'Заполнить пустые', 'set' => 'Установить значение', 'clear' => 'Очистить',
|
||||
'replace' => 'Найти и заменить', 'move' => 'Перенести в рубрику',
|
||||
'publish' => 'Опубликовать', 'unpublish' => 'Снять с публикации',
|
||||
'recalculate' => 'Пересчитать поля и индексы',
|
||||
);
|
||||
'publish' => 'Опубликовать', 'unpublish' => 'Снять с публикации',
|
||||
'recalculate' => 'Пересчитать поля и индексы',
|
||||
'search_include' => 'Включить во внутренний поиск', 'search_exclude' => 'Исключить из внутреннего поиска',
|
||||
'robots_index' => 'Разрешить индексацию поисковиками', 'robots_noindex' => 'Запретить индексацию поисковиками',
|
||||
'sitemap_include' => 'Добавить в sitemap', 'sitemap_exclude' => 'Исключить из sitemap',
|
||||
'technical' => 'Сделать служебными', 'public' => 'Сделать обычными',
|
||||
'sitemap_frequency' => 'Изменить частоту sitemap', 'sitemap_priority' => 'Изменить приоритет sitemap',
|
||||
);
|
||||
return isset($labels[$type]) ? $labels[$type] : $type;
|
||||
}
|
||||
|
||||
protected static function operationTargetLabel($type)
|
||||
{
|
||||
$labels = array(
|
||||
'search_include'=>'Внутренний поиск','search_exclude'=>'Внутренний поиск',
|
||||
'robots_index'=>'Meta robots','robots_noindex'=>'Meta robots',
|
||||
'sitemap_include'=>'Участие в sitemap','sitemap_exclude'=>'Участие в sitemap',
|
||||
'technical'=>'Публичный доступ','public'=>'Публичный доступ',
|
||||
'sitemap_frequency'=>'Частота sitemap','sitemap_priority'=>'Приоритет sitemap',
|
||||
);
|
||||
return isset($labels[$type]) ? $labels[$type] : '';
|
||||
}
|
||||
|
||||
protected static function shortValue($value)
|
||||
{
|
||||
$value = trim(preg_replace('/\s+/u', ' ', strip_tags((string) $value)));
|
||||
|
||||
@@ -361,13 +361,22 @@
|
||||
return $this->error('Недостаточно прав', array(), 403);
|
||||
}
|
||||
|
||||
$scope = Request::getStr('scope', 'document');
|
||||
$items = $scope === 'parent'
|
||||
? Model::parentDocumentPicker(
|
||||
Request::getStr('q', ''),
|
||||
Request::getInt('limit', 20),
|
||||
Request::getInt('exclude_id', 0)
|
||||
)
|
||||
: Model::documentPicker(
|
||||
Request::getStr('q', ''),
|
||||
Request::getStr('rubric_id', ''),
|
||||
Request::getInt('limit', 20)
|
||||
);
|
||||
|
||||
return $this->success('', array(
|
||||
'data' => array(
|
||||
'items' => Model::documentPicker(
|
||||
Request::getStr('q', ''),
|
||||
Request::getStr('rubric_id', ''),
|
||||
Request::getInt('limit', 20)
|
||||
),
|
||||
'items' => $items,
|
||||
),
|
||||
));
|
||||
}
|
||||
|
||||
@@ -226,8 +226,8 @@
|
||||
'document_title', 'document_alias', 'document_alias_header', 'document_alias_history',
|
||||
'document_short_alias', 'document_breadcrumb_title', 'document_excerpt',
|
||||
'document_meta_keywords', 'document_meta_description', 'document_meta_robots',
|
||||
'document_sitemap_freq', 'document_sitemap_pr', 'document_tags', 'document_property',
|
||||
'guid', 'document_status', 'document_in_search', 'document_parent', 'rubric_tmpl_id',
|
||||
'document_sitemap_freq', 'document_sitemap_pr', 'document_in_sitemap', 'document_tags', 'document_property',
|
||||
'guid', 'document_status', 'document_in_search', 'document_is_technical', 'document_parent', 'rubric_tmpl_id',
|
||||
'document_linked_navi_id', 'document_position', 'document_published', 'document_expire',
|
||||
'document_author_id',
|
||||
) as $key) {
|
||||
|
||||
@@ -111,7 +111,7 @@
|
||||
$countArgs = array_merge(array('SELECT COUNT(*) FROM ' . self::documentsTable() . ' d' . $where), $args);
|
||||
$total = (int) call_user_func_array(array('DB', 'query'), $countArgs)->getValue();
|
||||
|
||||
$sql = 'SELECT d.*, r.rubric_title, r.rubric_alias,(' . $score . ') AS search_relevance'
|
||||
$sql = 'SELECT d.*, r.rubric_title, r.rubric_alias,COALESCE(r.rubric_is_technical,0) rubric_is_technical,(' . $score . ') AS search_relevance'
|
||||
. ' FROM ' . self::documentsTable() . ' d'
|
||||
. ' LEFT JOIN ' . self::rubricsTable() . ' r ON r.Id = d.rubric_id'
|
||||
. $where
|
||||
@@ -190,7 +190,7 @@
|
||||
public static function one($id)
|
||||
{
|
||||
$row = DB::query(
|
||||
'SELECT d.*, r.rubric_title, r.rubric_alias FROM ' . self::documentsTable() . ' d'
|
||||
'SELECT d.*, r.rubric_title, r.rubric_alias,COALESCE(r.rubric_is_technical,0) rubric_is_technical FROM ' . self::documentsTable() . ' d'
|
||||
. ' LEFT JOIN ' . self::rubricsTable() . ' r ON r.Id = d.rubric_id'
|
||||
. ' WHERE d.Id = %i LIMIT 1',
|
||||
(int) $id
|
||||
@@ -222,6 +222,8 @@
|
||||
'guid' => '',
|
||||
'document_status' => 1,
|
||||
'document_in_search' => 1,
|
||||
'document_is_technical' => $rubric && !empty($rubric['rubric_is_technical']) ? 1 : 0,
|
||||
'document_in_sitemap' => 1,
|
||||
'document_author_id' => 1,
|
||||
'document_parent' => 0,
|
||||
'rubric_tmpl_id' => 0,
|
||||
@@ -304,10 +306,21 @@
|
||||
if (!empty($allowed)) { $catalogAllowed = array_values(array_unique(array_merge($catalogAllowed, $allowed))); }
|
||||
}
|
||||
|
||||
$conditionReferences = $conditionsEnabled ? self::conditionReferences($rows) : array();
|
||||
$conditionSources = array();
|
||||
$groups = array();
|
||||
foreach ($rows as $row) {
|
||||
$settings = FieldSettings::effective($row);
|
||||
if (array_key_exists('placed', $settings) && empty($settings['placed'])) { continue; }
|
||||
if (array_key_exists('placed', $settings) && empty($settings['placed'])) {
|
||||
$idReference = 'id:' . (int) $row['Id'];
|
||||
$aliasReference = 'alias:' . strtolower(trim((string) $row['rubric_field_alias']));
|
||||
if (isset($conditionReferences[$idReference]) || isset($conditionReferences[$aliasReference])) {
|
||||
$conditionSources[(int) $row['Id']] = self::conditionSourceRow($row);
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
$groupId = (int) $row['rubric_field_group'];
|
||||
if (!isset($groups[$groupId])) {
|
||||
$groups[$groupId] = array(
|
||||
@@ -324,7 +337,12 @@
|
||||
$groups[$groupId]['items'][] = $field;
|
||||
}
|
||||
|
||||
return array_values($groups);
|
||||
$groups = array_values($groups);
|
||||
if (!empty($groups) && !empty($conditionSources)) {
|
||||
$groups[0]['condition_sources'] = array_values($conditionSources);
|
||||
}
|
||||
|
||||
return $groups;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -338,13 +356,11 @@
|
||||
return array();
|
||||
}
|
||||
|
||||
$fields = array();
|
||||
$fieldGroups = self::resolveFieldGroups($rubricId, (int) $documentId, $fieldGroups);
|
||||
$fields = self::conditionAwareFields($fieldGroups);
|
||||
$effectiveValues = array();
|
||||
foreach (self::resolveFieldGroups($rubricId, (int) $documentId, $fieldGroups) as $group) {
|
||||
foreach ($group['items'] as $field) {
|
||||
$fields[] = $field;
|
||||
$effectiveValues[(int) $field['Id']] = isset($field['field_value']) ? $field['field_value'] : '';
|
||||
}
|
||||
foreach ($fields as $field) {
|
||||
$effectiveValues[(int) $field['Id']] = isset($field['field_value']) ? $field['field_value'] : '';
|
||||
}
|
||||
|
||||
foreach ($values as $id => $value) {
|
||||
@@ -356,14 +372,14 @@
|
||||
|
||||
public static function computedFieldValues($rubricId, array $values, array $document = array(), $documentId = 0, $fieldGroups = null)
|
||||
{
|
||||
$fieldGroups = self::resolveFieldGroups((int) $rubricId, (int) $documentId, $fieldGroups);
|
||||
$fields = self::conditionAwareFields($fieldGroups);
|
||||
$definitions = array();
|
||||
$effectiveValues = array();
|
||||
foreach (self::resolveFieldGroups((int) $rubricId, (int) $documentId, $fieldGroups) as $group) {
|
||||
foreach ($group['items'] as $field) {
|
||||
$fieldId = (int) $field['Id'];
|
||||
$definitions[$fieldId] = $field;
|
||||
$effectiveValues[$fieldId] = isset($field['field_value']) ? $field['field_value'] : '';
|
||||
}
|
||||
foreach ($fields as $field) {
|
||||
$fieldId = (int) $field['Id'];
|
||||
$definitions[$fieldId] = $field;
|
||||
$effectiveValues[$fieldId] = isset($field['field_value']) ? $field['field_value'] : '';
|
||||
}
|
||||
|
||||
foreach ($values as $fieldId => $value) {
|
||||
@@ -387,18 +403,19 @@
|
||||
return $values;
|
||||
}
|
||||
|
||||
$fields = array();
|
||||
$fieldGroups = self::resolveFieldGroups((int) $rubricId, (int) $documentId, $fieldGroups);
|
||||
$fields = self::conditionAwareFields($fieldGroups);
|
||||
$fieldMap = array();
|
||||
$storedValues = array();
|
||||
$effectiveValues = array();
|
||||
foreach (self::resolveFieldGroups((int) $rubricId, (int) $documentId, $fieldGroups) as $group) {
|
||||
foreach ($group['items'] as $field) {
|
||||
$fields[] = $field;
|
||||
foreach ($fields as $field) {
|
||||
$fieldId = (int) $field['Id'];
|
||||
if (empty($field['_condition_source'])) {
|
||||
$fieldMap[$fieldId] = $field;
|
||||
}
|
||||
|
||||
$storedValues[$fieldId] = (int) $documentId > 0 && isset($field['field_value']) ? $field['field_value'] : '';
|
||||
$effectiveValues[$fieldId] = isset($field['field_value']) ? $field['field_value'] : '';
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($values as $id => $value) {
|
||||
@@ -609,8 +626,9 @@
|
||||
foreach (array(
|
||||
'document_title', 'document_alias', 'document_alias_header', 'document_alias_history',
|
||||
'document_short_alias', 'document_breadcrumb_title', 'document_excerpt', 'document_meta_keywords',
|
||||
'document_meta_description', 'document_meta_robots', 'document_sitemap_freq', 'document_sitemap_pr',
|
||||
'document_tags', 'document_property', 'guid', 'document_status', 'document_in_search',
|
||||
'document_meta_description', 'document_meta_robots', 'document_sitemap_freq', 'document_sitemap_pr',
|
||||
'document_in_sitemap', 'document_tags', 'document_property', 'guid', 'document_status', 'document_in_search',
|
||||
'document_is_technical',
|
||||
'document_parent', 'rubric_tmpl_id', 'document_linked_navi_id', 'document_position',
|
||||
'document_author_id',
|
||||
) as $key) {
|
||||
@@ -643,6 +661,10 @@
|
||||
$data['document_alias_header'] = 301;
|
||||
}
|
||||
|
||||
if ($id > 0 && self::isProtectedDocument($id)) {
|
||||
$data['document_is_technical'] = 0;
|
||||
}
|
||||
|
||||
$data['rubric_id'] = $rubricId;
|
||||
$data['document_changed'] = $now;
|
||||
$data['document_version'] = $existing ? max(1, (int) $existing['document_version']) + 1 : 1;
|
||||
@@ -821,6 +843,29 @@
|
||||
: self::fieldsForRubric((int) $rubricId, (int) $documentId);
|
||||
}
|
||||
|
||||
protected static function conditionAwareFields(array $fieldGroups)
|
||||
{
|
||||
$fields = array();
|
||||
$seen = array();
|
||||
foreach ($fieldGroups as $group) {
|
||||
foreach (isset($group['condition_sources']) && is_array($group['condition_sources']) ? $group['condition_sources'] : array() as $field) {
|
||||
$fieldId = isset($field['Id']) ? (int) $field['Id'] : 0;
|
||||
if ($fieldId <= 0 || isset($seen[$fieldId])) { continue; }
|
||||
$seen[$fieldId] = true;
|
||||
$fields[] = $field;
|
||||
}
|
||||
|
||||
foreach (isset($group['items']) && is_array($group['items']) ? $group['items'] : array() as $field) {
|
||||
$fieldId = isset($field['Id']) ? (int) $field['Id'] : 0;
|
||||
if ($fieldId <= 0 || isset($seen[$fieldId])) { continue; }
|
||||
$seen[$fieldId] = true;
|
||||
$fields[] = $field;
|
||||
}
|
||||
}
|
||||
|
||||
return $fields;
|
||||
}
|
||||
|
||||
public static function delete($id)
|
||||
{
|
||||
$id = (int) $id;
|
||||
@@ -906,6 +951,7 @@
|
||||
$source['document_deleted'] = '0';
|
||||
$source['document_count_print'] = 0;
|
||||
$source['document_count_view'] = 0;
|
||||
$source['module_catalog'] = '';
|
||||
$source['document_author_id'] = self::legacyAuthorId($authorId);
|
||||
$source['document_changed'] = time();
|
||||
$source['document_version'] = 1;
|
||||
@@ -1331,6 +1377,33 @@
|
||||
return (new \App\Content\Documents\DocumentPickerRepository())->search($q, $rubricId, $limit);
|
||||
}
|
||||
|
||||
public static function parentDocumentPicker($q, $limit = 20, $excludeId = 0)
|
||||
{
|
||||
$limit = max(1, min(50, (int) $limit));
|
||||
$excludeId = max(0, (int) $excludeId);
|
||||
$items = CatalogModel::searchParentDocuments($q, $limit);
|
||||
$seen = array();
|
||||
$result = array();
|
||||
foreach ($items as $item) {
|
||||
$id = (int) $item['id'];
|
||||
if ($id <= 0 || $id === $excludeId || isset($seen[$id])) { continue; }
|
||||
$seen[$id] = true;
|
||||
$result[] = $item;
|
||||
if (count($result) >= $limit) { return $result; }
|
||||
}
|
||||
|
||||
$documents = (new \App\Content\Documents\DocumentPickerRepository())->search($q, array(), $limit);
|
||||
foreach ($documents as $item) {
|
||||
$id = (int) $item['id'];
|
||||
if ($id <= 0 || $id === $excludeId || isset($seen[$id])) { continue; }
|
||||
$seen[$id] = true;
|
||||
$result[] = $item;
|
||||
if (count($result) >= $limit) { break; }
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/** Existing keywords/tags for the searchable tag inputs in document editor. */
|
||||
public static function termSuggestions($kind, $q = '', $rubricId = 0, $limit = 12)
|
||||
{
|
||||
@@ -1393,13 +1466,15 @@
|
||||
'document_meta_keywords' => trim($get('document_meta_keywords')),
|
||||
'document_meta_description' => trim($get('document_meta_description')),
|
||||
'document_meta_robots' => self::robotsValue($get('document_meta_robots')),
|
||||
'document_sitemap_freq' => self::sitemapFreqValue($get('document_sitemap_freq')),
|
||||
'document_sitemap_pr' => self::sitemapPrValue($get('document_sitemap_pr')),
|
||||
'document_sitemap_freq' => self::sitemapFreqValue($get('document_sitemap_freq')),
|
||||
'document_sitemap_pr' => self::sitemapPrValue($get('document_sitemap_pr')),
|
||||
'document_in_sitemap' => (int) $get('document_in_sitemap') === 1 ? 1 : 0,
|
||||
'document_tags' => trim($get('document_tags')),
|
||||
'document_property' => trim($get('document_property')),
|
||||
'guid' => substr(trim($get('guid')), 0, 100),
|
||||
'document_status' => (int) $get('document_status') === 1 ? '1' : '0',
|
||||
'document_in_search' => (int) $get('document_in_search') === 1 ? '1' : '0',
|
||||
'document_status' => (int) $get('document_status') === 1 ? '1' : '0',
|
||||
'document_in_search' => (int) $get('document_in_search') === 1 ? '1' : '0',
|
||||
'document_is_technical' => (int) $get('document_is_technical') === 1 ? 1 : 0,
|
||||
'document_parent' => (int) $get('document_parent'),
|
||||
'rubric_tmpl_id' => (int) $get('rubric_tmpl_id'),
|
||||
'document_linked_navi_id' => (int) $get('document_linked_navi_id'),
|
||||
@@ -1597,6 +1672,10 @@
|
||||
$row['document_status'] = (int) $row['document_status'];
|
||||
$row['document_deleted'] = (int) $row['document_deleted'];
|
||||
$row['document_in_search'] = (int) $row['document_in_search'];
|
||||
$row['document_is_technical'] = isset($row['document_is_technical']) ? (int) $row['document_is_technical'] : 0;
|
||||
$row['document_in_sitemap'] = isset($row['document_in_sitemap']) ? (int) $row['document_in_sitemap'] : 1;
|
||||
$row['rubric_is_technical'] = isset($row['rubric_is_technical']) ? (int) $row['rubric_is_technical'] : 0;
|
||||
$row['is_technical_effective'] = $row['document_is_technical'] || $row['rubric_is_technical'];
|
||||
$row['document_published'] = (int) $row['document_published'];
|
||||
$row['document_expire'] = (int) $row['document_expire'];
|
||||
$row['document_changed'] = (int) $row['document_changed'];
|
||||
@@ -1673,11 +1752,7 @@
|
||||
{
|
||||
$type = (string) $row['rubric_field_type'];
|
||||
$hasInitialValue = array_key_exists('__initial_value', $row);
|
||||
$raw = $hasInitialValue
|
||||
? (string) $row['__initial_value']
|
||||
: ($row['document_field_id']
|
||||
? (string) $row['field_value'] . (string) $row['field_value_more']
|
||||
: self::initialFieldValue($type, (string) $row['rubric_field_default']));
|
||||
$raw = self::rawFieldValue($row);
|
||||
$editor = FieldAdminEditors::describe($type);
|
||||
$kind = self::documentEditorKind($editor);
|
||||
$settings = FieldSettings::effective($row);
|
||||
@@ -1777,6 +1852,60 @@
|
||||
return $field;
|
||||
}
|
||||
|
||||
protected static function rawFieldValue(array $row)
|
||||
{
|
||||
if (array_key_exists('__initial_value', $row)) { return (string) $row['__initial_value']; }
|
||||
if (!empty($row['document_field_id'])) {
|
||||
return (string) $row['field_value'] . (string) $row['field_value_more'];
|
||||
}
|
||||
|
||||
return self::initialFieldValue((string) $row['rubric_field_type'], (string) $row['rubric_field_default']);
|
||||
}
|
||||
|
||||
protected static function conditionSourceRow(array $row)
|
||||
{
|
||||
return array(
|
||||
'Id' => (int) $row['Id'],
|
||||
'rubric_id' => (int) $row['rubric_id'],
|
||||
'rubric_field_group' => (int) $row['rubric_field_group'],
|
||||
'rubric_field_title' => self::decode($row['rubric_field_title']),
|
||||
'rubric_field_alias' => (string) $row['rubric_field_alias'],
|
||||
'rubric_field_type' => (string) $row['rubric_field_type'],
|
||||
'rubric_field_settings' => isset($row['rubric_field_settings']) ? (string) $row['rubric_field_settings'] : '',
|
||||
'group_settings' => isset($row['group_settings']) ? (string) $row['group_settings'] : '',
|
||||
'field_value' => self::rawFieldValue($row),
|
||||
'_condition_source' => true,
|
||||
);
|
||||
}
|
||||
|
||||
protected static function conditionReferences(array $rows)
|
||||
{
|
||||
$references = array();
|
||||
foreach ($rows as $row) {
|
||||
foreach (array(FieldConditionEvaluator::condition($row), FieldConditionEvaluator::groupCondition($row)) as $condition) {
|
||||
if (!empty($condition['tree']) && is_array($condition['tree'])) {
|
||||
self::collectConditionReferences($condition['tree'], $references);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $references;
|
||||
}
|
||||
|
||||
protected static function collectConditionReferences(array $node, array &$references)
|
||||
{
|
||||
if (isset($node['items']) && is_array($node['items'])) {
|
||||
foreach ($node['items'] as $item) {
|
||||
if (is_array($item)) { self::collectConditionReferences($item, $references); }
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$reference = isset($node['field']) ? strtolower(trim((string) $node['field'])) : '';
|
||||
if ($reference !== '') { $references[$reference] = true; }
|
||||
}
|
||||
|
||||
protected static function hasGroupSettingsColumn()
|
||||
{
|
||||
static $has = null;
|
||||
@@ -1941,7 +2070,9 @@
|
||||
}
|
||||
|
||||
if ($kind === 'relation') {
|
||||
return isset($parsed['document_id']) ? (string) $parsed['document_id'] : (string) $raw;
|
||||
return array(
|
||||
'document_id' => isset($parsed['document_id']) ? (string) $parsed['document_id'] : (string) $raw,
|
||||
);
|
||||
}
|
||||
|
||||
if (in_array($kind, array('lines', 'relation_list'), true)) {
|
||||
@@ -2594,11 +2725,16 @@
|
||||
|
||||
protected static function clearDocumentCache($documentId)
|
||||
{
|
||||
ContentCacheInvalidator::document($documentId, false);
|
||||
DB::afterCommit(function () use ($documentId) { ContentCacheInvalidator::document($documentId, false); });
|
||||
}
|
||||
|
||||
protected static function buildDocumentSnapshot($documentId)
|
||||
{
|
||||
if (DB::$transaction_in_progress) {
|
||||
DB::afterCommit(function () use ($documentId) { ContentCacheInvalidator::document($documentId, true); });
|
||||
return null;
|
||||
}
|
||||
|
||||
return ContentCacheInvalidator::document($documentId, true);
|
||||
}
|
||||
|
||||
|
||||
@@ -230,6 +230,7 @@
|
||||
'document_parent' => 'Родитель', 'rubric_tmpl_id' => 'Шаблон', 'document_linked_navi_id' => 'Навигация',
|
||||
'document_position' => 'Позиция', 'document_published' => 'Дата публикации', 'document_expire' => 'Дата окончания',
|
||||
'document_author_id' => 'Автор', 'document_sitemap_freq' => 'Sitemap: частота', 'document_sitemap_pr' => 'Sitemap: приоритет',
|
||||
'document_in_sitemap' => 'Sitemap: участие', 'document_is_technical' => 'Служебный документ',
|
||||
);
|
||||
$out = array();
|
||||
foreach ($document as $key => $value) {
|
||||
@@ -238,8 +239,12 @@
|
||||
$value = (int) $value > 0 ? date('d.m.Y H:i:s', (int) $value) : 'не задано';
|
||||
} elseif ($key === 'document_status') {
|
||||
$value = (int) $value === 1 ? 'Опубликован' : 'Черновик';
|
||||
} elseif ($key === 'document_in_search') {
|
||||
$value = (int) $value === 1 ? 'В поиске' : 'Скрыт';
|
||||
} elseif ($key === 'document_in_search') {
|
||||
$value = (int) $value === 1 ? 'В поиске' : 'Скрыт';
|
||||
} elseif ($key === 'document_in_sitemap') {
|
||||
$value = (int) $value === 1 ? 'Добавляется' : 'Не добавляется';
|
||||
} elseif ($key === 'document_is_technical') {
|
||||
$value = (int) $value === 1 ? 'Служебный' : 'Обычный';
|
||||
}
|
||||
|
||||
$out[] = array('key' => $key, 'title' => $labels[$key], 'value' => (string) $value, 'value_preview' => self::shorten((string) $value, 420));
|
||||
|
||||
@@ -571,6 +571,40 @@
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.documents-public-link {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 5px;
|
||||
min-width: 0;
|
||||
max-width: 100%;
|
||||
width: fit-content;
|
||||
color: var(--blue-600);
|
||||
font-size: 11.5px;
|
||||
line-height: 1.35;
|
||||
text-decoration: none;
|
||||
}
|
||||
.documents-public-link i {
|
||||
flex: 0 0 auto;
|
||||
color: var(--blue-600);
|
||||
font-size: 13px;
|
||||
}
|
||||
.documents-public-link span {
|
||||
overflow: hidden;
|
||||
min-width: 0;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.documents-public-link:hover,
|
||||
.documents-public-link:focus-visible {
|
||||
color: var(--blue-700);
|
||||
}
|
||||
.documents-public-alias-empty {
|
||||
color: var(--text-muted);
|
||||
font-size: 11.5px;
|
||||
}
|
||||
.documents-admin-card-title .documents-public-link {
|
||||
margin-top: 3px;
|
||||
}
|
||||
.documents-search-flag {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
@@ -1209,6 +1243,10 @@
|
||||
.documents-bulk-controls .field {
|
||||
min-width: 0;
|
||||
}
|
||||
.documents-bulk-controls .field[hidden],
|
||||
[data-bulk-technical-help][hidden] {
|
||||
display: none;
|
||||
}
|
||||
.documents-bulk-search,
|
||||
.documents-bulk-value {
|
||||
grid-column: span 2;
|
||||
@@ -1236,6 +1274,23 @@
|
||||
margin-top: 1px;
|
||||
font-size: 16px;
|
||||
}
|
||||
.documents-bulk-technical-help {
|
||||
margin: 0 16px 16px;
|
||||
}
|
||||
.documents-bulk-technical-help b,
|
||||
.documents-bulk-technical-help span {
|
||||
display: block;
|
||||
}
|
||||
.documents-bulk-technical-help span {
|
||||
margin-top: 2px;
|
||||
}
|
||||
.documents-technical-alert b,
|
||||
.documents-technical-alert span {
|
||||
display: block;
|
||||
}
|
||||
.documents-technical-alert span {
|
||||
margin-top: 2px;
|
||||
}
|
||||
.documents-bulk-step-footer,
|
||||
.documents-bulk-run {
|
||||
display: flex;
|
||||
@@ -1462,13 +1517,15 @@
|
||||
.documents-editor-workspace[data-active-panel="attributes"] #documentForm,
|
||||
.documents-editor-workspace[data-active-panel="promotions"] #documentForm,
|
||||
.documents-editor-workspace[data-active-panel="variants"] #documentForm,
|
||||
.documents-editor-workspace[data-active-panel="shipping"] #documentForm {
|
||||
.documents-editor-workspace[data-active-panel="shipping"] #documentForm,
|
||||
.documents-editor-workspace[data-active-panel="search"] #documentForm {
|
||||
display: none;
|
||||
}
|
||||
.documents-editor-workspace[data-active-panel="attributes"] [data-document-workspace-panel="attributes"],
|
||||
.documents-editor-workspace[data-active-panel="promotions"] [data-document-workspace-panel="promotions"],
|
||||
.documents-editor-workspace[data-active-panel="variants"] [data-document-workspace-panel="variants"],
|
||||
.documents-editor-workspace[data-active-panel="shipping"] [data-document-workspace-panel="shipping"] {
|
||||
.documents-editor-workspace[data-active-panel="shipping"] [data-document-workspace-panel="shipping"],
|
||||
.documents-editor-workspace[data-active-panel="search"] [data-document-workspace-panel="search"] {
|
||||
display: block;
|
||||
}
|
||||
.documents-editor-workspace [data-document-workspace-panel] {
|
||||
@@ -2618,22 +2675,25 @@
|
||||
}
|
||||
.documents-value-row {
|
||||
display: grid;
|
||||
grid-template-columns: 34px minmax(0, 1fr) 34px;
|
||||
grid-template-columns: 106px minmax(0, 1fr) 34px;
|
||||
gap: 10px;
|
||||
align-items: start;
|
||||
align-items: center;
|
||||
min-width: 0;
|
||||
padding: 12px;
|
||||
border-radius: var(--radius-lg);
|
||||
background: var(--bg-soft);
|
||||
box-shadow: inset 0 0 0 1px var(--border-default);
|
||||
}
|
||||
.documents-value-row-tools,
|
||||
.documents-value-row-tools {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 34px);
|
||||
gap: 2px;
|
||||
min-width: 0;
|
||||
}
|
||||
.documents-value-row-fields {
|
||||
display: grid;
|
||||
gap: 8px;
|
||||
min-width: 0;
|
||||
}
|
||||
.documents-value-row-fields {
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
}
|
||||
.documents-value-row-list_single .documents-value-row-fields {
|
||||
@@ -2651,6 +2711,22 @@
|
||||
}
|
||||
}
|
||||
@media (max-width: 640px) {
|
||||
.documents-value-row {
|
||||
grid-template-columns: minmax(0, 1fr) 34px;
|
||||
}
|
||||
.documents-value-row-tools {
|
||||
grid-column: 1;
|
||||
grid-row: 2;
|
||||
justify-content: start;
|
||||
}
|
||||
.documents-value-row-fields {
|
||||
grid-column: 1 / -1;
|
||||
grid-row: 1;
|
||||
}
|
||||
.documents-value-remove {
|
||||
grid-column: 2;
|
||||
grid-row: 2;
|
||||
}
|
||||
.documents-value-row-packages .documents-value-row-fields {
|
||||
grid-template-columns: minmax(0, 1fr);
|
||||
}
|
||||
|
||||
@@ -1124,6 +1124,13 @@
|
||||
|
||||
documentFieldConditionContext: function () {
|
||||
var context = {};
|
||||
this.form.querySelectorAll('[data-document-condition-source]').forEach(function (source) {
|
||||
var id = String(parseInt(source.getAttribute('data-field-id'), 10) || 0);
|
||||
var alias = String(source.getAttribute('data-field-alias') || '').trim().toLowerCase();
|
||||
var values = [String(source.value == null ? '' : source.value)];
|
||||
context['id:' + id] = values;
|
||||
if (alias) { context['alias:' + alias] = values; }
|
||||
});
|
||||
this.form.querySelectorAll('.ax-document-field[data-rubric-field-id]').forEach(function (field) {
|
||||
var values = [];
|
||||
var controls = Array.prototype.slice.call(field.querySelectorAll('input[name], select[name], textarea[name]'));
|
||||
@@ -1349,9 +1356,24 @@
|
||||
|
||||
searchCatalog: function (catalog, value) {
|
||||
if (!catalog) { return; }
|
||||
value = String(value || '').trim().toLowerCase();
|
||||
catalog.querySelectorAll('[data-document-catalog-node]').forEach(function (node) {
|
||||
node.classList.toggle('is-filtered', value && String(node.getAttribute('data-search') || '').toLowerCase().indexOf(value) < 0);
|
||||
var normalize = function (input) {
|
||||
return String(input || '').toLowerCase().replace(/ё/g, 'е').replace(/[^0-9a-zа-я]+/gi, ' ').trim();
|
||||
};
|
||||
var query = normalize(value);
|
||||
var tokens = query ? query.split(/\s+/) : [];
|
||||
var nodes = Array.prototype.slice.call(catalog.querySelectorAll('[data-document-catalog-node]'));
|
||||
nodes.forEach(function (node) {
|
||||
var haystack = normalize(node.getAttribute('data-search'));
|
||||
var matches = !tokens.length || tokens.every(function (token) { return haystack.indexOf(token) >= 0; });
|
||||
node.classList.toggle('is-filtered', !matches);
|
||||
});
|
||||
nodes.forEach(function (node) {
|
||||
if (node.classList.contains('is-filtered')) { return; }
|
||||
var parent = node.parentElement ? node.parentElement.closest('[data-document-catalog-node]') : null;
|
||||
while (parent) {
|
||||
parent.classList.remove('is-filtered');
|
||||
parent = parent.parentElement ? parent.parentElement.closest('[data-document-catalog-node]') : null;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
@@ -1496,7 +1518,7 @@
|
||||
saveActiveWorkspace: function () {
|
||||
var workspace = document.querySelector('[data-document-workspace]');
|
||||
var panel = workspace ? workspace.getAttribute('data-active-panel') || 'main' : 'main';
|
||||
if (panel === 'attributes' || panel === 'shipping' || panel === 'promotions') {
|
||||
if (panel === 'attributes' || panel === 'shipping' || panel === 'promotions' || panel === 'search') {
|
||||
var form = workspace.querySelector('[data-document-workspace-panel="' + panel + '"] form');
|
||||
if (form && typeof form.requestSubmit === 'function') { form.requestSubmit(); }
|
||||
else if (form) { form.dispatchEvent(new Event('submit', { bubbles: true, cancelable: true })); }
|
||||
@@ -1772,6 +1794,16 @@
|
||||
if (textarea._adminxCodeMirror) { textarea._adminxCodeMirror.save(); }
|
||||
});
|
||||
this.form.querySelectorAll('textarea[data-rich-editor]').forEach(function (textarea) {
|
||||
if (window.Adminx && Adminx.RichEditor && typeof Adminx.RichEditor.syncTextarea === 'function') {
|
||||
Adminx.RichEditor.syncTextarea(textarea, textarea._adminxTiptap || null);
|
||||
return;
|
||||
}
|
||||
var root = textarea.closest('.rich-editor');
|
||||
if (root && root.classList.contains('rich-editor-source-open') && root._richSourceEditor) {
|
||||
root._richSourceEditor.save();
|
||||
textarea.value = root._richSourceEditor.getValue();
|
||||
return;
|
||||
}
|
||||
if (textarea._adminxTiptap && textarea.getAttribute('data-rich-editor-dirty') === '1') {
|
||||
textarea.value = textarea._adminxTiptap.getHTML();
|
||||
}
|
||||
@@ -2467,7 +2499,11 @@
|
||||
|
||||
applyPickedMedia: function (target, file) {
|
||||
var input = target ? target.querySelector('[data-document-media-url]') : null;
|
||||
if (input && file && file.url) { input.value = file.url; input.dispatchEvent(new Event('input', { bubbles: true })); }
|
||||
if (input && file && file.url) {
|
||||
input.value = file.url;
|
||||
input.dispatchEvent(new Event('input', { bubbles: true }));
|
||||
this.sortMediaRowsByName(target.closest('[data-document-media-list]'));
|
||||
}
|
||||
},
|
||||
|
||||
mediaPickerType: function (target) {
|
||||
@@ -2507,25 +2543,40 @@
|
||||
|
||||
uploadMediaFiles: function (container, files, replace) {
|
||||
if (!container || !files || !files.length) { return; }
|
||||
var data = new FormData();
|
||||
data.append('_csrf', this.csrf());
|
||||
data.append('dir', container.getAttribute('data-upload-dir') || '/uploads');
|
||||
data.append('field_id', container.getAttribute('data-field-id') || '0');
|
||||
data.append('document_id', (this.field('id') || {}).value || '0');
|
||||
data.append('media_draft_token', (this.field('media_draft_token') || {}).value || '');
|
||||
Array.prototype.forEach.call(files, function (file) { data.append('files[]', file); });
|
||||
var self = this;
|
||||
this.ajax(container.getAttribute('data-upload-url') || (this.base() + '/media/upload'), data, function (payload) {
|
||||
var uploaded = ((payload.data || {}).files) || [];
|
||||
if (replace && uploaded.length) {
|
||||
self.prepareMediaReplacement(container);
|
||||
var buttons = container.querySelectorAll('[data-document-media-upload]');
|
||||
buttons.forEach(function (button) { button.disabled = true; });
|
||||
Adminx.Loader.show();
|
||||
Adminx.Upload.files(
|
||||
container.getAttribute('data-upload-url') || (this.base() + '/media/upload'),
|
||||
files,
|
||||
function (chunk) {
|
||||
var data = new FormData();
|
||||
data.append('_csrf', self.csrf());
|
||||
data.append('dir', container.getAttribute('data-upload-dir') || '/uploads');
|
||||
data.append('field_id', container.getAttribute('data-field-id') || '0');
|
||||
data.append('document_id', (self.field('id') || {}).value || '0');
|
||||
data.append('media_draft_token', (self.field('media_draft_token') || {}).value || '');
|
||||
chunk.forEach(function (file) { data.append('files[]', file); });
|
||||
return data;
|
||||
}
|
||||
).then(function (result) {
|
||||
var uploaded = result.files || [];
|
||||
if (replace && uploaded.length) { self.prepareMediaReplacement(container); }
|
||||
if (container.matches('[data-document-media-single]')) {
|
||||
self.applyUploadedSingle(container, uploaded[0] || null);
|
||||
} else {
|
||||
self.appendMediaFiles(container, uploaded);
|
||||
}
|
||||
Adminx.Toast.show(payload.message || 'Файлы загружены', 'success');
|
||||
Adminx.Toast.show('Загружено файлов: ' + uploaded.length, 'success');
|
||||
}).catch(function (error) {
|
||||
var uploaded = error && error.uploaded ? error.uploaded.length : 0;
|
||||
var message = (error && error.message) || 'Не удалось загрузить файлы';
|
||||
if (uploaded) { message += '. До ошибки загружено: ' + uploaded; }
|
||||
Adminx.Toast.show(message, 'error');
|
||||
}).finally(function () {
|
||||
Adminx.Loader.hide();
|
||||
buttons.forEach(function (button) { button.disabled = false; });
|
||||
});
|
||||
},
|
||||
|
||||
@@ -2606,10 +2657,43 @@
|
||||
seen[url] = true;
|
||||
added++;
|
||||
});
|
||||
if (added) { this.sortMediaRowsByName(list); }
|
||||
this.updateMediaListEmpty(list);
|
||||
if (!added && files.length) { Adminx.Toast.show('Эти файлы уже есть в поле', 'info'); }
|
||||
},
|
||||
|
||||
sortMediaRowsByName: function (list) {
|
||||
if (!list || list.getAttribute('data-media-accept') !== 'image') { return; }
|
||||
var box = list.querySelector('[data-document-media-items]');
|
||||
if (!box) { return; }
|
||||
var rows = Array.prototype.slice.call(box.querySelectorAll('[data-document-media-row]'));
|
||||
if (rows.length < 2) { return; }
|
||||
var self = this;
|
||||
var collator = window.Intl && window.Intl.Collator
|
||||
? new window.Intl.Collator(undefined, { numeric: true, sensitivity: 'base' })
|
||||
: null;
|
||||
rows.sort(function (left, right) {
|
||||
var leftName = self.mediaRowFileName(left);
|
||||
var rightName = self.mediaRowFileName(right);
|
||||
if (!leftName && !rightName) { return 0; }
|
||||
if (!leftName) { return 1; }
|
||||
if (!rightName) { return -1; }
|
||||
return collator ? collator.compare(leftName, rightName) : leftName.localeCompare(rightName);
|
||||
});
|
||||
rows.forEach(function (row) { box.appendChild(row); });
|
||||
this.reindexMediaList(list);
|
||||
},
|
||||
|
||||
mediaRowFileName: function (row) {
|
||||
var input = row ? row.querySelector('[data-media-key="url"]') : null;
|
||||
var value = input ? String(input.value || '').trim() : '';
|
||||
if (!value) { return ''; }
|
||||
value = value.split(/[?#]/, 1)[0].replace(/\\/g, '/');
|
||||
var name = value.slice(value.lastIndexOf('/') + 1);
|
||||
try { name = decodeURIComponent(name); } catch (e) {}
|
||||
return name;
|
||||
},
|
||||
|
||||
createMediaRow: function (list) {
|
||||
this.addMediaRow(list);
|
||||
var rows = list.querySelectorAll('[data-document-media-row]');
|
||||
@@ -3016,11 +3100,15 @@
|
||||
var rubricEl = target ? (target.querySelector && target.querySelector('[data-document-picker-rubric]')) : null;
|
||||
if (!rubricEl && target && target.matches && target.matches('[data-document-picker-rubric]')) { rubricEl = target; }
|
||||
var rubric = rubricEl ? (rubricEl.getAttribute('data-document-picker-rubric') || '') : '';
|
||||
var scope = target && target.getAttribute ? (target.getAttribute('data-document-picker-scope') || '') : '';
|
||||
var excludeId = target && target.getAttribute ? (target.getAttribute('data-document-picker-exclude') || '') : '';
|
||||
var load = function () {
|
||||
var params = new URLSearchParams();
|
||||
params.set('q', search.value.trim());
|
||||
params.set('limit', 20);
|
||||
if (rubric) { params.set('rubric_id', rubric); }
|
||||
if (scope) { params.set('scope', scope); }
|
||||
if (excludeId) { params.set('exclude_id', excludeId); }
|
||||
status.textContent = 'Загрузка...';
|
||||
status.hidden = false;
|
||||
fetch(self.base() + '/documents/picker?' + params.toString(), { headers: { 'Accept': 'application/json' }, credentials: 'same-origin' })
|
||||
@@ -3581,7 +3669,8 @@
|
||||
var help = root.querySelector('[data-bulk-target-help]');
|
||||
if (!help || !target) { return; }
|
||||
var selected = target.options[target.selectedIndex];
|
||||
var message = selected ? String(selected.getAttribute('data-help') || '') : '';
|
||||
var editsField = operation && ['fill', 'set', 'clear', 'replace'].indexOf(operation.value) !== -1;
|
||||
var message = editsField && selected ? String(selected.getAttribute('data-help') || '') : '';
|
||||
if (selected && selected.value === 'document_title' && scope && scope.value === 'products') {
|
||||
message = 'Это заголовок документа в панели. Название товара на сайте обычно берётся из поля рубрики, помеченного «витрина: название товара на сайте».';
|
||||
}
|
||||
@@ -3616,8 +3705,11 @@
|
||||
var editsField = ['fill', 'set', 'clear', 'replace'].indexOf(value) !== -1;
|
||||
setVisibility('[data-bulk-target-wrap]', editsField);
|
||||
setVisibility('[data-bulk-search-wrap]', value === 'replace');
|
||||
setVisibility('[data-bulk-value-wrap]', value === 'fill' || value === 'set' || value === 'replace');
|
||||
setVisibility('[data-bulk-rubric-target-wrap]', value === 'move');
|
||||
setVisibility('[data-bulk-value-wrap]', value === 'fill' || value === 'set' || value === 'replace');
|
||||
setVisibility('[data-bulk-rubric-target-wrap]', value === 'move');
|
||||
setVisibility('[data-bulk-sitemap-frequency-wrap]', value === 'sitemap_frequency');
|
||||
setVisibility('[data-bulk-sitemap-priority-wrap]', value === 'sitemap_priority');
|
||||
setVisibility('[data-bulk-technical-help]', value === 'technical' || value === 'public');
|
||||
updateTargetHelp();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,302 +1,48 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<language>
|
||||
<phrase data="auto_003cc12783448df3">x</phrase>
|
||||
<phrase data="auto_0156bf1b8aac8565">Add more...</phrase>
|
||||
<phrase data="auto_02b4ebb5dc50bca5">The address of the document will be written into the link field.</phrase>
|
||||
<phrase data="auto_02fdd4b8923613d6">Up to 10 characters, optional.</phrase>
|
||||
<phrase data="auto_04c0389bc0db2353">Token copied</phrase>
|
||||
<phrase data="auto_080887ebc7bb5402"><button class="btn btn-ghost btn-icon btn-sm documents-media-remove" type="button" data-document-media-remove data-tooltip="Delete" aria-label="Delete"><i class="ti ti-trash"></i></button></phrase>
|
||||
<phrase data="auto_0957de938411c15b">field</phrase>
|
||||
<phrase data="auto_0af969e08c220502">Clear all field lines?</phrase>
|
||||
<phrase data="auto_0db49b55557f2bde">Parameter</phrase>
|
||||
<phrase data="auto_0e7fbe3404b67fe3">Rebuild JSON snapshots?</phrase>
|
||||
<phrase data="auto_0f9ccee053fe3b6b">New</phrase>
|
||||
<phrase data="auto_0ff730d95f9c5bc3">click to select</phrase>
|
||||
<phrase data="auto_122f4893d3d0d802">Failed to check alias</phrase>
|
||||
<phrase data="auto_1291e1971ba28ee6">API token created</phrase>
|
||||
<phrase data="auto_12bfabff3d7dc01c">Add a keyword</phrase>
|
||||
<phrase data="auto_18337ef195f7d88d"><div class="modal-body"><div class="input-wrap documents-relation-search"><i class="ti ti-search"></i><input class="input" type="search" placeholder="ID, title or alias" data-relation-search></div><div class="documents-picker-status" data-relation-status>Loading...</div><div class="documents-relation-list" data-relation-list></div></div></phrase>
|
||||
<phrase data="auto_1894f01f2cfa4702">JSON snapshot</phrase>
|
||||
<phrase data="auto_1a7725e697463fd8">to</phrase>
|
||||
<phrase data="auto_1af72c14888c4574">Creation preset</phrase>
|
||||
<phrase data="auto_1bc16af35fa47103">uh</phrase>
|
||||
<phrase data="auto_1d00a5603a94c17d">Teaser ID/link</phrase>
|
||||
<phrase data="auto_1d402bc8ffda29cd">Internal server error. Please refresh the page and try again.</phrase>
|
||||
<phrase data="auto_1f864100c5c97f02"><button class="btn btn-ghost btn-icon btn-sm" type="button" data-document-media-down data-tooltip="Below" aria-label="Below"><i class="ti ti-arrow-down"></i></button></phrase>
|
||||
<phrase data="auto_22dc89ab84f07324">"><button class="btn btn-secondary btn-icon btn-sm" type="button" data-document-media-pick data-tooltip="Select file" aria-label="Select file"><i class="ti ti-</phrase>
|
||||
<phrase data="auto_230b5877294e9726">ts</phrase>
|
||||
<phrase data="auto_23289c89f8c038a0">The document ID will be written in the field.</phrase>
|
||||
<phrase data="auto_242f64ddfe84899b">after saving</phrase>
|
||||
<phrase data="auto_25a9845975119103">Creation preset saved</phrase>
|
||||
<phrase data="auto_25dc101484dbd55c">Failed to load list</phrase>
|
||||
<phrase data="auto_285cc4001478d568">h</phrase>
|
||||
<phrase data="auto_28c993e4935524d8">h</phrase>
|
||||
<phrase data="auto_28fb6167ec0a79fe"><section class="documents-revision-system"><div class="documents-revision-subhead"><i class="ti ti-settings"></i><b>Basic settings</b><span></phrase>
|
||||
<phrase data="auto_292688e9915e161b">[link]" data-media-key="link" value="" placeholder="Link or document" data-document-media-url data-document-picker-type="all"></phrase>
|
||||
<phrase data="auto_29f3b29df0d0e54f">Restore</phrase>
|
||||
<phrase data="auto_2a9790fd6fab2922"><button class="btn btn-secondary btn-icon btn-sm" type="button" data-document-media-doc-pick data-tooltip="Select document" aria-label="Select document"><i class="ti ti-file-search"></i></button></div></phrase>
|
||||
<phrase data="auto_2ba58b00b4c52021"></span><label class="documents-revision-group-check"><input type="checkbox" data-document-revision-group="field" checked><span>All</span></label></div></phrase>
|
||||
<phrase data="auto_2c501dc73177148a">ID, name or alias</phrase>
|
||||
<phrase data="auto_2e31dae95f35e3b8">Select file</phrase>
|
||||
<phrase data="auto_2ec20105a2757791">Column 3</phrase>
|
||||
<phrase data="auto_2f1256a9610f7d64">Redirect saved</phrase>
|
||||
<phrase data="auto_2ff1fe42207df255">The secret is ready to be copied.</phrase>
|
||||
<phrase data="auto_301361625f901825">The server returned an incorrect response.</phrase>
|
||||
<phrase data="auto_30278b05221dd957">Refresh page</phrase>
|
||||
<phrase data="auto_32b74a3c47908c1e">Untitled</phrase>
|
||||
<phrase data="auto_33392e5848b4a8eb">JSON snapshots reassembled:</phrase>
|
||||
<phrase data="auto_336d12a4f96485a3"><button class="btn btn-ghost btn-icon btn-sm" type="button" data-document-media-up data-tooltip="Above" aria-label="Above"><i class="ti ti-arrow-up"></i></button></phrase>
|
||||
<phrase data="auto_359282f9ef75e654">Document ID</phrase>
|
||||
<phrase data="auto_35de32df9d942d9a">Note added</phrase>
|
||||
<phrase data="auto_3697bef0b3fc93f5">new</phrase>
|
||||
<phrase data="auto_3812a04b189ec1fd">new</phrase>
|
||||
<phrase data="auto_39704f311a86cd23">Draft</phrase>
|
||||
<phrase data="auto_3de49828e86a4016">Title</phrase>
|
||||
<phrase data="auto_3e096d0063299173">Revision deleted</phrase>
|
||||
<phrase data="auto_3e25fbc59741a10a">Document title</phrase>
|
||||
<phrase data="auto_3e670a1ec591883c">Files uploaded</phrase>
|
||||
<phrase data="auto_3eb77d3c13c51f92">Select revision</phrase>
|
||||
<phrase data="auto_3f039532d65bb5e3">Rebuild JSON</phrase>
|
||||
<phrase data="auto_4044fbc87708b9ad">Clear daily statistics?</phrase>
|
||||
<phrase data="auto_40785832c27c3a51">Column 1</phrase>
|
||||
<phrase data="auto_42ba924b3732dc07">fields</phrase>
|
||||
<phrase data="auto_433e4b40a403cdb0">th</phrase>
|
||||
<phrase data="auto_447d642f14fb2c8c">There are no matching files in the folder</phrase>
|
||||
<phrase data="auto_46551a5e6e43e854">Statistics cleared</phrase>
|
||||
<phrase data="auto_48be85b47e187f3c">not created yet</phrase>
|
||||
<phrase data="auto_4a05d8619dedc462">Copy</phrase>
|
||||
<phrase data="auto_4b4c88ed13b23b15">Redirect removed</phrase>
|
||||
<phrase data="auto_4d60d98f499d1580">Audits</phrase>
|
||||
<phrase data="auto_4f566fb5e3df4276">I</phrase>
|
||||
<phrase data="auto_516cbe2af24391af">l</phrase>
|
||||
<phrase data="auto_51b4eac98af84251">a</phrase>
|
||||
<phrase data="auto_51f784cde1916288">b</phrase>
|
||||
<phrase data="auto_522e27d7402089bc">Document saved</phrase>
|
||||
<phrase data="auto_53e908b396e3a6b3"><span class="badge badge-gray">not created</span></phrase>
|
||||
<phrase data="auto_54a8375d14dfdab5">Failed to read folder</phrase>
|
||||
<phrase data="auto_56ac0cff0f4a358f">Note deleted</phrase>
|
||||
<phrase data="auto_576895a59897535b">File not selected</phrase>
|
||||
<phrase data="auto_577021b5ac1fd915">f</phrase>
|
||||
<phrase data="auto_57afad1302f9645e">o</phrase>
|
||||
<phrase data="auto_588c8feeb973dcb1"><div><dt>File</dt><dd class="mono"></phrase>
|
||||
<phrase data="auto_59ddef8a55503c83">kg</phrase>
|
||||
<phrase data="auto_5a3b4bcf55400711">r</phrase>
|
||||
<phrase data="auto_5bd0d9fe0580526f">. The window must be left open until completion.</phrase>
|
||||
<phrase data="auto_5c019fa5d03ca5cf">in the section</phrase>
|
||||
<phrase data="auto_5e6c96299a2f11e9">s</phrase>
|
||||
<phrase data="auto_5e6d6b07b27b7a7c">All view_count lines will be removed. General document counters will remain unchanged.</phrase>
|
||||
<phrase data="auto_5f9eaa37c4e2ccff"><button class="btn btn-secondary btn-icon btn-sm" type="button" data-document-media-pick data-tooltip="Select file" aria-label="Select file"><i class="ti ti-paperclip"></i></button></phrase>
|
||||
<phrase data="auto_600363a73de5f3a5">Rebuild</phrase>
|
||||
<phrase data="auto_60512114c18fd5ed"><span class="badge badge-amber">needs reassembly</span></phrase>
|
||||
<phrase data="auto_619742ac4a834c45">doc.</phrase>
|
||||
<phrase data="auto_63b1fa390e91f75c">0 B</phrase>
|
||||
<phrase data="auto_65b7f1673713a00c">d</phrase>
|
||||
<phrase data="auto_66d207b9ebe9e4e3"><div class="documents-term-status is-error"><i class="ti ti-alert-circle"></i><span>Failed to load options</span></div></phrase>
|
||||
<phrase data="auto_6702cc12ca25aff1"><div class="empty-state">There are no revisions yet. The first snapshot will appear after saving the document.</div></phrase>
|
||||
<phrase data="auto_691245657a52bdce"><div><label class="documents-revision-check" aria-label="Restore</phrase>
|
||||
<phrase data="auto_6972375800d3e590">Clear the field?</phrase>
|
||||
<phrase data="auto_698ace159126e252">Column 2</phrase>
|
||||
<phrase data="auto_6b595786e068b5bc">Alias can be left empty</phrase>
|
||||
<phrase data="auto_6baaabf049b42cca">e</phrase>
|
||||
<phrase data="auto_6bee957a1f3ef55d">Length</phrase>
|
||||
<phrase data="auto_6c190c23240564f5">f</phrase>
|
||||
<phrase data="auto_6e408d3c9c3156bf">Delete "</phrase>
|
||||
<phrase data="auto_6e52ded051aa402d">Withdrawn</phrase>
|
||||
<phrase data="auto_6f658622a374b8d6"></p></div><button class="modal-close" type="button" data-relation-close aria-label="Close"><i class="ti ti-x"></i></button></div></phrase>
|
||||
<phrase data="auto_6fe63eee472a5a93"><span class="badge badge-green">relevant</span></phrase>
|
||||
<phrase data="auto_707a724dce1fa0d4">URL copied</phrase>
|
||||
<phrase data="auto_72c618d46424c93a">There are no saved values yet</phrase>
|
||||
<phrase data="auto_736a75710565c2f2">[description]" data-media-key="description" rows="2" placeholder="Description"></textarea></phrase>
|
||||
<phrase data="auto_75285ce97dc1dc97"><button class="btn btn-ghost btn-icon btn-sm" type="button" data-document-value-down data-tooltip="Below" aria-label="Below"><i class="ti ti-arrow-down"></i></button></phrase>
|
||||
<phrase data="auto_781e545c1063d5db">The integration will immediately lose access. It will be impossible to return this token.</phrase>
|
||||
<phrase data="auto_7845e83aad6bffff">Errors found:</phrase>
|
||||
<phrase data="auto_7a4f40b5797415a7">Category template: /</phrase>
|
||||
<phrase data="auto_7a9b21737266b2d1">, errors:</phrase>
|
||||
<phrase data="auto_7bd54e89985213b9">Template</phrase>
|
||||
<phrase data="auto_7c3bb087be98e4e9">Failed to load statistics</phrase>
|
||||
<phrase data="auto_7dcc70f455f9f122">API token revoked</phrase>
|
||||
<phrase data="auto_7f09659cde925652">Find or add a tag</phrase>
|
||||
<phrase data="auto_7f7328fc7d7316b8">n</phrase>
|
||||
<phrase data="auto_80a2c74df6ffb08d">Open the desired folder and confirm your selection. All suitable files from it will be added to the field.</phrase>
|
||||
<phrase data="auto_80c97478d2179d1c"><div><dt>State</dt><dd></phrase>
|
||||
<phrase data="auto_83c8e08533872aff"><div class="empty-state">Loading...</div></phrase>
|
||||
<phrase data="auto_84b96b359e9c61d3">The contents of the snapshot will appear after selecting a revision.</phrase>
|
||||
<phrase data="auto_86ea33aef5e95d4f">Delete</phrase>
|
||||
<phrase data="auto_8922542f90c16aee">Copied</phrase>
|
||||
<phrase data="auto_8bf2ee2944fdd73f">optional</phrase>
|
||||
<phrase data="auto_8c34e8bce7d519b3">The description will appear after filling out the meta description.</phrase>
|
||||
<phrase data="auto_8d333d8b91196c4b">Documents</phrase>
|
||||
<phrase data="auto_8d5d38d878604c11">The document has been restored</phrase>
|
||||
<phrase data="auto_8e8ca8428150664e">g</phrase>
|
||||
<phrase data="auto_8ff9429d66687894">No matches</phrase>
|
||||
<phrase data="auto_919be7c1e27ba64c"><button class="btn btn-ghost btn-icon btn-sm" type="button" data-document-value-up data-tooltip="Above" aria-label="Above"><i class="ti ti-arrow-up"></i></button></phrase>
|
||||
<phrase data="auto_9541be7605dbe971">Permissions for one external integration.</phrase>
|
||||
<phrase data="auto_96664ee8380d446c">The document has changed</phrase>
|
||||
<phrase data="auto_9729bca62f6c558e">Request Error</phrase>
|
||||
<phrase data="auto_97c557fb133f1f95">fields</phrase>
|
||||
<phrase data="auto_98b2073ed1815f28">Clear</phrase>
|
||||
<phrase data="auto_9b16ca539e602189">Revoke</phrase>
|
||||
<phrase data="auto_9bf756bd3124a21d">Changes saved</phrase>
|
||||
<phrase data="auto_9c4c0897f8ec6cf2">[title]" data-media-key="title" value="" placeholder="Image title"></phrase>
|
||||
<phrase data="auto_9c7449bfd16b63a0">Remove</phrase>
|
||||
<phrase data="auto_9caf4a95f812be6a">n</phrase>
|
||||
<phrase data="auto_9d1e4bc060f5da40">Added from folder:</phrase>
|
||||
<phrase data="auto_9d809f884b63cdec">Edit</phrase>
|
||||
<phrase data="auto_9da304d709611b05">Failed to load revisions</phrase>
|
||||
<phrase data="auto_9f0b990967c8a2ad">Meaning</phrase>
|
||||
<phrase data="auto_9f3b3c3b78133faa">Select document</phrase>
|
||||
<phrase data="auto_a15870f87e67e329"><div><dt>Formed by</dt><dd></phrase>
|
||||
<phrase data="auto_a18928c7baf57b4e">Fields only</phrase>
|
||||
<phrase data="auto_a2e9f606da125a72">b</phrase>
|
||||
<phrase data="auto_a37cb7b62a6f1b65">The category does not have a path template: the document alias is used from the root of the site.</phrase>
|
||||
<phrase data="auto_a45e66bc42d77b08">Failed to generate alias</phrase>
|
||||
<phrase data="auto_a59e2c2429fe7a88">and</phrase>
|
||||
<phrase data="auto_a5ecb551ebd318c2">Height,</phrase>
|
||||
<phrase data="auto_a63e1ce2e55b8d0a">No image selected</phrase>
|
||||
<phrase data="auto_a690b9dead4d8d8d"><div><dt>Size</dt><dd></phrase>
|
||||
<phrase data="auto_a7774650638b586d">JSON snapshot rebuilt</phrase>
|
||||
<phrase data="auto_a78e4bb6eb8c9ced">Document revisions</phrase>
|
||||
<phrase data="auto_a8504d513adfb6f5">Heading</phrase>
|
||||
<phrase data="auto_a90ed3357338f605">Loading...</phrase>
|
||||
<phrase data="auto_ab30701c85ebee86">Remove document</phrase>
|
||||
<phrase data="auto_ac3008315dc50b25">Add from this folder</phrase>
|
||||
<phrase data="auto_ae008e22ec3a8627">All lines in this field will be removed from the document after saving.</phrase>
|
||||
<phrase data="auto_af962c31c15d28d8"><button class="btn btn-ghost btn-icon btn-sm documents-drag-handle" type="button" data-doc-drag draggable="true" data-tooltip="Drag" aria-label="Drag"><i class="ti ti-grip-vertical"></i></button></phrase>
|
||||
<phrase data="auto_b0a419827426861b">Preset deleted</phrase>
|
||||
<phrase data="auto_b0d827d33fc8eb3f">Pictures</phrase>
|
||||
<phrase data="auto_b1c30d9335b4ffb7">/ + document alias. The date is taken from the publication.</phrase>
|
||||
<phrase data="auto_b279170b217c1e48"><div><dt>Fields</dt><dd class="mono"></phrase>
|
||||
<phrase data="auto_b2ac54889c1e667e">Batch rebuild stopped</phrase>
|
||||
<phrase data="auto_b36631e2d2874351"><article class="documents-revision-field documents-revision-system-field"><div><label class="documents-revision-check" aria-label="Restore</phrase>
|
||||
<phrase data="auto_b383b6f9be5e7ca2">Failed to get snapshot status</phrase>
|
||||
<phrase data="auto_b40bbca36d2d172e">with</phrase>
|
||||
<phrase data="auto_b5251271237d718b">These files are already in the field</phrase>
|
||||
<phrase data="auto_b92a4704544f84aa">The pictures will be sequentially reassembled to</phrase>
|
||||
<phrase data="auto_b9917824e609b5b3">pictures</phrase>
|
||||
<phrase data="auto_baa96cc9f67a7eb8">yu</phrase>
|
||||
<phrase data="auto_be1aff65661f854c">[name]" data-media-key="name" value="" placeholder="File name"></phrase>
|
||||
<phrase data="auto_be4a59e132257571">Revoke an API token?</phrase>
|
||||
<phrase data="auto_be7ec45710267c5c"><section class="documents-revision-content"><div class="documents-revision-subhead"><i class="ti ti-forms"></i><b>Category fields</b><span></phrase>
|
||||
<phrase data="auto_bea15c7bbd9e167c">e</phrase>
|
||||
<phrase data="auto_beed168817322eeb">from</phrase>
|
||||
<phrase data="auto_bf6379458cca6658">m</phrase>
|
||||
<phrase data="auto_c13875d6c76e5c2e">w</phrase>
|
||||
<phrase data="auto_c2b70c3bb20678a7">Failed to apply filters</phrase>
|
||||
<phrase data="auto_c52083faa73d3829">Field</phrase>
|
||||
<phrase data="auto_c5eb26618a7ede98">Read only</phrase>
|
||||
<phrase data="auto_c7fca87d8dd9b0e6">Click to find document</phrase>
|
||||
<phrase data="auto_c9d8ea6476aa730d">Add "</phrase>
|
||||
<phrase data="auto_cccd51a8c6aa88c1"><div class="documents-term-status"><i class="ti ti-loader-2"></i><span>Looking for matches...</span></div></phrase>
|
||||
<phrase data="auto_ccfe048a5551ed0f">preset</phrase>
|
||||
<phrase data="auto_cdd3b42f2a48df2f">Delete preset</phrase>
|
||||
<phrase data="auto_ceebfda5155965db">Failed to generate short alias</phrase>
|
||||
<phrase data="auto_cf0fc49836b59906">can be left blank</phrase>
|
||||
<phrase data="auto_cf412de9896e972b">Select at least one resolution</phrase>
|
||||
<phrase data="auto_d0888e0521387c25">Width,</phrase>
|
||||
<phrase data="auto_d164037dc0f1bd06">Delete revision</phrase>
|
||||
<phrase data="auto_d2264bee0979ddf6"><div><dt>Status</dt><dd>Loading...</dd></div></phrase>
|
||||
<phrase data="auto_d6951b2c8c477f98">All elements of this field will be removed from the document after saving.</phrase>
|
||||
<phrase data="auto_d6b08d92a7694cd4">Weight,</phrase>
|
||||
<phrase data="auto_d77df87cd6098c73">History of field values</phrase>
|
||||
<phrase data="auto_d7907f4d435df378">Additionally</phrase>
|
||||
<phrase data="auto_d944cde8b15c4d8b">at</phrase>
|
||||
<phrase data="auto_d9c83b31f5cb2376">Failed to check short alias</phrase>
|
||||
<phrase data="auto_da97cf5fe3fc4c42">Checking...</phrase>
|
||||
<phrase data="auto_db4d819570e77e56">draft</phrase>
|
||||
<phrase data="auto_dcedec8acc4af7ca">Assignment document</phrase>
|
||||
<phrase data="auto_dd0ec9a1c7140562">Add files from a folder</phrase>
|
||||
<phrase data="auto_defc150c8003aa92">Revisions deleted</phrase>
|
||||
<phrase data="auto_df5763ef792cf2f4">cm</phrase>
|
||||
<phrase data="auto_e01aed78c667a5aa"><button class="btn btn-ghost btn-icon btn-sm documents-value-remove" type="button" data-document-value-remove data-tooltip="Delete" aria-label="Delete"><i class="ti ti-trash"></i></button></phrase>
|
||||
<phrase data="auto_e4cedbc81a3c0d4e">ъ</phrase>
|
||||
<phrase data="auto_e576260a6a03f359">t</phrase>
|
||||
<phrase data="auto_e76f1ce35ab97dfb"></span><label class="documents-revision-group-check"><input type="checkbox" data-document-revision-group="document" checked><span>All</span></label></div></phrase>
|
||||
<phrase data="auto_e83e7fbf2312ab9e">The document has already been changed. Refresh the page.</phrase>
|
||||
<phrase data="auto_e94209605c9c0a4e"><button class="documents-media-thumb" type="button" data-document-media-pick aria-label="Select file"><span><i class="ti ti-</phrase>
|
||||
<phrase data="auto_ec6be72560e6078a">The story is still empty</phrase>
|
||||
<phrase data="auto_eeb60e75b96656e7">Incorrect answer</phrase>
|
||||
<phrase data="auto_f0b532724126bbe8">Clear all field elements?</phrase>
|
||||
<phrase data="auto_f26e5c0c72082089">Find or add a keyword</phrase>
|
||||
<phrase data="auto_f3d123e46297531d">in</phrase>
|
||||
<phrase data="auto_f42c85cd57ba4aa0">Stay</phrase>
|
||||
<phrase data="auto_f6069600bcb07eea"><div class="modal-footer"><div class="mf-left documents-picker-count" data-relation-count></div><button class="btn btn-ghost" type="button" data-relation-close>Close</button></div></phrase>
|
||||
<phrase data="auto_f61de80bf0ca15a4">No document selected</phrase>
|
||||
<phrase data="auto_f7286439b109e428">New redirect</phrase>
|
||||
<phrase data="auto_f7806fce80e51b40">Old URL</phrase>
|
||||
<phrase data="auto_f914c65278294e4a"><div class="modal-header"><span class="dialog-icon info"><i class="ti ti-file-search"></i></span><div style="flex:1"><h3>Select document</h3><p class="text-secondary" style="margin-top:4px"></phrase>
|
||||
<phrase data="auto_fa9f0524f3a0531e">Add a tag</phrase>
|
||||
<phrase data="auto_fc8b3939cc9dc467">The path will be written in the document field.</phrase>
|
||||
<phrase data="auto_fda74d41e3311f87">A newer version is already saved on the server. Refresh the page, check the changes, and save the document again.</phrase>
|
||||
<phrase data="auto_ffec67789fb1fcdc">sch</phrase>
|
||||
<phrase data="documents_bulk_action">Action</phrase>
|
||||
<phrase data="documents_bulk_action_fallback">Action</phrase>
|
||||
<phrase data="documents_bulk_documents_suffix"> documents.</phrase>
|
||||
<phrase data="documents_bulk_errors">errors</phrase>
|
||||
<phrase data="documents_bulk_processed">processed</phrase>
|
||||
<phrase data="documents_bulk_unchanged">unchanged</phrase>
|
||||
<phrase data="runtime_05d4ae78b6f1bfee">n</phrase>
|
||||
<phrase data="runtime_0918b4ba92684eaa">Title</phrase>
|
||||
<phrase data="runtime_0940401102b8a3fe">t</phrase>
|
||||
<phrase data="runtime_11cef8141437f8a6">ъ</phrase>
|
||||
<phrase data="runtime_15f2ccabeb425c29">th</phrase>
|
||||
<phrase data="runtime_1cc10a3947f7c245">d</phrase>
|
||||
<phrase data="runtime_1d51ebe0fc45e38e">Fields only</phrase>
|
||||
<phrase data="runtime_259f56cb715ba3a3">e</phrase>
|
||||
<phrase data="runtime_3051067c6324c63f">h</phrase>
|
||||
<phrase data="runtime_30fbc377ae9122ed">e</phrase>
|
||||
<phrase data="runtime_3164696756227147">Note added</phrase>
|
||||
<phrase data="runtime_34c6fbb62da8ce5c">n</phrase>
|
||||
<phrase data="runtime_37d43a57a463add5">yu</phrase>
|
||||
<phrase data="runtime_40831c5d98a57dfc">h</phrase>
|
||||
<phrase data="runtime_446cdc8e3c0d7efc">s</phrase>
|
||||
<phrase data="runtime_46b0d3855548054a">JSON snapshot rebuilt</phrase>
|
||||
<phrase data="runtime_4f60bd4e24e7dc7f">w</phrase>
|
||||
<phrase data="runtime_50338c005c41fb4e">o</phrase>
|
||||
<phrase data="runtime_5225a95b111d47bf">to</phrase>
|
||||
<phrase data="runtime_53b10ee4405f56d6">not created yet</phrase>
|
||||
<phrase data="runtime_557f4cd2c6d3c150">cm</phrase>
|
||||
<phrase data="runtime_61095f9d62dfe291">The document has been restored</phrase>
|
||||
<phrase data="runtime_6228f1454b196ffd">API token revoked</phrase>
|
||||
<phrase data="runtime_65fd24f1cb37fec4">Draft</phrase>
|
||||
<phrase data="runtime_72a81659de042887">Revisions deleted</phrase>
|
||||
<phrase data="runtime_734dbc2b54ab6c95">r</phrase>
|
||||
<phrase data="runtime_754309a41e0df98a">f</phrase>
|
||||
<phrase data="runtime_7592b7ec4eba966a">ts</phrase>
|
||||
<phrase data="runtime_7b0ff8a2e5fdd66d">m</phrase>
|
||||
<phrase data="runtime_823c4eb3e895adc9">a</phrase>
|
||||
<phrase data="runtime_85011fce4419ee63">Field #</phrase>
|
||||
<phrase data="runtime_894f97c52af9e5ac">Note deleted</phrase>
|
||||
<phrase data="runtime_9aa032336a8e122c">b</phrase>
|
||||
<phrase data="runtime_9b21f5cf014c9efb">I</phrase>
|
||||
<phrase data="runtime_9b6276c9a4ac5507">Document saved</phrase>
|
||||
<phrase data="runtime_a1f5d39a12e8f6be">with</phrase>
|
||||
<phrase data="runtime_ab1f4be7e5d6fd8b">g</phrase>
|
||||
<phrase data="runtime_ae51ade91d2b85b7">Revision deleted</phrase>
|
||||
<phrase data="runtime_b8012cb642c887a0">in</phrase>
|
||||
<phrase data="runtime_b95d78565f154f82">b</phrase>
|
||||
<phrase data="runtime_bb69a96efca3303e">x</phrase>
|
||||
<phrase data="runtime_bbb369f210d2969f">sch</phrase>
|
||||
<phrase data="runtime_beee80c256b458da">at</phrase>
|
||||
<phrase data="runtime_bf0d18ef68a8a34e">can be left blank</phrase>
|
||||
<phrase data="runtime_c08fb476eca49399">kg</phrase>
|
||||
<phrase data="runtime_c5412ba2cc2fc45a">Creation preset saved</phrase>
|
||||
<phrase data="runtime_c78364c5d0f27706">B</phrase>
|
||||
<phrase data="runtime_cdd02bd8b5684812">Redirect removed</phrase>
|
||||
<phrase data="runtime_d92fff560eb5495e">l</phrase>
|
||||
<phrase data="runtime_dd48804aa38b03e1">Preset deleted</phrase>
|
||||
<phrase data="runtime_dd591284d827e17f">f</phrase>
|
||||
<phrase data="runtime_e1c88af54b9fced2">Document #</phrase>
|
||||
<phrase data="runtime_e35c8bb151d3530d">Redirect saved</phrase>
|
||||
<phrase data="runtime_e93c3d6287d39cc3">API token created</phrase>
|
||||
<phrase data="runtime_ee71f8405f87d786">uh</phrase>
|
||||
<phrase data="runtime_eead37caf818d0fa">and</phrase>
|
||||
<phrase data="runtime_f4019994d4e75a2a">after saving</phrase>
|
||||
<phrase data="runtime_f9a506077fa0d961">New</phrase>
|
||||
<phrase data="runtime_fff8b34d92dab340">Template</phrase>
|
||||
<phrase data="auto_f8af664b7ab2ef75">Remove all items?</phrase>
|
||||
<phrase data="auto_10403ca9b11a0b49">After saving, the items will be removed from the document. Unused files can be restored from the media trash.</phrase>
|
||||
<phrase data="auto_5ede041b60096d58">Remove the image?</phrase>
|
||||
<phrase data="auto_c5b3cd090f16f479">After saving, the image will be removed from the document. The unused file can be restored from the media trash.</phrase>
|
||||
<phrase data="auto_e26c8664b60bfa9a">Remove the image from the document?</phrase>
|
||||
<phrase data="auto_02e536f7b2d5cec8">The document was saved, but some old files were not moved to the trash.</phrase>
|
||||
</language>
|
||||
|
||||
@@ -493,6 +493,8 @@
|
||||
<phrase data="auto_30278b05221dd957">Refresh page</phrase>
|
||||
<phrase data="auto_8bf2a1644e73bfa4">Published</phrase>
|
||||
<phrase data="auto_14c618ff49e965ac">Published</phrase>
|
||||
<phrase data="auto_5677fc62ef7bda9c">Open on site</phrase>
|
||||
<phrase data="auto_b41b9aaec38f5380">Open page in a new tab</phrase>
|
||||
<phrase data="auto_80a2c74df6ffb08d">Open the desired folder and confirm your selection. All suitable files from it will be added to the field.</phrase>
|
||||
<phrase data="auto_555ad1c0c33d26b3">Cancel</phrase>
|
||||
<phrase data="auto_f6e2120e73d10a68">Cancel change</phrase>
|
||||
|
||||
@@ -1,302 +1,48 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<language>
|
||||
<phrase data="auto_003cc12783448df3">х</phrase>
|
||||
<phrase data="auto_0156bf1b8aac8565">Добавить ещё…</phrase>
|
||||
<phrase data="auto_02b4ebb5dc50bca5">В поле-ссылку будет записан адрес документа.</phrase>
|
||||
<phrase data="auto_02fdd4b8923613d6">До 10 символов, необязательно.</phrase>
|
||||
<phrase data="auto_04c0389bc0db2353">Токен скопирован</phrase>
|
||||
<phrase data="auto_080887ebc7bb5402"><button class="btn btn-ghost btn-icon btn-sm documents-media-remove" type="button" data-document-media-remove data-tooltip="Удалить" aria-label="Удалить"><i class="ti ti-trash"></i></button></phrase>
|
||||
<phrase data="auto_0957de938411c15b">поле</phrase>
|
||||
<phrase data="auto_0af969e08c220502">Очистить все строки поля?</phrase>
|
||||
<phrase data="auto_0db49b55557f2bde">Параметр</phrase>
|
||||
<phrase data="auto_0e7fbe3404b67fe3">Пересобрать JSON-снимки?</phrase>
|
||||
<phrase data="auto_0f9ccee053fe3b6b">Новый</phrase>
|
||||
<phrase data="auto_0ff730d95f9c5bc3">нажмите, чтобы выбрать</phrase>
|
||||
<phrase data="auto_122f4893d3d0d802">Не удалось проверить alias</phrase>
|
||||
<phrase data="auto_1291e1971ba28ee6">API-токен создан</phrase>
|
||||
<phrase data="auto_12bfabff3d7dc01c">Добавить ключевое слово</phrase>
|
||||
<phrase data="auto_18337ef195f7d88d"><div class="modal-body"><div class="input-wrap documents-relation-search"><i class="ti ti-search"></i><input class="input" type="search" placeholder="ID, название или alias" data-relation-search></div><div class="documents-picker-status" data-relation-status>Загрузка...</div><div class="documents-relation-list" data-relation-list></div></div></phrase>
|
||||
<phrase data="auto_1894f01f2cfa4702">JSON-снимок</phrase>
|
||||
<phrase data="auto_1a7725e697463fd8">к</phrase>
|
||||
<phrase data="auto_1af72c14888c4574">Пресет создания</phrase>
|
||||
<phrase data="auto_1bc16af35fa47103">э</phrase>
|
||||
<phrase data="auto_1d00a5603a94c17d">ID тизера / ссылка</phrase>
|
||||
<phrase data="auto_1d402bc8ffda29cd">Внутренняя ошибка сервера. Обновите страницу и повторите попытку.</phrase>
|
||||
<phrase data="auto_1f864100c5c97f02"><button class="btn btn-ghost btn-icon btn-sm" type="button" data-document-media-down data-tooltip="Ниже" aria-label="Ниже"><i class="ti ti-arrow-down"></i></button></phrase>
|
||||
<phrase data="auto_22dc89ab84f07324">"><button class="btn btn-secondary btn-icon btn-sm" type="button" data-document-media-pick data-tooltip="Выбрать файл" aria-label="Выбрать файл"><i class="ti ti-</phrase>
|
||||
<phrase data="auto_230b5877294e9726">ц</phrase>
|
||||
<phrase data="auto_23289c89f8c038a0">В поле будет записан ID документа.</phrase>
|
||||
<phrase data="auto_242f64ddfe84899b">после сохранения</phrase>
|
||||
<phrase data="auto_25a9845975119103">Пресет создания сохранён</phrase>
|
||||
<phrase data="auto_25dc101484dbd55c">Не удалось загрузить список</phrase>
|
||||
<phrase data="auto_285cc4001478d568">ч</phrase>
|
||||
<phrase data="auto_28c993e4935524d8">з</phrase>
|
||||
<phrase data="auto_28fb6167ec0a79fe"><section class="documents-revision-system"><div class="documents-revision-subhead"><i class="ti ti-settings"></i><b>Основные настройки</b><span></phrase>
|
||||
<phrase data="auto_292688e9915e161b">[link]" data-media-key="link" value="" placeholder="Ссылка или документ" data-document-media-url data-document-picker-type="all"></phrase>
|
||||
<phrase data="auto_29f3b29df0d0e54f">Восстановить</phrase>
|
||||
<phrase data="auto_2a9790fd6fab2922"><button class="btn btn-secondary btn-icon btn-sm" type="button" data-document-media-doc-pick data-tooltip="Выбрать документ" aria-label="Выбрать документ"><i class="ti ti-file-search"></i></button></div></phrase>
|
||||
<phrase data="auto_2ba58b00b4c52021"></span><label class="documents-revision-group-check"><input type="checkbox" data-document-revision-group="field" checked><span>Все</span></label></div></phrase>
|
||||
<phrase data="auto_2c501dc73177148a">ID, название или alias</phrase>
|
||||
<phrase data="auto_2e31dae95f35e3b8">Выбрать файл</phrase>
|
||||
<phrase data="auto_2ec20105a2757791">Колонка 3</phrase>
|
||||
<phrase data="auto_2f1256a9610f7d64">Редирект сохранён</phrase>
|
||||
<phrase data="auto_2ff1fe42207df255">Секрет готов к копированию.</phrase>
|
||||
<phrase data="auto_301361625f901825">Сервер вернул некорректный ответ.</phrase>
|
||||
<phrase data="auto_30278b05221dd957">Обновить страницу</phrase>
|
||||
<phrase data="auto_32b74a3c47908c1e">Без названия</phrase>
|
||||
<phrase data="auto_33392e5848b4a8eb">JSON-снимки пересобраны:</phrase>
|
||||
<phrase data="auto_336d12a4f96485a3"><button class="btn btn-ghost btn-icon btn-sm" type="button" data-document-media-up data-tooltip="Выше" aria-label="Выше"><i class="ti ti-arrow-up"></i></button></phrase>
|
||||
<phrase data="auto_359282f9ef75e654">ID документа</phrase>
|
||||
<phrase data="auto_35de32df9d942d9a">Заметка добавлена</phrase>
|
||||
<phrase data="auto_3697bef0b3fc93f5">новый</phrase>
|
||||
<phrase data="auto_3812a04b189ec1fd">новое</phrase>
|
||||
<phrase data="auto_39704f311a86cd23">Черновик</phrase>
|
||||
<phrase data="auto_3de49828e86a4016">Название</phrase>
|
||||
<phrase data="auto_3e096d0063299173">Ревизия удалена</phrase>
|
||||
<phrase data="auto_3e25fbc59741a10a">Заголовок документа</phrase>
|
||||
<phrase data="auto_3e670a1ec591883c">Файлы загружены</phrase>
|
||||
<phrase data="auto_3eb77d3c13c51f92">Выберите ревизию</phrase>
|
||||
<phrase data="auto_3f039532d65bb5e3">Пересобрать JSON</phrase>
|
||||
<phrase data="auto_4044fbc87708b9ad">Очистить подневную статистику?</phrase>
|
||||
<phrase data="auto_40785832c27c3a51">Колонка 1</phrase>
|
||||
<phrase data="auto_42ba924b3732dc07">поля</phrase>
|
||||
<phrase data="auto_433e4b40a403cdb0">й</phrase>
|
||||
<phrase data="auto_447d642f14fb2c8c">В папке нет подходящих файлов</phrase>
|
||||
<phrase data="auto_46551a5e6e43e854">Статистика очищена</phrase>
|
||||
<phrase data="auto_48be85b47e187f3c">ещё не создан</phrase>
|
||||
<phrase data="auto_4a05d8619dedc462">Копировать</phrase>
|
||||
<phrase data="auto_4b4c88ed13b23b15">Редирект удалён</phrase>
|
||||
<phrase data="auto_4d60d98f499d1580">Ревизии</phrase>
|
||||
<phrase data="auto_4f566fb5e3df4276">я</phrase>
|
||||
<phrase data="auto_516cbe2af24391af">л</phrase>
|
||||
<phrase data="auto_51b4eac98af84251">а</phrase>
|
||||
<phrase data="auto_51f784cde1916288">ь</phrase>
|
||||
<phrase data="auto_522e27d7402089bc">Документ сохранён</phrase>
|
||||
<phrase data="auto_53e908b396e3a6b3"><span class="badge badge-gray">не создан</span></phrase>
|
||||
<phrase data="auto_54a8375d14dfdab5">Не удалось прочитать папку</phrase>
|
||||
<phrase data="auto_56ac0cff0f4a358f">Заметка удалена</phrase>
|
||||
<phrase data="auto_576895a59897535b">Файл не выбран</phrase>
|
||||
<phrase data="auto_577021b5ac1fd915">ф</phrase>
|
||||
<phrase data="auto_57afad1302f9645e">о</phrase>
|
||||
<phrase data="auto_588c8feeb973dcb1"><div><dt>Файл</dt><dd class="mono"></phrase>
|
||||
<phrase data="auto_59ddef8a55503c83">кг</phrase>
|
||||
<phrase data="auto_5a3b4bcf55400711">р</phrase>
|
||||
<phrase data="auto_5bd0d9fe0580526f">. Окно нужно оставить открытым до завершения.</phrase>
|
||||
<phrase data="auto_5c019fa5d03ca5cf">в рубрике</phrase>
|
||||
<phrase data="auto_5e6c96299a2f11e9">ы</phrase>
|
||||
<phrase data="auto_5e6d6b07b27b7a7c">Все строки view_count будут удалены. Общие счётчики документов останутся без изменений.</phrase>
|
||||
<phrase data="auto_5f9eaa37c4e2ccff"><button class="btn btn-secondary btn-icon btn-sm" type="button" data-document-media-pick data-tooltip="Выбрать файл" aria-label="Выбрать файл"><i class="ti ti-paperclip"></i></button></phrase>
|
||||
<phrase data="auto_600363a73de5f3a5">Пересобрать</phrase>
|
||||
<phrase data="auto_60512114c18fd5ed"><span class="badge badge-amber">нужна пересборка</span></phrase>
|
||||
<phrase data="auto_619742ac4a834c45">док.</phrase>
|
||||
<phrase data="auto_63b1fa390e91f75c">0 Б</phrase>
|
||||
<phrase data="auto_65b7f1673713a00c">д</phrase>
|
||||
<phrase data="auto_66d207b9ebe9e4e3"><div class="documents-term-status is-error"><i class="ti ti-alert-circle"></i><span>Не удалось загрузить варианты</span></div></phrase>
|
||||
<phrase data="auto_6702cc12ca25aff1"><div class="empty-state">Ревизий пока нет. Первый снимок появится после сохранения документа.</div></phrase>
|
||||
<phrase data="auto_691245657a52bdce"><div><label class="documents-revision-check" aria-label="Восстановить</phrase>
|
||||
<phrase data="auto_6972375800d3e590">Очистить поле?</phrase>
|
||||
<phrase data="auto_698ace159126e252">Колонка 2</phrase>
|
||||
<phrase data="auto_6b595786e068b5bc">Alias можно оставить пустым</phrase>
|
||||
<phrase data="auto_6baaabf049b42cca">ё</phrase>
|
||||
<phrase data="auto_6bee957a1f3ef55d">Длина,</phrase>
|
||||
<phrase data="auto_6c190c23240564f5">ж</phrase>
|
||||
<phrase data="auto_6e408d3c9c3156bf">Удалить «</phrase>
|
||||
<phrase data="auto_6e52ded051aa402d">Отозван</phrase>
|
||||
<phrase data="auto_6f658622a374b8d6"></p></div><button class="modal-close" type="button" data-relation-close aria-label="Закрыть"><i class="ti ti-x"></i></button></div></phrase>
|
||||
<phrase data="auto_6fe63eee472a5a93"><span class="badge badge-green">актуален</span></phrase>
|
||||
<phrase data="auto_707a724dce1fa0d4">URL скопирован</phrase>
|
||||
<phrase data="auto_72c618d46424c93a">Сохранённых значений пока нет</phrase>
|
||||
<phrase data="auto_736a75710565c2f2">[description]" data-media-key="description" rows="2" placeholder="Описание"></textarea></phrase>
|
||||
<phrase data="auto_75285ce97dc1dc97"><button class="btn btn-ghost btn-icon btn-sm" type="button" data-document-value-down data-tooltip="Ниже" aria-label="Ниже"><i class="ti ti-arrow-down"></i></button></phrase>
|
||||
<phrase data="auto_781e545c1063d5db">Интеграция сразу потеряет доступ. Вернуть этот токен будет невозможно.</phrase>
|
||||
<phrase data="auto_7845e83aad6bffff">Найдено ошибок:</phrase>
|
||||
<phrase data="auto_7a4f40b5797415a7">Шаблон рубрики: /</phrase>
|
||||
<phrase data="auto_7a9b21737266b2d1">, ошибок:</phrase>
|
||||
<phrase data="auto_7bd54e89985213b9">Шаблон</phrase>
|
||||
<phrase data="auto_7c3bb087be98e4e9">Не удалось загрузить статистику</phrase>
|
||||
<phrase data="auto_7dcc70f455f9f122">API-токен отозван</phrase>
|
||||
<phrase data="auto_7f09659cde925652">Найти или добавить тег</phrase>
|
||||
<phrase data="auto_7f7328fc7d7316b8">н</phrase>
|
||||
<phrase data="auto_80a2c74df6ffb08d">Откройте нужную папку и подтвердите выбор. В поле добавятся все подходящие файлы из неё.</phrase>
|
||||
<phrase data="auto_80c97478d2179d1c"><div><dt>Состояние</dt><dd></phrase>
|
||||
<phrase data="auto_83c8e08533872aff"><div class="empty-state">Загрузка...</div></phrase>
|
||||
<phrase data="auto_84b96b359e9c61d3">Содержимое снимка появится после выбора ревизии.</phrase>
|
||||
<phrase data="auto_86ea33aef5e95d4f">Удалить</phrase>
|
||||
<phrase data="auto_8922542f90c16aee">Скопировано</phrase>
|
||||
<phrase data="auto_8bf2ee2944fdd73f">необязательно</phrase>
|
||||
<phrase data="auto_8c34e8bce7d519b3">Описание появится после заполнения meta description.</phrase>
|
||||
<phrase data="auto_8d333d8b91196c4b">Документов</phrase>
|
||||
<phrase data="auto_8d5d38d878604c11">Документ восстановлен</phrase>
|
||||
<phrase data="auto_8e8ca8428150664e">г</phrase>
|
||||
<phrase data="auto_8ff9429d66687894">Совпадений нет</phrase>
|
||||
<phrase data="auto_919be7c1e27ba64c"><button class="btn btn-ghost btn-icon btn-sm" type="button" data-document-value-up data-tooltip="Выше" aria-label="Выше"><i class="ti ti-arrow-up"></i></button></phrase>
|
||||
<phrase data="auto_9541be7605dbe971">Права доступа для одной внешней интеграции.</phrase>
|
||||
<phrase data="auto_96664ee8380d446c">Документ изменился</phrase>
|
||||
<phrase data="auto_9729bca62f6c558e">Ошибка запроса</phrase>
|
||||
<phrase data="auto_97c557fb133f1f95">полей</phrase>
|
||||
<phrase data="auto_98b2073ed1815f28">Очистить</phrase>
|
||||
<phrase data="auto_9b16ca539e602189">Отозвать</phrase>
|
||||
<phrase data="auto_9bf756bd3124a21d">Изменения сохранены</phrase>
|
||||
<phrase data="auto_9c4c0897f8ec6cf2">[title]" data-media-key="title" value="" placeholder="Заголовок изображения"></phrase>
|
||||
<phrase data="auto_9c7449bfd16b63a0">Убрать</phrase>
|
||||
<phrase data="auto_9caf4a95f812be6a">п</phrase>
|
||||
<phrase data="auto_9d1e4bc060f5da40">Добавлено из папки:</phrase>
|
||||
<phrase data="auto_9d809f884b63cdec">Изменить</phrase>
|
||||
<phrase data="auto_9da304d709611b05">Не удалось загрузить ревизии</phrase>
|
||||
<phrase data="auto_9f0b990967c8a2ad">Значение</phrase>
|
||||
<phrase data="auto_9f3b3c3b78133faa">Выбрать документ</phrase>
|
||||
<phrase data="auto_a15870f87e67e329"><div><dt>Сформирован</dt><dd></phrase>
|
||||
<phrase data="auto_a18928c7baf57b4e">Только поля</phrase>
|
||||
<phrase data="auto_a2e9f606da125a72">б</phrase>
|
||||
<phrase data="auto_a37cb7b62a6f1b65">У рубрики нет шаблона пути: alias документа используется от корня сайта.</phrase>
|
||||
<phrase data="auto_a45e66bc42d77b08">Не удалось сгенерировать alias</phrase>
|
||||
<phrase data="auto_a59e2c2429fe7a88">и</phrase>
|
||||
<phrase data="auto_a5ecb551ebd318c2">Высота,</phrase>
|
||||
<phrase data="auto_a63e1ce2e55b8d0a">Изображение не выбрано</phrase>
|
||||
<phrase data="auto_a690b9dead4d8d8d"><div><dt>Размер</dt><dd></phrase>
|
||||
<phrase data="auto_a7774650638b586d">JSON-снимок пересобран</phrase>
|
||||
<phrase data="auto_a78e4bb6eb8c9ced">Ревизии документа</phrase>
|
||||
<phrase data="auto_a8504d513adfb6f5">Заголовок</phrase>
|
||||
<phrase data="auto_a90ed3357338f605">Загрузка...</phrase>
|
||||
<phrase data="auto_ab30701c85ebee86">Убрать документ</phrase>
|
||||
<phrase data="auto_ac3008315dc50b25">Добавить из этой папки</phrase>
|
||||
<phrase data="auto_ae008e22ec3a8627">Все строки этого поля будут удалены из документа после сохранения.</phrase>
|
||||
<phrase data="auto_af962c31c15d28d8"><button class="btn btn-ghost btn-icon btn-sm documents-drag-handle" type="button" data-doc-drag draggable="true" data-tooltip="Перетащить" aria-label="Перетащить"><i class="ti ti-grip-vertical"></i></button></phrase>
|
||||
<phrase data="auto_b0a419827426861b">Пресет удалён</phrase>
|
||||
<phrase data="auto_b0d827d33fc8eb3f">Снимки</phrase>
|
||||
<phrase data="auto_b1c30d9335b4ffb7">/ + alias документа. Дата берётся из публикации.</phrase>
|
||||
<phrase data="auto_b279170b217c1e48"><div><dt>Поля</dt><dd class="mono"></phrase>
|
||||
<phrase data="auto_b2ac54889c1e667e">Пакетная пересборка остановлена</phrase>
|
||||
<phrase data="auto_b36631e2d2874351"><article class="documents-revision-field documents-revision-system-field"><div><label class="documents-revision-check" aria-label="Восстановить</phrase>
|
||||
<phrase data="auto_b383b6f9be5e7ca2">Не удалось получить статус снимка</phrase>
|
||||
<phrase data="auto_b40bbca36d2d172e">с</phrase>
|
||||
<phrase data="auto_b5251271237d718b">Эти файлы уже есть в поле</phrase>
|
||||
<phrase data="auto_b92a4704544f84aa">Снимки будут последовательно пересобраны для</phrase>
|
||||
<phrase data="auto_b9917824e609b5b3">снимков</phrase>
|
||||
<phrase data="auto_baa96cc9f67a7eb8">ю</phrase>
|
||||
<phrase data="auto_be1aff65661f854c">[name]" data-media-key="name" value="" placeholder="Название файла"></phrase>
|
||||
<phrase data="auto_be4a59e132257571">Отозвать API-токен?</phrase>
|
||||
<phrase data="auto_be7ec45710267c5c"><section class="documents-revision-content"><div class="documents-revision-subhead"><i class="ti ti-forms"></i><b>Поля рубрики</b><span></phrase>
|
||||
<phrase data="auto_bea15c7bbd9e167c">е</phrase>
|
||||
<phrase data="auto_beed168817322eeb">из</phrase>
|
||||
<phrase data="auto_bf6379458cca6658">м</phrase>
|
||||
<phrase data="auto_c13875d6c76e5c2e">ш</phrase>
|
||||
<phrase data="auto_c2b70c3bb20678a7">Не удалось применить фильтры</phrase>
|
||||
<phrase data="auto_c52083faa73d3829">Поле</phrase>
|
||||
<phrase data="auto_c5eb26618a7ede98">Только чтение</phrase>
|
||||
<phrase data="auto_c7fca87d8dd9b0e6">Нажмите, чтобы найти документ</phrase>
|
||||
<phrase data="auto_c9d8ea6476aa730d">Добавить «</phrase>
|
||||
<phrase data="auto_cccd51a8c6aa88c1"><div class="documents-term-status"><i class="ti ti-loader-2"></i><span>Ищем совпадения…</span></div></phrase>
|
||||
<phrase data="auto_ccfe048a5551ed0f">пресет</phrase>
|
||||
<phrase data="auto_cdd3b42f2a48df2f">Удалить пресет</phrase>
|
||||
<phrase data="auto_ceebfda5155965db">Не удалось сгенерировать короткий алиас</phrase>
|
||||
<phrase data="auto_cf0fc49836b59906">можно оставить пустым</phrase>
|
||||
<phrase data="auto_cf412de9896e972b">Выберите хотя бы одно разрешение</phrase>
|
||||
<phrase data="auto_d0888e0521387c25">Ширина,</phrase>
|
||||
<phrase data="auto_d164037dc0f1bd06">Удалить ревизию</phrase>
|
||||
<phrase data="auto_d2264bee0979ddf6"><div><dt>Состояние</dt><dd>Загрузка...</dd></div></phrase>
|
||||
<phrase data="auto_d6951b2c8c477f98">Все элементы этого поля будут удалены из документа после сохранения.</phrase>
|
||||
<phrase data="auto_d6b08d92a7694cd4">Вес,</phrase>
|
||||
<phrase data="auto_d77df87cd6098c73">История значений полей</phrase>
|
||||
<phrase data="auto_d7907f4d435df378">Дополнительно</phrase>
|
||||
<phrase data="auto_d944cde8b15c4d8b">у</phrase>
|
||||
<phrase data="auto_d9c83b31f5cb2376">Не удалось проверить короткий alias</phrase>
|
||||
<phrase data="auto_da97cf5fe3fc4c42">Проверка...</phrase>
|
||||
<phrase data="auto_db4d819570e77e56">черновик</phrase>
|
||||
<phrase data="auto_dcedec8acc4af7ca">Документ назначения</phrase>
|
||||
<phrase data="auto_dd0ec9a1c7140562">Добавить файлы из папки</phrase>
|
||||
<phrase data="auto_defc150c8003aa92">Ревизии удалены</phrase>
|
||||
<phrase data="auto_df5763ef792cf2f4">см</phrase>
|
||||
<phrase data="auto_e01aed78c667a5aa"><button class="btn btn-ghost btn-icon btn-sm documents-value-remove" type="button" data-document-value-remove data-tooltip="Удалить" aria-label="Удалить"><i class="ti ti-trash"></i></button></phrase>
|
||||
<phrase data="auto_e4cedbc81a3c0d4e">ъ</phrase>
|
||||
<phrase data="auto_e576260a6a03f359">т</phrase>
|
||||
<phrase data="auto_e76f1ce35ab97dfb"></span><label class="documents-revision-group-check"><input type="checkbox" data-document-revision-group="document" checked><span>Все</span></label></div></phrase>
|
||||
<phrase data="auto_e83e7fbf2312ab9e">Документ уже изменён. Обновите страницу.</phrase>
|
||||
<phrase data="auto_e94209605c9c0a4e"><button class="documents-media-thumb" type="button" data-document-media-pick aria-label="Выбрать файл"><span><i class="ti ti-</phrase>
|
||||
<phrase data="auto_ec6be72560e6078a">История пока пустая</phrase>
|
||||
<phrase data="auto_eeb60e75b96656e7">Некорректный ответ</phrase>
|
||||
<phrase data="auto_f0b532724126bbe8">Очистить все элементы поля?</phrase>
|
||||
<phrase data="auto_f26e5c0c72082089">Найти или добавить ключевое слово</phrase>
|
||||
<phrase data="auto_f3d123e46297531d">в</phrase>
|
||||
<phrase data="auto_f42c85cd57ba4aa0">Остаться</phrase>
|
||||
<phrase data="auto_f6069600bcb07eea"><div class="modal-footer"><div class="mf-left documents-picker-count" data-relation-count></div><button class="btn btn-ghost" type="button" data-relation-close>Закрыть</button></div></phrase>
|
||||
<phrase data="auto_f61de80bf0ca15a4">Документ не выбран</phrase>
|
||||
<phrase data="auto_f7286439b109e428">Новый редирект</phrase>
|
||||
<phrase data="auto_f7806fce80e51b40">Старый URL</phrase>
|
||||
<phrase data="auto_f914c65278294e4a"><div class="modal-header"><span class="dialog-icon info"><i class="ti ti-file-search"></i></span><div style="flex:1"><h3>Выбрать документ</h3><p class="text-secondary" style="margin-top:4px"></phrase>
|
||||
<phrase data="auto_fa9f0524f3a0531e">Добавить тег</phrase>
|
||||
<phrase data="auto_fc8b3939cc9dc467">Путь будет записан в поле документа.</phrase>
|
||||
<phrase data="auto_fda74d41e3311f87">На сервере уже сохранена более новая версия. Обновите страницу, проверьте изменения и сохраните документ повторно.</phrase>
|
||||
<phrase data="auto_ffec67789fb1fcdc">щ</phrase>
|
||||
<phrase data="documents_bulk_action">Действие</phrase>
|
||||
<phrase data="documents_bulk_action_fallback">Действие</phrase>
|
||||
<phrase data="documents_bulk_documents_suffix"> документов.</phrase>
|
||||
<phrase data="documents_bulk_errors">ошибок</phrase>
|
||||
<phrase data="documents_bulk_processed">обработано</phrase>
|
||||
<phrase data="documents_bulk_unchanged">без изменений</phrase>
|
||||
<phrase data="runtime_05d4ae78b6f1bfee">н</phrase>
|
||||
<phrase data="runtime_0918b4ba92684eaa">Название</phrase>
|
||||
<phrase data="runtime_0940401102b8a3fe">т</phrase>
|
||||
<phrase data="runtime_11cef8141437f8a6">ъ</phrase>
|
||||
<phrase data="runtime_15f2ccabeb425c29">й</phrase>
|
||||
<phrase data="runtime_1cc10a3947f7c245">д</phrase>
|
||||
<phrase data="runtime_1d51ebe0fc45e38e">Только поля</phrase>
|
||||
<phrase data="runtime_259f56cb715ba3a3">е</phrase>
|
||||
<phrase data="runtime_3051067c6324c63f">з</phrase>
|
||||
<phrase data="runtime_30fbc377ae9122ed">ё</phrase>
|
||||
<phrase data="runtime_3164696756227147">Заметка добавлена</phrase>
|
||||
<phrase data="runtime_34c6fbb62da8ce5c">п</phrase>
|
||||
<phrase data="runtime_37d43a57a463add5">ю</phrase>
|
||||
<phrase data="runtime_40831c5d98a57dfc">ч</phrase>
|
||||
<phrase data="runtime_446cdc8e3c0d7efc">ы</phrase>
|
||||
<phrase data="runtime_46b0d3855548054a">JSON-снимок пересобран</phrase>
|
||||
<phrase data="runtime_4f60bd4e24e7dc7f">ш</phrase>
|
||||
<phrase data="runtime_50338c005c41fb4e">о</phrase>
|
||||
<phrase data="runtime_5225a95b111d47bf">к</phrase>
|
||||
<phrase data="runtime_53b10ee4405f56d6">ещё не создан</phrase>
|
||||
<phrase data="runtime_557f4cd2c6d3c150">см</phrase>
|
||||
<phrase data="runtime_61095f9d62dfe291">Документ восстановлен</phrase>
|
||||
<phrase data="runtime_6228f1454b196ffd">API-токен отозван</phrase>
|
||||
<phrase data="runtime_65fd24f1cb37fec4">Черновик</phrase>
|
||||
<phrase data="runtime_72a81659de042887">Ревизии удалены</phrase>
|
||||
<phrase data="runtime_734dbc2b54ab6c95">р</phrase>
|
||||
<phrase data="runtime_754309a41e0df98a">ф</phrase>
|
||||
<phrase data="runtime_7592b7ec4eba966a">ц</phrase>
|
||||
<phrase data="runtime_7b0ff8a2e5fdd66d">м</phrase>
|
||||
<phrase data="runtime_823c4eb3e895adc9">а</phrase>
|
||||
<phrase data="runtime_85011fce4419ee63">Поле #</phrase>
|
||||
<phrase data="runtime_894f97c52af9e5ac">Заметка удалена</phrase>
|
||||
<phrase data="runtime_9aa032336a8e122c">б</phrase>
|
||||
<phrase data="runtime_9b21f5cf014c9efb">я</phrase>
|
||||
<phrase data="runtime_9b6276c9a4ac5507">Документ сохранён</phrase>
|
||||
<phrase data="runtime_a1f5d39a12e8f6be">с</phrase>
|
||||
<phrase data="runtime_ab1f4be7e5d6fd8b">г</phrase>
|
||||
<phrase data="runtime_ae51ade91d2b85b7">Ревизия удалена</phrase>
|
||||
<phrase data="runtime_b8012cb642c887a0">в</phrase>
|
||||
<phrase data="runtime_b95d78565f154f82">ь</phrase>
|
||||
<phrase data="runtime_bb69a96efca3303e">х</phrase>
|
||||
<phrase data="runtime_bbb369f210d2969f">щ</phrase>
|
||||
<phrase data="runtime_beee80c256b458da">у</phrase>
|
||||
<phrase data="runtime_bf0d18ef68a8a34e">можно оставить пустым</phrase>
|
||||
<phrase data="runtime_c08fb476eca49399">кг</phrase>
|
||||
<phrase data="runtime_c5412ba2cc2fc45a">Пресет создания сохранён</phrase>
|
||||
<phrase data="runtime_c78364c5d0f27706">Б</phrase>
|
||||
<phrase data="runtime_cdd02bd8b5684812">Редирект удалён</phrase>
|
||||
<phrase data="runtime_d92fff560eb5495e">л</phrase>
|
||||
<phrase data="runtime_dd48804aa38b03e1">Пресет удалён</phrase>
|
||||
<phrase data="runtime_dd591284d827e17f">ж</phrase>
|
||||
<phrase data="runtime_e1c88af54b9fced2">Документ #</phrase>
|
||||
<phrase data="runtime_e35c8bb151d3530d">Редирект сохранён</phrase>
|
||||
<phrase data="runtime_e93c3d6287d39cc3">API-токен создан</phrase>
|
||||
<phrase data="runtime_ee71f8405f87d786">э</phrase>
|
||||
<phrase data="runtime_eead37caf818d0fa">и</phrase>
|
||||
<phrase data="runtime_f4019994d4e75a2a">после сохранения</phrase>
|
||||
<phrase data="runtime_f9a506077fa0d961">Новый</phrase>
|
||||
<phrase data="runtime_fff8b34d92dab340">Шаблон</phrase>
|
||||
<phrase data="auto_f8af664b7ab2ef75">Удалить все элементы?</phrase>
|
||||
<phrase data="auto_10403ca9b11a0b49">После сохранения элементы исчезнут из документа. Неиспользуемые файлы можно будет восстановить из корзины медиа.</phrase>
|
||||
<phrase data="auto_5ede041b60096d58">Удалить изображение?</phrase>
|
||||
<phrase data="auto_c5b3cd090f16f479">После сохранения изображение исчезнет из документа. Неиспользуемый файл можно будет восстановить из корзины медиа.</phrase>
|
||||
<phrase data="auto_e26c8664b60bfa9a">Удалить изображение из документа?</phrase>
|
||||
<phrase data="auto_02e536f7b2d5cec8">Документ сохранён, но часть старых файлов не перемещена в корзину.</phrase>
|
||||
</language>
|
||||
|
||||
@@ -493,6 +493,8 @@
|
||||
<phrase data="auto_30278b05221dd957">Обновить страницу</phrase>
|
||||
<phrase data="auto_8bf2a1644e73bfa4">Опубликован</phrase>
|
||||
<phrase data="auto_14c618ff49e965ac">Опубликованные</phrase>
|
||||
<phrase data="auto_5677fc62ef7bda9c">Открыть на сайте</phrase>
|
||||
<phrase data="auto_b41b9aaec38f5380">Открыть страницу в новой вкладке</phrase>
|
||||
<phrase data="auto_80a2c74df6ffb08d">Откройте нужную папку и подтвердите выбор. В поле добавятся все подходящие файлы из неё.</phrase>
|
||||
<phrase data="auto_555ad1c0c33d26b3">Отменить</phrase>
|
||||
<phrase data="auto_f6e2120e73d10a68">Отменить изменение</phrase>
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
ALTER TABLE `{{prefix}}_documents`
|
||||
ADD COLUMN IF NOT EXISTS `document_is_technical` TINYINT UNSIGNED NOT NULL DEFAULT 0 AFTER `document_in_search`,
|
||||
ADD COLUMN IF NOT EXISTS `document_in_sitemap` TINYINT UNSIGNED NOT NULL DEFAULT 1 AFTER `document_sitemap_pr`,
|
||||
ADD KEY IF NOT EXISTS `idx_public_visibility` (`document_is_technical`,`document_in_sitemap`);
|
||||
@@ -17,7 +17,7 @@
|
||||
return array(
|
||||
'code' => 'documents',
|
||||
'name' => 'Документы',
|
||||
'version' => '0.3.3',
|
||||
'version' => '0.4.2',
|
||||
|
||||
'permissions' => array(
|
||||
'key' => 'documents',
|
||||
@@ -131,6 +131,7 @@
|
||||
array('id' => '014_document_relation_edges', 'file' => 'migrations/014_document_relation_edges.sql'),
|
||||
array('id' => '015_document_creation_presets', 'file' => 'migrations/015_document_creation_presets.sql'),
|
||||
array('id' => '016_reconcile_document_content_columns', 'file' => 'migrations/016_reconcile_document_content_columns.php'),
|
||||
array('id' => '017_document_public_visibility', 'file' => 'migrations/017_document_public_visibility.sql'),
|
||||
),
|
||||
|
||||
'view_globals' => array(
|
||||
|
||||
@@ -1,3 +1,26 @@
|
||||
{% if catalog_mode and not is_new and product_search_aliases_available %}
|
||||
<section class="card documents-card product-search-aliases" data-document-workspace-panel="search" data-product-search-aliases data-suggestions-url="{{ ADMINX_BASE }}/catalog/search-alias-suggestions" data-document-id="{{ document.Id }}">
|
||||
<form method="post" action="{{ ADMINX_BASE }}/catalog/products/{{ document.Id }}/search-aliases" data-product-search-alias-form>
|
||||
<input type="hidden" name="_csrf" value="{{ csrf_token }}">
|
||||
<div class="documents-section-head">
|
||||
<div class="documents-head-left"><span class="icon-tile documents-head-icon" style="--tile-bg:var(--blue-100);--tile-fg:var(--blue-600)"><i class="ti ti-vocabulary"></i></span><div><h2>Поисковые названия</h2><p>Другие названия только этого товара: народные, прежние или разговорные.</p></div></div>
|
||||
<span class="badge badge-blue" data-product-search-alias-count>{{ product_search_aliases|length }}</span>
|
||||
</div>
|
||||
<div class="documents-card-body product-search-aliases-body">
|
||||
<div class="alert alert-info"><i class="ti ti-info-circle"></i><div><b>Название товара не изменится</b><p>Например, «кушетка» или «стол-чемодан» помогут найти товар, но не появятся в карточке на сайте.</p></div></div>
|
||||
<div class="product-search-alias-list" data-product-search-alias-list>
|
||||
{% for alias in product_search_aliases %}
|
||||
<div class="product-search-alias-row" data-product-search-alias-row><div class="combobox product-search-alias-control"><span class="input-wrap"><i class="ti ti-search"></i><input class="input" name="aliases[]" value="{{ alias|e('html_attr') }}" maxlength="190" autocomplete="off" role="combobox" aria-autocomplete="list" aria-expanded="false" aria-label="Поисковое название" data-product-search-alias-input></span><div class="combo-list product-search-alias-suggestions" role="listbox" hidden data-product-search-alias-suggestions></div></div><button class="btn btn-ghost btn-icon btn-sm ax-act ax-act-danger" type="button" data-product-search-alias-remove data-tooltip="Удалить название" aria-label="Удалить название"><i class="ti ti-trash"></i></button></div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div class="product-search-alias-empty" data-product-search-alias-empty{{ product_search_aliases ? ' hidden' : '' }}><i class="ti ti-vocabulary-off"></i><span>Дополнительных названий пока нет</span></div>
|
||||
<div class="product-search-alias-actions"><button class="btn btn-secondary" type="button" data-product-search-alias-add><i class="ti ti-plus"></i>Добавить название</button><button class="btn btn-primary" type="submit"><i class="ti ti-device-floppy"></i>Сохранить</button></div>
|
||||
</div>
|
||||
</form>
|
||||
<template data-product-search-alias-template><div class="product-search-alias-row" data-product-search-alias-row><div class="combobox product-search-alias-control"><span class="input-wrap"><i class="ti ti-search"></i><input class="input" name="aliases[]" value="" maxlength="190" autocomplete="off" role="combobox" aria-autocomplete="list" aria-expanded="false" aria-label="Поисковое название" placeholder="Например, кушетка" data-product-search-alias-input></span><div class="combo-list product-search-alias-suggestions" role="listbox" hidden data-product-search-alias-suggestions></div></div><button class="btn btn-ghost btn-icon btn-sm ax-act ax-act-danger" type="button" data-product-search-alias-remove data-tooltip="Удалить название" aria-label="Удалить название"><i class="ti ti-trash"></i></button></div></template>
|
||||
</section>
|
||||
{% endif %}
|
||||
|
||||
{% if catalog_mode and not is_new %}
|
||||
<section class="product-promotions-panel" data-document-workspace-panel="promotions" data-product-promotions data-base="{{ ADMINX_BASE }}" data-product-id="{{ document.Id }}" data-product-title="{{ document.document_title|e('html_attr') }}" data-search-url="{{ ADMINX_BASE }}/catalog/product-relations/products" data-csrf="{{ csrf_token }}">
|
||||
<header class="section-header blocks-panel-header product-promotions-header">
|
||||
@@ -88,18 +111,34 @@
|
||||
|
||||
{% if catalog_mode and not is_new %}
|
||||
<section class="card documents-card catalog-product-variant-bridge" data-document-workspace-panel="variants">
|
||||
<div class="documents-section-head"><h2>Варианты товара</h2>{% if variant_group %}<span class="badge badge-blue">Группа #{{ variant_group.id }}</span>{% endif %}</div>
|
||||
<div class="documents-card-body between">
|
||||
<div class="documents-section-head"><div class="documents-head-left"><span class="icon-tile documents-head-icon" style="--tile-bg:var(--violet-100);--tile-fg:var(--violet-600)"><i class="ti ti-box-multiple"></i></span><div><h2>Варианты товара</h2><p>Цвета, комплектации и другие исполнения одной модели.</p></div></div>{% if variant_group %}<span class="badge badge-blue">Группа #{{ variant_group.id }}</span>{% endif %}</div>
|
||||
<div class="documents-card-body product-variant-bridge-body">
|
||||
{% if variant_group %}
|
||||
<div><b>{{ variant_group.title }}</b><p class="text-secondary">{{ variant_group.is_primary ? 'Основной вариант группы' : 'Вариант группы' }}</p></div>
|
||||
<a class="btn btn-secondary" href="{{ ADMINX_BASE }}/catalog/variant-groups/{{ variant_group.id }}"><i class="ti ti-box-multiple"></i>Управление вариантами</a>
|
||||
<div class="product-variant-current"><span class="icon-tile"><i class="ti ti-stack-2"></i></span><div><b>{{ variant_group.title }}</b><p class="text-secondary">{{ variant_group.is_primary ? 'Основной вариант группы' : 'Вариант группы' }}</p></div></div>
|
||||
<div class="product-variant-bridge-actions">
|
||||
<form method="post" action="{{ ADMINX_BASE }}/catalog/variant-groups/{{ variant_group.id }}/products/{{ document.Id }}/copy" data-variant-action data-confirm="Создать выключенную копию товара и сразу добавить её в эту группу?" data-confirm-kind="info" data-confirm-label="Создать вариант">
|
||||
<input type="hidden" name="_csrf" value="{{ csrf_token }}">
|
||||
<button class="btn btn-secondary" type="submit"><i class="ti ti-copy"></i>Создать вариант копированием</button>
|
||||
</form>
|
||||
<a class="btn btn-primary" href="{{ ADMINX_BASE }}/catalog/variant-groups/{{ variant_group.id }}?focus={{ document.Id }}#variant-{{ document.Id }}"><i class="ti ti-adjustments-horizontal"></i>Открыть матрицу</a>
|
||||
</div>
|
||||
{% else %}
|
||||
<div><b>Товар пока не объединён с вариантами</b><p class="text-secondary">Создайте группу на основе текущего товара.</p></div>
|
||||
<form method="post" action="{{ ADMINX_BASE }}/catalog/products/{{ document.Id }}/variant-group" data-variant-action>
|
||||
<input type="hidden" name="_csrf" value="{{ csrf_token }}">
|
||||
<input type="hidden" name="title" value="{{ document.document_title|e('html_attr') }}">
|
||||
<button class="btn btn-secondary" type="submit"><i class="ti ti-plus"></i>Создать группу вариантов</button>
|
||||
</form>
|
||||
<div class="product-variant-start-copy"><b>Товар пока не входит в группу</b><p class="text-secondary">Создайте новую группу для этой модели или добавьте товар в уже существующую.</p></div>
|
||||
<div class="product-variant-start-grid">
|
||||
<form class="product-variant-start-option" method="post" action="{{ ADMINX_BASE }}/catalog/products/{{ document.Id }}/variant-group" data-variant-action>
|
||||
<input type="hidden" name="_csrf" value="{{ csrf_token }}">
|
||||
<span class="product-variant-start-head"><i class="ti ti-library-plus"></i><span><b>Новая группа</b><small>Текущий товар станет первым и основным вариантом.</small></span></span>
|
||||
<label class="field"><span class="field-label">Название группы</span><span class="input-wrap"><i class="ti ti-box-multiple"></i><input class="input" name="title" value="{{ document.document_title|e('html_attr') }}" required></span></label>
|
||||
<button class="btn btn-primary" type="submit"><i class="ti ti-plus"></i>Создать группу</button>
|
||||
</form>
|
||||
<form class="product-variant-start-option" method="post" action="{{ ADMINX_BASE }}/catalog/products/{{ document.Id }}/variant-group/attach" data-variant-action>
|
||||
<input type="hidden" name="_csrf" value="{{ csrf_token }}">
|
||||
<span class="product-variant-start-head"><i class="ti ti-link-plus"></i><span><b>Существующая группа</b><small>Подходит, если другие исполнения модели уже добавлены.</small></span></span>
|
||||
<label class="field"><span class="field-label">Группа вариантов</span><select class="select" name="group_id" required><option value="">Выберите группу</option>{% for group in variant_groups %}<option value="{{ group.id }}">{{ group.title }} · {{ group.variants_count }} вариантов</option>{% endfor %}</select></label>
|
||||
<button class="btn btn-secondary" type="submit"{{ variant_groups ? '' : ' disabled' }}><i class="ti ti-link"></i>Добавить в группу</button>
|
||||
{% if not variant_groups %}<small class="field-hint">Других групп пока нет.</small>{% endif %}
|
||||
</form>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@@ -79,9 +79,19 @@
|
||||
<option value="clear">Очистить значение</option>
|
||||
<option value="replace">Найти и заменить</option>
|
||||
<option value="move">Перенести в другую рубрику</option>
|
||||
<option value="publish">Опубликовать</option>
|
||||
<option value="unpublish">Снять с публикации</option>
|
||||
<option value="recalculate">Пересчитать поля и индексы</option>
|
||||
<option value="publish">Опубликовать</option>
|
||||
<option value="unpublish">Снять с публикации</option>
|
||||
<option value="technical">Сделать служебными</option>
|
||||
<option value="public">Сделать обычными</option>
|
||||
<option value="search_include">Включить во внутренний поиск</option>
|
||||
<option value="search_exclude">Исключить из внутреннего поиска</option>
|
||||
<option value="robots_index">Разрешить индексацию поисковиками</option>
|
||||
<option value="robots_noindex">Запретить индексацию поисковиками</option>
|
||||
<option value="sitemap_include">Добавить в sitemap</option>
|
||||
<option value="sitemap_exclude">Исключить из sitemap</option>
|
||||
<option value="sitemap_frequency">Изменить частоту sitemap</option>
|
||||
<option value="sitemap_priority">Изменить приоритет sitemap</option>
|
||||
<option value="recalculate">Пересчитать поля и индексы</option>
|
||||
</select></label>
|
||||
|
||||
<label class="field" data-bulk-target-wrap hidden><span>Поле</span><select class="select" name="target" data-bulk-target>
|
||||
@@ -96,16 +106,25 @@
|
||||
<label class="field" data-bulk-search-wrap hidden><span>Что найти</span><input class="input" type="text" name="search" placeholder="Точное вхождение"></label>
|
||||
<label class="field documents-bulk-value" data-bulk-value-wrap hidden><span>Новое значение</span><textarea class="textarea" name="value" rows="3" placeholder="Введите значение"></textarea></label>
|
||||
|
||||
<label class="field" data-bulk-rubric-target-wrap hidden><span>Новая рубрика</span><select class="select" name="target_rubric_id">
|
||||
<label class="field" data-bulk-rubric-target-wrap hidden><span>Новая рубрика</span><select class="select" name="target_rubric_id">
|
||||
<option value="0">Выберите рубрику</option>
|
||||
{% for rubric in bulk_options.rubrics %}
|
||||
<option value="{{ rubric.Id }}">{{ rubric.rubric_title }}</option>
|
||||
{% endfor %}
|
||||
</select></label>
|
||||
</select></label>
|
||||
|
||||
<label class="field" data-bulk-sitemap-frequency-wrap hidden><span>Частота обновления</span><select class="select" name="sitemap_frequency">
|
||||
<option value="0">always</option><option value="1">hourly</option><option value="2">daily</option>
|
||||
<option value="3" selected>weekly</option><option value="4">monthly</option><option value="5">yearly</option><option value="6">never</option>
|
||||
</select></label>
|
||||
<label class="field" data-bulk-sitemap-priority-wrap hidden><span>Приоритет</span><select class="select" name="sitemap_priority">
|
||||
{% for pr in [0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1] %}<option value="{{ pr }}"{{ pr == 0.5 ? ' selected' : '' }}>{{ pr }}</option>{% endfor %}
|
||||
</select></label>
|
||||
</div>
|
||||
<div class="documents-bulk-target-help" data-bulk-target-help hidden>
|
||||
<div class="documents-bulk-target-help" data-bulk-target-help hidden>
|
||||
<i class="ti ti-info-circle"></i><span></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="alert alert-info documents-bulk-technical-help" data-bulk-technical-help hidden><i class="ti ti-tool alert-ic"></i><div><b class="alert-title">Служебный документ не удаляется</b><span>Он остаётся доступен запросам, полям и связям, но не открывается отдельной страницей и автоматически исключается из поиска, sitemap и SEO-проверок.</span></div></div>
|
||||
<div class="documents-bulk-step-footer">
|
||||
<span class="text-secondary"><i class="ti ti-info-circle"></i>Ничего не сохранится до подтверждения результата проверки.</span>
|
||||
<button class="btn btn-primary" type="submit" data-bulk-preview><i class="ti ti-eye"></i>Проверить изменения</button>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
<nav class="breadcrumbs" aria-label="Хлебные крошки">
|
||||
<a href="{{ ADMINX_BASE }}/">Главная</a><i class="ti ti-chevron-right"></i>
|
||||
{% if catalog_mode %}<a href="{{ ADMINX_BASE }}/catalog">Каталог</a><i class="ti ti-chevron-right"></i><a href="{{ return_url }}">Товары</a>{% else %}<a href="{{ ADMINX_BASE }}/documents">Документы</a>{% endif %}<i class="ti ti-chevron-right"></i>
|
||||
{% if catalog_mode %}<a href="{{ ADMINX_BASE }}/catalog">Каталог</a><i class="ti ti-chevron-right"></i><a href="{{ return_url }}">{{ return_label|default('Товары') }}</a>{% else %}<a href="{{ ADMINX_BASE }}/documents">Документы</a>{% endif %}<i class="ti ti-chevron-right"></i>
|
||||
<span>{{ is_new ? 'новый' : '#' ~ document.Id }}</span>
|
||||
</nav>
|
||||
|
||||
@@ -15,13 +15,14 @@
|
||||
<p class="text-secondary" style="margin-top:5px" data-document-edit-meta>{{ is_new ? (catalog_mode ? 'Заполните основные данные. Характеристики, варианты и доставка откроются после первого сохранения.' : 'Создание базовой карточки документа.') : 'ID ' ~ document.Id ~ ', ' ~ (document.state_label|admin_trans) ~ ', изменён: ' ~ document.changed_label }}</p>
|
||||
</div>
|
||||
<div class="cluster">
|
||||
{% if catalog_mode and not is_new and can_manage and product_copy_url %}<button class="btn btn-secondary" type="button" data-catalog-product-copy data-url="{{ product_copy_url }}" data-csrf="{{ csrf_token }}"><i class="ti ti-copy"></i>Создать копию</button>{% endif %}
|
||||
{% if catalog_mode and not is_new and can_manage and product_copy_url %}<button class="btn btn-secondary" type="button" data-catalog-product-copy data-url="{{ product_copy_url }}" data-csrf="{{ csrf_token }}" data-confirm-copy="1"><i class="ti ti-copy"></i>Создать копию</button>{% endif %}
|
||||
<a class="btn btn-ghost" href="{{ return_url|default(ADMINX_BASE ~ '/documents') }}"><i class="ti ti-arrow-left"></i>К списку</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="documents-editor-workspace" data-document-workspace data-active-panel="main" data-catalog-mode="{{ catalog_mode ? '1' : '0' }}" data-is-new="{{ is_new ? '1' : '0' }}">
|
||||
{% if catalog_mode and product_context_links %}{% include '@catalog/_context-links.twig' with {context_links: product_context_links} %}{% endif %}
|
||||
<div class="documents-workspace-navigation">
|
||||
<div class="tabs documents-workspace-tabs" role="tablist" aria-label="{{ catalog_mode ? 'Разделы товара' : 'Разделы документа' }}">
|
||||
<button class="tab is-active" type="button" role="tab" aria-selected="true" data-document-workspace-tab="main"><i class="ti ti-file-description"></i>Основное</button>
|
||||
@@ -30,6 +31,7 @@
|
||||
<button class="tab" type="button" role="tab" aria-selected="false" data-document-workspace-tab="attributes"{{ is_new ? ' aria-disabled="true" data-tooltip="Доступно после первого сохранения"' : '' }}><i class="ti ti-list-details"></i>Характеристики</button>
|
||||
<button class="tab" type="button" role="tab" aria-selected="false" data-document-workspace-tab="variants"{{ is_new ? ' aria-disabled="true" data-tooltip="Доступно после первого сохранения"' : '' }}><i class="ti ti-box-multiple"></i>Варианты</button>
|
||||
<button class="tab" type="button" role="tab" aria-selected="false" data-document-workspace-tab="shipping"{{ is_new ? ' aria-disabled="true" data-tooltip="Доступно после первого сохранения"' : '' }}><i class="ti ti-truck-delivery"></i>Доставка</button>
|
||||
{% if product_search_aliases_available %}<button class="tab" type="button" role="tab" aria-selected="false" data-document-workspace-tab="search"><i class="ti ti-search"></i>Поиск</button>{% endif %}
|
||||
{% endif %}
|
||||
<button class="tab" type="button" role="tab" aria-selected="false" data-document-workspace-tab="additional"><i class="ti ti-adjustments-horizontal"></i>Дополнительно</button>
|
||||
</div>
|
||||
@@ -41,8 +43,9 @@
|
||||
<option value="promotions"{{ is_new ? ' disabled' : '' }}>Акции{{ is_new ? ' · после сохранения' : '' }}</option>
|
||||
<option value="attributes"{{ is_new ? ' disabled' : '' }}>Характеристики{{ is_new ? ' · после сохранения' : '' }}</option>
|
||||
<option value="variants"{{ is_new ? ' disabled' : '' }}>Варианты{{ is_new ? ' · после сохранения' : '' }}</option>
|
||||
<option value="shipping"{{ is_new ? ' disabled' : '' }}>Доставка{{ is_new ? ' · после сохранения' : '' }}</option>
|
||||
{% endif %}
|
||||
<option value="shipping"{{ is_new ? ' disabled' : '' }}>Доставка{{ is_new ? ' · после сохранения' : '' }}</option>
|
||||
{% if product_search_aliases_available %}<option value="search">Поиск</option>{% endif %}
|
||||
{% endif %}
|
||||
<option value="additional">Дополнительно</option>
|
||||
</select>
|
||||
</label>
|
||||
@@ -71,6 +74,11 @@
|
||||
<input type="hidden" name="id" value="{{ document.Id }}">
|
||||
<input type="hidden" name="document_version" value="{{ document.document_version|default(1) }}">
|
||||
<input type="hidden" name="media_draft_token" value="{{ media_draft_token|default('')|e('html_attr') }}">
|
||||
{% if field_groups %}
|
||||
{% for source in field_groups[0].condition_sources|default([]) %}
|
||||
<input type="hidden" value="{{ source.field_value|e('html_attr') }}" data-document-condition-source data-field-id="{{ source.Id }}" data-field-alias="{{ source.rubric_field_alias|e('html_attr') }}">
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
<section class="documents-draft-recovery" data-document-draft-recovery hidden>
|
||||
<span class="icon-tile" style="--tile-bg:var(--amber-100);--tile-fg:var(--amber-700)"><i class="ti ti-device-floppy"></i></span>
|
||||
@@ -294,11 +302,14 @@
|
||||
<div class="documents-card-body">
|
||||
<div class="form-grid">
|
||||
<label class="field col-6"><span class="field-label">Статус</span><select class="select" name="document_status"><option value="1"{{ document.document_status == 1 ? ' selected' : '' }}>Опубликован</option><option value="0"{{ document.document_status == 0 ? ' selected' : '' }}>Черновик</option></select></label>
|
||||
<label class="field col-6"><span class="field-label">Поиск</span><select class="select" name="document_in_search"><option value="1"{{ document.document_in_search == 1 ? ' selected' : '' }}>В поиске</option><option value="0"{{ document.document_in_search == 0 ? ' selected' : '' }}>Скрыт</option></select></label>
|
||||
<label class="field col-6"><span class="field-label">Поиск</span><select class="select" name="document_in_search"><option value="1"{{ document.document_in_search == 1 ? ' selected' : '' }}>В поиске</option><option value="0"{{ document.document_in_search == 0 ? ' selected' : '' }}>Скрыт</option></select></label>
|
||||
<label class="field col-6"><span class="field-label">Публичный доступ</span><select class="select" name="document_is_technical"><option value="0"{{ not document.document_is_technical ? ' selected' : '' }}>Обычный документ</option><option value="1"{{ document.document_is_technical ? ' selected' : '' }}>Служебный документ</option></select><span class="field-hint">Служебный документ доступен полям, связям и запросам, но не открывается отдельной страницей.</span></label>
|
||||
<label class="field col-6"><span class="field-label">Sitemap</span><select class="select" name="document_in_sitemap"><option value="1"{{ document.document_in_sitemap ? ' selected' : '' }}>Добавлять</option><option value="0"{{ not document.document_in_sitemap ? ' selected' : '' }}>Не добавлять</option></select></label>
|
||||
{% if document.rubric_is_technical %}<div class="alert alert-info documents-technical-alert col-12"><i class="ti ti-tool alert-ic"></i><div><b class="alert-title">Рубрика служебная</b><span>Публичный URL этого документа скрыт настройкой рубрики независимо от переключателя выше.</span></div></div>{% endif %}
|
||||
<label class="field col-12"><span class="field-label">Автор</span><select class="select" name="document_author_id">{% for author in authors %}<option value="{{ author.id }}"{{ document.document_author_id == author.id ? ' selected' : '' }}>{{ author.name }}{% if not author.active %} · отключён{% endif %}</option>{% endfor %}</select></label>
|
||||
<div class="field col-12">
|
||||
<span class="field-label">Родительский документ</span>
|
||||
<div class="documents-picker-input">
|
||||
<div class="documents-picker-input" data-document-picker-scope="parent" data-document-picker-exclude="{{ document.Id }}">
|
||||
<input class="input" type="number" name="document_parent" value="{{ document.document_parent }}" placeholder="ID документа" min="0" data-document-parent-id>
|
||||
<button class="btn btn-secondary btn-icon btn-sm" type="button" data-document-parent-pick data-tooltip="Выбрать документ" aria-label="Выбрать документ"><i class="ti ti-file-search"></i></button>
|
||||
</div>
|
||||
|
||||
@@ -16,6 +16,14 @@
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endmacro %}
|
||||
{% macro public_link(item) %}
|
||||
{% if item.document_alias %}
|
||||
{% set public_url = item.document_alias == '/' ? '/' : '/' ~ item.document_alias|trim('/') %}
|
||||
<a class="documents-public-link mono" href="{{ public_url }}" target="_blank" rel="noopener" aria-label="Открыть страницу в новой вкладке" data-tooltip="Открыть на сайте"><i class="ti ti-external-link"></i><span>{{ item.document_alias }}</span></a>
|
||||
{% else %}
|
||||
<span class="documents-public-alias-empty">без alias</span>
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
{% import _self as document_ui %}
|
||||
{% block title %}Документы{% endblock %}
|
||||
{% block content %}
|
||||
@@ -136,8 +144,8 @@
|
||||
<article class="documents-admin-card {{ item.document_deleted ? 'is-deleted' : (item.document_status ? 'is-published' : 'is-draft') }}" data-document-row data-id="{{ item.Id }}" data-title="{{ item.document_title|e('html_attr') }}">
|
||||
<header>
|
||||
{% if can_manage %}<input type="checkbox" value="{{ item.Id }}" data-document-check aria-label="Выбрать документ #{{ item.Id }}">{% endif %}
|
||||
<div class="documents-admin-card-title"><a href="{{ ADMINX_BASE }}/documents/{{ item.Id }}/edit">{{ item.document_title }}</a><small>#{{ item.Id }} · {{ item.document_alias ? item.document_alias : 'без alias' }}</small></div>
|
||||
<span class="badge badge-{{ item.state_badge }}">{{ item.state_label }}</span>
|
||||
<div class="documents-admin-card-title"><a href="{{ ADMINX_BASE }}/documents/{{ item.Id }}/edit">{{ item.document_title }}</a><small>#{{ item.Id }}</small>{{ document_ui.public_link(item) }}</div>
|
||||
<span class="badge badge-{{ item.state_badge }}">{{ item.state_label }}</span>{% if item.is_technical_effective %}<span class="badge badge-gray"><i class="ti ti-tool"></i>Служебный</span>{% endif %}
|
||||
</header>
|
||||
<div class="documents-admin-card-body">
|
||||
{% if admin_view.mode == 'custom' %}
|
||||
@@ -172,7 +180,7 @@
|
||||
<tr class="documents-row {{ item.document_deleted ? 'is-deleted' : (item.document_status ? 'is-published' : 'is-draft') }}" data-document-row data-id="{{ item.Id }}" data-title="{{ item.document_title|e('html_attr') }}">
|
||||
{% if can_manage %}<td><input type="checkbox" value="{{ item.Id }}" data-document-check aria-label="Выбрать документ #{{ item.Id }}"></td>{% endif %}
|
||||
<td class="mono text-muted">{{ item.Id }}</td>
|
||||
<td><div class="documents-name"><b title="{{ item.document_title|e('html_attr') }}">{{ item.document_title }}</b><small>{{ item.document_alias ? item.document_alias : 'без alias' }}</small></div></td>
|
||||
<td><div class="documents-name"><b title="{{ item.document_title|e('html_attr') }}">{{ item.document_title }}</b>{{ document_ui.public_link(item) }}</div></td>
|
||||
{% for display in item.admin_view_values %}
|
||||
<td class="documents-admin-value is-{{ display.width }}">
|
||||
{% if display.format == 'image' %}{% if display.value.image %}<img src="{{ display.value.image }}" alt="">{% else %}<span class="text-muted">—</span>{% endif %}
|
||||
@@ -218,7 +226,7 @@
|
||||
<td class="documents-cell-title">
|
||||
<div class="documents-name">
|
||||
<b title="{{ item.document_title|e('html_attr') }}">{{ item.document_title }}</b>
|
||||
<span class="documents-title-meta"><span><i class="ti ti-eye"></i>{{ item.document_count_view|number_format(0, '.', ' ') }} просмотров</span><span class="mono"><i class="ti ti-link"></i>{{ item.document_alias ? item.document_alias : 'без alias' }}</span></span>
|
||||
<span class="documents-title-meta"><span><i class="ti ti-eye"></i>{{ item.document_count_view|number_format(0, '.', ' ') }} просмотров</span><span>{{ document_ui.public_link(item) }}</span></span>
|
||||
</div>
|
||||
</td>
|
||||
<td class="documents-cell-rubric">
|
||||
@@ -229,7 +237,8 @@
|
||||
</td>
|
||||
<td class="documents-cell-state">
|
||||
<div class="documents-badges">
|
||||
<span class="badge badge-{{ item.state_badge }}">{{ item.state_label }}</span>
|
||||
<span class="badge badge-{{ item.state_badge }}">{{ item.state_label }}</span>
|
||||
{% if item.is_technical_effective %}<span class="badge badge-gray"><i class="ti ti-tool"></i>Служебный</span>{% endif %}
|
||||
{% if item.document_in_search %}<span class="badge badge-blue documents-search-flag"><i class="ti ti-search"></i>В поиске</span>{% endif %}
|
||||
{% if item.Id == 1 %}<span class="badge badge-amber">system</span>{% endif %}
|
||||
</div>
|
||||
|
||||
@@ -233,6 +233,9 @@
|
||||
border: none;
|
||||
min-height: 260px;
|
||||
}
|
||||
.events-mobile-label {
|
||||
display: none;
|
||||
}
|
||||
.events-table-day td {
|
||||
padding: 9px 14px;
|
||||
background: var(--background-muted);
|
||||
@@ -247,18 +250,147 @@
|
||||
gap: 8px;
|
||||
}
|
||||
@media (max-width: 760px) {
|
||||
.events-summary {
|
||||
display: none;
|
||||
}
|
||||
.events-tabs {
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
.events-table-wrap {
|
||||
max-height: none;
|
||||
overflow-x: auto;
|
||||
overflow-y: hidden;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
overflow: visible;
|
||||
}
|
||||
.events-table,
|
||||
.events-table tbody,
|
||||
.events-table tr,
|
||||
.events-table th,
|
||||
.events-table td {
|
||||
.events-table-wrap .table.table-compact.events-table {
|
||||
display: block;
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
table-layout: auto;
|
||||
}
|
||||
.events-table colgroup,
|
||||
.events-table thead {
|
||||
display: none;
|
||||
}
|
||||
.events-table tbody {
|
||||
display: block;
|
||||
}
|
||||
.events-table .events-row {
|
||||
position: relative;
|
||||
display: grid;
|
||||
width: 100%;
|
||||
height: auto;
|
||||
grid-template-columns: minmax(0, 1fr) auto;
|
||||
gap: 8px 12px;
|
||||
padding: 12px 14px 12px 17px;
|
||||
border-bottom: 1px solid var(--border-default);
|
||||
}
|
||||
.events-table .events-row:last-of-type {
|
||||
border-bottom: 0;
|
||||
}
|
||||
.events-table .events-row::before {
|
||||
position: absolute;
|
||||
top: 12px;
|
||||
bottom: 12px;
|
||||
left: 0;
|
||||
width: 3px;
|
||||
border-radius: 3px;
|
||||
background: var(--event-state-color, var(--gray-300));
|
||||
content: "";
|
||||
}
|
||||
.events-table .events-row td {
|
||||
display: block;
|
||||
width: auto;
|
||||
min-width: 0;
|
||||
height: auto;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
background: transparent;
|
||||
}
|
||||
.events-table .events-row.has-open-details {
|
||||
background: var(--background-muted);
|
||||
}
|
||||
.events-row td:first-child::before {
|
||||
display: none;
|
||||
}
|
||||
.events-cell-state {
|
||||
grid-column: 1;
|
||||
grid-row: 1;
|
||||
}
|
||||
.events-cell-time {
|
||||
grid-column: 2;
|
||||
grid-row: 1;
|
||||
align-self: center;
|
||||
font-size: 11px !important;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.events-cell-actor,
|
||||
.events-cell-message {
|
||||
grid-column: 1 / -1;
|
||||
}
|
||||
.events-cell-actor {
|
||||
display: flex !important;
|
||||
align-items: baseline;
|
||||
gap: 6px;
|
||||
grid-row: 2;
|
||||
color: var(--text-secondary);
|
||||
font-size: 12px !important;
|
||||
}
|
||||
.events-cell-message {
|
||||
grid-row: 3;
|
||||
padding-top: 2px !important;
|
||||
}
|
||||
.events-cell-message .events-message {
|
||||
line-height: 1.45;
|
||||
}
|
||||
.events-cell-message .text-xs {
|
||||
margin-top: 3px;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
.events-cell-ip {
|
||||
display: flex !important;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
grid-column: 1;
|
||||
grid-row: 4;
|
||||
color: var(--text-muted);
|
||||
font-size: 11px !important;
|
||||
}
|
||||
.events-cell-actions {
|
||||
grid-column: 2;
|
||||
grid-row: 4;
|
||||
justify-self: end;
|
||||
}
|
||||
.events-mobile-label {
|
||||
display: inline;
|
||||
color: var(--text-muted);
|
||||
font-family: var(--font-family);
|
||||
font-size: 10px;
|
||||
font-weight: 600;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
.events-details-row,
|
||||
.events-details-row td {
|
||||
display: block;
|
||||
width: 100%;
|
||||
}
|
||||
.events-details-row[hidden] {
|
||||
display: none;
|
||||
}
|
||||
.events-details-row td {
|
||||
padding: 0 14px 12px 17px !important;
|
||||
border-bottom: 1px solid var(--border-default);
|
||||
}
|
||||
.events-details {
|
||||
max-height: 280px;
|
||||
overflow: auto;
|
||||
padding: 10px;
|
||||
}
|
||||
.events-table-day,
|
||||
.events-table-day td {
|
||||
display: block;
|
||||
width: 100%;
|
||||
}
|
||||
.events-table-day td {
|
||||
padding: 8px 14px;
|
||||
}
|
||||
.events-filter,
|
||||
.events-filter .input-wrap,
|
||||
|
||||
@@ -35,9 +35,11 @@
|
||||
if (hidden) {
|
||||
details.removeAttribute('hidden');
|
||||
button.classList.add('active');
|
||||
row.classList.add('has-open-details');
|
||||
} else {
|
||||
details.setAttribute('hidden', 'hidden');
|
||||
button.classList.remove('active');
|
||||
row.classList.remove('has-open-details');
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
return array(
|
||||
'code' => 'events',
|
||||
'name' => 'Системные события',
|
||||
'version' => '0.1.1',
|
||||
'version' => '0.1.3',
|
||||
|
||||
'permissions' => array(
|
||||
'key' => 'events',
|
||||
@@ -49,7 +49,7 @@
|
||||
'icon' => 'ti ti-history',
|
||||
'permission' => 'view_events',
|
||||
'group' => 'Система',
|
||||
'sort_order' => 35,
|
||||
'sort_order' => 99,
|
||||
'match' => array(
|
||||
'/events',
|
||||
),
|
||||
|
||||
@@ -110,15 +110,15 @@
|
||||
<tbody>
|
||||
{% for row in rows %}
|
||||
<tr class="events-row {{ row.state_class }}">
|
||||
<td class="mono text-muted">{{ row.time_display }}</td>
|
||||
<td><span class="badge {{ row.source_type_badge }} events-source-kind">{{ row.source_type_label }}</span></td>
|
||||
<td><div class="events-referrer-source">{{ row.source_name }}</div></td>
|
||||
<td>
|
||||
<td class="mono text-muted events-cell-time">{{ row.time_display }}</td>
|
||||
<td class="events-cell-state"><span class="badge {{ row.source_type_badge }} events-source-kind">{{ row.source_type_label }}</span></td>
|
||||
<td class="events-cell-actor"><span class="events-mobile-label">Источник</span><div class="events-referrer-source">{{ row.source_name }}</div></td>
|
||||
<td class="events-cell-message">
|
||||
<div class="events-message mono">{{ row.message }}</div>
|
||||
{% if row.url %}<div class="text-muted text-xs events-referrer-url">{{ row.url }}</div>{% endif %}
|
||||
</td>
|
||||
<td><span class="badge badge-gray events-hit-count">{{ row.hits }}</span></td>
|
||||
<td>
|
||||
<td class="events-cell-ip"><span class="events-mobile-label">Переходы</span><span class="badge badge-gray events-hit-count">{{ row.hits }}</span></td>
|
||||
<td class="events-cell-actions">
|
||||
{% if row.details_text %}
|
||||
<button class="btn btn-ghost btn-icon btn-sm" type="button" data-events-details data-tooltip="Детали" aria-label="Детали"><i class="ti ti-chevron-down"></i></button>
|
||||
{% endif %}
|
||||
@@ -170,15 +170,15 @@
|
||||
</tr>
|
||||
{% endif %}
|
||||
<tr class="events-row {{ row.state_class }}">
|
||||
<td class="mono text-muted">{{ row.time_display }}</td>
|
||||
<td><span class="badge {{ row.state_badge }} events-state"><i class="{{ row.state_icon }}"></i>{{ row.state_label }}</span></td>
|
||||
<td>{{ row.actor }}</td>
|
||||
<td>
|
||||
<td class="mono text-muted events-cell-time">{{ row.time_display }}</td>
|
||||
<td class="events-cell-state"><span class="badge {{ row.state_badge }} events-state"><i class="{{ row.state_icon }}"></i>{{ row.state_label }}</span></td>
|
||||
<td class="events-cell-actor"><span class="events-mobile-label">Пользователь</span>{{ row.actor }}</td>
|
||||
<td class="events-cell-message">
|
||||
<div class="events-message">{{ row.message }}</div>
|
||||
{% if row.url %}<div class="mono text-muted text-xs">{{ row.url }}</div>{% endif %}
|
||||
</td>
|
||||
<td class="mono text-muted">{{ row.ip }}</td>
|
||||
<td>
|
||||
<td class="mono text-muted events-cell-ip">{% if row.ip %}<span class="events-mobile-label">IP</span>{{ row.ip }}{% endif %}</td>
|
||||
<td class="events-cell-actions">
|
||||
{% if row.details_text %}
|
||||
<button class="btn btn-ghost btn-icon btn-sm" type="button" data-events-details data-tooltip="Детали" aria-label="Детали"><i class="ti ti-chevron-down"></i></button>
|
||||
{% endif %}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<language>
|
||||
<phrase data="auto_0f0b8f55edcc806d">Users</phrase>
|
||||
<phrase data="auto_1240ef2fb91174ca">" will be deleted along with the assignment of rights.</phrase>
|
||||
<phrase data="auto_5ea67f9e32546482">Role "</phrase>
|
||||
<phrase data="auto_721da5d070ce0d16">Failed to delete</phrase>
|
||||
@@ -8,4 +9,5 @@
|
||||
<phrase data="auto_8b064896cc26e067">Delete role?</phrase>
|
||||
<phrase data="auto_c00aca49199296d7">Network error</phrase>
|
||||
<phrase data="auto_e02d4b658f2984f4">New role</phrase>
|
||||
<phrase data="runtime_845595d6e899ecb0">Users</phrase>
|
||||
</language>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<language>
|
||||
<phrase data="auto_0f0b8f55edcc806d">Пользователи</phrase>
|
||||
<phrase data="auto_1240ef2fb91174ca">» будет удалена вместе с назначением прав.</phrase>
|
||||
<phrase data="auto_5ea67f9e32546482">Роль «</phrase>
|
||||
<phrase data="auto_721da5d070ce0d16">Не удалось удалить</phrase>
|
||||
@@ -8,4 +9,5 @@
|
||||
<phrase data="auto_8b064896cc26e067">Удалить роль?</phrase>
|
||||
<phrase data="auto_c00aca49199296d7">Ошибка сети</phrase>
|
||||
<phrase data="auto_e02d4b658f2984f4">Новая роль</phrase>
|
||||
<phrase data="runtime_845595d6e899ecb0">Пользователи</phrase>
|
||||
</language>
|
||||
|
||||
@@ -197,6 +197,7 @@
|
||||
'pages' => $listing['pages'],
|
||||
'total' => $listing['total'],
|
||||
'per_page' => $perPage,
|
||||
'can_manage' => Permission::check('manage_media'),
|
||||
),
|
||||
));
|
||||
}
|
||||
@@ -278,6 +279,7 @@
|
||||
}
|
||||
|
||||
return $this->success('Папка создана', array(
|
||||
'data' => array('path' => $path),
|
||||
'redirect' => $this->base() . '/media?dir=' . rawurlencode($path),
|
||||
));
|
||||
}
|
||||
|
||||
@@ -446,32 +446,32 @@
|
||||
}
|
||||
|
||||
function upload(files) {
|
||||
var fd;
|
||||
var i;
|
||||
if (!files || !files.length) {
|
||||
setStatus('Файлы не выбраны', 'error');
|
||||
return;
|
||||
}
|
||||
fd = new FormData(form);
|
||||
fd.delete('files[]');
|
||||
for (i = 0; i < files.length; i++) {
|
||||
fd.append('files[]', files[i]);
|
||||
}
|
||||
var total = files.length;
|
||||
form.classList.add('is-loading');
|
||||
setStatus('Загрузка: ' + files.length, 'progress');
|
||||
Adminx.Ajax.post(self.base() + '/media/upload', fd).then(function (payload) {
|
||||
setStatus('Подготовка к загрузке: ' + total, 'progress');
|
||||
Adminx.Upload.files(self.base() + '/media/upload', files, function (chunk) {
|
||||
var fd = new FormData(form);
|
||||
fd.delete('files[]');
|
||||
chunk.forEach(function (file) { fd.append('files[]', file); });
|
||||
return fd;
|
||||
}, function (processed, count) {
|
||||
setStatus('Загружено: ' + processed + ' из ' + count, 'progress');
|
||||
}).then(function (result) {
|
||||
form.classList.remove('is-loading');
|
||||
var d = payload.data || {};
|
||||
if (d.success) {
|
||||
setStatus(d.message || 'Готово', 'success');
|
||||
Adminx.Ajax.handle(payload);
|
||||
} else {
|
||||
setStatus(d.message || 'Ошибка загрузки', 'error');
|
||||
Adminx.Toast.show(d.message || 'Ошибка загрузки', 'error');
|
||||
}
|
||||
}).catch(function () {
|
||||
setStatus('Загружено файлов: ' + result.files.length, 'success');
|
||||
Adminx.Toast.show('Загружено файлов: ' + result.files.length, 'success');
|
||||
window.location.href = self.base() + '/media?dir=' + encodeURIComponent(form.getAttribute('data-dir') || '/uploads');
|
||||
}).catch(function (error) {
|
||||
form.classList.remove('is-loading');
|
||||
setStatus('Ошибка сети', 'error');
|
||||
var uploaded = error && error.uploaded ? error.uploaded.length : 0;
|
||||
var message = (error && error.message) || 'Ошибка сети';
|
||||
if (uploaded) { message += '. До ошибки загружено: ' + uploaded; }
|
||||
setStatus(message, 'error');
|
||||
Adminx.Toast.show(message, 'error');
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
return array(
|
||||
'code' => 'media',
|
||||
'name' => 'Медиа',
|
||||
'version' => '0.6.2',
|
||||
'version' => '0.6.4',
|
||||
|
||||
'permissions' => array(
|
||||
'key' => 'media',
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
defined('BASEPATH') || die('Direct access to this location is not allowed.');
|
||||
|
||||
use App\Adminx\Support\ModuleExtensions;
|
||||
use App\Adminx\Support\InterfaceSettings;
|
||||
use App\Common\AdminLocation;
|
||||
use App\Common\ModuleManager;
|
||||
use App\Common\ModuleMigrator;
|
||||
@@ -115,6 +116,11 @@
|
||||
|
||||
if (!empty($item['has_dashboard'])) {
|
||||
ModuleSettings::set('adminx_dashboard_enabled', (bool) $dashboardEnabled, $code, 'bool');
|
||||
InterfaceSettings::setModuleDashboardVisibility(
|
||||
$code,
|
||||
(bool) $dashboardEnabled,
|
||||
ModuleExtensions::dashboardDefinitions()
|
||||
);
|
||||
}
|
||||
|
||||
return self::one($code);
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
return array(
|
||||
'code' => 'modules',
|
||||
'name' => 'Модули',
|
||||
'version' => '0.2.0',
|
||||
'version' => '0.2.1',
|
||||
|
||||
'settings' => array(
|
||||
'repository_enabled' => array('label' => 'Удалённый каталог модулей', 'type' => 'bool', 'default' => false, 'group' => 'modules_repository'),
|
||||
|
||||
@@ -17,10 +17,12 @@
|
||||
defined('BASEPATH') || die('Direct access to this location is not allowed.');
|
||||
|
||||
use App\Adminx\Support\CodeEditor;
|
||||
use App\Adminx\Support\AdminLocale;
|
||||
use App\Common\AdminAssets;
|
||||
use App\Common\Auth;
|
||||
use App\Common\Controller as BaseController;
|
||||
use App\Common\Permission;
|
||||
use App\Helpers\Hooks;
|
||||
use App\Helpers\Request;
|
||||
|
||||
class Controller extends BaseController
|
||||
@@ -32,12 +34,22 @@
|
||||
CodeEditor::useCodeMirror('htmlmixed');
|
||||
|
||||
$q = Request::getStr('q', '');
|
||||
$panelSources = Hooks::filter('navigation.item.panel_sources', array());
|
||||
if (!is_array($panelSources)) { $panelSources = array(); }
|
||||
$panelSources = array_values(array_filter(array_map(function ($source) {
|
||||
if (!is_array($source)) { return null; }
|
||||
$code = strtolower(trim(isset($source['code']) ? (string) $source['code'] : ''));
|
||||
$title = trim(isset($source['title']) ? (string) $source['title'] : '');
|
||||
if (!preg_match('/^[a-z][a-z0-9_-]{1,31}$/', $code) || $title === '') { return null; }
|
||||
return array('code' => $code, 'title' => AdminLocale::translateMarkup($title));
|
||||
}, $panelSources)));
|
||||
|
||||
return $this->render('@navigation/index.twig', array(
|
||||
'navigation_items' => Model::all($q),
|
||||
'stats' => Model::stats(),
|
||||
'filters' => array('q' => $q),
|
||||
'access_groups' => Model::accessGroups(),
|
||||
'navigation_panel_sources' => $panelSources,
|
||||
'can_manage' => Permission::check('manage_navigation'),
|
||||
));
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
defined('BASEPATH') || die('Direct access to this location is not allowed.');
|
||||
|
||||
use App\Common\FileCacheInvalidator;
|
||||
use App\Content\ContentTables;
|
||||
use App\Content\PublicUserTables;
|
||||
use App\Helpers\Dir;
|
||||
@@ -234,6 +235,10 @@
|
||||
}
|
||||
|
||||
$navigationId = (int) $current['navigation_id'];
|
||||
if (!array_key_exists('status', $input)) {
|
||||
$data['status'] = (string) $current['status'];
|
||||
}
|
||||
|
||||
self::assertItemParent($navigationId, (int) $id, (int) $data['parent_id']);
|
||||
$data['navigation_id'] = $navigationId;
|
||||
DB::startTransaction();
|
||||
@@ -406,6 +411,7 @@
|
||||
|
||||
public static function clearCache($id, $alias = '')
|
||||
{
|
||||
$id = (int) $id;
|
||||
$keys = array((string) (int) $id);
|
||||
$alias = trim((string) $alias);
|
||||
if ($alias !== '') {
|
||||
@@ -417,6 +423,8 @@
|
||||
self::removeFile(self::cacheDir($key) . '/items.cache');
|
||||
self::removeDir(self::cacheDir($key));
|
||||
}
|
||||
|
||||
FileCacheInvalidator::navigation($id, $alias);
|
||||
}
|
||||
|
||||
protected static function input(array $input)
|
||||
@@ -485,6 +493,11 @@
|
||||
}
|
||||
|
||||
$parentId = isset($input['parent_id']) ? (int) $input['parent_id'] : 0;
|
||||
$cssClass = isset($input['css_class']) ? (string) $input['css_class'] : '';
|
||||
if (array_key_exists('panel_source', $input)) {
|
||||
$cssClass = self::applyPanelSource($cssClass, (string) $input['panel_source']);
|
||||
}
|
||||
|
||||
return array(
|
||||
'document_id' => isset($input['document_id']) && (int) $input['document_id'] > 0 ? (int) $input['document_id'] : null,
|
||||
'alias' => $alias,
|
||||
@@ -494,7 +507,7 @@
|
||||
'image' => isset($input['image']) ? (string) $input['image'] : '',
|
||||
'css_style' => isset($input['css_style']) ? (string) $input['css_style'] : '',
|
||||
'css_id' => isset($input['css_id']) ? (string) $input['css_id'] : '',
|
||||
'css_class' => isset($input['css_class']) ? (string) $input['css_class'] : '',
|
||||
'css_class' => $cssClass,
|
||||
'parent_id' => $parentId,
|
||||
'level' => '1',
|
||||
'position' => isset($input['position']) ? (int) $input['position'] : 1,
|
||||
@@ -502,6 +515,25 @@
|
||||
);
|
||||
}
|
||||
|
||||
protected static function applyPanelSource($cssClass, $source)
|
||||
{
|
||||
$classes = preg_split('/\s+/', trim((string) $cssClass)) ?: array();
|
||||
$classes = array_values(array_filter($classes, function ($class) {
|
||||
return $class !== 'catalog-menu-link'
|
||||
&& $class !== 'catalog-menu-panel'
|
||||
&& strpos($class, 'catalog-menu-source-') !== 0;
|
||||
}));
|
||||
|
||||
$source = strtolower(trim((string) $source));
|
||||
if ($source === 'children') {
|
||||
$classes[] = 'catalog-menu-panel';
|
||||
} elseif (preg_match('/^[a-z][a-z0-9_-]{1,31}$/', $source)) {
|
||||
$classes[] = 'catalog-menu-source-' . $source;
|
||||
}
|
||||
|
||||
return implode(' ', array_values(array_unique(array_filter($classes))));
|
||||
}
|
||||
|
||||
protected static function row(array $row, $withCode = false)
|
||||
{
|
||||
$id = (int) $row['navigation_id'];
|
||||
@@ -530,6 +562,7 @@
|
||||
$row['id'] = $row['navigation_item_id'];
|
||||
$row['navigation_id'] = isset($row['navigation_id']) ? (int) $row['navigation_id'] : 0;
|
||||
$row['document_id'] = isset($row['document_id']) ? (int) $row['document_id'] : 0;
|
||||
$row['panel_source'] = self::panelSource(isset($row['css_class']) ? $row['css_class'] : '');
|
||||
$row['parent_id'] = isset($row['parent_id']) ? (int) $row['parent_id'] : 0;
|
||||
$row['level'] = isset($row['level']) ? (string) $row['level'] : '1';
|
||||
$row['position'] = isset($row['position']) ? (int) $row['position'] : 1;
|
||||
@@ -541,6 +574,16 @@
|
||||
return $row;
|
||||
}
|
||||
|
||||
protected static function panelSource($cssClass)
|
||||
{
|
||||
$cssClass = trim((string) $cssClass);
|
||||
if (preg_match('/(?:^|\s)catalog-menu-source-([a-z][a-z0-9_-]{1,31})(?:\s|$)/', $cssClass, $match)) {
|
||||
return (string) $match[1];
|
||||
}
|
||||
|
||||
return preg_match('/(?:^|\s)catalog-menu-panel(?:\s|$)/', $cssClass) ? 'children' : 'link';
|
||||
}
|
||||
|
||||
protected static function decode($value)
|
||||
{
|
||||
return html_entity_decode((string) $value, ENT_QUOTES, 'UTF-8');
|
||||
|
||||
@@ -3,18 +3,22 @@
|
||||
<phrase data="auto_11609834a799e96c">editing</phrase>
|
||||
<phrase data="auto_141924f7e6e6cff8">Menu item</phrase>
|
||||
<phrase data="auto_1a4a85e95ad35531">Menu structure</phrase>
|
||||
<phrase data="auto_1e9b9882dbfae49a">Access groups</phrase>
|
||||
<phrase data="auto_22b85f14d5be7427">Drag item</phrase>
|
||||
<phrase data="auto_29d2f0e6febdd8f5">Check item fields</phrase>
|
||||
<phrase data="auto_2b7bc3187b5e647a">Unfolding</phrase>
|
||||
<phrase data="auto_32b74a3c47908c1e">Untitled</phrase>
|
||||
<phrase data="auto_3697bef0b3fc93f5">new</phrase>
|
||||
<phrase data="auto_3757f7f85265ba50">Menu root</phrase>
|
||||
<phrase data="auto_42039dbdd60cceb2">Check the form fields</phrase>
|
||||
<phrase data="auto_4297c5c52ad0e7c1">Alias saved</phrase>
|
||||
<phrase data="auto_50fa71be94dbeb13">Level 1</phrase>
|
||||
<phrase data="auto_542e162a598ab71f"><button class="btn btn-ghost btn-icon btn-sm navigation-action-level" type="button" data-navigation-item-indent="1" data-tooltip="Increase level" aria-label="Increase level"><i class="ti ti-indent-increase"></i></button></phrase>
|
||||
<phrase data="auto_650078bec041bcf9">Failed to load item</phrase>
|
||||
<phrase data="auto_68ee41202091a86a">(copy)</phrase>
|
||||
<phrase data="auto_6f6792553955fa39">New menu item</phrase>
|
||||
<phrase data="auto_710b4d61663b2ab5">Drag</phrase>
|
||||
<phrase data="auto_71a2dbf76a91220d">Level 3</phrase>
|
||||
<phrase data="auto_7287413ae60a4181"><button class="btn btn-ghost btn-icon btn-sm navigation-action-level" type="button" data-navigation-item-indent="-1" data-tooltip="Decrease level" aria-label="Decrease level"><i class="ti ti-indent-decrease"></i></button></phrase>
|
||||
<phrase data="auto_73dfa7ea85e8eb75">Alias</phrase>
|
||||
<phrase data="auto_7e8692a57c2aa378">groups</phrase>
|
||||
@@ -35,6 +39,7 @@
|
||||
<phrase data="auto_c2b70c3bb20678a7">Failed to apply filters</phrase>
|
||||
<phrase data="auto_c610cbf449544098">not selected</phrase>
|
||||
<phrase data="auto_c6a433696290fb08">Select at least one group</phrase>
|
||||
<phrase data="auto_cd0b995b4ac664c4">Level 2</phrase>
|
||||
<phrase data="auto_d09bf6d4c36412be">" data-tooltip="On/Off" aria-label="On/Off"><i class="ti ti-power"></i></button></phrase>
|
||||
<phrase data="auto_d32b8258ca6f9d3e">" data-tooltip="Change" aria-label="Change"><i class="ti ti-pencil"></i></button></phrase>
|
||||
<phrase data="auto_d7d9310af67c647b">Select image</phrase>
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<language>
|
||||
<phrase data="navigation_catalog_panel_behavior">Catalog menu behavior</phrase>
|
||||
<phrase data="navigation_catalog_panel_link">Regular link</phrase>
|
||||
<phrase data="navigation_catalog_panel_children">Show child items on the right</phrase>
|
||||
<phrase data="navigation_catalog_panel_hint">Used only by navigation connected to the product catalog.</phrase>
|
||||
<phrase data="navigation_parity_tag">[tag:if_every:2]even[tag:if_else]odd[tag:/if]</phrase>
|
||||
<phrase data="auto_bf209b0159668b33">, and normal and active items are elements</phrase>
|
||||
<phrase data="auto_3475d30e6543216b">, start and end of level - list</phrase>
|
||||
|
||||
@@ -3,18 +3,22 @@
|
||||
<phrase data="auto_11609834a799e96c">редактирование</phrase>
|
||||
<phrase data="auto_141924f7e6e6cff8">Пункт меню</phrase>
|
||||
<phrase data="auto_1a4a85e95ad35531">Структура меню</phrase>
|
||||
<phrase data="auto_1e9b9882dbfae49a">Группы доступа</phrase>
|
||||
<phrase data="auto_22b85f14d5be7427">Перетащить пункт</phrase>
|
||||
<phrase data="auto_29d2f0e6febdd8f5">Проверьте поля пункта</phrase>
|
||||
<phrase data="auto_2b7bc3187b5e647a">Разворачивание</phrase>
|
||||
<phrase data="auto_32b74a3c47908c1e">Без названия</phrase>
|
||||
<phrase data="auto_3697bef0b3fc93f5">новый</phrase>
|
||||
<phrase data="auto_3757f7f85265ba50">Корень меню</phrase>
|
||||
<phrase data="auto_42039dbdd60cceb2">Проверьте поля формы</phrase>
|
||||
<phrase data="auto_4297c5c52ad0e7c1">Алиас сохранён</phrase>
|
||||
<phrase data="auto_50fa71be94dbeb13">Уровень 1</phrase>
|
||||
<phrase data="auto_542e162a598ab71f"><button class="btn btn-ghost btn-icon btn-sm navigation-action-level" type="button" data-navigation-item-indent="1" data-tooltip="Увеличить уровень" aria-label="Увеличить уровень"><i class="ti ti-indent-increase"></i></button></phrase>
|
||||
<phrase data="auto_650078bec041bcf9">Не удалось загрузить пункт</phrase>
|
||||
<phrase data="auto_68ee41202091a86a">(копия)</phrase>
|
||||
<phrase data="auto_6f6792553955fa39">Новый пункт меню</phrase>
|
||||
<phrase data="auto_710b4d61663b2ab5">Перетащить</phrase>
|
||||
<phrase data="auto_71a2dbf76a91220d">Уровень 3</phrase>
|
||||
<phrase data="auto_7287413ae60a4181"><button class="btn btn-ghost btn-icon btn-sm navigation-action-level" type="button" data-navigation-item-indent="-1" data-tooltip="Уменьшить уровень" aria-label="Уменьшить уровень"><i class="ti ti-indent-decrease"></i></button></phrase>
|
||||
<phrase data="auto_73dfa7ea85e8eb75">Алиас</phrase>
|
||||
<phrase data="auto_7e8692a57c2aa378">группы</phrase>
|
||||
@@ -35,6 +39,7 @@
|
||||
<phrase data="auto_c2b70c3bb20678a7">Не удалось применить фильтры</phrase>
|
||||
<phrase data="auto_c610cbf449544098">не выбран</phrase>
|
||||
<phrase data="auto_c6a433696290fb08">Выберите хотя бы одну группу</phrase>
|
||||
<phrase data="auto_cd0b995b4ac664c4">Уровень 2</phrase>
|
||||
<phrase data="auto_d09bf6d4c36412be">" data-tooltip="Вкл/выкл" aria-label="Вкл/выкл"><i class="ti ti-power"></i></button></phrase>
|
||||
<phrase data="auto_d32b8258ca6f9d3e">" data-tooltip="Изменить" aria-label="Изменить"><i class="ti ti-pencil"></i></button></phrase>
|
||||
<phrase data="auto_d7d9310af67c647b">Выбрать изображение</phrase>
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<language>
|
||||
<phrase data="navigation_catalog_panel_behavior">Поведение в меню каталога</phrase>
|
||||
<phrase data="navigation_catalog_panel_link">Обычная ссылка</phrase>
|
||||
<phrase data="navigation_catalog_panel_children">Показать справа дочерние пункты</phrase>
|
||||
<phrase data="navigation_catalog_panel_hint">Используется только навигацией, подключённой к товарному каталогу.</phrase>
|
||||
<phrase data="navigation_parity_tag">[tag:if_every:2]чётный[tag:if_else]нечётный[tag:/if]</phrase>
|
||||
<phrase data="auto_bf209b0159668b33">, а обычный и активный пункты — элементы</phrase>
|
||||
<phrase data="auto_3475d30e6543216b">, начало и конец уровня — список</phrase>
|
||||
|
||||
@@ -17,7 +17,14 @@
|
||||
return array(
|
||||
'code' => 'navigation',
|
||||
'name' => 'Навигация',
|
||||
'version' => '0.2.0',
|
||||
'version' => '0.2.2',
|
||||
|
||||
'hook_definitions' => array(
|
||||
array(
|
||||
'name' => 'navigation.item.panel_sources',
|
||||
'description' => 'Дополнительные источники правой панели для пункта навигации товарного каталога.',
|
||||
),
|
||||
),
|
||||
|
||||
'permissions' => array(
|
||||
'key' => 'navigation',
|
||||
|
||||
@@ -391,6 +391,17 @@
|
||||
<label class="field col-12"><span class="field-label">CSS style</span><input class="input" type="text" name="css_style"></label>
|
||||
<label class="field col-6"><span class="field-label">CSS class</span><input class="input" type="text" name="css_class"></label>
|
||||
<label class="field col-6"><span class="field-label">CSS ID</span><input class="input" type="text" name="css_id"></label>
|
||||
{% if navigation_panel_sources %}
|
||||
<label class="field col-12">
|
||||
<span class="field-label">Поведение в меню каталога</span>
|
||||
<select class="select" name="panel_source">
|
||||
<option value="link">Обычная ссылка</option>
|
||||
<option value="children">Показать справа дочерние пункты</option>
|
||||
{% for source in navigation_panel_sources %}<option value="{{ source.code }}">{{ source.title }}</option>{% endfor %}
|
||||
</select>
|
||||
<span class="field-hint">Используется только навигацией, подключённой к товарному каталогу.</span>
|
||||
</label>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@@ -46,6 +46,18 @@
|
||||
));
|
||||
}
|
||||
|
||||
public function templateMap(array $params = array())
|
||||
{
|
||||
if (!Permission::check('view_public_site')) {
|
||||
return $this->renderStatus('@adminx/404.twig', array('title' => 'Недостаточно прав'), 403);
|
||||
}
|
||||
|
||||
AdminAssets::addStyle($this->base() . '/modules/PublicSite/assets/public-site.css', 50);
|
||||
return $this->render('@public_site/template-map.twig', array(
|
||||
'template_map' => TemplateMap::build(),
|
||||
));
|
||||
}
|
||||
|
||||
public function placements(array $params = array())
|
||||
{
|
||||
if (!Permission::check('view_public_site')) {
|
||||
@@ -217,6 +229,7 @@
|
||||
protected function publicTemplateAssets()
|
||||
{
|
||||
CodeEditor::useCodeMirror('htmlmixed');
|
||||
AdminAssets::addStyle($this->base() . '/modules/PublicSite/assets/public-site.css', 50);
|
||||
AdminAssets::addStyle(ADMINX_BASE . '/modules/Themes/assets/view-overrides.css', 56);
|
||||
AdminAssets::addScript(ADMINX_BASE . '/modules/Themes/assets/view-overrides.js', 56);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,317 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------------------
|
||||
| AVE.cms
|
||||
|--------------------------------------------------------------------------------------
|
||||
| @package AVE.cms
|
||||
| @file adminx/modules/PublicSite/TemplateMap.php
|
||||
| @author AVE.cms <support@ave-cms.ru>
|
||||
| @copyright 2007-2026 (c) AVE.cms
|
||||
| @link https://ave-cms.ru
|
||||
| @version 3.3
|
||||
*/
|
||||
|
||||
namespace App\Adminx\PublicSite;
|
||||
|
||||
defined('BASEPATH') || die('Direct access to this location is not allowed.');
|
||||
|
||||
use App\Common\DatabaseSchema;
|
||||
use App\Content\ContentTables;
|
||||
use App\Frontend\ThemeAssets;
|
||||
use DB;
|
||||
|
||||
/** Read-only description of the active public template chain. */
|
||||
class TemplateMap
|
||||
{
|
||||
public static function build()
|
||||
{
|
||||
$theme = self::theme();
|
||||
$siteTemplates = self::siteTemplates();
|
||||
$rubrics = self::rubrics();
|
||||
$components = self::components();
|
||||
$product = self::productLayer();
|
||||
|
||||
return array(
|
||||
'theme' => $theme,
|
||||
'summary' => array(
|
||||
'site_templates' => count($siteTemplates),
|
||||
'rubrics' => count($rubrics),
|
||||
'components' => $components['count'],
|
||||
'active_overrides' => $components['active_count'],
|
||||
),
|
||||
'rules' => self::rules($theme),
|
||||
'scenarios' => self::scenarios($theme, $components, $product),
|
||||
'site_templates' => $siteTemplates,
|
||||
'rubrics' => $rubrics,
|
||||
'component_groups' => $components['groups'],
|
||||
'product' => $product,
|
||||
);
|
||||
}
|
||||
|
||||
protected static function theme()
|
||||
{
|
||||
$code = ThemeAssets::currentTheme();
|
||||
$manifest = ThemeAssets::manifest($code);
|
||||
$mode = isset($manifest['presentation_mode']) && $manifest['presentation_mode'] === 'theme'
|
||||
? 'theme' : 'native';
|
||||
$pageShell = isset($manifest['page_shell']) ? trim((string) $manifest['page_shell']) : '';
|
||||
|
||||
return array(
|
||||
'code' => $code,
|
||||
'name' => isset($manifest['name']) && trim((string) $manifest['name']) !== ''
|
||||
? (string) $manifest['name'] : $code,
|
||||
'version' => isset($manifest['version']) ? (string) $manifest['version'] : '',
|
||||
'mode' => $mode,
|
||||
'mode_label' => $mode === 'theme' ? 'Оболочка темы' : 'Штатные шаблоны AVE.cms',
|
||||
'mode_note' => $mode === 'theme'
|
||||
? 'Тема формирует внешний каркас страницы; наследование шаблонов рубрики зависит от настроек темы.'
|
||||
: 'Общий шаблон сайта и шаблон рубрики собирают страницу. Тема подключает стили и переоформляет отдельные компоненты.',
|
||||
'page_shell' => $pageShell,
|
||||
'page_shell_active' => $mode === 'theme' && $pageShell !== '',
|
||||
'inherit_rubric_templates' => !empty($manifest['inherit_rubric_templates']),
|
||||
'overrides' => isset($manifest['view_overrides']) && is_array($manifest['view_overrides'])
|
||||
? array_values($manifest['view_overrides']) : array(),
|
||||
'url' => '/themes?theme=' . rawurlencode($code),
|
||||
);
|
||||
}
|
||||
|
||||
protected static function siteTemplates()
|
||||
{
|
||||
$table = ContentTables::table('templates');
|
||||
$rubrics = ContentTables::table('rubrics');
|
||||
if (!self::tableExists($table) || !self::tableExists($rubrics)) { return array(); }
|
||||
|
||||
$rows = DB::query(
|
||||
'SELECT t.Id id,t.template_title title,COUNT(r.Id) usage_count'
|
||||
. ' FROM ' . $table . ' t LEFT JOIN ' . $rubrics . ' r ON r.rubric_template_id=t.Id'
|
||||
. ' GROUP BY t.Id,t.template_title ORDER BY usage_count DESC,t.template_title,t.Id'
|
||||
)->getAll() ?: array();
|
||||
$out = array();
|
||||
foreach ($rows as $row) {
|
||||
$out[] = array(
|
||||
'id' => (int) $row['id'],
|
||||
'title' => self::decode($row['title']),
|
||||
'usage_count' => (int) $row['usage_count'],
|
||||
'url' => '/templates/' . (int) $row['id'],
|
||||
);
|
||||
}
|
||||
|
||||
return $out;
|
||||
}
|
||||
|
||||
protected static function rubrics()
|
||||
{
|
||||
$out = array();
|
||||
foreach (Model::structure() as $row) {
|
||||
$purpose = 'Обычные документы';
|
||||
if (!empty($row['catalogs_count'])) {
|
||||
$purpose = 'Каталог';
|
||||
} elseif (!empty($row['requests_count'])) {
|
||||
$purpose = 'Документы и подборки';
|
||||
}
|
||||
|
||||
$out[] = array(
|
||||
'id' => (int) $row['id'],
|
||||
'title' => (string) $row['title'],
|
||||
'alias' => (string) $row['alias'],
|
||||
'purpose' => $purpose,
|
||||
'template_id' => (int) $row['template_id'],
|
||||
'template_title' => (string) $row['template_title'],
|
||||
'has_main_template' => (int) $row['template_length'] > 0,
|
||||
'extra_templates_count' => (int) $row['rubric_templates_count'],
|
||||
'documents_count' => (int) $row['documents_count'],
|
||||
'url' => '/rubrics/' . (int) $row['id'] . '/templates',
|
||||
);
|
||||
}
|
||||
|
||||
return $out;
|
||||
}
|
||||
|
||||
protected static function components()
|
||||
{
|
||||
$items = array();
|
||||
try {
|
||||
foreach (PublicViewTemplates::all() as $item) {
|
||||
$items[] = self::component($item, 'site', '/public-site/templates');
|
||||
}
|
||||
} catch (\Throwable $e) {
|
||||
// A broken optional theme must not make the read-only map unavailable.
|
||||
}
|
||||
|
||||
$productClass = '\\App\\Adminx\\Packages\\Products\\PublicViewTemplates';
|
||||
if (class_exists($productClass) && method_exists($productClass, 'all')) {
|
||||
try {
|
||||
foreach ($productClass::all() as $item) {
|
||||
$items[] = self::component($item, 'products', '/catalog/public-templates');
|
||||
}
|
||||
} catch (\Throwable $e) {
|
||||
// The products module can be installed without its latest schema during an update.
|
||||
}
|
||||
}
|
||||
|
||||
$groups = array();
|
||||
$active = 0;
|
||||
foreach ($items as $item) {
|
||||
$group = $item['group'] !== '' ? $item['group'] : 'Другие компоненты';
|
||||
if (!isset($groups[$group])) {
|
||||
$groups[$group] = array('title' => $group, 'items' => array());
|
||||
}
|
||||
|
||||
$groups[$group]['items'][] = $item;
|
||||
$active += $item['active'] ? 1 : 0;
|
||||
}
|
||||
|
||||
return array('count' => count($items), 'active_count' => $active, 'items' => $items, 'groups' => array_values($groups));
|
||||
}
|
||||
|
||||
protected static function component(array $item, $owner, $route)
|
||||
{
|
||||
$source = isset($item['source']) ? (string) $item['source'] : 'missing';
|
||||
return array(
|
||||
'code' => isset($item['code']) ? (string) $item['code'] : '',
|
||||
'namespace' => isset($item['namespace']) ? (string) $item['namespace'] : '',
|
||||
'file' => isset($item['file']) ? (string) $item['file'] : '',
|
||||
'path' => isset($item['theme_path']) ? (string) $item['theme_path'] : '',
|
||||
'group' => isset($item['group']) ? (string) $item['group'] : '',
|
||||
'title' => isset($item['title']) ? (string) $item['title'] : '',
|
||||
'description' => isset($item['description']) ? (string) $item['description'] : '',
|
||||
'icon' => isset($item['icon']) ? (string) $item['icon'] : 'ti ti-template',
|
||||
'owner' => $owner,
|
||||
'active' => !empty($item['active_override']) || $source === 'fallback',
|
||||
'source' => $source,
|
||||
'source_label' => isset($item['source_label']) ? (string) $item['source_label'] : 'Не определён',
|
||||
'state_class' => $source === 'theme' ? 'badge-green' : ($source === 'fallback' ? 'badge-blue' : 'badge-amber'),
|
||||
'url' => $route . '?template=' . rawurlencode(isset($item['code']) ? (string) $item['code'] : ''),
|
||||
);
|
||||
}
|
||||
|
||||
protected static function productLayer()
|
||||
{
|
||||
$result = array(
|
||||
'available' => false,
|
||||
'cards' => array('total' => 0, 'published' => 0, 'used' => 0, 'url' => '/catalog/card-templates'),
|
||||
'filters' => array('total' => 0, 'published' => 0, 'used' => 0, 'url' => '/catalog/filter-templates'),
|
||||
);
|
||||
$classes = array(
|
||||
'cards' => '\\App\\Adminx\\Packages\\Products\\CardTemplates',
|
||||
'filters' => '\\App\\Adminx\\Packages\\Products\\FilterTemplates',
|
||||
);
|
||||
foreach ($classes as $key => $class) {
|
||||
if (!class_exists($class) || !method_exists($class, 'stats')) { continue; }
|
||||
try {
|
||||
$stats = $class::stats();
|
||||
$result[$key] = array_merge($result[$key], is_array($stats) ? $stats : array());
|
||||
$result['available'] = true;
|
||||
} catch (\Throwable $e) {
|
||||
// Keep the map usable while an optional module waits for migrations.
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
protected static function rules(array $theme)
|
||||
{
|
||||
return array(
|
||||
array('icon' => 'ti ti-database', 'title' => 'Данные остаются в AVE.cms', 'text' => 'Документы, поля, рубрики и условия запросов не переносятся в файлы темы.'),
|
||||
array('icon' => 'ti ti-template', 'title' => 'Шаблон задаёт место', 'text' => 'Общий шаблон создаёт каркас, а шаблон рубрики размещает содержимое конкретного типа документа.'),
|
||||
array('icon' => 'ti ti-palette', 'title' => 'Тема оформляет результат', 'text' => $theme['mode'] === 'native'
|
||||
? 'Сейчас тема подключает стили и заменяет только перечисленные публичные компоненты.'
|
||||
: 'Сейчас активна оболочка темы; её файл формирует внешний каркас страницы.'),
|
||||
);
|
||||
}
|
||||
|
||||
protected static function scenarios(array $theme, array $components, array $product)
|
||||
{
|
||||
$componentItems = isset($components['items']) ? $components['items'] : array();
|
||||
$productUrl = $product['available'] ? '/catalog/products' : '/modules';
|
||||
$productCardsUrl = $product['available'] ? '/catalog/card-templates' : '/modules';
|
||||
return array(
|
||||
array(
|
||||
'icon' => 'ti ti-browser', 'title' => 'Общий каркас сайта',
|
||||
'description' => 'Шапка, подвал и место, куда AVE.cms вставляет содержимое текущего документа.',
|
||||
'steps' => array(
|
||||
self::step('Шаблон сайта', 'Хранит общий HTML и тег [tag:maincontent].', '/templates', 'Основной слой', 'blue'),
|
||||
self::step('Назначение рубрике', 'Каждая рубрика выбирает нужный общий шаблон.', '/rubrics', 'Настройка', 'gray'),
|
||||
self::step('Активная тема', $theme['mode_note'], $theme['url'], $theme['mode_label'], $theme['mode'] === 'native' ? 'green' : 'violet'),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'icon' => 'ti ti-file-text', 'title' => 'Обычная текстовая страница',
|
||||
'description' => 'Например: «О компании», «Доставка», статья или новость.',
|
||||
'steps' => array(
|
||||
self::step('Документ', 'Заголовок, текст, изображения и остальные значения полей.', '/documents', 'Данные', 'gray'),
|
||||
self::step('Шаблон рубрики', 'Решает, какие поля и блоки вывести и в каком порядке.', '/rubrics', 'Сборка содержимого', 'blue'),
|
||||
self::componentStep($componentItems, 'storefront', 'info.twig', 'Компонент темы', 'Дополнительное оформление, только если его вызывает шаблон.'),
|
||||
self::step('Шаблон сайта', 'Оборачивает готовое содержимое общей шапкой и подвалом.', '/templates', 'Каркас', 'green'),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'icon' => 'ti ti-list-search', 'title' => 'Список новостей или материалов',
|
||||
'description' => 'Запрос выбирает документы, а его шаблоны или публичное представление оформляют список.',
|
||||
'steps' => array(
|
||||
self::step('Запрос', 'Условия, сортировка, количество и пагинация.', '/requests', 'Выбор данных', 'gray'),
|
||||
self::step('Шаблоны запроса', 'Шаблон элемента и общая обёртка результата.', '/requests', 'Основной вывод', 'blue'),
|
||||
self::componentStep($componentItems, 'content_public', 'list.twig', 'Резервный список', 'Используется для нативных коллекций без отдельного представления.'),
|
||||
self::step('Рубрика и сайт', 'Определяют место списка на странице и общий каркас.', '/rubrics', 'Размещение', 'green'),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'icon' => 'ti ti-category-2', 'title' => 'Раздел товарного каталога',
|
||||
'description' => 'Категория остаётся документом, а каталог добавляет подразделы, фильтры, сортировку и выдачу.',
|
||||
'steps' => array(
|
||||
self::step('Раздел каталога', 'Связь с документом, полями, условиями и фильтрами.', '/catalog', 'Данные и правила', 'gray'),
|
||||
self::step('Шаблон рубрики', 'Размещает теги подразделов, фильтров и товарной выдачи.', '/rubrics', 'Сборка страницы', 'blue'),
|
||||
self::componentStep($componentItems, 'products_public', 'filter.twig', 'Фильтры', 'Оформляет готовые параметры фильтрации.'),
|
||||
self::componentStep($componentItems, 'products_public', 'listing.twig', 'Товарная выдача', 'Оформляет список и пагинацию.'),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'icon' => 'ti ti-package', 'title' => 'Карточка и страница товара',
|
||||
'description' => 'Один товар может выглядеть по-разному в списке и на собственной странице.',
|
||||
'steps' => array(
|
||||
self::step('Товар', 'Документ, цены, изображения и нативные характеристики.', $productUrl, 'Данные', 'gray'),
|
||||
self::step('Карточки товара', $product['available']
|
||||
? 'Опубликованные карточки назначаются разделам и контекстам.'
|
||||
: 'Слой появляется после установки модуля «Товары».', $productCardsUrl, 'Списки', 'blue'),
|
||||
self::componentStep($componentItems, 'products_public', 'product-card.twig', 'Резервная карточка', 'Работает, если отдельная опубликованная карточка не назначена.'),
|
||||
self::componentStep($componentItems, 'products_public', 'product-detail.twig', 'Страница товара', 'Галерея, цена, покупка, описание и характеристики.'),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
protected static function componentStep(array $items, $namespace, $file, $title, $description)
|
||||
{
|
||||
foreach ($items as $item) {
|
||||
if ($item['namespace'] !== $namespace || $item['file'] !== $file) { continue; }
|
||||
return self::step($title, $description, $item['url'], $item['source_label'],
|
||||
$item['source'] === 'theme' ? 'green' : ($item['source'] === 'fallback' ? 'blue' : 'amber'));
|
||||
}
|
||||
|
||||
return self::step($title, $description, '', 'Не найден', 'amber');
|
||||
}
|
||||
|
||||
protected static function step($title, $text, $url, $state, $tone)
|
||||
{
|
||||
return array(
|
||||
'title' => (string) $title,
|
||||
'text' => (string) $text,
|
||||
'url' => (string) $url,
|
||||
'state' => (string) $state,
|
||||
'tone' => in_array($tone, array('gray', 'blue', 'green', 'violet', 'amber'), true) ? $tone : 'gray',
|
||||
);
|
||||
}
|
||||
|
||||
protected static function tableExists($table)
|
||||
{
|
||||
try { return DatabaseSchema::tableExists($table); }
|
||||
catch (\Throwable $e) { return false; }
|
||||
}
|
||||
|
||||
protected static function decode($value)
|
||||
{
|
||||
return html_entity_decode((string) $value, ENT_QUOTES, 'UTF-8');
|
||||
}
|
||||
}
|
||||
@@ -92,6 +92,12 @@
|
||||
self.save().catch(function () {});
|
||||
});
|
||||
setTimeout(function () { self.bindEditors(); }, 120);
|
||||
this.openFromLocation();
|
||||
},
|
||||
|
||||
openFromLocation: function () {
|
||||
var id = Number(new URLSearchParams(window.location.search).get('edit'));
|
||||
if (Number.isInteger(id) && id > 0) { this.open(id); }
|
||||
},
|
||||
|
||||
base: function () { return this.form.getAttribute('data-base') || ''; },
|
||||
|
||||
@@ -837,3 +837,508 @@
|
||||
margin-left: 0;
|
||||
}
|
||||
}
|
||||
.public-template-map-notice {
|
||||
margin-bottom: var(--space-4);
|
||||
}
|
||||
.public-template-map-summary {
|
||||
grid-template-columns: repeat(4, minmax(0, 1fr));
|
||||
}
|
||||
.public-template-map-mode {
|
||||
margin-top: var(--space-5);
|
||||
}
|
||||
.public-template-mode-row {
|
||||
position: relative;
|
||||
display: grid;
|
||||
grid-template-columns: minmax(320px, 1.4fr) minmax(180px, 0.7fr) minmax(220px, 0.9fr) 40px;
|
||||
align-items: center;
|
||||
gap: var(--space-4);
|
||||
min-height: 88px;
|
||||
padding: var(--space-4) var(--space-5);
|
||||
border-radius: var(--radius-sm);
|
||||
background: var(--surface-muted);
|
||||
}
|
||||
.public-template-mode-main {
|
||||
display: grid;
|
||||
grid-template-columns: 42px minmax(0, 1fr);
|
||||
align-items: center;
|
||||
gap: var(--space-3);
|
||||
}
|
||||
.public-template-mode-main h3,
|
||||
.public-template-mode-main p {
|
||||
margin: 0;
|
||||
}
|
||||
.public-template-mode-main h3 {
|
||||
margin-top: 2px;
|
||||
font-size: 17px;
|
||||
text-wrap: balance;
|
||||
}
|
||||
.public-template-mode-main p {
|
||||
margin-top: 4px;
|
||||
color: var(--text-secondary);
|
||||
font-size: 12px;
|
||||
line-height: 1.45;
|
||||
text-wrap: pretty;
|
||||
}
|
||||
.public-template-mode-theme,
|
||||
.public-template-mode-shell {
|
||||
display: grid;
|
||||
gap: 4px;
|
||||
min-width: 0;
|
||||
}
|
||||
.public-template-mode-theme > span,
|
||||
.public-template-mode-shell > span {
|
||||
font-size: 12px;
|
||||
}
|
||||
.public-template-mode-theme > b,
|
||||
.public-template-mode-shell > b,
|
||||
.public-template-mode-theme > code,
|
||||
.public-template-mode-shell > code {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.public-template-mode-theme > small,
|
||||
.public-template-mode-shell > small {
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
.public-template-mode-shell > small {
|
||||
color: var(--amber-700);
|
||||
}
|
||||
.public-template-mode-shell > small.is-active {
|
||||
color: var(--green-700);
|
||||
}
|
||||
.public-template-rules {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, minmax(0, 1fr));
|
||||
gap: 1px;
|
||||
margin-top: var(--space-3);
|
||||
overflow: hidden;
|
||||
border-radius: var(--radius-sm);
|
||||
background: var(--border-default);
|
||||
}
|
||||
.public-template-rule {
|
||||
display: grid;
|
||||
grid-template-columns: 28px minmax(0, 1fr);
|
||||
align-items: start;
|
||||
gap: var(--space-3);
|
||||
min-height: 72px;
|
||||
padding: var(--space-4);
|
||||
background: var(--surface);
|
||||
}
|
||||
.public-template-rule > i {
|
||||
color: var(--blue-600);
|
||||
font-size: 22px;
|
||||
}
|
||||
.public-template-rule > div {
|
||||
display: grid;
|
||||
gap: 4px;
|
||||
}
|
||||
.public-template-rule span {
|
||||
color: var(--text-secondary);
|
||||
font-size: 12px;
|
||||
line-height: 1.45;
|
||||
text-wrap: pretty;
|
||||
}
|
||||
.public-template-scenarios,
|
||||
.public-template-inventory,
|
||||
.public-template-components {
|
||||
margin-top: var(--space-6);
|
||||
}
|
||||
.public-template-flow-list {
|
||||
display: grid;
|
||||
gap: var(--space-3);
|
||||
}
|
||||
.public-template-flow {
|
||||
overflow: hidden;
|
||||
border-radius: var(--radius-sm);
|
||||
background: var(--surface);
|
||||
box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
|
||||
}
|
||||
.public-template-flow > header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--space-3);
|
||||
padding: var(--space-4) var(--space-5);
|
||||
border-bottom: 1px solid var(--border-default);
|
||||
}
|
||||
.public-template-flow > header h3,
|
||||
.public-template-flow > header p {
|
||||
margin: 0;
|
||||
}
|
||||
.public-template-flow > header h3 {
|
||||
font-size: 15px;
|
||||
text-wrap: balance;
|
||||
}
|
||||
.public-template-flow > header p {
|
||||
margin-top: 3px;
|
||||
color: var(--text-secondary);
|
||||
font-size: 12px;
|
||||
text-wrap: pretty;
|
||||
}
|
||||
[data-theme="dark"] .public-template-flow {
|
||||
box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.09);
|
||||
}
|
||||
.public-template-flow-steps {
|
||||
display: flex;
|
||||
align-items: stretch;
|
||||
gap: 0;
|
||||
padding: var(--space-3);
|
||||
}
|
||||
.public-template-flow-step {
|
||||
position: relative;
|
||||
display: grid;
|
||||
grid-template-columns: 26px minmax(0, 1fr) 32px;
|
||||
align-items: start;
|
||||
gap: var(--space-2);
|
||||
flex: 1 1 0;
|
||||
min-width: 0;
|
||||
padding: var(--space-3);
|
||||
border-radius: var(--radius-sm);
|
||||
background: var(--surface-muted);
|
||||
}
|
||||
.public-template-flow-step.is-blue .public-template-flow-number {
|
||||
background: var(--blue-100);
|
||||
color: var(--blue-700);
|
||||
}
|
||||
.public-template-flow-step.is-green .public-template-flow-number {
|
||||
background: var(--green-100);
|
||||
color: var(--green-700);
|
||||
}
|
||||
.public-template-flow-step.is-violet .public-template-flow-number {
|
||||
background: var(--violet-100);
|
||||
color: var(--violet-700);
|
||||
}
|
||||
.public-template-flow-step.is-amber .public-template-flow-number {
|
||||
background: var(--amber-100);
|
||||
color: var(--amber-700);
|
||||
}
|
||||
.public-template-flow-number {
|
||||
display: grid;
|
||||
place-items: center;
|
||||
width: 26px;
|
||||
height: 26px;
|
||||
border-radius: 50%;
|
||||
background: var(--gray-200);
|
||||
color: var(--text-secondary);
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
}
|
||||
.public-template-flow-copy {
|
||||
display: grid;
|
||||
gap: 6px;
|
||||
min-width: 0;
|
||||
}
|
||||
.public-template-flow-copy p {
|
||||
margin: 0;
|
||||
color: var(--text-secondary);
|
||||
font-size: 12px;
|
||||
line-height: 1.4;
|
||||
text-wrap: pretty;
|
||||
}
|
||||
.public-template-flow-title {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
justify-content: space-between;
|
||||
gap: var(--space-2);
|
||||
}
|
||||
.public-template-flow-title b {
|
||||
font-size: 13px;
|
||||
line-height: 1.35;
|
||||
}
|
||||
.public-template-flow-title .badge {
|
||||
flex: 0 0 auto;
|
||||
max-width: 48%;
|
||||
white-space: normal;
|
||||
}
|
||||
.public-template-flow-step > .btn {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
min-height: 32px;
|
||||
}
|
||||
.public-template-flow-arrow {
|
||||
align-self: center;
|
||||
flex: 0 0 24px;
|
||||
color: var(--text-secondary);
|
||||
text-align: center;
|
||||
}
|
||||
.public-template-inventory-grid {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
|
||||
gap: var(--space-4);
|
||||
}
|
||||
.public-template-site-templates table th:nth-child(2),
|
||||
.public-template-site-templates table td:nth-child(2) {
|
||||
width: 120px;
|
||||
}
|
||||
.public-template-site-templates table th:last-child,
|
||||
.public-template-site-templates table td:last-child {
|
||||
width: 52px;
|
||||
}
|
||||
.public-template-product-links {
|
||||
display: grid;
|
||||
}
|
||||
.public-template-product-links > a {
|
||||
display: grid;
|
||||
grid-template-columns: 40px minmax(0, 1fr) 20px;
|
||||
align-items: center;
|
||||
gap: var(--space-3);
|
||||
min-height: 66px;
|
||||
padding: var(--space-3) var(--space-4);
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
}
|
||||
.public-template-product-links > a + a {
|
||||
border-top: 1px solid var(--border-default);
|
||||
}
|
||||
.public-template-product-links > a:hover {
|
||||
background: var(--surface-muted);
|
||||
}
|
||||
.public-template-product-links > a > span:nth-child(2) {
|
||||
display: grid;
|
||||
gap: 3px;
|
||||
min-width: 0;
|
||||
}
|
||||
.public-template-product-links > a small {
|
||||
color: var(--text-secondary);
|
||||
font-size: 12px;
|
||||
}
|
||||
.public-template-product-links > a > i {
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
.public-template-product-empty {
|
||||
min-height: 198px;
|
||||
padding: var(--space-5);
|
||||
}
|
||||
.public-template-rubrics-card {
|
||||
margin-top: var(--space-4);
|
||||
}
|
||||
.public-template-rubrics-table th:nth-child(1) {
|
||||
width: 22%;
|
||||
}
|
||||
.public-template-rubrics-table th:nth-child(2) {
|
||||
width: 15%;
|
||||
}
|
||||
.public-template-rubrics-table th:nth-child(3) {
|
||||
width: 20%;
|
||||
}
|
||||
.public-template-rubrics-table th:nth-child(4) {
|
||||
width: 23%;
|
||||
}
|
||||
.public-template-rubrics-table th:nth-child(5) {
|
||||
width: 90px;
|
||||
}
|
||||
.public-template-rubrics-table th:last-child {
|
||||
width: 52px;
|
||||
}
|
||||
.public-template-rubric-state {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
gap: 5px 8px;
|
||||
}
|
||||
.public-template-rubric-state small {
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
.public-template-component-groups {
|
||||
column-count: 2;
|
||||
column-gap: var(--space-4);
|
||||
}
|
||||
.public-template-component-group {
|
||||
display: inline-block;
|
||||
width: 100%;
|
||||
margin-bottom: var(--space-4);
|
||||
overflow: hidden;
|
||||
padding: 0;
|
||||
break-inside: avoid;
|
||||
}
|
||||
.public-template-component-group > summary {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: var(--space-3);
|
||||
min-height: 58px;
|
||||
padding: var(--space-3) var(--space-4);
|
||||
cursor: pointer;
|
||||
list-style: none;
|
||||
}
|
||||
.public-template-component-group > summary::-webkit-details-marker {
|
||||
display: none;
|
||||
}
|
||||
.public-template-component-group > summary > span {
|
||||
display: grid;
|
||||
grid-template-columns: 24px minmax(0, 1fr) auto;
|
||||
align-items: center;
|
||||
gap: var(--space-2);
|
||||
min-width: 0;
|
||||
}
|
||||
.public-template-component-group > summary > span > i {
|
||||
color: var(--blue-600);
|
||||
font-size: 20px;
|
||||
}
|
||||
.public-template-component-group > summary small {
|
||||
color: var(--text-secondary);
|
||||
font-size: 12px;
|
||||
}
|
||||
.public-template-component-group > summary > i {
|
||||
transition: transform 0.18s cubic-bezier(0.2, 0, 0, 1);
|
||||
}
|
||||
.public-template-component-group[open] > summary {
|
||||
border-bottom: 1px solid var(--border-default);
|
||||
}
|
||||
.public-template-component-group[open] > summary > i {
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
.public-template-component-list {
|
||||
display: grid;
|
||||
}
|
||||
.public-template-component-row {
|
||||
display: grid;
|
||||
grid-template-columns: 40px minmax(0, 1fr) 40px;
|
||||
align-items: center;
|
||||
gap: var(--space-3);
|
||||
min-height: 82px;
|
||||
padding: var(--space-3) var(--space-4);
|
||||
}
|
||||
.public-template-component-row + .public-template-component-row {
|
||||
border-top: 1px solid var(--border-default);
|
||||
}
|
||||
.public-template-component-copy {
|
||||
display: grid;
|
||||
gap: 4px;
|
||||
min-width: 0;
|
||||
}
|
||||
.public-template-component-copy > div {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: var(--space-2);
|
||||
}
|
||||
.public-template-component-copy p {
|
||||
margin: 0;
|
||||
color: var(--text-secondary);
|
||||
font-size: 12px;
|
||||
line-height: 1.4;
|
||||
text-wrap: pretty;
|
||||
}
|
||||
.public-template-component-copy code {
|
||||
overflow: hidden;
|
||||
color: var(--text-secondary);
|
||||
font-size: 11px;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
@media (max-width: 1280px) {
|
||||
.public-template-mode-row {
|
||||
grid-template-columns: minmax(280px, 1.2fr) minmax(160px, 0.7fr) minmax(190px, 0.8fr) 40px;
|
||||
}
|
||||
.public-template-flow-steps {
|
||||
align-items: stretch;
|
||||
flex-wrap: wrap;
|
||||
gap: var(--space-2);
|
||||
}
|
||||
.public-template-flow-step {
|
||||
flex-basis: calc(50% - var(--space-2));
|
||||
}
|
||||
.public-template-flow-arrow {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
@media (max-width: 980px) {
|
||||
.public-template-map-summary,
|
||||
.public-template-rules,
|
||||
.public-template-inventory-grid {
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
}
|
||||
.public-template-mode-row {
|
||||
grid-template-columns: minmax(0, 1fr) minmax(160px, 0.6fr) 40px;
|
||||
}
|
||||
.public-template-mode-shell {
|
||||
grid-column: 1 / -1;
|
||||
grid-row: 2;
|
||||
}
|
||||
}
|
||||
@media (max-width: 720px) {
|
||||
.public-template-map-summary,
|
||||
.public-template-rules,
|
||||
.public-template-inventory-grid,
|
||||
.public-template-mode-row {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
.public-template-component-groups {
|
||||
column-count: 1;
|
||||
}
|
||||
.public-template-mode-row {
|
||||
gap: var(--space-3);
|
||||
padding: var(--space-4);
|
||||
}
|
||||
.public-template-mode-shell {
|
||||
grid-column: auto;
|
||||
grid-row: auto;
|
||||
}
|
||||
.public-template-mode-row > .btn {
|
||||
position: absolute;
|
||||
right: var(--space-4);
|
||||
}
|
||||
.public-template-flow > header {
|
||||
align-items: flex-start;
|
||||
padding: var(--space-3) var(--space-4);
|
||||
}
|
||||
.public-template-flow-steps {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr;
|
||||
padding: var(--space-2);
|
||||
}
|
||||
.public-template-flow-step {
|
||||
width: 100%;
|
||||
}
|
||||
.public-template-rubrics-card .table-scroll {
|
||||
overflow: visible;
|
||||
}
|
||||
.public-template-rubrics-table {
|
||||
display: block;
|
||||
min-width: 0;
|
||||
}
|
||||
.public-template-rubrics-table thead,
|
||||
.public-template-rubrics-table colgroup {
|
||||
display: none;
|
||||
}
|
||||
.public-template-rubrics-table tbody,
|
||||
.public-template-rubrics-table tr,
|
||||
.public-template-rubrics-table td {
|
||||
display: block;
|
||||
width: 100%;
|
||||
}
|
||||
.public-template-rubrics-table tr {
|
||||
box-sizing: border-box;
|
||||
padding: var(--space-3) var(--space-4);
|
||||
border-bottom: 1px solid var(--border-default);
|
||||
}
|
||||
.public-template-rubrics-table td {
|
||||
box-sizing: border-box;
|
||||
display: grid;
|
||||
grid-template-columns: minmax(100px, 34%) minmax(0, 1fr);
|
||||
gap: var(--space-3);
|
||||
padding: 6px 0;
|
||||
border: 0;
|
||||
}
|
||||
.public-template-rubrics-table td::before {
|
||||
color: var(--text-secondary);
|
||||
content: attr(data-label);
|
||||
font-size: 12px;
|
||||
}
|
||||
.public-template-component-group > summary > span {
|
||||
grid-template-columns: 24px minmax(0, 1fr);
|
||||
}
|
||||
.public-template-component-group > summary > span small {
|
||||
grid-column: 2;
|
||||
}
|
||||
.public-template-component-row {
|
||||
grid-template-columns: 36px minmax(0, 1fr) 40px;
|
||||
align-items: start;
|
||||
padding: var(--space-3);
|
||||
}
|
||||
.public-template-component-copy > div {
|
||||
align-items: flex-start;
|
||||
flex-direction: column;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
return array(
|
||||
'code' => 'public_site',
|
||||
'name' => 'Публичный сайт',
|
||||
'version' => '0.5.0',
|
||||
'version' => '0.5.3',
|
||||
'permissions' => array(
|
||||
'key' => 'public_site',
|
||||
'items' => array(
|
||||
@@ -56,6 +56,7 @@
|
||||
),
|
||||
'routes' => array(
|
||||
array('GET', '/public-site', array(\App\Adminx\PublicSite\Controller::class, 'index')),
|
||||
array('GET', '/public-site/template-map', array(\App\Adminx\PublicSite\Controller::class, 'templateMap')),
|
||||
array('GET', '/public-site/map', array(\App\Adminx\PublicSite\Controller::class, 'siteMap')),
|
||||
array('GET', '/public-site/placements', array(\App\Adminx\PublicSite\Controller::class, 'placements')),
|
||||
array('GET', '/public-site/diagnostics', array(\App\Adminx\PublicSite\Controller::class, 'diagnostics')),
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<nav class="tabs public-site-tabs" aria-label="Разделы публичного сайта">
|
||||
<a class="tab {{ public_site_tab == 'structure' ? 'is-active' : '' }}" href="{{ ADMINX_BASE }}/public-site"><i class="ti ti-sitemap"></i>Структура</a>
|
||||
<a class="tab {{ public_site_tab == 'template_map' ? 'is-active' : '' }}" href="{{ ADMINX_BASE }}/public-site/template-map"><i class="ti ti-hierarchy-2"></i>Карта шаблонов</a>
|
||||
<a class="tab {{ public_site_tab == 'map' ? 'is-active' : '' }}" href="{{ ADMINX_BASE }}/public-site/map"><i class="ti ti-route"></i>Карта сайта</a>
|
||||
<a class="tab {{ public_site_tab == 'presentations' ? 'is-active' : '' }}" href="{{ ADMINX_BASE }}/public-site/presentations"><i class="ti ti-layout-cards"></i>Представления</a>
|
||||
<a class="tab {{ public_site_tab == 'templates' ? 'is-active' : '' }}" href="{{ ADMINX_BASE }}/public-site/templates"><i class="ti ti-template"></i>Шаблоны страницы</a>
|
||||
|
||||
@@ -0,0 +1,262 @@
|
||||
{% extends '@adminx/main.twig' %}
|
||||
{% block title %}Карта шаблонов{% endblock %}
|
||||
{% block content %}
|
||||
|
||||
<nav class="breadcrumbs" aria-label="Хлебные крошки">
|
||||
<a href="{{ ADMINX_BASE }}/">Главная</a><i class="ti ti-chevron-right"></i>
|
||||
<a href="{{ ADMINX_BASE }}/public-site">Публичный сайт</a><i class="ti ti-chevron-right"></i>
|
||||
<span>Карта шаблонов</span>
|
||||
</nav>
|
||||
|
||||
<div class="page-header">
|
||||
<div class="between public-site-page-head">
|
||||
<div>
|
||||
<h1>Карта шаблонов</h1>
|
||||
<p class="text-secondary">Из чего собираются страницы и где редактируется каждый слой.</p>
|
||||
</div>
|
||||
<div class="cluster public-site-page-actions">
|
||||
<a class="btn btn-secondary" href="{{ ADMINX_BASE }}/themes?theme={{ template_map.theme.code|url_encode }}"><i class="ti ti-palette"></i>Активная тема</a>
|
||||
<a class="btn btn-primary" href="{{ ADMINX_BASE }}/templates"><i class="ti ti-template"></i>Шаблоны сайта</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% set public_site_tab = 'template_map' %}
|
||||
{% include '@public_site/_tabs.twig' %}
|
||||
|
||||
<div class="alert alert-info public-template-map-notice">
|
||||
<i class="ti ti-info-circle"></i>
|
||||
<div>
|
||||
<b>Это навигатор, а не новый конструктор</b>
|
||||
<span>Карта ничего не переключает и не сохраняет. Она показывает действующую цепочку AVE.cms и ведёт в штатный редактор нужного шаблона.</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="public-site-summary public-template-map-summary">
|
||||
<div class="card public-site-stat">
|
||||
<span class="icon-tile" style="--tile-bg:var(--blue-100);--tile-fg:var(--blue-600)"><i class="ti ti-template"></i></span>
|
||||
<div><b>{{ template_map.summary.site_templates }}</b><span>Общих шаблонов</span></div>
|
||||
</div>
|
||||
<div class="card public-site-stat">
|
||||
<span class="icon-tile" style="--tile-bg:var(--green-100);--tile-fg:var(--green-600)"><i class="ti ti-folders"></i></span>
|
||||
<div><b>{{ template_map.summary.rubrics }}</b><span>Рубрик</span></div>
|
||||
</div>
|
||||
<div class="card public-site-stat">
|
||||
<span class="icon-tile" style="--tile-bg:var(--violet-100);--tile-fg:var(--violet-600)"><i class="ti ti-components"></i></span>
|
||||
<div><b>{{ template_map.summary.components }}</b><span>Публичных компонентов</span></div>
|
||||
</div>
|
||||
<div class="card public-site-stat">
|
||||
<span class="icon-tile" style="--tile-bg:var(--cyan-100);--tile-fg:var(--cyan-600)"><i class="ti ti-checks"></i></span>
|
||||
<div><b>{{ template_map.summary.active_overrides }}</b><span>Действующих источников</span></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<section class="public-site-panel public-template-map-mode">
|
||||
<div class="section-header public-site-panel-header">
|
||||
<div class="section-icon"><i class="ti ti-adjustments-horizontal"></i></div>
|
||||
<div>
|
||||
<div class="section-eyebrow">Текущая установка</div>
|
||||
<h2>Как сайт собирается сейчас</h2>
|
||||
<p class="section-desc">Режим читается из активной темы, поэтому на карте показана фактическая, а не предполагаемая схема.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="public-template-mode-row">
|
||||
<div class="public-template-mode-main">
|
||||
<span class="icon-tile" style="--tile-bg:var(--blue-100);--tile-fg:var(--blue-600)"><i class="ti ti-stack-2"></i></span>
|
||||
<div>
|
||||
<span class="text-secondary">Способ сборки</span>
|
||||
<h3>{{ template_map.theme.mode_label }}</h3>
|
||||
<p>{{ template_map.theme.mode_note }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="public-template-mode-theme">
|
||||
<span class="text-secondary">Активная тема</span>
|
||||
<b>{{ template_map.theme.name }}</b>
|
||||
<small><code>{{ template_map.theme.code }}</code>{% if template_map.theme.version %} · версия {{ template_map.theme.version }}{% endif %}</small>
|
||||
</div>
|
||||
<div class="public-template-mode-shell">
|
||||
<span class="text-secondary">Файловая оболочка</span>
|
||||
{% if template_map.theme.page_shell %}<code>{{ template_map.theme.page_shell }}</code>{% else %}<b>Не задана</b>{% endif %}
|
||||
<small class="{{ template_map.theme.page_shell_active ? 'is-active' : '' }}">{{ template_map.theme.page_shell_active ? 'Используется' : 'Не заменяет общий шаблон' }}</small>
|
||||
</div>
|
||||
<a class="btn btn-ghost btn-icon" href="{{ ADMINX_BASE }}{{ template_map.theme.url }}" data-tooltip-left="Открыть настройки темы" aria-label="Открыть настройки темы"><i class="ti ti-arrow-up-right"></i></a>
|
||||
</div>
|
||||
|
||||
<div class="public-template-rules">
|
||||
{% for rule in template_map.rules %}
|
||||
<div class="public-template-rule">
|
||||
<i class="{{ rule.icon }}"></i>
|
||||
<div><b>{{ rule.title }}</b><span>{{ rule.text }}</span></div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="public-site-panel public-template-scenarios">
|
||||
<div class="section-header public-site-panel-header">
|
||||
<div class="section-icon"><i class="ti ti-route-square"></i></div>
|
||||
<div>
|
||||
<div class="section-eyebrow">Типовые страницы</div>
|
||||
<h2>Цепочки сборки</h2>
|
||||
<p class="section-desc">Читайте слева направо: данные выбираются, оформляются своим шаблоном и затем попадают в общий каркас сайта.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="public-template-flow-list">
|
||||
{% for scenario in template_map.scenarios %}
|
||||
<article class="public-template-flow">
|
||||
<header>
|
||||
<span class="icon-tile"><i class="{{ scenario.icon }}"></i></span>
|
||||
<div><h3>{{ scenario.title }}</h3><p>{{ scenario.description }}</p></div>
|
||||
</header>
|
||||
<div class="public-template-flow-steps" style="--flow-columns:{{ scenario.steps|length }}">
|
||||
{% for step in scenario.steps %}
|
||||
<div class="public-template-flow-step is-{{ step.tone }}">
|
||||
<div class="public-template-flow-number">{{ loop.index }}</div>
|
||||
<div class="public-template-flow-copy">
|
||||
<div class="public-template-flow-title"><b>{{ step.title }}</b><span class="badge badge-{{ step.tone == 'gray' ? 'gray' : step.tone }}">{{ step.state }}</span></div>
|
||||
<p>{{ step.text }}</p>
|
||||
</div>
|
||||
{% if step.url %}<a class="btn btn-ghost btn-icon btn-sm" href="{{ ADMINX_BASE }}{{ step.url }}" data-tooltip-left="Открыть редактор" aria-label="Открыть редактор"><i class="ti ti-arrow-up-right"></i></a>{% endif %}
|
||||
</div>
|
||||
{% if not loop.last %}<i class="ti ti-chevron-right public-template-flow-arrow"></i>{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
</article>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="public-site-panel public-template-inventory">
|
||||
<div class="section-header public-site-panel-header">
|
||||
<div class="section-icon"><i class="ti ti-link"></i></div>
|
||||
<div>
|
||||
<div class="section-eyebrow">Фактические назначения</div>
|
||||
<h2>Общие шаблоны и рубрики</h2>
|
||||
<p class="section-desc">Здесь видно, какой общий шаблон назначен каждому типу контента и есть ли у рубрики собственная разметка документа.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="public-template-inventory-grid">
|
||||
<div class="card public-site-card public-template-site-templates">
|
||||
<div class="public-site-card-head">
|
||||
<div class="public-site-card-title"><span class="icon-tile"><i class="ti ti-browser"></i></span><div><h2>Общие шаблоны сайта</h2><p class="text-secondary">Каркас страницы и место [tag:maincontent]</p></div></div>
|
||||
<a class="btn btn-ghost btn-icon" href="{{ ADMINX_BASE }}/templates" data-tooltip-left="Все шаблоны" aria-label="Все шаблоны"><i class="ti ti-arrow-up-right"></i></a>
|
||||
</div>
|
||||
<div class="table-scroll">
|
||||
<table class="table table-compact">
|
||||
<thead><tr><th>Шаблон</th><th>Назначен</th><th></th></tr></thead>
|
||||
<tbody>
|
||||
{% for item in template_map.site_templates %}
|
||||
<tr>
|
||||
<td><div class="public-site-name"><b>{{ item.title }}</b><span>ID {{ item.id }}</span></div></td>
|
||||
<td><span class="badge {{ item.usage_count ? 'badge-green' : 'badge-gray' }}">{{ item.usage_count }} рубрик</span></td>
|
||||
<td><a class="btn btn-ghost btn-icon btn-sm" href="{{ ADMINX_BASE }}{{ item.url }}" data-tooltip-left="Редактировать" aria-label="Редактировать"><i class="ti ti-pencil"></i></a></td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr><td colspan="3"><div class="empty-state"><i class="ti ti-template-off"></i><b>Общих шаблонов нет</b><span>Создайте шаблон сайта и назначьте его рубрике.</span></div></td></tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card public-site-card public-template-product-layer">
|
||||
<div class="public-site-card-head">
|
||||
<div class="public-site-card-title"><span class="icon-tile"><i class="ti ti-package"></i></span><div><h2>Товарное оформление</h2><p class="text-secondary">Отдельные представления карточек и фильтров</p></div></div>
|
||||
{% if template_map.product.available %}<span class="badge badge-green">Подключено</span>{% else %}<span class="badge badge-gray">Не установлено</span>{% endif %}
|
||||
</div>
|
||||
{% if template_map.product.available %}
|
||||
<div class="public-template-product-links">
|
||||
<a href="{{ ADMINX_BASE }}{{ template_map.product.cards.url }}">
|
||||
<span class="icon-tile"><i class="ti ti-layout-cards"></i></span>
|
||||
<span><b>Карточки товаров</b><small>{{ template_map.product.cards.published }} опубликовано · {{ template_map.product.cards.used }} используется</small></span>
|
||||
<i class="ti ti-arrow-up-right"></i>
|
||||
</a>
|
||||
<a href="{{ ADMINX_BASE }}{{ template_map.product.filters.url }}">
|
||||
<span class="icon-tile"><i class="ti ti-adjustments-horizontal"></i></span>
|
||||
<span><b>Вид фильтров</b><small>{{ template_map.product.filters.published }} опубликовано · {{ template_map.product.filters.used }} используется</small></span>
|
||||
<i class="ti ti-arrow-up-right"></i>
|
||||
</a>
|
||||
<a href="{{ ADMINX_BASE }}/catalog/public-templates">
|
||||
<span class="icon-tile"><i class="ti ti-template"></i></span>
|
||||
<span><b>Шаблоны страницы товара</b><small>Категория, выдача, карточка и полная страница</small></span>
|
||||
<i class="ti ti-arrow-up-right"></i>
|
||||
</a>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="empty-state public-template-product-empty">
|
||||
<i class="ti ti-package-off"></i><b>Товарный слой не установлен</b>
|
||||
<span>После установки модуля «Товары» здесь появятся карточки, фильтры и шаблоны страницы товара.</span>
|
||||
<a class="btn btn-secondary" href="{{ ADMINX_BASE }}/modules"><i class="ti ti-package-import"></i>Открыть модули</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card public-site-card public-template-rubrics-card">
|
||||
<div class="public-site-card-head">
|
||||
<div class="public-site-card-title"><span class="icon-tile"><i class="ti ti-folders"></i></span><div><h2>Рубрики и их шаблоны</h2><p class="text-secondary">{{ template_map.rubrics|length }} типов контента в текущей установке</p></div></div>
|
||||
<a class="btn btn-ghost btn-icon" href="{{ ADMINX_BASE }}/rubrics" data-tooltip-left="Все рубрики" aria-label="Все рубрики"><i class="ti ti-arrow-up-right"></i></a>
|
||||
</div>
|
||||
<div class="table-scroll">
|
||||
<table class="table table-compact public-template-rubrics-table">
|
||||
<thead><tr><th>Рубрика</th><th>Назначение</th><th>Общий шаблон</th><th>Шаблон документа</th><th>Документы</th><th></th></tr></thead>
|
||||
<tbody>
|
||||
{% for item in template_map.rubrics %}
|
||||
<tr>
|
||||
<td data-label="Рубрика"><div class="public-site-name"><b>{{ item.title }}</b><span><code>{{ item.alias ?: 'без alias' }}</code> · ID {{ item.id }}</span></div></td>
|
||||
<td data-label="Назначение"><span class="badge {{ item.purpose == 'Каталог' ? 'badge-violet' : (item.purpose == 'Документы и подборки' ? 'badge-blue' : 'badge-gray') }}">{{ item.purpose }}</span></td>
|
||||
<td data-label="Общий шаблон">{% if item.template_title %}<div class="public-site-template"><b>{{ item.template_title }}</b><span>ID {{ item.template_id }}</span></div>{% else %}<span class="badge badge-red">Не назначен</span>{% endif %}</td>
|
||||
<td data-label="Шаблон документа"><div class="public-template-rubric-state"><span class="badge {{ item.has_main_template ? 'badge-green' : 'badge-red' }}">{{ item.has_main_template ? 'Основной задан' : 'Основной пуст' }}</span>{% if item.extra_templates_count %}<small>+ {{ item.extra_templates_count }} дополнительных</small>{% endif %}</div></td>
|
||||
<td data-label="Документы"><b>{{ item.documents_count }}</b></td>
|
||||
<td data-label="Действия"><a class="btn btn-ghost btn-icon btn-sm" href="{{ ADMINX_BASE }}{{ item.url }}" data-tooltip-left="Открыть шаблоны рубрики" aria-label="Открыть шаблоны рубрики"><i class="ti ti-pencil"></i></a></td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr><td colspan="6"><div class="empty-state"><i class="ti ti-folders-off"></i><b>Рубрик пока нет</b><span>После создания они появятся на карте автоматически.</span></div></td></tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="public-site-panel public-template-components">
|
||||
<div class="section-header public-site-panel-header">
|
||||
<div class="section-icon"><i class="ti ti-components"></i></div>
|
||||
<div>
|
||||
<div class="section-eyebrow">Файловое оформление</div>
|
||||
<h2>Компоненты активной темы</h2>
|
||||
<p class="section-desc">Это не отдельные страницы. Компонент работает только тогда, когда его вызывает шаблон рубрики, запрос, блок или модуль.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="public-template-component-groups">
|
||||
{% for group in template_map.component_groups %}
|
||||
<details class="card public-template-component-group"{{ loop.index <= 2 ? ' open' : '' }}>
|
||||
<summary>
|
||||
<span><i class="ti ti-folder-code"></i><b>{{ group.title }}</b><small>{{ group.items|length }} компонентов</small></span>
|
||||
<i class="ti ti-chevron-down"></i>
|
||||
</summary>
|
||||
<div class="public-template-component-list">
|
||||
{% for item in group.items %}
|
||||
<div class="public-template-component-row">
|
||||
<span class="icon-tile"><i class="{{ item.icon }}"></i></span>
|
||||
<div class="public-template-component-copy">
|
||||
<div><b>{{ item.title }}</b><span class="badge {{ item.state_class }}">{{ item.source_label }}</span></div>
|
||||
<p>{{ item.description }}</p>
|
||||
<code>{{ item.path ?: item.namespace ~ '/' ~ item.file }}</code>
|
||||
</div>
|
||||
<a class="btn btn-ghost btn-icon" href="{{ ADMINX_BASE }}{{ item.url }}" data-tooltip-left="Открыть шаблон" aria-label="Открыть шаблон"><i class="ti ti-arrow-up-right"></i></a>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</details>
|
||||
{% else %}
|
||||
<div class="card"><div class="empty-state"><i class="ti ti-template-off"></i><b>Компоненты темы не найдены</b><span>Проверьте реестр активной темы.</span></div></div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</section>
|
||||
|
||||
{% endblock %}
|
||||
@@ -1,136 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<language>
|
||||
<phrase data="auto_032ed2dfb1db0f14">meaning "</phrase>
|
||||
<phrase data="auto_05e7bc6e97af552c">found</phrase>
|
||||
<phrase data="auto_07577dba507e4ec0">For each request, the complete Legacy sequence will be checked against the ID in ascending and descending order. Native will only be enabled if there is an exact match; any discrepancy will automatically cancel the change.</phrase>
|
||||
<phrase data="auto_08cb0aef9082fa66">specify a constant</phrase>
|
||||
<phrase data="auto_0b90dcb0d77c2aeb">Order verified</phrase>
|
||||
<phrase data="auto_0c0d58a11ba9633a">contains</phrase>
|
||||
<phrase data="auto_0e18a76b455f27f5">Random order is used without other levels</phrase>
|
||||
<phrase data="auto_0fd261036ee38c89">Document</phrase>
|
||||
<phrase data="auto_104e36078b0fb18a">one of the parameter values "</phrase>
|
||||
<phrase data="auto_1199e46110c703d0">Checking requests</phrase>
|
||||
<phrase data="auto_15782150a0e84091"><div class="request-explain-options-state"><i class="ti ti-loader-2"></i>Search...</div></phrase>
|
||||
<phrase data="auto_189d15bc7eec18dd">Comparison</phrase>
|
||||
<phrase data="auto_19114f713f604d3e">Material</phrase>
|
||||
<phrase data="auto_1c4bc45438abb81c">Field "</phrase>
|
||||
<phrase data="auto_1e1b70b17c42674c">Nothing found</phrase>
|
||||
<phrase data="auto_1f1437928ef434ed">Delete condition?</phrase>
|
||||
<phrase data="auto_27cb45d3018b58de"><div class="request-explain-tree-empty">There are no active conditions in the group</div></phrase>
|
||||
<phrase data="auto_27d21beea42d7951">less</phrase>
|
||||
<phrase data="auto_28eebd6e05bfd532">requests in the list.</phrase>
|
||||
<phrase data="auto_2c6cbba7ca20d02c">And</phrase>
|
||||
<phrase data="auto_2f8f4ee43113f5e0">greater than or equal to</phrase>
|
||||
<phrase data="auto_31f574d9b034389c">Random order</phrase>
|
||||
<phrase data="auto_32b74a3c47908c1e">Untitled</phrase>
|
||||
<phrase data="auto_33424a86f54e6100">parameter value "</phrase>
|
||||
<phrase data="auto_351bdca36f04479b">» filled</phrase>
|
||||
<phrase data="auto_359282f9ef75e654">Document ID</phrase>
|
||||
<phrase data="auto_378361e0be144aac">starts with</phrase>
|
||||
<phrase data="auto_389de083564f342a"><div class="request-explain-options-state"><i class="ti ti-file-off"></i>Documents not found</div></phrase>
|
||||
<phrase data="auto_3bc36e9ea4a0955a">· deleted</phrase>
|
||||
<phrase data="auto_4ae50d30739d5840">Close</phrase>
|
||||
<phrase data="auto_4b6f3241a7b5a788">. An empty parameter does not participate in filtering.</phrase>
|
||||
<phrase data="auto_4c2932b20bd66231">Boolean value</phrase>
|
||||
<phrase data="auto_4c386bc752f0e6df">[structured data]</phrase>
|
||||
<phrase data="auto_4e68100dbb3f79b4">Cache, integrations, compatibility, result contract and Native executor.</phrase>
|
||||
<phrase data="auto_4e8f0c3a1fc7e9ad">Explain the result</phrase>
|
||||
<phrase data="auto_537aca486e1ad692">The order is not fixed</phrase>
|
||||
<phrase data="auto_5a5b2e3257454e31">» in the format |value|</phrase>
|
||||
<phrase data="auto_5b1c65c008232b00">Terms</phrase>
|
||||
<phrase data="auto_5b9a18a54f30b067">Reinforce the order without changing the output?</phrase>
|
||||
<phrase data="auto_5c196ee8576211db">Request</phrase>
|
||||
<phrase data="auto_5c879d95515a61f9">less than or equal to</phrase>
|
||||
<phrase data="auto_5e09daddaaae2f28">active conditions</phrase>
|
||||
<phrase data="auto_5e5ccbc2d58c978f">No documents found</phrase>
|
||||
<phrase data="auto_5e6ded00f244387d">Verification failed</phrase>
|
||||
<phrase data="auto_5e70abc6833fb7dc">included in the list</phrase>
|
||||
<phrase data="auto_5e8acb5405d7c6b6">Reinforce order</phrase>
|
||||
<phrase data="auto_5f8e0e29375c5a82">Requests</phrase>
|
||||
<phrase data="auto_60b8ce4b9f94a2f2">checked by free condition</phrase>
|
||||
<phrase data="auto_60ea15b1d4c0f5dc"><span class="request-explain-condition-state"><i class="ti"></i></span><div class="request-explain-condition-copy"><div><b></b><code></code></div><dl><div><dt>Actually</dt><dd data-actual></dd></div><div><dt>Condition</dt><dd data-expected></dd></div></dl><p hidden></p></div></phrase>
|
||||
<phrase data="auto_61f6bda106d823f8">matches one of the values</phrase>
|
||||
<phrase data="auto_61f764b6b199e9de">Remains Legacy</phrase>
|
||||
<phrase data="auto_62fc87d293033233">· extra IDs:</phrase>
|
||||
<phrase data="auto_63aff46d2fcad83f">is compared with the value</phrase>
|
||||
<phrase data="auto_65706e55e18054d0">Any element inside is enough</phrase>
|
||||
<phrase data="auto_66809f536a0e52de">equals</phrase>
|
||||
<phrase data="auto_686b2c5053cc58b8">Query conditions and actual result of executor.</phrase>
|
||||
<phrase data="auto_6f4a8d79ac8c9786">Validation error</phrase>
|
||||
<phrase data="auto_714f3223440dbb5f">range min/max from the parameter "</phrase>
|
||||
<phrase data="auto_72aecd9ad85642d8">Error</phrase>
|
||||
<phrase data="auto_78142342bc327ad4">Basic parameters, conditions and presentation of the result.</phrase>
|
||||
<phrase data="auto_7a46f37072ba9ad5">not included in the list</phrase>
|
||||
<phrase data="auto_7aa95369282ead6c">groups</phrase>
|
||||
<phrase data="auto_7c3834203266fab3">· withdrawn from publication</phrase>
|
||||
<phrase data="auto_7edf68dad8afcc29">The order is different</phrase>
|
||||
<phrase data="auto_7f0369a76d750f0a">Native confirmed</phrase>
|
||||
<phrase data="auto_804cf21f365ef47b"><i class="ti ti-loader-2"></i><span>Checking the request...</span></phrase>
|
||||
<phrase data="auto_851f9c331eaf483e">One coincidence is enough</phrase>
|
||||
<phrase data="auto_86ea33aef5e95d4f">Delete</phrase>
|
||||
<phrase data="auto_87451e618697c593">", when the parameter "</phrase>
|
||||
<phrase data="auto_8d2fab2d123f89ab">Yes</phrase>
|
||||
<phrase data="auto_92d3ae9f63c77ac5">· no ID:</phrase>
|
||||
<phrase data="auto_947023ee6188249c">Preparation</phrase>
|
||||
<phrase data="auto_9540ae80e12ace33">Shuffle cannot be combined with other levels</phrase>
|
||||
<phrase data="auto_96d88e8e31201094">All available fields have already been added</phrase>
|
||||
<phrase data="auto_97ab80304c3f0564">Enable Confirmed</phrase>
|
||||
<phrase data="auto_97b8648c721d2183">Ready</phrase>
|
||||
<phrase data="auto_9b52dbd7737373bd">Post verification</phrase>
|
||||
<phrase data="auto_9c8243db16c84bef">fixed value</phrase>
|
||||
<phrase data="auto_a4588dfa770d10c3">Test results</phrase>
|
||||
<phrase data="auto_a480e18f45a4e204">Saved PHP code</phrase>
|
||||
<phrase data="auto_a4d765aa97521f40">does not contain</phrase>
|
||||
<phrase data="auto_ad0995eca44142c4">the result of the saved PHP code.</phrase>
|
||||
<phrase data="auto_ae8e1a46739261fa">parameter value "</phrase>
|
||||
<phrase data="auto_b1a5a8acb3ed7df1">Request verified</phrase>
|
||||
<phrase data="auto_b22f4c76befc0be0">parameter</phrase>
|
||||
<phrase data="auto_b58e8d5d7248d75f">decimal number from parameter "</phrase>
|
||||
<phrase data="auto_b5d52a68fc7c1aca">Requires Legacy</phrase>
|
||||
<phrase data="auto_beed168817322eeb">from</phrase>
|
||||
<phrase data="auto_c00aca49199296d7">Network error</phrase>
|
||||
<phrase data="auto_c139a7f87025424d">Position</phrase>
|
||||
<phrase data="auto_c34624da0ccdeeec">no changes:</phrase>
|
||||
<phrase data="auto_c5439a1ef48ca614">Scan stopped</phrase>
|
||||
<phrase data="auto_c8de745114264843">Explain</phrase>
|
||||
<phrase data="auto_cc5462f639836db2">Final order by ID has already been added</phrase>
|
||||
<phrase data="auto_d20c1341aa2d75f5">Results vary</phrase>
|
||||
<phrase data="auto_d2881051aa8668f1">doesn't start with</phrase>
|
||||
<phrase data="auto_d39886d5753cc067">· checked states:</phrase>
|
||||
<phrase data="auto_d52c691335394be0">an integer from the parameter "</phrase>
|
||||
<phrase data="auto_dbfb65b02e39f8f7">not equal</phrase>
|
||||
<phrase data="auto_dd02bc21dabc217c">There are no queries with loose order</phrase>
|
||||
<phrase data="auto_de0428ac4f69cb1d">All elements must match</phrase>
|
||||
<phrase data="auto_df119811d4b0283b">Found:</phrase>
|
||||
<phrase data="auto_e0b0e0fb72dfdc42">The order is fixed:</phrase>
|
||||
<phrase data="auto_e0b8fe4f27c488e1">Failed to upload documents</phrase>
|
||||
<phrase data="auto_e0f1201ba77617e7">No explicit sorting</phrase>
|
||||
<phrase data="auto_e2ec03f1e750f62b">This field is already being sorted</phrase>
|
||||
<phrase data="auto_e2fbce9d8a1f491f">Validation failed</phrase>
|
||||
<phrase data="auto_e3c6d93632cf386b">Find document</phrase>
|
||||
<phrase data="auto_e43ee32b856aa90a">We are checking the request...</phrase>
|
||||
<phrase data="auto_e939dbf27072b380">more</phrase>
|
||||
<phrase data="auto_e9b76330e794cf78">Matches</phrase>
|
||||
<phrase data="auto_ea84a51a0b3a4cdc">Document verification</phrase>
|
||||
<phrase data="auto_edf1164e6de24189">Return Legacy</phrase>
|
||||
<phrase data="auto_ee1a08bdb4da0f24">Network error when checking document</phrase>
|
||||
<phrase data="auto_eec268a8aa03da99">OR</phrase>
|
||||
<phrase data="auto_efb923a146075185">Need manual verification</phrase>
|
||||
<phrase data="auto_eff79c40e2100ae5">In progress</phrase>
|
||||
<phrase data="auto_f0dff5ab4a669f7a">Saved</phrase>
|
||||
<phrase data="auto_f285f61cdca7dc54"><div class="request-explain-options-state is-error"><i class="ti ti-alert-circle"></i>Search unavailable</div></phrase>
|
||||
<phrase data="auto_f49d62eb4ff9605b">selected field</phrase>
|
||||
<phrase data="auto_f4f8afbe303728f1">You can add up to eight levels</phrase>
|
||||
<phrase data="auto_f554d87de9a7370d">All elements inside must be executed</phrase>
|
||||
<phrase data="auto_f5edf19efa035287">Check and secure</phrase>
|
||||
<phrase data="auto_f6f3a1a1ff2cd5b6"><i class="ti ti-filter-off"></i><b>Documents not found</b><span>Check the conditions, publication status and selected category.</span></phrase>
|
||||
<phrase data="auto_f82a8219414c7c8e">No</phrase>
|
||||
<phrase data="auto_fd2566032f8228a3">Comparison value</phrase>
|
||||
<phrase data="runtime_04d278fefcfa9d3c">Check the fields</phrase>
|
||||
<phrase data="runtime_2fe8f2fd72439d26">Saved</phrase>
|
||||
<phrase data="runtime_6087165c7ca7a986">No explicit sorting</phrase>
|
||||
<phrase data="runtime_6e42b31a32562d11">Preview updated</phrase>
|
||||
<phrase data="runtime_85011fce4419ee63">Field #</phrase>
|
||||
<phrase data="runtime_8f88b95463e29667">Random order</phrase>
|
||||
<phrase data="runtime_cef09ed8cdc5809d">Request verified</phrase>
|
||||
</language>
|
||||
@@ -1,136 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<language>
|
||||
<phrase data="auto_032ed2dfb1db0f14">значением «</phrase>
|
||||
<phrase data="auto_05e7bc6e97af552c">найдено</phrase>
|
||||
<phrase data="auto_07577dba507e4ec0">Для каждого запроса полная Legacy-последовательность будет сверена с ID по возрастанию и убыванию. Native включится только при точном совпадении; любое расхождение автоматически отменит изменение.</phrase>
|
||||
<phrase data="auto_08cb0aef9082fa66">укажите константу</phrase>
|
||||
<phrase data="auto_0b90dcb0d77c2aeb">Порядок проверен</phrase>
|
||||
<phrase data="auto_0c0d58a11ba9633a">содержит</phrase>
|
||||
<phrase data="auto_0e18a76b455f27f5">Случайный порядок используется без других уровней</phrase>
|
||||
<phrase data="auto_0fd261036ee38c89">Документ</phrase>
|
||||
<phrase data="auto_104e36078b0fb18a">одним из значений параметра «</phrase>
|
||||
<phrase data="auto_1199e46110c703d0">Проверка запросов</phrase>
|
||||
<phrase data="auto_15782150a0e84091"><div class="request-explain-options-state"><i class="ti ti-loader-2"></i>Поиск…</div></phrase>
|
||||
<phrase data="auto_189d15bc7eec18dd">Сравнение</phrase>
|
||||
<phrase data="auto_19114f713f604d3e">Материал</phrase>
|
||||
<phrase data="auto_1c4bc45438abb81c">Поле «</phrase>
|
||||
<phrase data="auto_1e1b70b17c42674c">Ничего не найдено</phrase>
|
||||
<phrase data="auto_1f1437928ef434ed">Удалить условие?</phrase>
|
||||
<phrase data="auto_27cb45d3018b58de"><div class="request-explain-tree-empty">В группе нет активных условий</div></phrase>
|
||||
<phrase data="auto_27d21beea42d7951">меньше</phrase>
|
||||
<phrase data="auto_28eebd6e05bfd532">запросов в списке.</phrase>
|
||||
<phrase data="auto_2c6cbba7ca20d02c">И</phrase>
|
||||
<phrase data="auto_2f8f4ee43113f5e0">больше или равно</phrase>
|
||||
<phrase data="auto_31f574d9b034389c">Случайный порядок</phrase>
|
||||
<phrase data="auto_32b74a3c47908c1e">Без названия</phrase>
|
||||
<phrase data="auto_33424a86f54e6100">значением параметра «</phrase>
|
||||
<phrase data="auto_351bdca36f04479b">» заполнен</phrase>
|
||||
<phrase data="auto_359282f9ef75e654">ID документа</phrase>
|
||||
<phrase data="auto_378361e0be144aac">начинается с</phrase>
|
||||
<phrase data="auto_389de083564f342a"><div class="request-explain-options-state"><i class="ti ti-file-off"></i>Документы не найдены</div></phrase>
|
||||
<phrase data="auto_3bc36e9ea4a0955a">· удалён</phrase>
|
||||
<phrase data="auto_4ae50d30739d5840">Закрыть</phrase>
|
||||
<phrase data="auto_4b6f3241a7b5a788">. Пустой параметр не участвует в фильтрации.</phrase>
|
||||
<phrase data="auto_4c2932b20bd66231">Логическое значение</phrase>
|
||||
<phrase data="auto_4c386bc752f0e6df">[структурированные данные]</phrase>
|
||||
<phrase data="auto_4e68100dbb3f79b4">Кеш, интеграции, совместимость, контракт результата и Native executor.</phrase>
|
||||
<phrase data="auto_4e8f0c3a1fc7e9ad">Объяснить результат</phrase>
|
||||
<phrase data="auto_537aca486e1ad692">Порядок не закреплён</phrase>
|
||||
<phrase data="auto_5a5b2e3257454e31">» в формате |значение|</phrase>
|
||||
<phrase data="auto_5b1c65c008232b00">Условия</phrase>
|
||||
<phrase data="auto_5b9a18a54f30b067">Закрепить порядок без изменения выдачи?</phrase>
|
||||
<phrase data="auto_5c196ee8576211db">Запрос</phrase>
|
||||
<phrase data="auto_5c879d95515a61f9">меньше или равно</phrase>
|
||||
<phrase data="auto_5e09daddaaae2f28">активных условий</phrase>
|
||||
<phrase data="auto_5e5ccbc2d58c978f">Документы не найдены</phrase>
|
||||
<phrase data="auto_5e6ded00f244387d">Проверка не выполнена</phrase>
|
||||
<phrase data="auto_5e70abc6833fb7dc">входит в список</phrase>
|
||||
<phrase data="auto_5e8acb5405d7c6b6">Закрепить порядок</phrase>
|
||||
<phrase data="auto_5f8e0e29375c5a82">Запросов</phrase>
|
||||
<phrase data="auto_60b8ce4b9f94a2f2">проверяется свободным условием</phrase>
|
||||
<phrase data="auto_60ea15b1d4c0f5dc"><span class="request-explain-condition-state"><i class="ti"></i></span><div class="request-explain-condition-copy"><div><b></b><code></code></div><dl><div><dt>Фактически</dt><dd data-actual></dd></div><div><dt>Условие</dt><dd data-expected></dd></div></dl><p hidden></p></div></phrase>
|
||||
<phrase data="auto_61f6bda106d823f8">совпадает с одним из значений</phrase>
|
||||
<phrase data="auto_61f764b6b199e9de">Остаётся Legacy</phrase>
|
||||
<phrase data="auto_62fc87d293033233">· лишние ID:</phrase>
|
||||
<phrase data="auto_63aff46d2fcad83f">сравнивается со значением</phrase>
|
||||
<phrase data="auto_65706e55e18054d0">Достаточно любого элемента внутри</phrase>
|
||||
<phrase data="auto_66809f536a0e52de">равно</phrase>
|
||||
<phrase data="auto_686b2c5053cc58b8">Условия запроса и фактический итог executor.</phrase>
|
||||
<phrase data="auto_6f4a8d79ac8c9786">Ошибка проверки</phrase>
|
||||
<phrase data="auto_714f3223440dbb5f">диапазоном min/max из параметра «</phrase>
|
||||
<phrase data="auto_72aecd9ad85642d8">Ошибка</phrase>
|
||||
<phrase data="auto_78142342bc327ad4">Основные параметры, условия и оформление результата.</phrase>
|
||||
<phrase data="auto_7a46f37072ba9ad5">не входит в список</phrase>
|
||||
<phrase data="auto_7aa95369282ead6c">групп</phrase>
|
||||
<phrase data="auto_7c3834203266fab3">· снят с публикации</phrase>
|
||||
<phrase data="auto_7edf68dad8afcc29">Отличается порядок</phrase>
|
||||
<phrase data="auto_7f0369a76d750f0a">Native подтверждён</phrase>
|
||||
<phrase data="auto_804cf21f365ef47b"><i class="ti ti-loader-2"></i><span>Проверяем запрос…</span></phrase>
|
||||
<phrase data="auto_851f9c331eaf483e">Достаточно одного совпадения</phrase>
|
||||
<phrase data="auto_86ea33aef5e95d4f">Удалить</phrase>
|
||||
<phrase data="auto_87451e618697c593">», когда параметр «</phrase>
|
||||
<phrase data="auto_8d2fab2d123f89ab">Да</phrase>
|
||||
<phrase data="auto_92d3ae9f63c77ac5">· нет ID:</phrase>
|
||||
<phrase data="auto_947023ee6188249c">Подготовка</phrase>
|
||||
<phrase data="auto_9540ae80e12ace33">Случайный порядок нельзя сочетать с другими уровнями</phrase>
|
||||
<phrase data="auto_96d88e8e31201094">Все доступные поля уже добавлены</phrase>
|
||||
<phrase data="auto_97ab80304c3f0564">Включить подтверждённые</phrase>
|
||||
<phrase data="auto_97b8648c721d2183">Готов</phrase>
|
||||
<phrase data="auto_9b52dbd7737373bd">Проверка публикации</phrase>
|
||||
<phrase data="auto_9c8243db16c84bef">фиксированное значение</phrase>
|
||||
<phrase data="auto_a4588dfa770d10c3">Результаты проверки</phrase>
|
||||
<phrase data="auto_a480e18f45a4e204">Сохранённый PHP-код</phrase>
|
||||
<phrase data="auto_a4d765aa97521f40">не содержит</phrase>
|
||||
<phrase data="auto_ad0995eca44142c4">результатом сохранённого PHP-кода.</phrase>
|
||||
<phrase data="auto_ae8e1a46739261fa">значение параметра «</phrase>
|
||||
<phrase data="auto_b1a5a8acb3ed7df1">Запрос проверен</phrase>
|
||||
<phrase data="auto_b22f4c76befc0be0">параметр</phrase>
|
||||
<phrase data="auto_b58e8d5d7248d75f">десятичным числом из параметра «</phrase>
|
||||
<phrase data="auto_b5d52a68fc7c1aca">Требуется Legacy</phrase>
|
||||
<phrase data="auto_beed168817322eeb">из</phrase>
|
||||
<phrase data="auto_c00aca49199296d7">Ошибка сети</phrase>
|
||||
<phrase data="auto_c139a7f87025424d">Позиция</phrase>
|
||||
<phrase data="auto_c34624da0ccdeeec">· без изменений:</phrase>
|
||||
<phrase data="auto_c5439a1ef48ca614">Проверка остановлена</phrase>
|
||||
<phrase data="auto_c8de745114264843">Объяснить</phrase>
|
||||
<phrase data="auto_cc5462f639836db2">Финальный порядок по ID уже добавлен</phrase>
|
||||
<phrase data="auto_d20c1341aa2d75f5">Результаты различаются</phrase>
|
||||
<phrase data="auto_d2881051aa8668f1">не начинается с</phrase>
|
||||
<phrase data="auto_d39886d5753cc067">· проверено состояний:</phrase>
|
||||
<phrase data="auto_d52c691335394be0">целым числом из параметра «</phrase>
|
||||
<phrase data="auto_dbfb65b02e39f8f7">не равно</phrase>
|
||||
<phrase data="auto_dd02bc21dabc217c">Запросов с незакреплённым порядком нет</phrase>
|
||||
<phrase data="auto_de0428ac4f69cb1d">Должны совпасть все элементы</phrase>
|
||||
<phrase data="auto_df119811d4b0283b">Найдено:</phrase>
|
||||
<phrase data="auto_e0b0e0fb72dfdc42">Порядок закреплён:</phrase>
|
||||
<phrase data="auto_e0b8fe4f27c488e1">Не удалось загрузить документы</phrase>
|
||||
<phrase data="auto_e0f1201ba77617e7">Без явной сортировки</phrase>
|
||||
<phrase data="auto_e2ec03f1e750f62b">Это поле уже участвует в сортировке</phrase>
|
||||
<phrase data="auto_e2fbce9d8a1f491f">Не удалось выполнить проверку</phrase>
|
||||
<phrase data="auto_e3c6d93632cf386b">Найти документ</phrase>
|
||||
<phrase data="auto_e43ee32b856aa90a">Проверяем запрос…</phrase>
|
||||
<phrase data="auto_e939dbf27072b380">больше</phrase>
|
||||
<phrase data="auto_e9b76330e794cf78">Совпадает</phrase>
|
||||
<phrase data="auto_ea84a51a0b3a4cdc">Проверка документа</phrase>
|
||||
<phrase data="auto_edf1164e6de24189">Вернуть Legacy</phrase>
|
||||
<phrase data="auto_ee1a08bdb4da0f24">Ошибка сети при проверке документа</phrase>
|
||||
<phrase data="auto_eec268a8aa03da99">ИЛИ</phrase>
|
||||
<phrase data="auto_efb923a146075185">Нужна ручная проверка</phrase>
|
||||
<phrase data="auto_eff79c40e2100ae5">Выполняется</phrase>
|
||||
<phrase data="auto_f0dff5ab4a669f7a">Сохранено</phrase>
|
||||
<phrase data="auto_f285f61cdca7dc54"><div class="request-explain-options-state is-error"><i class="ti ti-alert-circle"></i>Поиск недоступен</div></phrase>
|
||||
<phrase data="auto_f49d62eb4ff9605b">выбранное поле</phrase>
|
||||
<phrase data="auto_f4f8afbe303728f1">Можно добавить не больше восьми уровней</phrase>
|
||||
<phrase data="auto_f554d87de9a7370d">Должны выполняться все элементы внутри</phrase>
|
||||
<phrase data="auto_f5edf19efa035287">Проверить и закрепить</phrase>
|
||||
<phrase data="auto_f6f3a1a1ff2cd5b6"><i class="ti ti-filter-off"></i><b>Документы не найдены</b><span>Проверьте условия, статус публикации и выбранную рубрику.</span></phrase>
|
||||
<phrase data="auto_f82a8219414c7c8e">Нет</phrase>
|
||||
<phrase data="auto_fd2566032f8228a3">Значение для сравнения</phrase>
|
||||
<phrase data="runtime_04d278fefcfa9d3c">Проверьте поля</phrase>
|
||||
<phrase data="runtime_2fe8f2fd72439d26">Сохранено</phrase>
|
||||
<phrase data="runtime_6087165c7ca7a986">Без явной сортировки</phrase>
|
||||
<phrase data="runtime_6e42b31a32562d11">Предпросмотр обновлён</phrase>
|
||||
<phrase data="runtime_85011fce4419ee63">Поле #</phrase>
|
||||
<phrase data="runtime_8f88b95463e29667">Случайный порядок</phrase>
|
||||
<phrase data="runtime_cef09ed8cdc5809d">Запрос проверен</phrase>
|
||||
</language>
|
||||
@@ -665,6 +665,12 @@
|
||||
return $this->error('Шаблон рубрики не найден', array(), 404);
|
||||
}
|
||||
|
||||
if (!$this->wantsJson()) {
|
||||
$this->redirect($this->base() . '/rubrics?templates=' . (int) $item['rubric_id']
|
||||
. '&template=' . (int) $item['id']);
|
||||
return null;
|
||||
}
|
||||
|
||||
return $this->success('', array('data' => $item));
|
||||
}
|
||||
|
||||
|
||||
@@ -21,6 +21,8 @@
|
||||
use App\Content\ContentTables;
|
||||
use App\Content\PublicUserTables;
|
||||
use App\Common\AuditLog;
|
||||
use App\Common\Cache;
|
||||
use App\Common\CacheKey;
|
||||
use App\Common\FileCacheInvalidator;
|
||||
use App\Content\Fields\FieldConditionEvaluator;
|
||||
use App\Content\Fields\FieldRegistry;
|
||||
@@ -840,7 +842,10 @@
|
||||
}
|
||||
|
||||
$rows = DB::query(
|
||||
'SELECT t.*, (SELECT COUNT(*) FROM ' . self::docsTable() . ' d WHERE d.rubric_id = t.rubric_id AND d.rubric_tmpl_id = t.id) AS docs_count'
|
||||
'SELECT t.*,'
|
||||
. ' (SELECT COUNT(*) FROM ' . self::docsTable() . ' d WHERE d.rubric_id = t.rubric_id AND d.rubric_tmpl_id = t.id) AS docs_count,'
|
||||
. ' (SELECT d.Id FROM ' . self::docsTable() . ' d WHERE d.rubric_id = t.rubric_id AND d.rubric_tmpl_id = t.id ORDER BY d.Id ASC LIMIT 1) AS first_document_id,'
|
||||
. ' (SELECT d.document_title FROM ' . self::docsTable() . ' d WHERE d.rubric_id = t.rubric_id AND d.rubric_tmpl_id = t.id ORDER BY d.Id ASC LIMIT 1) AS first_document_title'
|
||||
. ' FROM ' . self::templatesTable() . ' t WHERE t.rubric_id = %i ORDER BY t.id ASC',
|
||||
(int) $rubricId
|
||||
)->getAll();
|
||||
@@ -882,7 +887,10 @@
|
||||
public static function extraTemplate($id)
|
||||
{
|
||||
$row = DB::query(
|
||||
'SELECT t.*, (SELECT COUNT(*) FROM ' . self::docsTable() . ' d WHERE d.rubric_id = t.rubric_id AND d.rubric_tmpl_id = t.id) AS docs_count'
|
||||
'SELECT t.*,'
|
||||
. ' (SELECT COUNT(*) FROM ' . self::docsTable() . ' d WHERE d.rubric_id = t.rubric_id AND d.rubric_tmpl_id = t.id) AS docs_count,'
|
||||
. ' (SELECT d.Id FROM ' . self::docsTable() . ' d WHERE d.rubric_id = t.rubric_id AND d.rubric_tmpl_id = t.id ORDER BY d.Id ASC LIMIT 1) AS first_document_id,'
|
||||
. ' (SELECT d.document_title FROM ' . self::docsTable() . ' d WHERE d.rubric_id = t.rubric_id AND d.rubric_tmpl_id = t.id ORDER BY d.Id ASC LIMIT 1) AS first_document_title'
|
||||
. ' FROM ' . self::templatesTable() . ' t WHERE t.id = %i LIMIT 1',
|
||||
(int) $id
|
||||
)->getAssoc();
|
||||
@@ -964,7 +972,8 @@
|
||||
'rubric_title' => trim(isset($input['rubric_title']) ? (string) $input['rubric_title'] : ''),
|
||||
'rubric_alias' => trim(isset($input['rubric_alias']) ? (string) $input['rubric_alias'] : ''),
|
||||
'rubric_template_id' => max(1, (int) (isset($input['rubric_template_id']) ? $input['rubric_template_id'] : 1)),
|
||||
'rubric_docs_active' => !empty($input['rubric_docs_active']) ? 1 : 0,
|
||||
'rubric_docs_active' => !empty($input['rubric_docs_active']) ? 1 : 0,
|
||||
'rubric_is_technical' => !empty($input['rubric_is_technical']) ? 1 : 0,
|
||||
'rubric_meta_gen' => !empty($input['rubric_meta_gen']) ? '1' : '0',
|
||||
'rubric_alias_history' => !empty($input['rubric_alias_history']) ? '1' : '0',
|
||||
'rubric_description' => isset($input['rubric_description']) ? (string) $input['rubric_description'] : '',
|
||||
@@ -1377,6 +1386,7 @@
|
||||
$row['templates_count'] = isset($row['templates_count']) ? (int) $row['templates_count'] : 0;
|
||||
$row['site_template_title'] = isset($row['site_template_title']) ? trim((string) $row['site_template_title']) : '';
|
||||
$row['form_conditions_enabled'] = !empty($row['rubric_form_conditions']);
|
||||
$row['rubric_is_technical'] = !empty($row['rubric_is_technical']) ? 1 : 0;
|
||||
$row['rubric_purpose'] = isset($row['rubric_purpose']) && (string) $row['rubric_purpose'] === 'directory'
|
||||
? 'directory'
|
||||
: 'content';
|
||||
@@ -1457,6 +1467,8 @@
|
||||
$row['author_id'] = (int) $row['author_id'];
|
||||
$row['created'] = (int) $row['created'];
|
||||
$row['docs_count'] = isset($row['docs_count']) ? (int) $row['docs_count'] : 0;
|
||||
$row['first_document_id'] = isset($row['first_document_id']) ? (int) $row['first_document_id'] : 0;
|
||||
$row['first_document_title'] = isset($row['first_document_title']) ? (string) $row['first_document_title'] : '';
|
||||
$row['created_label'] = $row['created'] > 0 ? date('d.m.Y H:i', $row['created']) : 'не задано';
|
||||
$row['size_label'] = self::formatBytes(strlen((string) $row['template']));
|
||||
$row['can_delete'] = $row['docs_count'] === 0;
|
||||
@@ -1516,6 +1528,8 @@
|
||||
protected static function clearRubricCache($rubricId)
|
||||
{
|
||||
FileCacheInvalidator::rubric($rubricId);
|
||||
Cache::forgetTag(CacheKey::tag('search'));
|
||||
Cache::forgetTag(CacheKey::tag('catalog-admin-stats'));
|
||||
}
|
||||
|
||||
protected static function nextPosition($table, $field)
|
||||
|
||||
@@ -1129,7 +1129,8 @@
|
||||
overflow-x: hidden;
|
||||
}
|
||||
.rubrics-extra-template-panel {
|
||||
width: min(66vw, 980px);
|
||||
width: 66.6667vw;
|
||||
max-width: 66.6667vw;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
.rubrics-drawer {
|
||||
@@ -1141,6 +1142,63 @@
|
||||
.rubrics-drawer .drawer-body {
|
||||
overflow-x: hidden;
|
||||
}
|
||||
.rubrics-extra-template-body {
|
||||
display: flex;
|
||||
min-height: 0;
|
||||
flex-direction: column;
|
||||
gap: 16px;
|
||||
}
|
||||
.rubrics-extra-template-help {
|
||||
flex: 0 0 auto;
|
||||
align-items: center;
|
||||
margin: 0;
|
||||
}
|
||||
.rubrics-extra-template-help > i {
|
||||
flex: 0 0 auto;
|
||||
color: var(--blue-600);
|
||||
font-size: 20px;
|
||||
}
|
||||
.rubrics-extra-template-help > div {
|
||||
display: grid;
|
||||
flex: 1 1 auto;
|
||||
gap: 3px;
|
||||
min-width: 0;
|
||||
}
|
||||
.rubrics-extra-template-help b,
|
||||
.rubrics-extra-template-help span {
|
||||
display: block;
|
||||
}
|
||||
.rubrics-extra-template-help span {
|
||||
color: var(--text-secondary);
|
||||
font-size: 12px;
|
||||
line-height: 1.45;
|
||||
}
|
||||
.rubrics-extra-template-help .btn {
|
||||
flex: 0 0 auto;
|
||||
max-width: 42%;
|
||||
}
|
||||
.rubrics-extra-template-help .btn span {
|
||||
overflow: hidden;
|
||||
color: inherit;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.rubrics-extra-template-fields {
|
||||
display: flex;
|
||||
flex: 1 1 auto;
|
||||
flex-direction: column;
|
||||
gap: 14px;
|
||||
min-height: 0;
|
||||
}
|
||||
.rubrics-extra-template-fields > .rubrics-code-field {
|
||||
flex: 1 1 auto;
|
||||
min-height: 360px;
|
||||
}
|
||||
.rubrics-extra-template-fields > .rubrics-code-field > .CodeMirror {
|
||||
flex: 1 1 auto;
|
||||
min-height: 320px;
|
||||
height: auto !important;
|
||||
}
|
||||
/* Секции формы настроек поля: цветные плашки-заголовки и визуальное разделение */
|
||||
.rubrics-field-form {
|
||||
display: flex;
|
||||
@@ -3859,12 +3917,24 @@
|
||||
.rubrics-group-panel {
|
||||
width: min(96vw, 980px);
|
||||
}
|
||||
.rubrics-extra-template-panel {
|
||||
max-width: min(96vw, 980px);
|
||||
}
|
||||
#rubricDrawer {
|
||||
width: 96vw;
|
||||
max-width: 96vw;
|
||||
}
|
||||
}
|
||||
@media (max-width: 760px) {
|
||||
.rubrics-extra-template-help {
|
||||
align-items: stretch;
|
||||
flex-direction: column;
|
||||
}
|
||||
.rubrics-extra-template-help .btn {
|
||||
justify-content: center;
|
||||
max-width: none;
|
||||
width: 100%;
|
||||
}
|
||||
.rubrics-builder-runtime {
|
||||
grid-template-columns: 40px minmax(0, 1fr) auto;
|
||||
}
|
||||
|
||||
@@ -72,8 +72,16 @@
|
||||
var params = new URLSearchParams(window.location.search);
|
||||
var rubricId = parseInt(params.get('templates'), 10) || 0;
|
||||
var editId = parseInt(params.get('edit'), 10) || 0;
|
||||
var fieldsId = parseInt(params.get('fields'), 10) || 0;
|
||||
var create = params.get('create') === '1';
|
||||
var row;
|
||||
if (fieldsId) {
|
||||
row = document.querySelector('[data-rubric-row][data-id="' + fieldsId + '"]');
|
||||
if (!row) { return; }
|
||||
this.pendingFieldId = parseInt(params.get('field'), 10) || 0;
|
||||
this.openFields(row);
|
||||
return;
|
||||
}
|
||||
if (rubricId) {
|
||||
row = document.querySelector('[data-rubric-row][data-id="' + rubricId + '"]');
|
||||
if (!row) { return; }
|
||||
@@ -636,6 +644,7 @@
|
||||
this.form.reset();
|
||||
this.form.elements.id.value = '';
|
||||
this.form.elements.rubric_template_id.value = '1';
|
||||
if (this.form.elements.rubric_is_technical) { this.form.elements.rubric_is_technical.value = '0'; }
|
||||
var isDirectory = purpose === 'directory';
|
||||
if (this.form.elements.rubric_purpose) {
|
||||
this.form.elements.rubric_purpose.value = isDirectory ? 'directory' : 'content';
|
||||
@@ -681,6 +690,7 @@
|
||||
self.form.elements.rubric_template_id.value = item.rubric_template_id || 1;
|
||||
if (self.form.elements.rubric_template_id.selectedIndex < 0) { self.form.elements.rubric_template_id.selectedIndex = 0; }
|
||||
self.form.elements.rubric_docs_active.value = String(item.rubric_docs_active || 0);
|
||||
if (self.form.elements.rubric_is_technical) { self.form.elements.rubric_is_technical.value = String(item.rubric_is_technical || 0); }
|
||||
self.form.elements.rubric_meta_gen.value = String(item.rubric_meta_gen || 0);
|
||||
self.form.elements.rubric_alias_history.value = String(item.rubric_alias_history || 0);
|
||||
self.form.elements.rubric_description.value = item.rubric_description || '';
|
||||
@@ -1339,6 +1349,7 @@
|
||||
this.extraTemplateForm.elements.rubric_id.value = this.currentRubricId;
|
||||
this.setCodeValue(this.extraTemplateForm.elements.template, '');
|
||||
document.getElementById('rubricExtraTemplateTitle').textContent = 'Новый дополнительный шаблон';
|
||||
this.updateExtraTemplateDocumentLink({ rubric_id: this.currentRubricId, docs_count: 0 });
|
||||
this.activeTemplateTextarea = this.extraTemplateForm.elements.template;
|
||||
if (Adminx.Drawer) { Adminx.Drawer.open('rubricExtraTemplateDrawer'); }
|
||||
this.refreshEditors();
|
||||
@@ -1357,11 +1368,29 @@
|
||||
self.extraTemplateForm.elements.title.value = item.title || '';
|
||||
self.setCodeValue(self.extraTemplateForm.elements.template, item.template || '');
|
||||
document.getElementById('rubricExtraTemplateTitle').textContent = 'Редактирование шаблона #' + item.id;
|
||||
self.updateExtraTemplateDocumentLink(item);
|
||||
self.activeTemplateTextarea = self.extraTemplateForm.elements.template;
|
||||
self.refreshEditors();
|
||||
});
|
||||
},
|
||||
|
||||
updateExtraTemplateDocumentLink: function (item) {
|
||||
var link = document.querySelector('[data-extra-template-document-link]');
|
||||
var label;
|
||||
if (!link) { return; }
|
||||
item = item || {};
|
||||
if ((parseInt(item.docs_count, 10) || 0) === 1 && (parseInt(item.first_document_id, 10) || 0) > 0) {
|
||||
link.href = this.base() + '/documents/' + parseInt(item.first_document_id, 10) + '/edit';
|
||||
label = item.first_document_title
|
||||
? (link.getAttribute('data-edit-prefix') || '') + item.first_document_title
|
||||
: link.getAttribute('data-edit-content');
|
||||
} else {
|
||||
link.href = this.base() + '/documents?rubric_id=' + (parseInt(item.rubric_id, 10) || this.currentRubricId || 0);
|
||||
label = link.getAttribute('data-documents-label');
|
||||
}
|
||||
link.querySelector('span').textContent = label;
|
||||
},
|
||||
|
||||
submitExtraTemplate: function () {
|
||||
var self = this;
|
||||
var id = this.extraTemplateForm.elements.id.value;
|
||||
@@ -1586,6 +1615,7 @@
|
||||
self.renderLinkedFieldSets();
|
||||
self.fillGroupSelect();
|
||||
if (Adminx.Drawer) { Adminx.Drawer.open('rubricFieldsDrawer'); }
|
||||
if (self.pendingFieldId) { var fieldId = self.pendingFieldId; self.pendingFieldId = 0; self.selectBuilderField(fieldId); }
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
@@ -1140,4 +1140,8 @@
|
||||
<phrase data="auto_a4bb945f71c3e11d">Replace all</phrase>
|
||||
<phrase data="auto_582dbae7c8ee21b0">The old file will be moved to the trash after saving.</phrase>
|
||||
<phrase data="auto_434e952b35fa2970">The current set will be moved to the trash after saving.</phrase>
|
||||
<phrase data="rubrics_extra_template_help_title">The template controls presentation</phrase>
|
||||
<phrase data="rubrics_extra_template_help_text">Headings, text, and other data are edited in the document that uses this template.</phrase>
|
||||
<phrase data="rubrics_extra_template_edit_content">Edit content</phrase>
|
||||
<phrase data="rubrics_extra_template_edit_prefix">Edit: </phrase>
|
||||
</language>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user