Журнал изменений
Update all module callers to match the updated fragment/partial contracts: replace CSS class strings with boolean semantic flags, adopt consolidated partials for forms and views, and align getPageNumbers() calls with the dropped $frag parameter.
Core changes:
- Fragment API normalization (all 20 modules + admin/modules/referers.php):
link: 'class' => 'sl_but_foot' → is_footer_button; 'class' => 'sl_last' → is_last; 'class' => 'sl_but' → is_account_button; 'class' => 'sl_votes/sl_coms' → is_votes/is_comments
image: 'class' => 'sl_avatar' → is_avatar; link_class sl-avatar-link → is_avatar_link; 'img_class' → is_avatar in table-row cells
table: 'class' => 'sl_table_form' → is_form; + is_avatar_grid flag for avatar grids; 'class' => 'sl_table_amount' → is_amount
- post-div: 'class' => 'sl-form-submit' → is_form_submit; 'class' => 'sl_center' → is_center
- select: 'select_class' => 'sl-field--account' → is_account
- submit: 'class' => 'sl_but_blue' removed (fragment uses default style)
- Partial migration:
- contact: contact-form → getHtmlPart('contact-form'); contact-email-body → message-block
- account: account-view → getHtmlPart('account-view')
- faq: faq-quicklinks-open/row/close → table/table-row/table with is_faq flag
- files, forum, whois, shop, rss, recommend, money, order: respective obsolete fragments → partials
- Action element migration:
- action-delete → link with is_delete flag (across forum, content, faq, voting, news, etc.)
- action-menu-item → list-item with content_html key (all editor action menus)
- getPageNumbers() caller updates (admin + all modules):
- Drop first $frag argument from every call site
Benefits:
- Modules no longer carry CSS knowledge — all styling decisions live in templates
- Consistent boolean flag convention across all call sites
- Partial-based forms reduce inline HTML from module PHP files
Technical notes:
- getPageNumbers() breaking change handled in all 21 affected call sites
- No functional behavior changes — pure API contract migration
Replace raw CSS class strings and obsolete fragment names with boolean semantic flags and consolidated partial templates, completing the contract-driven template layer. getPageNumbers() signature simplified by removing the unused $frag parameter.
Core changes:
- Fragment/partial API migration (core/helpers.php):
- getPageNumbers(): remove dead $frag param, update all internal call sites
- getTplViewFieldRows(): view-field → field-value, label → label key rename
- getTplBbEditor(): inline HTML → getHtmlPart('editor-upload-panel', ...)
- getTplAjaxTextarea(): ajax-textarea-form → getHtmlPart('form-wrap', ...) + inlined buttons
- getRatingAsync(): nrate class string → has_score bool; rating-like-live/rating-bar-live merged into unified rating-like/rating-bar with is_live flag; wrap_class → is_like bool
- getTplCategorySelect(): category-select → getHtmlFrag('select', ...)
- Security email templates (core/security.php):
- addHackReport/addWarnReport: security-report-email + br-line → getHtmlPart('message-block', lines[])
- System helpers (core/system.php):
- setHead(): getHtmlFrag('login') → getHtmlPart('login-nav')
- filterTextHighlight(): remove admin-only span-raw branch, use span with is_highlight flag
- setCategories(): style string → is_hidden bool; category-link → link with is_category flag; category-row style → is_hidden
- addSitemapTask(): inline HTML ol/li → list/list-item fragments; add $tpl to globals
- getNaviTabs(): navi-tab-link → link + list-item
- getVotingView(): action-delete → link with is_delete; action-menu-item → list-item; voting-widget → getHtmlPart; CSS class strings → is_* booleans; width calculation clamped with max/min/round
- User/message templates (core/user.php):
- setComShow: submit class removed (default style)
- setMessageShow: post-div class → is_center bool
- getPrivateMessageView: action-menu-item → list-item; comment-date → inline-badge with is_comment_date; comment-rank-image → image; meta-value → span with label; privat-message → forum-view-basic with is_private_message; span class strings → is_* booleans
Benefits:
- PHP callers no longer embed CSS class strings, removing style coupling
- Partial contracts centralize layout logic in templates
- Unified rating-like and rating-bar fragments (removed *-live duplicates)
- Cleaner boolean API reduces fragile string concatenation
Technical notes:
- getPageNumbers() signature change is breaking for all callers (all updated in this commit)
- rating-like-live and rating-bar-live fragments no longer referenced from PHP
- message-block partial replaces security-report-email + br-line combination
Delete frontend fragments whose callers have been migrated in the preceding runtime-migration commit. Every deletion is covered by a generic replacement contract; no productive code path references these files any more.
Core changes:
- Account form fragments (10 files × 3 themes):
- Replaced by partials/form-add with flexible attributes
- activate, edit, login, newuser, passlost, password, privat-message, rss-select, rss-url, comment
- Account view helpers (14 files × 3 themes):
- account-avatar-current, account-avatar-grid-cell, account-avatar-grid, account-avatar-upload
- account-favorite-add, account-favorite-on, account-favorite-off, account-favorites-list
- account-last-row, account-last-wrap
- account-message-admin-note, account-pm-icon-link
- account-avatar-grid-row-open, account-avatar-grid-row-close (merged via open flag)
- Shop summary fragments (4 files × 3 themes):
- shop-cart-item-row, shop-cart-table (replaced by generic table)
- shop-partners-form, shop-partners-summary
- Clients list info (clients-list-info, 3 files):
- Replaced by post-div atom
- Link variant (comment-action-link, 3 files):
- Replaced by the generic link fragment with is_blank flag
Benefits:
- Net template count reduced by 90 productive files
- Single source of truth per view role (forms, tables, links, avatars)
- No orphaned references remain
Technical notes:
- All deletions verified via grep before commit
- Three themes (default, simple, lite) carry identical deletions
Migrate PHP callers to the new unified contracts introduced in the preceding template commits. Removes every raw <a> HTML string from core/user.php, drops hclass attribute assembly in core/system.php, switches comment-action-link callsites to the generic link atom, and rewrites the shop cart summary onto the generic table/table-row.
Core changes:
- Account module (modules/account/index.php):
- Migrate the avatar-grid row loop onto account-avatar-grid-row with open flag (no per-row tr/close fragments)
- Drop per-cell width math; grid sizing is now CSS-driven
- Migrate account forms to the shared form-add partial with new flags
- User helpers (core/user.php):
- Replace five add_menu raw-HTML calls with comment-action-ajax and link fragment arrays joined by pipe separators
- Favorites toggle inlined via span fragment
- No raw HTML remains in user.php for action menus
- System helpers (core/system.php):
- Drop hclass variable in ashowcom; pass is_closed/closed_title
- Replace comment-action-link with link (including is_blank flag)
- Rewrite getCartSummary onto generic table/table-row/link/ajax fragments (no shop-cart-* fragments)
- Rename checkbox-input callers to checkbox
- Search, voting, admin config (modules/search/index.php, modules/voting/index.php, admin/modules/config.php):
- Switch comment-action-link to link
- Forum module (modules/forum/index.php):
- Open and close mod-form via forum-mod-form with open flag
- Pass is_closed/closed_title to forum-view-basic (no hclass)
- Shop module (modules/shop/index.php):
- Align cart callers with the new table-based summary
- Clients module (modules/clients/index.php):
- Switch clients-list-info to the generic post-div atom
- Help and order modules (modules/help/index.php, modules/help/admin/index.php, modules/order/index.php):
- Adjust getTplFieldsIn call sites to the named-array signature
- Parser (core/classes/parser.php):
- Rename checkbox-input call to checkbox
Benefits:
- Removes the last inline <a> HTML from frontend PHP
- Single link contract powers every non-htmx action link
- Shop cart uses the generic table atom; no bespoke fragments left
- Account views are contract-driven, not per-form duplicates
Technical notes:
- Link fragment adds rel=noopener noreferrer to former target=_blank callers (security hardening, not behavior change)
- Legacy add_menu(string) signature preserved for existing clients/forum callers; arrays joined with pipe separators at callsites
Drop the hclass attribute-string hack in favor of explicit is_closed/closed_title booleans, replace inline-style avatars with proper <img class="sl_avatar">, and rename forum-mod-form-open to forum-mod-form with an open flag (matching the table/cat-wrap pattern).
Core changes:
- Comment post shell (comment.html):
- Replace hclass passthrough with conditional is_closed attributes
- Default avatar branch now uses <img> (not <a style background-image>)
- Avatar fragment (comment-avatar.html):
- Switch from <a class sl_avatar style background-image> to <img>
- Forum list mod-form (forum-mod-form.html, renamed):
- Collapse forum-mod-form-open into single fragment with open flag
- Emit <form> on open and </form> otherwise
- Forum post shell (forum-view-basic.html):
- Replace hclass with is_closed/closed_title
- Switch avatar to <img>
- Private message shell (privat-message.html):
- Switch avatar to <img>
- Account profile view (account-view.html):
- Switch avatar to <img>
Benefits:
- Removes every hclass attribute-string hack from the codebase
- Eliminates inline style= for dynamic avatar URLs
- Fewer fragment files (forum-mod-form-open gone via rename)
Technical notes:
- Callers updated in the runtime-migration commit that follows
- All three themes (default, simple, lite) kept in sync
Extend the shared form-add partial so callers can override action, method, form name/id, enctype, and append content after submit. Needed to migrate account forms (POST, GET activate, htmx hx-post variants) onto a single reusable contract.
Core changes:
- partials/form-add.html (default/simple/lite):
- Optional action with no_action bypass
- Optional method (default post), form_name (default post), form_id
- Optional enctype with no_enctype bypass; default multipart
- Optional form_attr raw-attribute passthrough
- Optional token (render only when present)
- Optional after_submit content hook
Benefits:
- Single partial covers 7+ formerly separate account-*-form fragments
- GET, POST and htmx-post flows share the same layout
- Preserves defaults: existing callers continue to work unchanged
Technical notes:
- All three themes carry identical markup
- No PHP changes in this commit; runtime migration in later commits
Add CSS rules that back the inline-style removals in account and avatar grid fragments. Styles live exclusively in new.css per the project rule; no inline styles are reintroduced anywhere.
Core changes:
- new.css (default/simple/lite):
- .sl_table_amount td:first-child widths the date column
- .sl-avatar-grid + .sl-avatar-grid td provide fixed 6-column distribution without per-cell inline style
Benefits:
- Removes style="width: X%" from HTML fragments
- Consistent avatar grid rendering across themes
Technical notes:
- Rules are additive; no existing selectors changed
Add four reusable atomic primitives that replace inline markup in forms and lists. These are the building blocks for the upcoming form-add consolidation and the account-* migration.
Core changes:
- checkbox.html:
- Unified checkbox input with optional label wrapper
- Supports is_checked, is_required, is_disabled, input_id, input_attr
- submit.html:
- Single submit-button contract with default sl-but-blue class
- Supports title, input_id, input_attr passthrough
- image.html:
- Generic <img> fragment with class and arbitrary attribute passthrough
- field-value.html:
- Form-row contract for read-only display (label + rendered value)
Benefits:
- Eliminates copy-pasted <input type="submit"> and <img> markup
- Enables form-add partial and account forms to share primitives
Technical notes:
- All three themes (default, simple, lite) carry identical markup
- No callers wired in this commit; migration follows in later commits
Generalize reusable atomic fragments so callers can cover more form and rendering scenarios through parameters rather than per-module copies. This is a backward-compatible extension that prepares the ground for consolidating account, forum and comment view paths.
Core changes:
- Input and textarea (input.html, textarea.html):
- Add is_checked, is_readonly, is_disabled booleans
- Support autocomplete_attr passthrough
- Default itype to text; make name_attr optional for textarea
- Switch textarea value to triple-brace for embedded HTML
- Anchor link (link.html):
- Add rel_attr passthrough, mutually exclusive with is_blank
- Table primitives (table.html, table-row.html):
- Expand header class/is_num handling and cell class overrides
- Support link_class and colspan on cells
- Ajax action link (comment-action-ajax.html):
- Minor refinements aligned with caller needs
- Post content wrapper (post-div.html):
- Normalize id/class/content contract
Benefits:
- Fewer per-module variants needed for forms and tables
- Consistent attribute surface across themes (default/simple/lite)
- Backward-compatible: existing callers work unchanged
Technical notes:
- No PHP changes in this commit
- All three theme copies (default, simple, lite) kept in sync
Add CSS rules for all new sl-* class names introduced by the fragment consolidation. All new rules follow the sl-* (dash) naming convention. Applied identically to all three themes (default, lite, simple).
Core changes:
- Navigation (new.css):
- sl-navi-lower, sl-navi-lower-action: bottom-of-page action bar
- Utility classes (new.css):
- sl-highlight: search term highlight (red text, yellow bg)
- sl-geo-flag: geo-IP flag image alignment
- sl-calculator-field: narrow number input for calculator form
- Table enhancements (new.css):
- sl-table-num-link: pill-style anchor for numeric ID cells
- sl-table-date: inherit color for date cells
- Related items (new.css):
- sl-related-img-inner: object-fit cover for related item thumbnail
- sl-related-date: inherit color for related item date
- Card grid (new.css):
- sl-card-col-1 through sl-card-col-6: responsive column widths
- sl-grid: flex layout baseline corrections
- sl-card-aside: floating sidebar list within card
- sl-card-comment/reads/post/date/category/id/image/read/admin/menu: named element selectors
- Sprite-based icon rules for card meta elements
- Shop cart (new.css):
- sl-cart-table, sl-cart-head, sl-cart-row, sl-cart-foot
- sl-cart-col-num, sl-cart-col-content, sl-cart-col-stat
- sl-cart-id, sl-cart-plus, sl-cart-minus, sl-cart-checkout, sl-cart-total
Benefits:
- All sl-* class names now have corresponding CSS rules
- Zero unnamed or orphaned classes remaining in consolidated fragments
Technical notes:
- Legacy sl_* classes in new.css are intentionally preserved for existing HTML
- Sprite coordinates for card meta icons match existing sprite.png layout