Журнал изменений
Consolidated 68 atomic micro-fragments into unified fachliche templates. Eliminated action-menu, action-delete, alpha-nav, category-icon/title, rating-bar/like, pager-dots duplicates via merged variants with optional slots. Inlined trivial single-tag fragments (danger-text, note-label, tab-list-close, pager-dots). Updated all callers in core/admin.php and core/system.php accordingly.
Added docs/ADMIN_MIGRATION_PLAN.md as master plan covering Spur 1 fragment consolidation phases 1-5 and Spur 2 module-by-module HTML migration for all 24 admin modules with risk-based batch ordering, helper decision model, raw-slot rules, stop conditions and verification matrix.
Added partials scaffold: blocks/add.html, blocks/edit.html, admin-config-base.html, admin-config-communication.html.
Moves all theme CSS/JS files from theme root and legacy js/ directories into a consistent assets/css/ and assets/js/ layout across all themes, and fixes broken image URL references caused by the deeper file location.
Core changes:
- Theme asset structure (templates/admin, default, lite, simple):
- Move CSS files from theme root into assets/css/
- Move JS files from js/ into assets/js/
- Move fonts into assets/css/fonts/
- Remove old root-level and js/ directories
- CSS image path fix (all theme CSS files):
- Replace url(images/) with url(../../images/) to correctly resolve paths relative to new assets/css/ location
- doCss() path resolver (core/system.php):
- Replace str_replace('../', '') + naive prefix with proper relative path resolution that correctly handles ../ navigation
- Layout hardcoded script tags (all themes admin.html, lite home.html):
- Remove redundant hardcoded script tags; files are now auto-loaded via getThemeAssets()
- modules/shop/index.php:
- Update theme.css existence check to assets/css/theme.css
Introduces automatic CSS/JS loading for partials and components, shortname resolution for include and component tags, and a restructured asset pipeline in doCss/doScript with vendor subdirectory support.
Core changes:
- Asset injection system (core/classes/template.php):
- Add $assets property collecting CSS/JS per render pass
- Reset at start of getHtmlPage(), getHtmlPart(), getHtmlFrag()
- Reset in finally block of getPageHtml()
- Add addAssetPath(): registers companion .css/.js files at runtime
- Add getAssetMarkup(): renders collected tags for standalone output
- Add mergePageAssets(): injects assets into links/scripts data for layouts
- Fix evaluation order bug in fallback render path (line 75)
- Shortname syntax (core/classes/template.php):
- include and component tags now accept bare names without path or extension
- 'header' auto-resolves to 'partials/header.html'
- 'modal' auto-resolves to 'partials/modal.html'
- Asset pipeline (core/system.php):
- Add getAssetFiles(): resolves config entries as files or directories
- getThemeAssets(): scan vendor subdirectories two levels deep; deduplicate
- doCss(): delegate file resolution to getAssetFiles() + getThemeAssets()
- doScript(): same restructure as doCss
- Documentation (docs/, CONTRIBUTING.md, UPGRADING.md, admin/info/template/ru.md):
- Document shortname syntax, smart asset loading and component/slot support
- Update test list and runtime feature status
Benefits:
- Assets are collected centrally and injected into <head> via layout data
- No duplicate <link>/<script> tags regardless of how many times a partial is used
- Zero runtime I/O overhead: file existence checked only at addAssetPath call
- Vendor CSS/JS under assets/vendor/<lib>/<type>/ now auto-loaded
Technical notes:
- Asset deduplication uses href/src as array key
- Cache hash reverted to theme + path + mtime only (CSS/JS checked at runtime)
- Shortname expansion applies only when path has no slash and no .html suffix
Revise the template admin guide to reflect the current architecture: component/slot syntax, corrected cache path, removal of legacy layout tags, and clarified fragment/partials directory roles.
Core changes:
- Architecture section (admin/info/template/ru.md):
- Rename title to "Phoenix Template Engine" to match class identity
- Clarify layouts/partials/fragments roles with updated descriptions
- Note cache dir: storage/cache/templates/<theme>/
- State that legacy layouts and {%MODULE%}-style tags are removed
Benefits:
- Documentation matches the implemented template system
- Developers get accurate directory and directive references
Technical notes:
- Russian-language documentation file, no code changes
Update tests to reflect renamed template variables in partials/preview.html and the new required fragment path convention for frontend themes.
Core changes:
- Variable name update (tests/Unit/AdminPreviewBridgeFlowTest.php):
- Replace fields/fields1/fields2/fields3 with title_html/body_a/body_b/body_c in all three test scenarios (direct render, missing theme, bridge flow)
- Required fragment path update (tests/TemplateValidationTest.php):
- Change required template check from basic.html/title.html to fragments/basic.html/fragments/title.html for frontend themes
Benefits:
- Tests reflect the actual template variable contract
- Fragment path validation aligned with new theme structure
Technical notes:
- No test logic changed, only variable names and path strings updated
- All three AdminPreviewBridgeFlow scenarios updated consistently
Extract all inline HTML string construction from system.php and admin.php into dedicated template fragment helper functions, backed by per-theme atomic fragment HTML files. Legacy standalone templates deleted; new fragment files added for all four themes (admin, default, lite, simple).
Core changes:
- Fragment rendering functions (core/system.php):
- Replace inline foot/category/pager HTML with renderFootControls(), categoryIconLink(), categoryTitleLink(), categoryIconText(), categoryTitleText(), categoryTextLink(), categorySubItem(), categoryRow(), pagerLink(), pagerCurrent()
- Add head_html, blocks_left, blocks_right, blocks_down to adminvars
- Admin UI fragment functions (core/admin.php):
- Replace inline tab list/link HTML with adminTabListOpen(), adminTabListClose(), adminTabLink()
- Add adminInfoCountValue() helper using admin-info-count fragment
- Legacy core removed (core/template.php):
- File deleted; functionality fully absorbed by Template class
- New fragment HTML files (templates/*/fragments/):
- Add ~50 atomic fragment files per theme: comment, editor, admin-block, session, preview-title, foot-controls, navi-lower, etc.
- Update partials/preview.html variable API: fields → title_html, fields1 → body_a, fields2 → body_b, fields3 → body_c
- Update fragments/comment.html for all themes
- Legacy templates removed:
- Delete basic.html, title.html, preview.html, spoiler.html, warn.html, basic-changelog*.html, layouts/main.html and similar per-theme files
Benefits:
- Inline HTML fully removed from PHP business logic
- Theme authors can override any UI fragment without touching PHP
- Consistent, semantic variable names across all fragment templates
Technical notes:
- partials/preview.html variables renamed: fields/fields1/fields2/fields3 → title_html/body_a/body_b/body_c (breaking for custom themes)
- renderFootControls() replaces hardcoded foot_html string
- All themes must provide required fragment files
Introduce {% component %}/{% endcomponent %} and {% slot %}/{% endslot %} directives into the template compiler, enabling partials to receive isolated props and inlined slot payloads. Correct the view cache directory path from cache/view/ to cache/templates/ for consistency with storage layout.
Core changes:
- Component/slot filters (core/classes/template.php):
- Add filterComp() for {% component 'partials/foo.html' with vars %}...{% endcomponent %}
- Path restricted to partials/ subdirectory
- Prevents nested component blocks
- Passes isolated props array and slot body to getComp()
- Add filterSlot() for {% slot name %}...{% endslot %} placeholders
- Compilation pipeline (core/classes/template.php):
- Register filterComp() and filterSlot() in compileCode()
- Add $slots property for slot state tracking
- Cache path correction (core/classes/template.php):
- Change cache dir: storage/cache/view/{theme} → storage/cache/templates/{theme}
Benefits:
- Reusable partials with dynamic slot content
- Template logic stays declarative and HTML-author-friendly
- Cache path aligned with storage layout convention
Technical notes:
- Component nesting is explicitly blocked at compile time
- Slot body is passed as raw string evaluated in partial scope
- No existing templates used {% component %}, no migration needed
Finalize Phase 6–9 changes for the lite theme and clean up test support files after Phase 12 legacy removal.
Core changes:
- Lite theme layout migration (templates/lite/):
- Delete index.html and index-main.html (legacy shell files)
- Refactor index.php to data-only provider
- Update layouts/app.html and layouts/home.html to new engine contract
- Add partials: menu.html, forum-teaser.html, contact-block.html
- Add fragments: forum-pagenum.html, forum-teaser-item.html
- Admin theme fragments (templates/admin/fragments/):
- Add admin-lang-item.html and admin-menu-item.html
- Test suite (tests/):
- Remove getThemeLoad/getThemeFile stubs from ViewTestBootstrap.php
- Fix if/endif balance regex in TemplateValidationTest.php
- Remove stale lite-menu assertion in ViewBridgeSmokeTest.php
Benefits:
- Lite theme fully decoupled from legacy shell rendering
- All themes consistent with new Template engine contract
- Test suite passes cleanly after legacy stub removal