Журнал изменений
Move the Markdown+BB-code processing pipeline out of the inline anonymous class in core/system.php into a dedicated Parser class at core/classes/parser.php. Expose a single entry point filterContent() that merges the old two-step filterMarkdown() + filterReplaceText() call into one method. Instantiate $prs globally alongside $tpl in system.php and remove the now-replaced standalone functions.
Core changes:
- New class (core/classes/parser.php):
Parser class with filterContent(string $src, bool $safe, string $mod) as the unified entry point
- safe=true: escapes user-injected HTML and applies URL allowlist
- safe=false: allows raw HTML blocks and admin BB tags
Internal pipeline: filterBbBlocks → filterCode → filterBlocks → filterSafe (safe mode) → filterStash
Per-request parse cache keyed by md5(src + safe + mod) to avoid re-parsing identical content within one request
All logic is a direct extraction of the anonymous class from system.php; no behavioral changes
- Bootstrap (core/system.php):
- Add require_once for core/classes/parser.php
- Instantiate $prs = new Parser() immediately after $tpl
- Remove filterMarkdown() and filterReplaceText() function definitions
Migrate all call sites inside system.php to $prs->filterContent()
- getBlocks(), scheduler mail, comment rendering, updateComment(),
getUserSessionInfo() area
Benefits:
- Parser logic is testable in isolation via core/classes/parser.php
- Single filterContent() call replaces every filterMarkdown() + filterReplaceText() pair
- Removes 780-line anonymous class from system.php bootstrap
Technical notes:
- $prs is a global like $tpl and $db; callers must declare global $prs
- filterMarkdown() and filterReplaceText() no longer exist after this commit
- All remaining callers are migrated in subsequent commits
Regenerate base_fingerprint to reflect the current state of the codebase after the admin fragment namespace was flattened and all PHP callers were updated to use flat fragment paths.
Core changes:
- Config fingerprint (config/local.php):
Update base_fingerprint from 95db252... to 67064900...
- Reflects changes across templates, core, admin modules, and
module admin/public pages from the fragment refactor
Benefits:
- Fingerprint is consistent with the actual file state
- Prevents false-positive change detection on next build
Technical notes:
- No functional change; fingerprint is a build-state checksum only
Remove the new/ prefix from getHtmlFrag() calls in public-facing module controllers and replace the removed span-btn fragment with the new inline-badge fragment. Update title_tip() call sites to use the new structured array API.
Core changes:
- Content module (modules/content/index.php):
Migrate title_tip() call to structured array: label/value/is_last pairs
- Replaces getTplAdminTipLine() helper with direct data array
- Forum module (modules/forum/index.php):
Replace span-btn fragment calls with inline-badge across all icon rows
- topic state badges: new, old, popular, announce, hot, mod, admin,
closed, pinned (9 call sites)
- forum state badges: new, nonew, closed (3 call sites)
- Fix form submit button: sl_but_blue → sl-but-blue (BEM class)
- Rename title_attr → title_text in inline-badge call signature
- Files, links, media, money, shop, users, voting (modules/*/index.php):
- Remove new/ prefix from getHtmlFrag() calls where present
- Apply BEM class name corrections where applicable
Benefits:
- Public module pages no longer reference deleted span-btn fragment
- Consistent inline-badge fragment usage across admin and front-end
- title_tip() structured API replaces ad-hoc string concatenation
Technical notes:
inline-badge replaces span-btn 1:1 for icon-label badges; title attr key renamed from title to title_text in the new fragment signature
- sl_but_blue → sl-but-blue is a visual-only class change (no layout effect)
Remove the new/ prefix from every getHtmlFrag() call in all 23 module admin controllers (modules/*/admin/index.php). Aligns the module admin layer with the flat fragment namespace introduced in the template refactor.
Core changes:
- Account module (modules/account/admin/index.php):
Replace new/* fragment paths with flat names throughout all views
- label-hint, input, select, select-option, checkbox, radio-group, etc.
- Auto-links, changelog, clients, contact, content (admin):
- Remove new/ prefix from getHtmlFrag() calls (input, label-hint, div-row)
- FAQ, files, forum, help, jokes, links, media (admin):
- Remove new/ prefix from all getHtmlFrag() fragment calls
- Money, news, order, pages, RSS, search, shop, sitemap (admin):
Remove new/ prefix; shop/admin has the most call sites (select, checkbox, table-cell, table-cells, row-actions)
- Voting, whois (admin):
- Remove new/ prefix from getHtmlFrag() calls
Benefits:
- Module admin pages are fully aligned with the flat fragment API
- No new/ prefix fragment paths remain in any modules/*/admin/ file
Technical notes:
- Pure path prefix removal; no logic or behavior changes
- All 23 admin index files affected; changes are mechanical and uniform
Update admin/index.php, core/admin.php, and all 25 admin/modules/*.php to use the flat fragment namespace. Remove the new/ prefix from every getHtmlFrag() call site. Migrate admininfo() in core/admin.php from legacy getTplAdminInfoRow() to the new table-row / table-cells / row-actions-item / inline-badge fragment composition.
Core changes:
- Admin dashboard (core/admin.php):
Rewrite admininfo() rows using table-row + table-cells + row-actions-item
- inline-badge fragments (replaces getTplAdminInfoRow() calls)
- All 16 module rows (account, faq, files, help, jokes, links, media,
news, pages, shop, voting, etc.) converted to new API
- Admin entry point (admin/index.php):
- Remove new/ prefix from getHtmlFrag() calls for menu and panel fragments
- Admin modules (admin/modules/*.php — 25 files):
Remove new/ prefix from all getHtmlFrag() calls: label-hint, input, select, select-option, checkbox, radio, radio-group, textarea, hidden, div-row, div-collapse, div, form, button, submit, move-controls, tabs-link, tabs-panel, table-cell, table-cells, table-row, inline-badge, row-actions, row-actions-item, image-preview, toggle-form-block, user-search, edit-tip, title-tip
Benefits:
- All admin panel PHP is aligned with the flat fragment namespace
- Legacy getTplAdminInfoRow() dependency removed from core/admin.php
- Consistent getHtmlFrag() call style across the entire admin layer
Technical notes:
- Pure search-and-replace of new/ prefix; no logic changes
- getTplAdminInfoRow() function can now be removed from helpers
Update all core PHP files to use the new flat fragment namespace after the new/ subdirectory was removed. Replace dedicated micro-fragments (meta-refresh, head-link-icon, pdo-query-time) with direct inline HTML to eliminate trivial fragment round-trips and reduce the fragment dependency surface.
Core changes:
- Template engine (core/classes/template.php):
Change fallback alert path from new/alert → alert
- Removes hard-coded new/ prefix in the fragment-not-found error path
- Database logger (core/classes/pdo.php):
Replace getHtmlFrag('pdo-query-time', ...) with direct sprintf HTML
- Eliminates pdo-query-time fragment dependency from the DB layer
- Pager and tab helpers (core/helpers.php):
- Remove new/ prefix from getHtmlFrag() calls: pager, pager-link, pager-dots
Remove new/ prefix from tabs-link, module-head, alert calls in getTplPager() and getTplAdminTabs() / setTplAdminInfoPage()
- Legacy helpers (core/helpers-old.php):
Add getTplFragmentName(string $name): string helper for theme-aware fragment path resolution (used by access.php, security.php, system.php)
Remove obsolete getTplAdminTable(), getTplAdminTableRow(), getTplAdminForm(), and related wrapper functions (replaced by direct getHtmlFrag() calls in callers)
- Exit-page renderers (core/access.php, core/security.php):
Inline meta-refresh and head-link-icon HTML directly (htmlspecialchars-safe)
- Removes fragment dependency for trivial one-liner tags
- Replace head-link-css fragment lookup with getTplFragmentName() call
- Front-end session rendering (core/system.php):
- Replace new/alert with alert in getFlashHtml()
Replace bare 'session-row' with getTplFragmentName('session-row') in getUserSessionInfo() and getUserSessionAdminInfo() (5 call sites)
- Fix CSS class: sl_but_blue → sl-but-blue in getVotingView()
Benefits:
- Zero new/ fragment paths remain in core after this commit
- Trivial micro-fragments (meta tag, link tag, query-time span) eliminated
- getTplFragmentName() provides a single lookup point for theme-context paths
Technical notes:
- Inline HTML in access.php and security.php is equivalent to the removed fragments
- No behavior changes; only fragment-path and class-name corrections
Drop the templates/admin/fragments/new/ subdirectory and promote all shared UI primitives to the flat fragments/ root. Delete obsolete module-specific fragment files that were replaced by the new generic API in earlier commits. Update alert, table, input, th, title-tip, pager-link, and label-hint fragments to the new BEM-style CSS class naming.
Core changes:
- CSS stylesheets (new.css, system.css, theme.css):
Rename legacy sl_ class names to BEM sl- convention throughout
- sl_table_form → sl-table-form, sl_but_blue → sl-but-blue, etc.
- Add new layout utility and component classes for revised fragments
- Fragment promotion (templates/admin/fragments/):
Move all new/.html → fragments/.html (flat namespace)
- button, checkbox, div, div-row, div-collapse, form, hidden
- image-preview, inline-badge, label-item, module-head, module-foot
- move-controls, pager, pager-dots, pager-link, radio, radio-group
- row-actions, row-actions-item, select, select-option, submit
- table-cell, table-cells, table-row-content, table-row, tabs
- tabs-link, tabs-panel, textarea, th, title-tip, toggle-form-block
- user-search, edit-tip, label-hint
Add new dashboard-panel, menu-grid, menu-grid-item, menu-grid-row menu-list-item, sidebar-block, edit-list-select fragments
- Fragment updates (existing files):
- alert.html: add is_flash, alert_attr, lines[] support; BEM class names
- table.html: add is_wrapless and disable_sort flags; BEM wrapper classes
- input.html: replace generic input_class with is_config flag
- th.html, title-tip.html, pager-link.html: minor markup updates
- Deleted legacy fragments (~200 files):
- All admin-* module-specific fragments (replaced by generic API)
Micro-fragments: meta-refresh, head-link-css, pdo-query-time, span-btn script-inline, style-inline, navi, br-line, etc.
Partials: admin-config-base.html, admin-config-communication.html blocks/add.html, blocks/edit.html (rendered inline in PHP)
- Partials and index updates:
box.html, login.html, preview-content.html, registration.html, searchbox.html: align with new BEM class names and revised fragment API
Benefits:
- Single flat fragment directory eliminates the ambiguous new/ indirection
- BEM class naming is consistent across CSS and templates
- Removal of 200+ obsolete fragment files reduces maintenance surface
- New generic fragments (dashboard-panel, menu-grid) enable admin UI rebuild
Technical notes:
- All new/ fragment paths are now invalid; PHP callers updated in parallel
- CSS class renames are breaking for any custom themes using old sl_* names
- No functional behavior changes — purely structural and naming refactor
Rewrote admin listing and action views in 10 modules to use the new fragment API (new/table-row, new/row-actions, new/title-tip, getTplAdminTabs instead of getTplAdminNavi). CSRF tokens added to all state-changing action URLs. Indentation and inline style issues fixed throughout.
Core changes:
Fragment API migration (modules/money, news, order, pages, rss, search, shop, sitemap, voting, whois — admin/index.php):
- getTplAdminNavi() replaced with getTplAdminTabs()
- getTplAdminActionMenu() replaced with new/row-actions fragment
- Table rows rebuilt with new/table-cell + new/title-tip fragments
- Legacy getTplOption/getTplSelect replaced with new/select-option/select
- CSRF hardening:
- getSiteToken() appended to all activate/delete/action URLs
- Style fixes:
- Corrected indentation (spurious leading spaces in setHead() etc.)
- Removed alignment padding in variable assignments
Benefits:
- Consistent admin UI rendering across all modules
- State-changing GET actions protected with CSRF tokens
- Easier template maintenance via named fragment params
Technical notes:
- new/row-actions expects 'items' array with href/label/title keys
- new/title-tip expects 'items' array with label/value/is_last keys
- Backward compatible: no DB or config schema changes
Replaced legacy preview() calls with getTplPreviewContent() across all affected admin modules and removed hardcoded 'tab' index from setTplAdminInfoPage() calls so the info tab is resolved automatically.
Core changes:
preview() migration (admin/modules/messages.php, newsletter.php, modules/clients, faq, files, help, jokes, links, media admin/index.php):
- preview($title, $body, ...) replaced with getTplPreviewContent([...]) using named params
setTplAdminInfoPage() cleanup (modules/clients, contact, faq, files, forum, help, jokes, links, media admin/index.php):
- Removed explicit 'tab' => N argument; tab is now auto-computed
Benefits:
- Consistent preview rendering API across all admin modules
- Info tab no longer needs manual index maintenance
Technical notes:
- getTplPreviewContent() accepts named array: title, texta, textb, field, mod
- Behavior unchanged; visual output identical
Two targeted config updates applied after module refactoring: content module removed from the search index, base_fingerprint refreshed to match current admin module state.
Core changes:
- Search config (config/search.php):
- Removed 'content' from the 'mods' list of searchable modules
- Local config (config/local.php):
- Updated base_fingerprint to 95db25262294c2f867f3bb75581549e2e3b277eb
Benefits:
- Search no longer indexes removed content module
- Fingerprint reflects current admin build state
Technical notes:
- base_fingerprint is auto-derived; manual update after module changes
- Backward compatible