Журнал изменений
Replace all ru.html admin info pages with ru.md equivalents across the admin panel and all module admin sections. Adds a new scheduler info page. Aligns documentation format with the project's Markdown-first content strategy.
Core changes:
- Admin core info pages (admin/info/*/):
- Delete 22 legacy ru.html help files
Add 23 ru.md replacements (blocks, categories, comments, config, database, editor, favorites, fields, groups, lang, messages, modules, newsletter, privat, ratings, referers, replace, scheduler, security, statistic, template, uploads)
- Update admins/ru.md in place
- Module admin info pages (modules/*/admin/info/):
Delete 21 legacy ru.html files (account, auto_links, changelog, clients, contact, content, faq, files, forum, help, jokes, links, media, money, news, pages, rss, shop, sitemap, voting, whois)
- Add 21 ru.md replacements
Benefits:
- Consistent Markdown format across all documentation
- Easier diffing and editing of help content
- Enables future tooling that expects .md sources
Technical notes:
- Content migrated verbatim; no structural changes to help text
- Scheduler page is new (no prior HTML equivalent)
Replace all setTemplateWarning calls in changelog module with $tpl->getHtmlFrag('alert', ...) completing the full removal of setTemplateWarning from all modules except basic-changelog slice.
Core changes:
- modules/changelog/admin/index.php:
- changelog(): variable $warnType migrated to is_warn boolean flag
- configsave(): fixed 'warn' token error migrated to direct getHtmlFrag
- modules/changelog/index.php:
- changelog(): variable $warnType migrated to is_warn boolean flag
Benefits:
- setTemplateWarning fully eliminated from all PHP call sites
- Remaining setTemplateBasic('basic-changelog') is a separate slice task
Technical notes:
- basic-changelog template (339 lines) stays in legacy pending its own slice
- form-conf is a stop condition (343-line universal template, per-module split required)
Replace all setTemplateWarning() and setTemplateBasic('title') calls with direct $tpl->getHtmlFrag() calls across admin and modules, removing the dependency on the legacy core/template.php render path for these slices.
Core changes:
- New fragments — alert (templates/*/fragments/alert.html):
- admin: sl_{{ type }} CSS classes (warn/info/atten)
- lite: sl_warn / sl_info CSS classes via is_warn boolean
- default/simple: Bootstrap alert-warning / alert-info via is_warn boolean
- Redirect cases: meta HTTP-refresh tag passed as raw 'meta' variable
- New fragments — title (templates/*/fragments/title.html):
- lite: <h3 class="font mtl">
- default: <h3 class="view-title">
- simple: <h3 class="h4 mb-3">
- Dead if_flag removed from modules/content/index.php
- PHP call sites (62 files):
- admin/index.php + admin/modules/*.php: 60 setTemplateWarning replaced
- modules/*/.php: 190 setTemplateWarning + 32 setTemplateBasic('title') replaced
- $tpl added to global declarations where missing
- modules/changelog excluded (variable template name, separate task)
Benefits:
- Legacy core/template.php no longer touched for alert and title output
- HTML moved to theme files; PHP passes plain scalar data only
- Each theme renders alert/title with its own CSS conventions
Technical notes:
- open/close wrappers remain in legacy (unclosed HTML pair, bad slice)
- setTemplateWarning still present in modules/changelog only
- All 25 PHPUnit tests pass
Rewrite root-level and docs/ markdown files to reflect the current codebase state, remove outdated scaffolding instructions, and add a new TEMPLATE_STATUS.md reference for the Template engine migration.
Core changes:
- Root docs (CONTRIBUTING.md, README.md, SECURITY.md, UPGRADING.md):
- Removed placeholder setup commands and redundant boilerplate
- Updated prerequisite lists to match actual PHP and extension requirements
- Added Template Runtime Guidance section to CONTRIBUTING.md
- Internal docs (docs/):
- PRINCIPLES.md — updated to reflect Template class architecture decisions
- TEMPLATES.md — heavily trimmed; now describes engine API and directory layout
- TESTS.md — updated test strategy to cover Template bridge PHPUnit suites
TEMPLATE_STATUS.md (new) — migration status tracker listing implemented engine features and which admin views are running through the new runtime
Benefits:
- Docs match the current codebase rather than an earlier planned state
- New contributors get accurate setup and contribution instructions
- TEMPLATE_STATUS.md provides a clear handover point for future migration work
Technical notes:
- All four root markdown files were significantly shortened (net -2438 lines)
- TEMPLATE_STATUS.md is the authoritative reference for migration progress
Cover the full Template engine pipeline and each migrated admin partial with PHPUnit tests, using an in-process bootstrap that sets up a minimal CMS environment without a database or web server.
Core changes:
- Test bootstrap (tests/Support/ViewTestBootstrap.php):
- Defines required CMS constants (BASE_DIR, FUNC_FILE, ADMIN_FILE, PREFIX_DB)
- Instantiates $tpl as Template('admin') for all test suites
- Provides fixture helpers for creating throwaway template files
- Admin bridge tests (tests/Unit/Admin*BridgeFlowTest.php):
AdminLoginBridgeFlowTest — verifies login and registration partials render with all required named keys and escape HTML entities correctly
- AdminPreviewBridgeFlowTest — asserts preview partial outputs title and fields
- AdminSearchboxBridgeFlowTest — confirms searchbox partial renders form input
- Engine flow tests (tests/Unit/):
- TemplateBridgeFlowTest — getHtmlPart / getHtmlFrag happy-path and empty-name guard
- TemplateBridgeFallbackTest — missing file, bad name, and path-traversal attempts
- ViewBridgeSmokeTest — compiled cache creation, mtime invalidation, include tag
Benefits:
- Regression safety for every admin partial migrated from setTemplateBasic()
- Engine security assertions block null-byte, dotdot, and symlink bypass attempts
- Tests run without a live CMS install using the in-process bootstrap
Technical notes:
- PHPUnit 10+ compatible; no database fixtures required
- Fixture templates written to sys_get_temp_dir() and cleaned up in tearDown
Delete the shared plugins/bootstrap/ directory now that Bootstrap is bundled inside templates/simple/assets/vendor/bootstrap/ and the default theme carries no Bootstrap dependency at all.
Core changes:
- Removed (plugins/bootstrap/):
- bootstrap.min.css, bootstrap.bundle.min.js, bootstrap-icons.min.css
- fonts/bootstrap-icons.woff2
- index.html
Benefits:
- Eliminates a global shared asset that coupled all themes to one Bootstrap version
- Each theme now owns its vendor dependencies explicitly
Technical notes:
- simple theme ships an identical Bootstrap copy under assets/vendor/bootstrap/
- Any theme that does not need Bootstrap simply omits the vendor directory
Introduce two starter themes under templates/ implementing the canonical engine directory structure (pages, partials, fragments, layouts, assets), providing reusable error pages, login views, alerts, and layout wrappers.
Core changes:
- default theme (templates/default/):
- layouts/bare.html — minimal HTML shell without nav or sidebar
- pages/error.html — styled error page with title and message slots
- partials/login.html, login-logged.html, login-without.html — auth views
- partials/alerts.html — flash message list partial
- fragments/message.html — inline status fragment
- simple theme (templates/simple/):
- layouts/bare.html, layouts/main.html — bare and full-nav layout wrappers
- pages/error.html — lightweight error page
- Same partials and fragment set as default
- assets/css/theme.css, assets/js/theme.js — minimal theme stylesheet and script
- assets/vendor/bootstrap/ — bundled Bootstrap 5 for this theme only
Benefits:
- Demonstrates full engine directory convention for future theme authors
- simple theme ships Bootstrap self-contained, not as a global plugin
- default theme has no JS/CSS dependency, suitable for lightweight deploys
Technical notes:
- Bootstrap vendor files in simple/assets/vendor/ replace the removed global plugin
- Both themes use {{ }} / {{{ }}} syntax and {% if/for/include %} engine tags
Move login, registration, searchbox, and preview from flat HTML files into the structured partials/ directory expected by the Template engine, enabling named-key variable injection and HTML auto-escaping.
Core changes:
- New admin partials (templates/admin/partials/):
- login.html — form with {{ route }}, {{ nickname }}, {{ password }}, {{ captcha }}
- registration.html — full registration form with all named fields
- searchbox.html — search input partial
- preview.html — preview panel with {{ title }}, {{ fields }}, {{ fieldsa/b/c }}
- Removed flat templates (templates/admin/):
- login.html, registration.html, searchbox.html — superseded by partials above
- These were loaded via setTemplateBasic() which is replaced by getHtmlPart()
Benefits:
- Templates now live in the canonical engine directory structure
- Variable names are clean identifiers, not {%placeholder%} strings
- Auto-escaping via {{ }} protects against XSS in admin views
Technical notes:
- preview.html added as a new partial (no previous flat equivalent)
- Partials use {{ var }} for escaped output and {{{ var }}} for raw HTML fields
Replace every setTemplateBasic() call with $tpl->getHtmlPart() across admin core and all module admin controllers, converting placeholder-map syntax to named-key arrays and normalising captcha condition logic.
Core changes:
- Admin core (admin/index.php):
- login() and preview() use $tpl->getHtmlPart() with named-key arrays
- Captcha condition simplified to in_array() instead of chained ==
- Admin modules (admin/modules/*.php):
- categories, modules, referers, statistic, template, uploads migrated
- Each search helper and listing function now passes named keys to getHtmlPart()
- uploads: bulk-edit form and per-file row rendering fully converted
- Module admin controllers (modules/*/admin/index.php):
- account, auto_links, search, shop — all setTemplateBasic() calls replaced
- shop: form helpers (getItemFields, getCategFields) and listing rows migrated
Benefits:
- Eliminates string-keyed {%placeholder%} map pattern across 11 files
- Template data validated and escaped by the engine, not inline PHP
- Consistent API surface for all future admin template additions
Technical notes:
- All calls use $tpl->getHtmlPart(name, [key => value]) signature
- $tpl declared global inside each function that renders a partial
- setTemplateBasic() remains in system.php for non-migrated frontend callers
Add a theme-aware template engine that compiles Jinja-style syntax to cached PHP, replaces setTemplateBasic() for admin and frontend views, and enforces path-traversal safety at every resolution step.
Core changes:
- Template engine (core/classes/template.php):
getHtmlPage() — renders a page with optional layout inheritance
- supports {% extends 'layouts/app.html' %} and {% block %}/{% endblock %}
- falls back to standalone render when no layout exists
- getHtmlPart() / getHtmlFrag() — compile and return partials and fragments
- Compiled PHP cache stored in storage/cache/view/<theme>/ keyed by sha1 hash
- Syntax compiled: {{ var }} (escaped), {{{ var }}} (raw), {% if/for/include/extends/block %}
- checkFile() / checkIncl() / checkName() prevent path traversal in all lookups
- Bootstrap (core/system.php):
- require_once Template class at startup
- Instantiate $tpl as Template('admin') or Template($theme) based on ADMIN_FILE
- Expose via $GLOBALS['tpl'] for access from all module functions
- Rewrite preview() to use $tpl->getHtmlPart('preview', [...])
Benefits:
- Decouples HTML from PHP string interpolation across all admin views
- Compiled cache eliminates repeated regex parsing per request
- Single validated entry point for all template rendering
Technical notes:
- Template files live under templates/<theme>/{pages,partials,fragments,layouts}/
- Cache invalidated automatically when source mtime changes
- Backward-compatible: setTemplateBasic() remains available for non-migrated callers