Журнал изменений

Журнал изменений

Фильтр и поиск

Всего: 1173 Доступных коммитов | Отфильтровано: 1173 Коммиты | Страница: 60 из 118
15.04.2026
Refactor: system — перевести getVotingView на new/ фрагменты
Автор: Eduard Laas | Дата: 15:23 15.04.2026

Весь inline HTML в getVotingView заменён на вызовы $tpl->getHtmlFrag() через new/ namespace. HTML больше не собирается строками в PHP.

Core changes:

  1. getVotingView (core/system.php):
  2. Убрать inline <form>, <h4>, <ul>, </ul>, </form> из PHP
  3. Заменить getHtmlFrag('voting-post',...) на getHtmlFrag('new/voting-post',...)
  4. Заменить getHtmlFrag('voting-view',...) на getHtmlFrag('new/voting-view',...)
  5. Переименовать $cont (loop accumulator) в $items для ясности
  6. Заменить inline <span class="sl_votes">...</span> на getHtmlFrag('new/span',...)
  7. Финальный $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 остаются без изменений
Fix: helpers — исправить getTplFieldsIn и getTplViewFieldRows
Автор: Eduard Laas | Дата: 15:23 15.04.2026

Два независимых исправления в core/helpers.php для корректной работы custom fields в display и preview путях.

Core changes:

  1. getTplFieldsIn (core/helpers.php):
  2. Заменить getVar('post','field','raw','') на getVar('post','field[]','raw',[])

    • filter_input(INPUT_POST,'field') возвращает null/false для массивов
    • [] суффикс активирует $allarr=true в getVar — читает $_POST['field'] напрямую
  3. Заменить filterFields() + explode на array_values(array_map('strval',$posted))

    • posted массив используется напрямую без лишней фильтрации в display-пути
  4. getTplViewFieldRows (core/helpers.php):
  5. Заменить фрагмент 'view-field' на 'new/view-field'

    • фрагмент перенесён в new/ namespace
  6. Убрать 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 пустой
Fix: news — исправить add() preview, field[], getStopText
Автор: Eduard Laas | Дата: 15:23 15.04.2026

В add()-функции frontend и admin модуля news устранены три независимые ошибки, из-за которых preview не работал корректно при повторных отправках.

Core changes:

  1. Frontend add() (modules/news/index.php):
  2. Заменить тип 'text' на 'raw' для hometext/bodytext в display-пути

    • filterHtml + {{ value_text }} вместе давали двойное кодирование за каждый round-trip
    • 'raw' разрывает цикл; 'text' остаётся только в send() для записи в БД
  3. Заменить getVar('post','field','field') на field[] паттерн с implode

    • filter_input возвращает null для массивов — field[] через getVar корректен
  4. Заменить $stop напрямую на getStopText((array)$stop)

    • шаблон new/alert ожидает строку; PHP-массив давал пустой блок
  5. Вызывать getTplPreviewContent() напрямую вместо preview()-обёртки
  6. Admin add() POST-ветка (modules/news/admin/index.php):
  7. Те же исправления: 'raw', field[] паттерн, implode

Benefits:

  • Текст больше не ломается при повторных preview-отправках
  • Custom fields сохраняют значения в форме после preview
  • Блок предупреждений отображается корректно

Technical notes:

  • send() и admin save() сохраняют 'text' для БД — без изменений
  • Admin DB-ветка (загрузка из БД) — без изменений; decode на уровне драйвера
Refactor: replace misnamed files-add-*-row with new/form-field-row composition
Автор: Eduard Laas | Дата: 13:46 15.04.2026

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:

  1. modules/files/index.php — extra fields rewritten:
  2. files-add-upload-row → new/form-field-row + new/file-input
  3. files-add-input-row (×3) → new/form-field-row + new/input with correct variable names: name_attr, value_attr, itype, maxlength_num, placeholder_text

  4. templates/*/fragments/new/file-input.html (all 4 themes) — new:
  5. <input type="file" name="{{ name_attr }}" class="sl-field">
  6. templates/*/fragments/new/files-add-input-row.html (all 4 themes) — deleted
  7. 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
