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

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

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

Всего: 1045 Доступных коммитов | Отфильтровано: 1045 Коммиты | Страница: 58 / 105
01.04.2026
Refactor: optimize admin fragments and migrate to canonical helpers
Автор: Eduard Laas | Дата: 12:42 01.04.2026

Eliminate duplicate, dead and module-specific admin fragments by migrating all list-head patterns to getTplAdminTableHead() and fixing shared helper canonical fragment references.

Core changes:

  1. Admin helpers (core/helpers.php):
  2. getTplAdminTableHead(): use th/th-nosort fragments, not inline HTML
  3. getTplAdminTableCells(): use td fragment, not inline HTML
  4. getTplAdminSection(): use admin-section-heading fragment
  5. getTplAdminTabClose(): use admin-tab-list-close fragment
  6. getTplAjaxAction(): fix canonical back to comment-action-ajax
  7. getTplDeleteAction(): fix canonical to action-delete
  8. Admin modules (21 files):
  9. Replace getHtmlFrag('admin-*-list-head') with getTplAdminTableHead([])
  10. admin/modules/: groups, messages, modules, newsletter, referers, security
  11. modules/*/admin/index.php: account, auto_links, clients, content, faq, files, help, jokes, links, media, money, news, order, pages, search, voting

  12. Admin fragments (templates/admin/fragments/):
  13. Delete 83 dead fragments (list-head, account-*, orphans)
  14. Restore incorrectly removed: td, th, th-nosort, admin-section-heading, admin-tab-list-close, admin-admins-permission-empty, comment-action-ajax

Benefits:

  • Admin fragment count: 569 → 486 (-83)
  • Single canonical path for all table headers via getTplAdminTableHead()
  • Shared helpers use correct fragment names for all theme contexts

Technical notes:

  • comment-action-ajax stays canonical for getTplAjaxAction() (shared, used in frontend)
  • action-delete is canonical for getTplDeleteAction() (all themes)
  • admin-whois-list-head.html kept (colspan=2, needs getTplAdminTableHead() extension)
Revert: remove templates/shared/ and restore theme independence
Автор: Eduard Laas | Дата: 10:21 01.04.2026

Reverts Phase 2: themes (lite, default, simple, admin) are self-contained and must not depend on a shared/ fallback directory.

Core changes:

  • templates/shared/: deleted
  • templates/lite/, default/, simple/: all 388 files restored
  • templates/admin/fragments/: 113 files restored
  • core/classes/template.php: removed $shared property, shared fallback in getFile(), and shared path check in checkFile()

Benefits:

  • Each theme is fully portable and independent
  • No hidden cross-theme dependencies
Refactor: delete 113 admin fragments served by shared/ and migrate 4 helpers
Автор: Eduard Laas | Дата: 10:09 01.04.2026

Admin Phase 2: remove 113 fragments from templates/admin/ that are byte-identical to templates/shared/ — engine fallback now serves them transparently.

system.php migration: move setModuleNavi, setNaviLower, setPageNumbers, setArticleNumbers from core/system.php to core/helpers.php, establishing helpers.php as the single rendering layer for both frontend and admin.

Core changes:

  • templates/admin/fragments/: 347 → 234 files (-113)
  • core/helpers.php: +4 functions (setModuleNavi, setNaviLower, setPageNumbers, setArticleNumbers)
  • core/system.php: -4 functions (same, removed)

Benefits:

  • All fragment-rendering helpers are now in one place (core/helpers.php)
  • Admin area no longer duplicates shared fragments — maintained in one location
  • Zero call-site changes required (function names unchanged)

Technical notes:

  • All 4 migrated functions rely on global $tpl/$db/$conf/$afile — unchanged
  • setArticleNumbers internally calls setPageNumbers — order preserved in helpers.php
  • php -l passes on both modified files
Feature: add shared template fallback and consolidate 388 identical files
Автор: Eduard Laas | Дата: 09:57 01.04.2026

Extend the Template engine with a shared/ fallback so theme directories only need to contain files that actually differ per theme. Move 388 files that were byte-identical across all three themes into templates/shared/.

Core changes:

  1. Template engine fallback (core/classes/template.php):
  2. Add protected string $shared property, initialized in constructor as BASE_DIR/templates/shared

  3. Update getFile(): try theme path first, return shared path as fallback (single is_file() check, no extra I/O when theme file exists)

  4. Update checkFile(): accept files from either $this->base or $this->shared (realpath-based containment check for both roots)

  5. Shared template directory (templates/shared/):
  6. Move 374 fragments, 5 partials, 6 pages, 3 layouts from all three themes
  7. Source: lite/ (canonical copy), verified identical in default/ and simple/
  8. Theme-specific files (~24-34 per theme) remain in their theme directories

Benefits:

  • Template files: ~1163 -> ~445 (62% reduction)
  • Theme directories now contain only genuinely theme-specific overrides
  • Adding a new theme requires only the files that differ from shared/
  • Zero change to PHP call sites, helpers, or fragment names

Technical notes:

  • Theme path takes priority over shared/ (theme-specific override works)
  • Admin theme is unaffected (uses its own base path, no shared/ fallback)
  • Cache uses realpath-based hash, works transparently for shared files
  • Verified: lite, default, simple all resolve fragments via fallback
  • Verified: admin theme continues to use templates/admin/ exclusively
Refactor: consolidate frontend fragment duplicates via helpers (Phase 1)
Автор: Eduard Laas | Дата: 09:57 01.04.2026

Eliminate cross-module fragment duplicates in frontend themes by routing all calls through canonical helpers. Add getTplAjaxAction helper and inline all trivial single-tag fragments. Sync all three themes (lite, default, simple) simultaneously since changes are theme-independent.

Core changes:

  1. New helper and system.php cleanup (core/helpers.php, core/system.php):
  2. Add getTplAjaxAction(target, query, title, label, class) using comment-action-ajax.html
  3. Update getEditorAsyncAction, getCommentAsyncAction, getVotingAsyncAction to delegate to getTplAjaxAction instead of direct getHtmlFrag calls

  4. Fragment duplicates removed (templates/lite|default|simple/fragments/):
  5. Delete action-menu duplicates: admin/comment/voting-action-menu.html (3x3=9 files) canonical: editor-action-menu.html via getTplMenuItems()

  6. Delete delete-action duplicates: admin/voting-action-delete.html (2x3=6 files) canonical: comment-action-delete.html via getTplDeleteAction()

  7. Delete link-action duplicates: admin/voting-action-link.html (2x3=6 files) canonical: comment-action-link.html via getTplLinkAction()

  8. Delete ajax duplicates: admin/editor-action-ajax.html (2x3=6 files) canonical: comment-action-ajax.html via getTplAjaxAction()

  9. Delete select-option duplicates: account/rss/whois/media variants (4x3=12 files) canonical: form-option.html via getTplSelectOption()

  10. Delete admin-session-box.html from all 3 themes (unused dead fragment)
  11. Inline trivial fragments across all themes: br, br-br, tr-open, tr-close, table-close, form-close (6x3=18 files)

  12. Call-site updates (modules/*/index.php):
  13. Replace duplicate getHtmlFrag() calls with getTplSelectOption() in account, media, rss, whois modules

  14. Inline '<br>', '<br><br>', '<tr>', '</tr>', '</tbody></table>', '</form>' directly in account, clients, content, files, forum, help, links, money, news, order, pages, shop, sitemap, users modules

