Журнал изменений
Весь inline HTML в getVotingView заменён на вызовы $tpl->getHtmlFrag() через new/ namespace. HTML больше не собирается строками в PHP.
Core changes:
- getVotingView (core/system.php):
- Убрать inline <form>, <h4>, <ul>, </ul>, </form> из PHP
- Заменить getHtmlFrag('voting-post',...) на getHtmlFrag('new/voting-post',...)
- Заменить getHtmlFrag('voting-view',...) на getHtmlFrag('new/voting-view',...)
- Переименовать $cont (loop accumulator) в $items для ясности
- Заменить inline <span class="sl_votes">...</span> на getHtmlFrag('new/span',...)
Финальный $cont собирается через getHtmlFrag('new/voting-widget',...)
- has_form, form_id, title, items_html, admin_html, post_html, polls_html, votes_html, comm_html
Benefits:
- HTML полностью вынесен в шаблоны
- Структура voting-widget изменяется только в .html файлах
- Соответствует архитектурному принципу: данные в PHP, разметка в templates
Technical notes:
- Новые фрагменты: new/voting-widget, new/voting-post, new/voting-view, new/span
- Фрагменты нужны во всех frontend темах: default, lite, simple
- Root-level voting-post.html и voting-view.html остаются без изменений
Два независимых исправления в core/helpers.php для корректной работы custom fields в display и preview путях.
Core changes:
- getTplFieldsIn (core/helpers.php):
Заменить getVar('post','field','raw','') на getVar('post','field[]','raw',[])
- filter_input(INPUT_POST,'field') возвращает null/false для массивов
- [] суффикс активирует $allarr=true в getVar — читает $_POST['field'] напрямую
Заменить filterFields() + explode на array_values(array_map('strval',$posted))
- posted массив используется напрямую без лишней фильтрации в display-пути
- getTplViewFieldRows (core/helpers.php):
Заменить фрагмент 'view-field' на 'new/view-field'
- фрагмент перенесён в new/ namespace
Убрать hardcoded ':' из label_text
- двоеточие теперь добавляется через CSS ::after в new.css
Benefits:
- Custom fields корректно отображаются в preview
- Custom fields сохраняют введённые значения после отправки формы
- label_text чистый — без hardcoded пунктуации в PHP
Technical notes:
- Фрагмент new/view-field.html должен существовать во всех темах
- Обратная совместимость: fallback через explode('|') если POST пустой
В add()-функции frontend и admin модуля news устранены три независимые ошибки, из-за которых preview не работал корректно при повторных отправках.
Core changes:
- Frontend add() (modules/news/index.php):
Заменить тип 'text' на 'raw' для hometext/bodytext в display-пути
- filterHtml + {{ value_text }} вместе давали двойное кодирование за каждый round-trip
- 'raw' разрывает цикл; 'text' остаётся только в send() для записи в БД
Заменить getVar('post','field','field') на field[] паттерн с implode
- filter_input возвращает null для массивов — field[] через getVar корректен
Заменить $stop напрямую на getStopText((array)$stop)
- шаблон new/alert ожидает строку; PHP-массив давал пустой блок
- Вызывать getTplPreviewContent() напрямую вместо preview()-обёртки
- Admin add() POST-ветка (modules/news/admin/index.php):
- Те же исправления: 'raw', field[] паттерн, implode
Benefits:
- Текст больше не ломается при повторных preview-отправках
- Custom fields сохраняют значения в форме после preview
- Блок предупреждений отображается корректно
Technical notes:
- send() и admin save() сохраняют 'text' для БД — без изменений
- Admin DB-ветка (загрузка из БД) — без изменений; decode на уровне драйвера
Remove the module-specific files-add-input-row and files-add-upload-row fragments (wrong naming, wrong abstraction level). Replace them with proper composition of the existing new/form-field-row + new/input / new/file-input fragments. Add new/file-input.html to all 4 themes.
Core changes:
- modules/files/index.php — extra fields rewritten:
- files-add-upload-row → new/form-field-row + new/file-input
files-add-input-row (×3) → new/form-field-row + new/input with correct variable names: name_attr, value_attr, itype, maxlength_num, placeholder_text
- templates/*/fragments/new/file-input.html (all 4 themes) — new:
- <input type="file" name="{{ name_attr }}" class="sl-field">
- templates/*/fragments/new/files-add-input-row.html (all 4 themes) — deleted
- templates/*/fragments/new/files-add-upload-row.html (all 4 themes) — deleted
Benefits:
- No module-specific fragments in new/ namespace
- File input reusable via new/file-input across any module
- Consistent composition pattern: new/form-field-row wraps any input type
Technical notes:
- new/form-field-row and new/input already existed — no new patterns introduced
All modules that previously used the legacy form-add, files-add-input-row and files-add-upload-row fragments now point exclusively to the new/ namespace. Legacy fragments deleted. New new/ fragments created in all 4 themes.
Core changes:
- modules/*.php (9 files) — call site renames:
'form-add' → 'new/form-add' (auto_links, faq, files, help, jokes, links, money, order, pages)
- 'files-add-upload-row' → 'new/files-add-upload-row' (files)
- 'files-add-input-row' → 'new/files-add-input-row' (files)
- templates/*/fragments/new/ — new fragments added (all 4 themes):
- new/files-add-input-row.html: sl-form-row with label + typed input
- new/files-add-upload-row.html: sl-form-row with label + file input
- templates/*/fragments/ — old fragments deleted (default, lite, simple):
- form-add.html (3×)
- files-add-input-row.html (3×)
- files-add-upload-row.html (3×)
Benefits:
- No legacy root-level fragment used by any module
- Single consistent new/ fragment namespace for all add-form templates
Technical notes:
- No template content changes — only namespace migration
- admin theme had no form-add.html to delete
Replace the legacy <table class="sl_table_form"> form layout in form-add.html with the same sl-form div structure already used by new/form-add.html. Also update files-add-input-row and files-add-upload-row to emit sl-form-row divs instead of <tr><td> rows, which were invalid inside the new div container.
Core changes:
- templates/*/fragments/form-add.html (default, lite, simple):
- Replace <table class="sl_table_form"> wrapper with <div class="sl-form">
Replace <tr><td>label</td><td>field</td></tr> rows with <div class="sl-form-row"><label class="sl-form-label">...</label>field</div>
- Replace {% if titleval %} condition with {% if lbl_title %}
- Replace {% if catselect %} condition with {% if lbl_cat %}
Replace <tr><td colspan="2" class="sl_center"> submit row with <div class="sl-form-submit">
- templates/*/fragments/files-add-input-row.html (default, lite, simple):
- <tr><td> → <div class="sl-form-row"><label class="sl-form-label">
- templates/*/fragments/files-add-upload-row.html (default, lite, simple):
- <tr><td> → <div class="sl-form-row"><label class="sl-form-label">
Benefits:
- form-add and new/form-add now use the same layout — one consistent design
All add-form modules (files, faq, jokes, links, pages, help, auto_links, money, order) render identical structure as the news module
- Valid HTML: no <tr> outside <table>
Technical notes:
- No PHP changes
All call sites already pass lbl_title and lbl_cat — condition change is transparent
- new/form-add.html unchanged; form-add.html now matches it exactly
Insert a <title> block into bare.html for default, lite, and simple themes so that bare-layout pages (e.g. print, iframe, standalone views) render a proper document title. Also update the config fingerprint to reflect the changed template layer.
Core changes:
- templates/default/layouts/bare.html
- templates/lite/layouts/bare.html
- templates/simple/layouts/bare.html:
Added <title> tag with block/fallback pattern before {{{ meta }}}: <title>{% block title %}{% if title %}{{ title }}{% else %}{{ sitename }}{% endif %}{% endblock %}</title>
- config/local.php:
- base_fingerprint updated to reflect new template state
Benefits:
- Bare-layout pages pass HTML validation (title is required)
- Consistent title rendering across all layout types
Technical notes:
- Admin theme bare.html not included (managed separately)
- Pattern matches existing block structure in main.html and app.html
Delete constants that are no longer referenced anywhere in the codebase after the getTpl* refactoring and admin UI cleanup. All 6 locales (de/en/fr/pl/ru/uk) updated in sync.
Core changes:
- admin/lang/*.php (6 locales) — 18 constants removed per locale:
- _BOTTOM, _CALENDAR, _CENTER, _INDEX
- _INFO_NO, _INFO_NULL
- _IP_CIDR_EX, _LISTING, _LOGGED
- _NAVI, _PAGENUM, _PRINTS, _STYLE
- _TCLOSE, _TMESS, _TOPEN, _TTITLE, _TWARNING
- lang/*.php (6 locales) — 3 constants removed per locale:
- _RATE2, _RATE4, _SPOILER
- modules/changelog/admin/lang/*.php (6 locales) — 1 constant removed:
- _CHLOG_ERR_TOKEN (moved to inline validation; no longer a translatable string)
Benefits:
- Lang files contain only constants that are actively used
- Reduces risk of accidental reuse of stale identifiers
Technical notes:
- No PHP logic changes — constants only
- All locales kept in sync; no locale-specific differences
Replace the test double for fields_out() with one for getTplFieldsOut() to match the renamed function in helpers.php. The stub behaviour is identical; only the function name changes.
Core changes:
- tests/Unit/AdminPreviewBridgeFlowTest.php:
- Stub function_exists guard: 'fields_out' → 'getTplFieldsOut'
- Stub function name: fields_out() → getTplFieldsOut()
Benefits:
- Test suite matches the current public API
- No risk of false-pass from stale stub name
Technical notes:
- Stub return value logic unchanged
Replace all legacy function calls throughout admin modules, frontend modules, and templates with the new getTpl* names established in helpers.php. No logic changes — pure rename at every call site.
Core changes:
- admin/modules/ (6 files):
- cat_modul() → getTplCategoryModule()
- getTplCategorySelect() (image picker) → getTplImageSelect()
- getcat() → getTplCategorySelect()
- language() → getTplLanguageOptions()
- naviTabsLink/Content/Wrap → getTplTabLink/Content/Wrap
- categoryRow, categoryTextLink → getTplCatRow, getTplCatText
- modules/ (24 files) + core/user.php:
- new_graphic() → getTplNewGraphic()
- gender() → getGenderText()
- get_gender() → getTplGenderSelect()
- fields_out() → getTplFieldsOut()
- fields_in() → getTplFieldsIn()
- catlink() → getTplCategoryTrail()
- getcat() → getTplCategorySelect()
- title_tip() → getTplTitleTip()
- editorFilePreview → getTplEditorPreview()
- editorInsertAction → getTplEditorInsert()
- commentActionLink/Js/Delete/Menu → getTplCommentLink/Js/Delete/Menu
- votingActionLink/Delete/Menu → getTplVotingLink/Delete/Menu
- pagerLink/Current/Dots → getTplPagerLink/Current/Dots()
- getAsyncPagerLink → unchanged signature, still resolves correctly
- templates/lite/index.php:
- catlink() → getTplCategoryTrail()
Benefits:
- All call sites consistent with getTpl* convention
- No ambiguity between old legacy names and new helpers
- Codebase-wide rename is complete after this commit
Technical notes:
- No template fragments were changed
- No behavior changes — pure rename at call sites