Refactor: migrate all form-add call sites to new/ fragment namespace
Автор: Eduard Laas | Дата: 13:44 15.04.2026

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:

  1. modules/*.php (9 files) — call site renames:
  2. 'form-add' → 'new/form-add' (auto_links, faq, files, help, jokes, links, money, order, pages)

  3. 'files-add-upload-row' → 'new/files-add-upload-row' (files)
  4. 'files-add-input-row' → 'new/files-add-input-row' (files)
  5. templates/*/fragments/new/ — new fragments added (all 4 themes):
  6. new/files-add-input-row.html: sl-form-row with label + typed input
  7. new/files-add-upload-row.html: sl-form-row with label + file input
  8. templates/*/fragments/ — old fragments deleted (default, lite, simple):
  9. form-add.html (3×)
  10. files-add-input-row.html (3×)
  11. 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
Refactor: migrate form-add and files-add rows to sl-form div layout
Автор: Eduard Laas | Дата: 13:41 15.04.2026

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:

  1. templates/*/fragments/form-add.html (default, lite, simple):
  2. Replace <table class="sl_table_form"> wrapper with <div class="sl-form">
  3. Replace <tr><td>label</td><td>field</td></tr> rows with <div class="sl-form-row"><label class="sl-form-label">...</label>field</div>

  4. Replace {% if titleval %} condition with {% if lbl_title %}
  5. Replace {% if catselect %} condition with {% if lbl_cat %}
  6. Replace <tr><td colspan="2" class="sl_center"> submit row with <div class="sl-form-submit">

  7. templates/*/fragments/files-add-input-row.html (default, lite, simple):
  8. <tr><td> → <div class="sl-form-row"><label class="sl-form-label">
  9. templates/*/fragments/files-add-upload-row.html (default, lite, simple):
  10. <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
Style: add <title> block to bare layout in all frontend themes
Автор: Eduard Laas | Дата: 13:18 15.04.2026

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:

  1. templates/default/layouts/bare.html
  2. templates/lite/layouts/bare.html
  3. templates/simple/layouts/bare.html:
  4. Added <title> tag with block/fallback pattern before {{{ meta }}}: <title>{% block title %}{% if title %}{{ title }}{% else %}{{ sitename }}{% endif %}{% endblock %}</title>

  5. config/local.php:
  6. 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
Chore: remove unused language constants from all locale files
Автор: Eduard Laas | Дата: 13:18 15.04.2026

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:

  1. admin/lang/*.php (6 locales) — 18 constants removed per locale:
  2. _BOTTOM, _CALENDAR, _CENTER, _INDEX
  3. _INFO_NO, _INFO_NULL
  4. _IP_CIDR_EX, _LISTING, _LOGGED
  5. _NAVI, _PAGENUM, _PRINTS, _STYLE
  6. _TCLOSE, _TMESS, _TOPEN, _TTITLE, _TWARNING
  7. lang/*.php (6 locales) — 3 constants removed per locale:
  8. _RATE2, _RATE4, _SPOILER
  9. modules/changelog/admin/lang/*.php (6 locales) — 1 constant removed:
  10. _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
Test: update AdminPreviewBridgeFlowTest — stub fields_out → getTplFieldsOut
Автор: Eduard Laas | Дата: 13:17 15.04.2026

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:

  1. tests/Unit/AdminPreviewBridgeFlowTest.php:
  2. Stub function_exists guard: 'fields_out' → 'getTplFieldsOut'
  3. 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
Refactor: update all call sites to getTpl* naming convention
Автор: Eduard Laas | Дата: 13:17 15.04.2026

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:

  1. admin/modules/ (6 files):
  2. cat_modul() → getTplCategoryModule()
  3. getTplCategorySelect() (image picker) → getTplImageSelect()
  4. getcat() → getTplCategorySelect()
  5. language() → getTplLanguageOptions()
  6. naviTabsLink/Content/Wrap → getTplTabLink/Content/Wrap
  7. categoryRow, categoryTextLink → getTplCatRow, getTplCatText
  8. modules/ (24 files) + core/user.php:
  9. new_graphic() → getTplNewGraphic()
  10. gender() → getGenderText()
  11. get_gender() → getTplGenderSelect()
  12. fields_out() → getTplFieldsOut()
  13. fields_in() → getTplFieldsIn()
  14. catlink() → getTplCategoryTrail()
  15. getcat() → getTplCategorySelect()
  16. title_tip() → getTplTitleTip()
  17. editorFilePreview → getTplEditorPreview()
  18. editorInsertAction → getTplEditorInsert()
  19. commentActionLink/Js/Delete/Menu → getTplCommentLink/Js/Delete/Menu
  20. votingActionLink/Delete/Menu → getTplVotingLink/Delete/Menu
  21. pagerLink/Current/Dots → getTplPagerLink/Current/Dots()
  22. getAsyncPagerLink → unchanged signature, still resolves correctly
  23. templates/lite/index.php:
  24. 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

Страница 60 из 118. Всего: 1173

1 55 56 57 58 59 60 61 62 63 64 118
Хотите опробовать SLAED CMS в действии?
Идеи и предложения
Обратная связь
Подтверждение

Поделиться
QR-код

Предварительный просмотр