Benefits:

  • 57 fewer fragment files across 3 frontend themes
  • getTplAjaxAction provides a named entry point for HTMX GET actions
  • All fragment calls go through helpers.php (single responsibility)
  • Themes are now in sync with no redundant copies

Technical notes:

  • comment-action-ajax.html kept as canonical (supports optional CSS class)
  • admin-action-link.html kept in admin/ theme (used by admin $tpl only)
  • All changes verified with php -l
Refactor: consolidate admin helpers and fragment duplicates (Phase 1)
Автор: Eduard Laas | Дата: 09:56 01.04.2026

Remove 23 delegate wrappers and migrate 7 rendering helpers from core/admin.php to core/helpers.php with proper naming. Inline trivial fragments, merge 4 input fields into one parameterized fragment, and eliminate intra-admin duplicate fragments found via content-hash audit.

Core changes:

  1. Helpers migration (core/admin.php, core/helpers.php):
  2. Delete 23 delegate wrappers (adminFlagBox, adminTitleTip, adminMenuItems, etc.)
  3. Move 7 rendering helpers to helpers.php with renamed canonical names:

    • setAdminNavi -> getTplAdminNavi
    • adminTabListOpen/Close/Link -> getTplAdminTabOpen/Close/Link
    • adminInfoCountValue/Row/Table -> getTplAdminInfoCount/Row/Table
  4. Add getTplAdminPanel helper and admin-panel.html fragment
  5. Add 9 new functions total to core/helpers.php
  6. Fragment consolidation (templates/admin/fragments/):
  7. Merge admin-text/number/url/email-input.html into admin-input.html (itype var)
  8. Inline getTplHrLine() -> return '<hr>' directly
  9. Inline trivial tr-open/close, br, br-br, table-close, form-close fragments
  10. Redirect admin-database-status-tag -> admin-flag-box (identical content)
  11. Redirect admin-fields/replace-tab-content -> admin-tab-content (3-way dup)
  12. Redirect admin-news-asso-table -> admin-shop-assoc-table (identical)
  13. Redirect admin-security-ban-tabs -> admin-uploads-config-tabs (identical)
  14. Inline admin-security-tab-divider (<hr>), admin-*-row-open/close (<tr>/<tr>)
  15. Delete admin-category-img-preview (use img-preview as canonical)
  16. Net result: 366 -> 347 fragments in templates/admin/
  17. Call-site updates (admin/modules/.php, modules//admin/index.php):
  18. Replace all old function names with new getTplAdmin* equivalents
  19. Replace direct getHtmlFrag() calls for duplicate fragments with canonical names

Benefits:

  • core/admin.php no longer contains rendering logic (separation of concerns)
  • Single entry point for all admin rendering via core/helpers.php
  • 19 fewer fragment files in templates/admin/
  • Consistent naming convention across all helpers

Technical notes:

  • Public API of all helpers unchanged (getTplTextInput etc. still work)
  • Fragment variable names updated per naming rules (itype, pid, cont)
  • All changes verified with php -l
31.03.2026
Refactor: complete PHP-without-HTML migration for blocks, core, modules and templates
Автор: Eduard Laas | Дата: 17:29 31.03.2026

Replace all remaining inline HTML across blocks, core modules, admin panel, and frontend modules with template fragments, completing the full separation of PHP logic from HTML output across the entire codebase.

Core changes:

  1. Blocks (18 files — blocks/block-*.php):
  2. All inline HTML replaced with getHtmlFrag() fragment calls
  3. New fragments added: block-banner-random, block-center-, block-forum-, block-img-, block-languages-, block-login-form, block-menu, block-module-*, block-network-row, block-search-form, block-stat-banners, block-user-*

  4. Core (core/access.php, admin.php, classes/pdo.php, security.php, user.php):
  5. access.php / security.php: error/report output migrated to fragments
  6. pdo.php: query debug output uses pdo-error-badge / pdo-query-time fragments
  7. user.php: RSS feed builder uses user.php-specific fragments
  8. admin.php: remaining inline HTML moved to fragments
  9. Frontend modules (modules/):
  10. account, changelog, clients, contact, content, faq, files, forum, help, jokes, links, main, media, news, order, pages, search — all cleaned

  11. forum/index.php: full rewrite using link-btn, span-btn, forum-* fragments
  12. main/index.php: carousel, grid and section output via main-* fragments
  13. search/index.php: result rendering via search-result-title fragment
  14. Templates (templates/):
  15. admin/index.php, lite/index.php: asset and layout output via fragments
  16. media-post-badge.html synced across default/lite/simple themes
  17. ~350 new .html fragment files added across all 4 theme directories

Benefits:

  • PHP files contain zero HTML tags (except filterMarkdown engine and RSS/XML)
  • All HTML exclusively in .html fragment files under templates/
  • Themes can now be fully swapped without touching any PHP logic
  • Fragment sync enforced by phpunit testSharedFrontendFragmentsStayInSyncAcrossThemes

Technical notes:

  • 125/125 phpunit tests pass (1 pre-existing CRLF failure unchanged)
  • All shared frontend fragments are hash-identical across default/lite/simple/admin
  • Admin-only fragments remain in templates/admin/fragments/ only
Refactor: eliminate all remaining raw HTML from PHP modules and core functions
Автор: Eduard Laas | Дата: 17:26 31.03.2026

Replace every inline HTML tag in admin modules, frontend modules, and core helper functions with template fragments or existing helper calls, completing the full PHP-without-HTML migration across the entire codebase.

Core changes:

  1. Core functions (core/system.php):
  2. categorySelectOption(): delegate to getTplOption() — removes <option> inline HTML
  3. title_tip(): use title-tip.html fragment — removes <nav><div> inline HTML
  4. ad_status(): use span-btn.html / link-btn.html — removes all <span>/<a> inline HTML
  5. New shared fragments (all 4 themes: default/lite/simple/admin):
  6. title-tip.html: <nav class="sl_tip"><div>{{{ content }}}</div></nav>
  7. rating-box.html: <div class="min-rate"><div class="rate-like-box">{{{ content }}}</div></div>
  8. form-checkall.html: checkall <input> for list headers
  9. td-check.html: <td><input type="checkbox"> for list rows
  10. tr-open.html / tr-close.html: structural table row wrappers
  11. img-preview.html: <img id="picture"> for config image preview
  12. Admin modules (19 files):
  13. adminTitleTipLabel/adminTitleTip with <br> separators → getTplAdminTipLine()
  14. getcat(..., '<option>') → getcat(..., getTplOption())
  15. <a href target="_blank"> links → getTplAdminTextLink()
  16. <br><br> before fields → $tpl->getHtmlFrag('br-br', [])
  17. <div>...<hr> voting preview → div-hr.html fragment
  18. <tr>/<\/tr> in news asso table → tr-open.html / tr-close.html
  19. <th> checkall → th-nosort.html + form-checkall.html
  20. <td> checkbox → td-check.html
  21. <img> preview → img-preview.html
  22. activate() in money/order: add global $tpl, use br-br fragment for email
  23. Frontend modules (5 files):
  24. rss/index.php: <option selected> → getTplOption(..., true)
  25. users/index.php: <br> tip lines → getTplAdminTipLine(); <div rating> → rating-box.html
  26. shop/index.php: <br> tip lines → getTplAdminTipLine() in $website/$note
  27. money/index.php: $sinfo .= val.<br> → getTplAdminInfoLine()
  28. voting/index.php: <div id="rep..."> → post-div.html fragment

Benefits:

  • Zero raw HTML tags remain in any module or core helper PHP file
  • All HTML exclusively lives in .html fragment files under templates/
  • categorySelectOption, title_tip, ad_status now fully template-driven
  • 125/125 phpunit tests pass (1 pre-existing CRLF failure unchanged)

Technical notes:

  • Justified exceptions: filterMarkdown class (IS the HTML generator), PDO constructor error path ($tpl unavailable), template engine asset management (circular dependency), RSS/XML generation, commented-out code

  • New fragments synced across all 4 theme dirs (hash-identical per phpunit)
  • getTplAdminTipLine trailing-<br> differs slightly from original leading-<br> pattern in tooltips — visually equivalent, no behavioral change

Feature: modernize editor panel with template fragments
Автор: Eduard Laas | Дата: 10:43 31.03.2026

Externalize the editor page's structural HTML and interactive components, such as the Robots.txt button and notification panels, into dedicated Mustache-style fragments to improve controller clarity and UI reuse.

Core changes:

  1. Editor management (admin/modules/editor.php):
  2. Use getHtmlFrag to load the new editor structural components
  3. Replace inline Robots.txt button generation with the admin-editor-robots-button fragment
  4. Move the note panel and root container structural logic to dedicated fragments
  5. New Fragments (templates/admin/fragments/admin-editor-*):
  6. admin-editor-robots-button: Standardized green button for Robots.txt templates
  7. admin-editor-note-panel: Flexible container for notifications and warnings
  8. admin-editor-root-panel: Main container for the editor interface

Benefits:

  • Decouples structural HTML from the editor's PHP controller logic
  • Consistent button styling for all editor templates
  • Cleaner DOM structure with standardized panel containers

Technical notes:

  • Uses the core getHtmlFrag() method for fragment retrieval
  • The Robots.txt button logic is encapsulated in the fragment but relies on existing external JS handling

  • All structural changes are backward compatible with the current admin layout
Refactor: modernize tables and links with shared UI helpers
Автор: Eduard Laas | Дата: 10:42 31.03.2026

Standardize the rendering of admin tables, status badges, and anchor links across various core and module management panels. Replaces repetitive HTML string concatenation with the new helper suite.

Core changes:

  1. Language and Module Management (admin/modules/lang.php, modules.php):
  2. Use getTplAdminTableHead for sorting-aware header generation
  3. Use getTplAdminStatusBadge for standardized status indicators
  4. Scheduler and Sitemap (admin/modules/scheduler.php, modules/sitemap/admin/index.php):
  5. Replace inline links with getTplAdminTextLink
  6. Use getTplAdminTipLine/InfoLine for descriptive list items
  7. Forum and Monitor (modules/forum/admin/index.php, admin/modules/monitor.php):
  8. Use getTplAdminTableCells for clean row generation
  9. Replace ad-hoc span tags with getTplSpan

Benefits:

  • Consistent look and feel for all admin data tables
  • Unified attribute escaping for all generated anchor tags
  • Simplified module controllers by moving HTML logic to core helpers

Technical notes:

  • Supports both sortable and non-sortable columns via getTplAdminTableHead
  • All textual labels are properly escaped by the underlying helpers
  • Backward compatible: resulting HTML matches the existing admin styles

Всего: 1045 на 105 страницах по 10 на каждой странице

1 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 105
Хотите опробовать SLAED CMS в действии?
Идеи и предложения
Обратная связь
Подтверждение

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