Журнал изменений
Updates all root-level and docs/ documentation to reflect changes made since the March 2026 snapshot: highlight.js integration, editor system migration, removal of legacy plugins, and the pluggable Editor architecture. Dates updated to April 2026.
Core changes:
- README.md:
- Remove Migration: 90% Complete badge (static metric)
- Update Tech Stack: Editor class and pluggable plugins/editors/ system
- Update Content Parsing: Parser class (not bare filterMarkdown)
- Update project structure: add editor.php, parser.php entries
- Remove docs/TEMPLATE_STATUS.md reference (file deleted)
- Update plugins/ description to reflect current directory contents
- CONTRIBUTING.md:
- Add Content Parsers and Editors section with Parser and Editor API guidance
- Remove MySQL/MariaDB version TODO (resolved by badge in README)
- UPGRADING.md:
- Add Content Editors section: Editor::getContent() / Editor::getCode() migration
- Add Content Parsing section: Parser::filterContent() replaces filterMarkdown()
- Fix storage/sitemap path reference
- SECURITY.md:
- Update storage paths for sitemap data
- docs/TESTS.md:
- Add ParserFixturesTest.php to Unit test list
- docs/TEMPLATES.md:
- Minor alignment with current runtime state
Benefits:
- Documentation accurately reflects the active plugin stack and editor API
- Contributors no longer see references to deleted functions or plugins
- Parser and Editor migration paths are explicitly documented
Technical notes:
- docs/TEMPLATE_STATUS.md was removed in the plugin cleanup commit
- No new documentation files created; existing files updated in place
Adds admin-preview-* CSS classes to preview-content.html across all themes for targeted admin-side styling. Updates div-row fragment to support field_unwrapped mode for editor widgets that should not be wrapped in the sl-div-field container. Adds CKEditor and full-width editor CSS rules to the admin theme stylesheet.
Core changes:
- Preview templates (templates/*/partials/preview-content.html):
- Add admin-preview class to root div (all themes)
- Add admin-preview-title, admin-preview-fields1/2/3 classes for scoped CSS
- admin theme: fix broken indentation from previous edit
- Admin template fragments (templates/admin/fragments/):
- div-row.html: add field_unwrapped branch to skip sl-div-field wrapper
- image-preview.html: replace show_image nullable check with explicit show_toggle / show_fallback boolean flags (matches editorFilePreview() update)
- Admin CSS (templates/admin/assets/css/new.css):
- Add .sl-div-item-full editor width rules for all active editor containers
- Add CKEditor min-height rule for inline editable regions
Benefits:
- Admin preview sections are independently targetable via CSS class
- Editor widgets in full-width rows no longer clip or overflow
- image-preview fragment logic is now explicit; no nullable-check ambiguity
Technical notes:
- Companion change to editorFilePreview() in core/system.php (show_toggle/show_fallback)
- No template engine changes required; existing Template runtime handles the new flags
The standalone CodeMirror bundle is superseded by the CodeMirror editor driver inside plugins/editors/codemirror/, which is loaded on demand by the Editor class. The old top-level directory was no longer referenced by any active code path after the editor system migration.
Core changes:
- Legacy CodeMirror bundle (plugins/codemirror/):
- Remove 5.x standalone distribution (lib, addon, mode, theme, keymap)
- Active CodeMirror 6.x driver lives in plugins/editors/codemirror/
- No remaining references from core, admin, or module code
Benefits:
- Eliminates dead asset tree from the repository
- Prevents confusion between the legacy standalone and the active driver
Technical notes:
- plugins/editors/codemirror/ and its manifest.json are unaffected
Replaces the hardcoded redaktor/editor integer flag system with the pluggable Editor class. Legacy functions textarea_code(), redaktor(), datetime(), getUserSearch() are removed; textarea() and getAjaxTextarea() now delegate to Editor::getContent(). encode_php() (syntax=2) now renders highlight.js blocks instead of SyntaxHighlighter. Config key 'redaktor' removed; editor config now lives under 'editor.user/admin/code'.
Core changes:
- Runtime bootstrap (core/system.php):
- Move Editor bootstrap before security.php to ensure availability
- Add getEditorKey(), checkHtmlEditor(), getEditorMode() helpers
- Rewrite textarea() to call Editor::getContent() via driver dispatch
- Remove textarea_code(), redaktor(), getUserSearch(), datetime()
- encode_php() syntax=2: emit highlight.js markup, map language aliases
- ad_save(), categorySelectOption(), editorFilePreview(): use $tpl frags
- Admin runtime (core/admin.php, core/classes/editor.php):
- Minor adjustments to editor key resolution and admin context
- Admin modules (admin/modules/*.php):
- editor.php: migrate to Editor::getCode() and Editor::getSelect()
- config.php: remove 'redaktor', update css_f default to highlightjs
- admins.php, newsletter.php: clean up editor field rendering
- Frontend modules (modules/*/admin/index.php, account, forum, rss):
- Migrate textarea_code() calls to Editor::getCode()
- Remove redaktor() dropdown calls; use Editor::getSelect()
- faq, files, help, jokes, links, media, money, news, order, pages, shop, voting
- Config (config/global.php, config/local.php):
- Remove 'redaktor' key from global config
- Update css_f from syntaxhighlighter path to highlightjs/slaed-theme.css
- Update base_fingerprint after asset changes
Benefits:
- Editor selection is now data-driven via manifest.json, not integer flags
- Removes ~150 lines of hardcoded editor branching from system.php
- Single dispatch point; adding a new editor requires only a driver file
Technical notes:
- Old admin[3] integer flags (0-4) are fully retired
- checkHtmlEditor() replaces the (editor==1) trust check for HTML input
- All admin modules continue to function identically from user perspective
Replaces the Flash-era SyntaxHighlighter 2.x with highlight.js 11.11.1 and highlightjs-line-numbers.js 2.9.0. The new stack works without Flash, auto-detects language when not specified, and ships a custom CSS theme that matches the original SyntaxHighlighter Default visual palette.
Core changes:
- Plugin assets (plugins/highlightjs/):
- Add highlight.min.js 11.11.1 (auto-detect, 185 languages bundled)
- Add highlight-line-numbers.min.js 2.9.0 (line number table renderer)
- Add slaed-theme.css — custom theme matching SyntaxHighlighter Default
- White/f8f8f8 alternating rows, gray line numbers, green left border
- Correct selectors: td.hljs-ln-numbers, .hljs-ln-n::before, data-line-number
Benefits:
- No Flash dependency; works in all modern browsers
- Language auto-detection when brush name is unrecognized
- tab-size: 4 applied via CSS for consistent tab rendering
- Single JS bundle replaces per-language shBrush*.js loading
Technical notes:
- encode_php() updated: syntax=2 now emits <pre><code class="language-X">
- Language name mapping: jscript→javascript, vb→vbnet, plain→plaintext
- Scripts injected lazily on first [code] block per page (sname=hljs guard)
Both directories are superseded by the new pluggable editor system and highlight.js integration respectively. Keeping them would create dead asset weight and mislead future contributors about the active stack.
Core changes:
- Legacy editor plugin (plugins/ckeditor/):
- Remove standalone CKEditor 4.x bundle from the repository root
- The CKEditor 4 driver is now bundled inside plugins/editors/ckeditor/
- The old top-level directory was not loaded by any active code path
- Legacy syntax highlighter (plugins/syntaxhighlighter/):
- Remove SyntaxHighlighter 2.1.382 (2010) from the repository
- Replaced by highlight.js 11.x in encode_php() and the CSS pipeline
- No active references remain after the syntax=2 branch was migrated
Benefits:
- Eliminates ~1100 unused files from the repository tree
- Removes Flash-dependent clipboard code (clipboard.swf)
- Reduces confusion about which syntax highlighter is active
Technical notes:
- No backward-compatibility shims required; encode_php() no longer references either plugin
- plugins/editors/ckeditor/ (the active CKEditor 5 driver) is unaffected
Remove the two static <link> tags for the old CodeMirror 2 distribution from all admin layout templates. Asset injection is now handled by Editor::getAssets() which injects driver CSS/JS only when the relevant editor is active on the page. Update base_fingerprint to reflect the current codebase state.
Core changes:
- Admin layouts (templates/*/layouts/admin.html — 4 files):
- Remove: <link rel="stylesheet" href="plugins/codemirror/lib/codemirror.css">
- Remove: <link rel="stylesheet" href="plugins/codemirror/addon/hint/show-hint.css">
- These referenced the old plugins/codemirror/ path (pre-plugin-system)
- The new CodeMirror 6 assets live in plugins/editors/codemirror/assets/
- Config fingerprint (config/local.php):
- Update base_fingerprint to match the current file state after Editor class, plugins, and admin module changes
Benefits:
- Layouts are no longer coupled to a specific editor implementation
- Editor assets are injected on-demand; pages without code editors load faster
Technical notes:
- The old plugins/codemirror/ directory is a separate cleanup task
- Fingerprint change is cosmetic; no runtime effect
Replace getTplCodeEditor() with Editor::getCode() and redaktor()/changeeditor() with Editor::getSelect() across all admin panel modules. Migrate the editor change flow in core/admin.php and admin/index.php to use string plugin keys instead of the legacy numeric redaktor flag.
Core changes:
- Admin entry and core (core/admin.php, admin/index.php):
- changeeditor(): store string plugin key instead of numeric editor value
- Read editor key from conf['editor']['admin'] instead of intval($admin[3])
- Validate key with isValidEditor() before saving to DB
- Config module (admin/modules/config.php):
- Replace single redaktor select with two rows: editor_user and editor_admin via Editor::getSelect() for each role
- Save handler reads editor_user/editor_admin and writes conf['editor'] block
- editor_code key preserved from existing conf
- Code editor call sites (7 files → Editor::getCode()):
- admin/modules/blocks.php: block code preview field; mode → lang: 'php'
- admin/modules/database.php: SQL query field; mode → lang: 'sql'
- admin/modules/editor.php: file editor; mode → lang inferred from extension
- admin/modules/security.php: HTTP monitor field; mode → lang: 'text'
- admin/modules/template.php: template file editor; mode → lang: 'html'
- admin/modules/uploads.php: network code field; mode → lang: 'html'
- modules/sitemap/admin/index.php: sitemap XML field; mode → lang: 'xml'
- Content editor call sites (account admin):
- modules/account/admin/index.php: account editor select via Editor::getSelect()
Benefits:
- Editor::getCode() normalises lang keys (php, sql, html, css, xml, text) replacing the MIME-type mode strings used by old CodeMirror integration
- Editor selection UI is driven by plugin manifests instead of hardcoded options
Technical notes:
- getTplCodeEditor() and redaktor() are now unused; removal planned separately
- 'height' parameter dropped — sizing is now handled per-driver via CSS
- No behavioral changes for end users; rendered widget is identical
Wire the Editor class into the system bootstrap and introduce the conf['editor'] config block that maps roles (user, admin, code) to editor plugin keys.
Core changes:
- System bootstrap (core/system.php):
- Add require_once for core/classes/editor.php before Template and Parser
- Editor is stateless (no instantiation); loaded once at request start
- Global config (config/global.php):
- Add conf['editor'] block with three role keys:
- 'user' => 'plain' — default editor for front-end content forms
- 'admin' => 'plain' — default editor for admin content forms
- 'code' => 'codemirror' — default editor for code/syntax fields
- Replaces the old scalar 'redaktor' key (numeric 0/1 flag)
Benefits:
- Role-based editor selection is now config-driven
- Three independent keys allow different editors for code vs. content
Technical notes:
- Existing 'redaktor' key is preserved for backward compatibility until all callers are migrated (handled in subsequent commit)
- Plugin keys correspond to directory names under plugins/editors/
Introduce a plugin-based editor architecture that replaces the hardcoded getTplCodeEditor() / getTplBbEditor() / redaktor() helpers with a unified Editor class backed by interchangeable driver plugins. Each editor plugin lives in plugins/editors/<name>/ and implements ContentDriver or CodeDriver.
Core changes:
- Editor class (core/classes/editor.php):
- Editor::getContent(array $data): string — render a content (WYSIWYG) widget
- Selects driver by role (admin/user) and optional editor/profile overrides
- Editor::getCode(array $data): string — render a code/syntax editor widget
- Selects driver by conf['editor']['code'] key (default: codemirror)
- Editor::getSelect(string $name, string $value, string $type, string $role): string — render an <select> listing available editor choices for role
- Editor::getAssets(string $context): string — collect CSS/JS assets from active drivers for the current request context
- ContentDriver and CodeDriver interfaces define the driver contract
- Plugin manifests (manifest.json) declare name, roles, formats, and profiles
- Editor plugins (plugins/editors/):
- plain/ — plain textarea (no assets); supports content for both roles
- codemirror/ — CodeMirror 6 bundle for code editing (cm6.bundle.js + cm6.css)
- driver.php implements CodeDriver
- build/entry.js, build.mjs: esbuild pipeline source
- ckeditor/ — CKEditor 5 bundle for rich content editing (ckeditor.bundle.js)
- driver.php implements ContentDriver (admin role, full/simple profiles)
- build/entry.js, build.mjs: esbuild pipeline source
- tinymce/ — TinyMCE 7 self-hosted distribution (tinymce.min.js + plugins/)
- driver.php implements ContentDriver (admin + user roles)
- toastui/ — Toast UI Editor (toastui-editor.all.min.js + css)
- driver.php implements ContentDriver (user role, markdown profile)
Benefits:
- Editor choice is configurable per role (user/admin/code) in conf['editor']
- Adding a new editor requires only a plugin directory + manifest + driver.php
- Asset injection is handled by Editor::getAssets() — no hardcoded <link> in layouts
Technical notes:
- ContentDriver::getWidget() signature: (id, name, value, profile)
- CodeDriver::getWidget() signature: (id, name, value, lang, profile)
- Manifests use JSON; driver.php must define a class named <Name>Driver
- TinyMCE is vendored in full (self-hosted); no CDN dependency