Последнии сообщения форума
Eliminate all inline <input type="hidden/text/number"> and <span/div> HTML constructions from PHP across the entire codebase, replacing them with getAdminHidden(), getAdminTextInput(), getAdminNumberInput(), adminFlagBox(), and getAdminHintLabel() helpers. Three new template fragments added to back the new input helpers.
Core changes:
- New template fragments (templates/admin/fragments/):
- admin-hidden-input.html, admin-text-input.html, admin-number-input.html
- New helpers (core/helpers.php):
- getAdminHidden(), getAdminTextInput(), getAdminNumberInput()
- getAdminHintLabel(), getAdminLangHint()
- Admin modules (admin/modules/*.php):
- All hidden, text and number inputs replaced; hint labels use getAdminHintLabel()
- Removed redundant htmlspecialchars() wrappers (template escapes values)
- Module admin pages (modules/*/admin/index.php):
- All <input type="hidden"> chains replaced with getAdminHidden() calls
- Frontend modules and blocks:
- modules/forum, help, money, search — text/number/hidden inputs replaced
- blocks/block-login.php, block-user_info.php — inputs replaced
- Core (core/system.php, core/user.php, core/admin.php):
- ad_save(), datetime(), fields_in(), get_user_search() use helpers
Benefits: - No raw HTML string assembly for form inputs anywhere in PHP - Template layer owns escaping — no scattered htmlspecialchars() calls - Consistent input rendering via single source of truth
Technical notes: - core/system.php:3242 (<input id="recaptcha">) left as-is: id attr not supported by template - <span class="sl_green/red"> in modules.php and security.php left as-is: adminFlagBox() generates <div>, wrong semantics for inline context - docs/RAW_SLOTS_ADMIN.md updated with new fragment entries
Replace raw HTML strings in core utilities, all admin modules, and frontend modules with helper functions and template fragments, completing the project-wide HTML abstraction campaign across ~50 PHP files.
Core changes:
- New helpers (core/helpers.php):
- getHtmlScriptSrc(), getHtmlScriptInline() for <script> tags
- getHtmlCssLink(), getHtmlCssInline() for <link>/<style> tags
- getHtmlHeadLink() for generic <link> head tags
- getAdminHidden(), getAdminTextInput(), getAdminNumberInput() for admin inputs
- getLinkAction(), getDeleteAction(), getExternalAction() for safe link items
- getMenuItem(), getMenuItems() for frontend action menus
- core/system.php:
All raw <script> patterns replaced: doScript(), doCss(), head links, scheduler, getCaptcha(), datetime(), get_user_search(), SyntaxHighlighter, textarea() editors (TinyMCE, CKEditor, CodeMirror), textarea_code()
- anti_spam() <script>/<noscript> split via getHtmlScriptInline()
- File-upload JS block in textarea() migrated
- Admin modules (admin/modules/.php, modules//admin/index.php):
- All add_menu('a||b') → adminMenuItems([adminLinkAction(), adminDeleteAction()])
- All raw <option>/<select> loops → getAdminOption() + getAdminSelect()
- All language() calls in raw <select> → getAdminSelect('lang', language(...))
- 150+ new module-specific admin template fragments added
- Frontend modules:
- modules/content/index.php: add_menu() + unescaped $title in DelCheck fixed
- modules/search/index.php: add_menu() + raw <select> in form
- modules/voting/index.php: add_menu() with delete confirm
Benefits: - PHP controllers free of raw HTML (outside documented raw slots) - XSS vectors in JS confirm dialogs now escaped inside getDeleteAction() - Markup changes no longer require PHP edits in hot paths
Technical notes: - getMenuItems() is the frontend counterpart of adminMenuItems() - getLinkAction/getDeleteAction/getExternalAction use comment-action-* fragments - All changes verified: php -l per file, phpunit OK (6 tests, 9 assertions)
Roots /vendor/, /composer.lock, /composer.phar in .gitignore so only the project-root Composer directory is excluded. This allows frontend vendor assets inside template directories to be tracked in the repo.
Core changes:
- .gitignore:
Changed vendor/, composer.lock, composer.phar to /vendor/, /composer.lock, /composer.phar * Prevents accidental exclusion of template-level asset vendor dirs
- Template vendor assets (templates/*/assets/vendor/):
- Added Bootstrap Icons CSS (admin + simple themes)
- Added Bootstrap bundle JS (simple theme)
- Added Bootstrap core CSS (simple theme)
- Added woff2 icon fonts for both themes
Benefits: - Frontend dependencies are now versioned alongside templates - No reliance on CDN or build step for Bootstrap in deployed environments - Consistent asset availability across dev and production
Technical notes: - Assets are pre-built minified files, no build step required - Composer root vendor/ remains excluded as before
Systematic removal of inline HTML from PHP across the entire CMS — all shared and repeated patterns are now rendered through named fragments, leaving only confirmed Sonderfälle (multi-tab JS forms, JS hidden forms) as inline strings.
Core changes:
- New helper layer (core/helpers.php, core/admin.php):
- getAdminConfSave() — ddtabcontent conf-save form wrapper
- getCatForm() — categories tab form wrapper
- getAccountSearchBox() — collapses 6 identical account search blocks
- getAdminListForm() — bulk-action list form wrapping getAdminTable()
- getMoneyCalcForm() — frontend currency calculator form
- getMetaRefresh() — meta http-equiv refresh tag (applied to 20+ files)
- getAdminSelect/Option, getAdminForm/Row/Wide, getAdminBox, getAdminTable/Row
- getAdminInfoBox, getAdminSearchBox, getAdminPlaceholderBox
- getCatPermRow, getCatTab, getCatTabScript, getCatSubmitRow
- getBlockViewGrid, getFormAddRow, getFormSubmit, getFormSelect
- getForumIcon, getForumReplyForm, getContentCard, getContentView
- adminFlagBox, adminNoteLabel, adminTitleTip, adminDangerText
- adminMoveControls, adminInfoForm, edit_list
- Admin fragments (templates/admin/fragments/):
35 new fragments covering table, form, row, select, info, flag, tip, move-controls, edit-list, editor-form, admins CRUD, categories tabs, blocks grid, conf-save, cat-form, list-form, account-search-form
- Frontend fragments (templates/default|lite|simple/fragments/):
- content-card, content-view, form-add-row, form-submit, form-select
- forum-topic-icon, forum-reply-form, meta-refresh, money-calculator-form
- Identical across all three themes (sync test enforced)
- Raw slot registry (docs/RAW_SLOTS_ADMIN.md):
- Documents every {{{ raw }}} slot with origin and escaping rationale
- Deleted legacy open/close fragment pair across all four themes
Benefits: - Zero raw <form>, <table>, <tr>, <td> strings in module files outside Sonderfälle - All meta http-equiv refresh tags replaced across 20+ frontend modules - Shared patterns reduced to single declaration: account search ×6→1, meta-refresh ×20→1, calculator forms ×3→1 - Fragment inventory is auditable and consistent
Technical notes: - Sonderfälle remain inline: config.php 7-tab, security.php ban forms, uploads config(), scheduler.php JS hidden forms, rss tab form - Search mini-forms inside getAdminSearchBox() are intentionally inline (single-use, already wrapped in the proper helper) - All frontend fragments pass testSharedFrontendFragmentsStayInSyncAcrossThemes
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





