Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGED_FILES.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@ The unused bundled `plugins/help/js/i18n/keynav/ar.js` and `fa.js` files are exc
## New integration files

- `model/library/TinyMCEContentSanitizer.php`
- `model/library/TinyMCEMarkdownMigrator.php`
- `model/module/TinyMCEContentTable.php`
- `route/administrator/tinymce/contents.php`
- `route/administrator/tinymce/migration.php`
- `asset/struct/tinymce/pas/content.css`
- `asset/struct/tinymce/pas/editor.css`
- `asset/struct/tinymce/pas/fonts/B Nazanin.ttf`
Expand All @@ -46,5 +48,6 @@ The unused bundled `plugins/help/js/i18n/keynav/ar.js` and `fa.js` files are exc
- Excel workbook inspection and visual rendering
- Font internal-family verification
- Local HTTP checks for TinyMCE, CSS, and font assets
- Legacy Markdown dry-run, batched migration, and guarded rollback checks on the local database copy

The final authenticated browser test must be repeated after installation on the target website because this delivery intentionally contains no login bypass or credentials.
12 changes: 11 additions & 1 deletion INSTALL-FA.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,15 @@
4. کش PHP/OPcache و کش مرورگر را پاک کنید.
5. مسیر `/administrator/content/contents` را باز کنید و ایجاد، ویرایش، جست‌وجو و ذخیرهٔ یک محتوای آزمایشی را بررسی کنید.

برای حذف ماژول، فقط فایل‌های فهرست‌شده در `CHANGED_FILES.md` را از Sequence سایت بردارید. فایل‌های محتوای ذخیره‌شده در پایگاه داده حذف نمی‌شوند.
## تبدیل پست‌های قدیمی

1. ابتدا از دیتابیس اصلی بک‌آپ کامل بگیرید و آن را روی محیط لوکال بازیابی کنید.
2. با حساب مدیر مسیر `/administrator/tinymce/migration` را باز کنید.
3. تعداد رکوردهای قابل مهاجرت و نمونه‌های Dry Run را بررسی کنید. در این مرحله دیتابیس تغییر نمی‌کند.
4. برای اجرای هر گروه، عبارت `MIGRATE` را وارد کنید. گروه‌ها را تا صفر شدن مقدار «قابل مهاجرت» ادامه دهید.
5. چند پست فارسی و انگلیسی، تصویر، لینک، دکمه، فهرست و جدول را در سایت و داخل ویرایشگر بررسی کنید.
6. اگر نتیجه درست بود، همین روند را فقط پس از تهیه بک‌آپ تازه روی دیتابیس اصلی اجرا کنید.

ماژول پیش از هر تغییر، محتوای اصلی و زمان ویرایش را در جدول پشتیبان اختصاصی ذخیره می‌کند. برای بازگردانی، عبارت `ROLLBACK` را وارد کنید. پستی که پس از مهاجرت ویرایش شده باشد به‌صورت خودکار بازنویسی نمی‌شود.

برای حذف ماژول، فقط فایل‌های فهرست‌شده در `CHANGED_FILES.md` را از Sequence سایت بردارید. فایل‌های محتوای ذخیره‌شده در پایگاه داده حذف نمی‌شوند.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ This package installs a self-contained rich content editor on an AseqBase websit
- Find and replace inside the editor
- Full-content administration search with Persian/Arabic character normalization
- Server-side HTML sanitization before content is stored
- Dry-run Markdown migration with batched conversion, database backup, and guarded rollback
- English source strings with AseqBase translation support

## Requirements
Expand All @@ -36,6 +37,14 @@ Import `translations/tinymce-en-fa.csv` through the AseqBase translation importe

After installation, open `/administrator/content/contents`. The initializer registers the module route ahead of the generic administrator route only for this URL.

## Migrating legacy Markdown content

Open `/administrator/tinymce/migration` as an administrator. Review the dry-run totals and samples before applying any changes. The migration converts only Markdown or plain-text records; existing HTML, mixed HTML/Markdown, unsupported custom directives, and unsafe legacy button URLs are skipped.

Apply the migration in batches. Before each content update, the original content and update time are stored in the module-owned `TinyMCE_ContentBackup` table (with the website database prefix). Rollback restores only records whose migrated HTML has not been edited afterward.

Always run the migration against a local copy of the production database first. Keep the original SQL backup until the migrated content has been reviewed on the target website.

## Security and licensing

The package bundles TinyMCE Community 8.9.0 under GPL-2.0-or-later. This integration package is licensed under GPL-3.0-only. Submitted content is sanitized on the server; unsafe elements, event handlers, URL schemes, and styles are removed.
Expand Down
7 changes: 6 additions & 1 deletion initialize/tinymce.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,10 @@
'Access' => \_::$User->AdminAccess,
'Image' => 'edit'
];
\_::$Front->AdminMenus['Administrator-System']['Items'][] = [
'Name' => 'Markdown Content Migration',
'Path' => '/administrator/tinymce/migration',
'Access' => \_::$User->AdminAccess,
'Image' => 'exchange'
];
}

Loading