Последнии сообщения форума
Externalize the editor page's structural HTML and interactive components, such as the Robots.txt button and notification panels, into dedicated Mustache-style fragments to improve controller clarity and UI reuse.
Core changes:
- Editor management (admin/modules/editor.php):
- Use getHtmlFrag to load the new editor structural components
- Replace inline Robots.txt button generation with the admin-editor-robots-button fragment
- Move the note panel and root container structural logic to dedicated fragments
- New Fragments (templates/admin/fragments/admin-editor-*):
- admin-editor-robots-button: Standardized green button for Robots.txt templates
- admin-editor-note-panel: Flexible container for notifications and warnings
- admin-editor-root-panel: Main container for the editor interface
Benefits: - Decouples structural HTML from the editor's PHP controller logic - Consistent button styling for all editor templates - Cleaner DOM structure with standardized panel containers
Technical notes: - Uses the core getHtmlFrag() method for fragment retrieval - The Robots.txt button logic is encapsulated in the fragment but relies on existing external JS handling - All structural changes are backward compatible with the current admin layout
Standardize the rendering of admin tables, status badges, and anchor links across various core and module management panels. Replaces repetitive HTML string concatenation with the new helper suite.
Core changes:
- Language and Module Management (admin/modules/lang.php, modules.php):
- Use getTplAdminTableHead for sorting-aware header generation
- Use getTplAdminStatusBadge for standardized status indicators
- Scheduler and Sitemap (admin/modules/scheduler.php, modules/sitemap/admin/index.php):
- Replace inline links with getTplAdminTextLink
- Use getTplAdminTipLine/InfoLine for descriptive list items
- Forum and Monitor (modules/forum/admin/index.php, admin/modules/monitor.php):
- Use getTplAdminTableCells for clean row generation
- Replace ad-hoc span tags with getTplSpan
Benefits: - Consistent look and feel for all admin data tables - Unified attribute escaping for all generated anchor tags - Simplified module controllers by moving HTML logic to core helpers
Technical notes: - Supports both sortable and non-sortable columns via getTplAdminTableHead - All textual labels are properly escaped by the underlying helpers - Backward compatible: resulting HTML matches the existing admin styles
Replace inline HTML <div> strings with standardized UI helper functions (getTplAdminHintLabel, getTplAdminSmallNote) in the blocks, configuration, and account modules to ensure consistent styling and encapsulation.
Core changes:
- Blocks management (admin/modules/blocks.php):
- Use getTplAdminSmallNote for RSS lines information row
- Configuration (admin/modules/config.php):
Replace inline <div> hints with getTplAdminHintLabel for captcha, SEO, and graph settings to maintain visual consistency
- User accounts (modules/account/admin/index.php):
- Update the mail password text panel to use the admin-admins-mail-panel fragment
Benefits: - Consistent presentation of hints and small notes across admin forms - Cleaner module templates that focus on structure rather than inline HTML - Improved maintainability through encapsulated presentation logic
Technical notes: - Uses helpers defined in core/helpers.php - Fragments are loaded via the standard getHtmlFrag() method - Backward compatible: visual output remains consistent with the previous implementation
Unify error message rendering across various admin modules by replacing inline implode('<br>', ...) with the shared getStopText() helper. Ensures consistent handling of empty error array entries and line breaks.
Core changes:
- Admin modules (modules/*/admin/index.php):
- Replace inline implode('<br>', \) with getStopText((array)\)
- Affected modules: auto_links, clients, files, help, jokes, links, media, money, news, order, pages, shop
Benefits: - Centralized logic for formatting error messages - Improved code readability across multiple modules - Consistent UI presentation for warnings and error alerts
Technical notes: - getStopText is a core helper from core/helpers.php - (array) cast added for safety where \ variable might be null or scalar - No functional change to the rendered HTML output
Introduce two new Mustache-style HTML fragment files that render a checkbox table for selecting news items associated with a record, keeping the markup out of PHP and in the template layer.
Core changes:
- Associated news table wrapper (admin-news-asso-table.html):
Renders an sl_form table element with {{{ rows_html }}} slot * rows_html is populated by iterating admin-news-asso-cell fragments
- Associated news cell (admin-news-asso-cell.html):
Renders a single <td> with a named checkbox input * name: associated[], value: {{ cid }}, checked state: {{{ checked }}} * Displays article title {{ ctitle }} as inline label text
Benefits: - Separates HTML structure from PHP controller logic - Reusable fragments composable via getHtmlFrag() calls - Consistent with existing admin fragment template conventions
Technical notes: - Triple-brace {{{ }}} used for pre-rendered HTML slots (rows_html, checked) - Double-brace {{ }} used for plain-text values (cid, ctitle) requiring escaping - Backward compatible: fragments are new additions, no existing files changed
--------------------------------------------------------------------
Types: Refactor | Feature | Fix | Docs | Style | Test | Chore | Perf
Bullets: - main point, * sub-detail
--------------------------------------------------------------------
Unify stop/error message rendering across modules by replacing ad-hoc inline implode('<br>', ...) calls with the new shared getStopText() helper introduced in core/helpers.php, removing the now-redundant local getAdmintext() wrapper from admins.php.
Core changes:
- Admin admins module (admin/modules/admins.php):
- Remove local getAdmintext(array \) function (replaced by getStopText)
- Replace getAdmintext(\) call with getStopText(\) in add()
- Whois admin module (modules/whois/admin/index.php):
- Replace inline implode('<br>', \) with getStopText((array)\)
- Private messages (core/user.php):
- Replace inline implode('<br>', (array)\) with getStopText((array)\)
Benefits: - Single source of truth for error message formatting - Eliminates duplicate logic across three independent modules - Consistent handling of empty/null stop entries via array_filter
Technical notes: - getStopText filters empty strings via array_filter before joining - Cast to (array) preserved where \ may be a scalar at call site - Backward compatible: output is identical to previous inline logic
--------------------------------------------------------------------
Types: Refactor | Feature | Fix | Docs | Style | Test | Chore | Perf
Bullets: - main point, * sub-detail
--------------------------------------------------------------------
Add a set of small, focused helper functions that generate reusable HTML fragments for admin panels, keeping presentation logic in helpers and out of individual module files.
Core changes:
- New UI helper functions (core/helpers.php):
- getTplAdminSmallNote(text): standalone sl_small note div for label-less form rows
- getStopText(stop): joins non-empty error/stop messages with <br> separators
- getTplAdminTextLink(href, label, ...): safe anchor tag for use inside raw HTML slots
- getTplAdminTipLine(key, val): one key-value line for tooltip content_html strings
- getTplAdminInfoLine(label, value): one label-value line for info block content
- getTplAdminTableHead(cols): builds <th> head_html from column label arrays
- getTplAdminTableCells(cells): builds <td> cells_html from pre-rendered cell content array
- getTplSpan(class, raw_content, title): inline span with CSS class and optional title
- getTplAdminStatusBadge(state, yes, no): sl_green/sl_red badge span for status display
Benefits: - Eliminates repetitive inline HTML string construction across modules - Centralises HTML-escaping rules in one place, reducing XSS risk - Provides a consistent API for all admin panel fragment generation
Technical notes: - All attribute values are escaped via htmlspecialchars with ENT_QUOTES/UTF-8 - raw_content in getTplSpan is intentionally not escaped (caller responsibility) - Backward compatible: no existing signatures changed
--------------------------------------------------------------------
Types: Refactor | Feature | Fix | Docs | Style | Test | Chore | Perf
Bullets: - main point, * sub-detail
--------------------------------------------------------------------
Same %20 space-encoding issue as the Migration badge. Replaced %20 with _ for consistency and reliable rendering on GitHub.
Core changes:
- Badge URL (README.md):
- Replace %20 with _ in Status badge URL
Technical notes: - shields.io treats _ as space in path-based badge URLs
shields.io path badges on GitHub were rendering incorrectly due to double percent-encoding of the space character (%20). Replaced %20 with underscore (_) which shields.io treats as a space and GitHub does not mangle.
Core changes:
- Badge URL (README.md):
Replace %20 with _ in Migration badge URL * Prevents double-decoding of percent-encoded space by GitHub
Benefits: - Badge renders correctly on GitHub
Technical notes: - shields.io treats _ as space in path-based badge URLs - %25 encoding for % sign is unaffected and remains correct
Miscellaneous updates accompanying the jQuery removal and getTpl* migration: lang constants for new editor operations, expanded test coverage, documentation refresh, robots.txt hardening, and vanilla BxSlider replacement in lib.js.
Core changes:
- JS vanilla migration (templates/lite/assets/js/lib.js):
- Replaced jQuery BxSlider slider init with standalone vanilla carousel/slider implementation
- No jQuery dependency remaining in lib.js
- Language constants (admin/lang/*.php - all 6 locales):
- Added _EROBSTD (robots.txt standard label) and _ESAVED (file saved confirmation)
- Test suite (tests/):
- PhpFileFormatTest.php: expanded PHP file format checks
- TemplateValidationTest.php: added testSharedFrontendFragmentsStayInSyncAcrossThemes
- Added tests/TextFileEncodingTest.php: new encoding validation for all text files
- Documentation (docs/, README.md):
- docs/RAW_SLOTS_ADMIN.md: updated raw slot usage reference for admin templates
- docs/TEMPLATES.md: updated template system documentation
- docs/TEMPLATE_STATUS.md: updated migration status
- docs/TESTS.md: added test run reference
- README.md: updated migration progress badge (85% -> 90%), removed jQuery from stack list
- Infrastructure:
- robots.txt: added Disallow for /setup/, /setup.php, /storage/; added Sitemap directive
- config/comments.php, config/fields.php: whitespace normalization
Benefits: - Full jQuery removal from lit theme frontend JS - New test covers UTF-8 encoding and cross-theme fragment sync - robots.txt now blocks sensitive paths from crawlers
Technical notes: - lib.js vanilla implementation replaces #slider-head and #slaed_sites BxSlider instances - No behavior change for end users





