================================================================================
MediaCMS Moodle Plugin Suite v1.0.0
Installation Guide
================================================================================

Requirements
------------
- Moodle 4.5 or later
- MediaCMS instance
- MediaCMS set as External Tool


The suite consists of two plugins that are distributed as separate ZIP files:

- filter_mediacms-v1.0.0.zip  (Text filter - install FIRST)
- tiny_mediacms-v1.0.0.zip    (TinyMCE editor button - requires the filter)

tiny_mediacms declares a dependency on filter_mediacms, so Moodle will not
let you install the editor plugin without the filter being present.


Installation - Option A: Upload through Moodle (recommended)
-------------------------------------------------------------

1. Log in as Administrator
2. Go to: Site Administration → Plugins → Install plugins
3. Upload filter_mediacms-v1.0.0.zip and complete the installation
4. Upload tiny_mediacms-v1.0.0.zip and complete the installation
5. Set the MediaCMS tool under the LTI Tool


Installation - Option B: Extract manually
-----------------------------------------

1. Extract the zip files to the Moodle root public directory:

   cd /var/www/moodle/public
   unzip filter_mediacms-v1.0.0.zip -d filter/
   unzip tiny_mediacms-v1.0.0.zip -d lib/editor/tiny/plugins/

   This will place files in:
   - filter/mediacms/
   - lib/editor/tiny/plugins/mediacms/

2. Set permissions
   chown -R www-data:www-data filter/mediacms
   chown -R www-data:www-data lib/editor/tiny/plugins/mediacms

3. Install through Moodle
   - Log in as Administrator
   - Go to: Site Administration → Notifications
   - Click "Upgrade Moodle database now"
   - Both plugins will be installed automatically
   - Set the MediaCMS tool under the LTI Tool

After installation (both options)
---------------------------------

Make sure the Filter is enabled
   - As Administrator, visit Plugins, 'Manage Filters', find MediaCMS filter and enable it.
   Then place it at the top of the filter. This is important, otherwise embeds won't load.


What to expect
-------

1. Create a test course
2. Add a page or label
3. Click MediaCMS button in TinyMCE editor
4. Try inserting from video library or pasting a URL

SUPPORT
-------
Issues: https://github.com/mediacms-io/mediacms/issues
Docs: https://docs.mediacms.io

================================================================================
