mirror of
https://github.com/mediacms-io/mediacms.git
synced 2026-03-20 11:48:31 -04:00
a
This commit is contained in:
@@ -109,7 +109,8 @@ class plugininfo extends plugin implements plugin_with_buttons, plugin_with_menu
|
||||
* @return array Auto-convert configuration data
|
||||
*/
|
||||
protected static function get_autoconvert_configuration(): array {
|
||||
$baseurl = get_config('tiny_mediacms', 'autoconvert_baseurl');
|
||||
// Read MediaCMS base URL from filter settings (unified)
|
||||
$baseurl = get_config('filter_mediacms', 'mediacmsurl');
|
||||
|
||||
// Helper function to get config with default value of true.
|
||||
$getboolconfig = function($name) {
|
||||
@@ -142,8 +143,8 @@ class plugininfo extends plugin implements plugin_with_buttons, plugin_with_menu
|
||||
protected static function get_lti_configuration(context $context): array {
|
||||
global $COURSE;
|
||||
|
||||
// Get the configured LTI tool ID from plugin settings.
|
||||
$ltitoolid = get_config('tiny_mediacms', 'ltitoolid');
|
||||
// Read LTI tool ID from filter settings (unified)
|
||||
$ltitoolid = get_config('filter_mediacms', 'ltitoolid');
|
||||
|
||||
// Determine the course ID from context.
|
||||
$courseid = 0;
|
||||
|
||||
@@ -159,12 +159,9 @@ $string['libraryselect'] = 'Select';
|
||||
$string['librarypage'] = 'Page {$a->current} of {$a->total}';
|
||||
$string['libraryvideoselected'] = 'Video selected. Configure embed options below.';
|
||||
|
||||
// LTI settings strings.
|
||||
$string['ltitoolid'] = 'LTI Tool';
|
||||
$string['ltitoolid_desc'] = 'Select the External Tool configuration for MediaCMS. This enables the authenticated video library in the editor.';
|
||||
$string['noltitoolsfound'] = 'No LTI tools found';
|
||||
$string['choose'] = 'Choose...';
|
||||
$string['ltitoolid_help'] = 'To find the LTI tool ID, go to Site administration > Plugins > Activity modules > External tool > Manage tools. The ID is shown in the URL when editing a tool (e.g., id=2).';
|
||||
// Core settings (configured in filter plugin).
|
||||
$string['coresettingsheading'] = 'Core MediaCMS Settings';
|
||||
$string['coresettingsheading_desc'] = '<strong>Note:</strong> MediaCMS URL and LTI Tool configuration are managed in the filter plugin. Go to: <a href="../filter/manage.php">Site Administration > Plugins > Filters > Manage filters</a>, then click "Settings" next to MediaCMS.';
|
||||
|
||||
// Iframe library from LTI strings.
|
||||
$string['iframelibraryloading'] = 'Loading MediaCMS video library...';
|
||||
|
||||
@@ -25,42 +25,15 @@
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
if ($ADMIN->fulltree) {
|
||||
global $DB;
|
||||
// Note: Core MediaCMS settings (URL, LTI Tool) are configured in the filter plugin
|
||||
// Go to: Site Administration > Plugins > Filters > MediaCMS
|
||||
$settings->add(new admin_setting_heading(
|
||||
'tiny_mediacms/coresettingsheading',
|
||||
new lang_string('coresettingsheading', 'tiny_mediacms'),
|
||||
new lang_string('coresettingsheading_desc', 'tiny_mediacms')
|
||||
));
|
||||
|
||||
// LTI Tool ID setting (Dropdown).
|
||||
$ltioptions = [0 => get_string('noltitoolsfound', 'tiny_mediacms')];
|
||||
try {
|
||||
$tools = $DB->get_records('lti_types', null, 'name ASC', 'id, name, baseurl');
|
||||
if (!empty($tools)) {
|
||||
$ltioptions = [0 => get_string('choose', 'tiny_mediacms')];
|
||||
foreach ($tools as $tool) {
|
||||
$ltioptions[$tool->id] = $tool->name . ' (' . $tool->baseurl . ')';
|
||||
}
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
// Database might not be ready during install
|
||||
}
|
||||
|
||||
$setting = new admin_setting_configselect(
|
||||
'tiny_mediacms/ltitoolid',
|
||||
new lang_string('ltitoolid', 'tiny_mediacms'),
|
||||
new lang_string('ltitoolid_desc', 'tiny_mediacms'),
|
||||
0,
|
||||
$ltioptions
|
||||
);
|
||||
$settings->add($setting);
|
||||
|
||||
// Auto-convert is enabled by default in plugininfo.php (data.autoConvertEnabled = true).
|
||||
|
||||
// MediaCMS base URL for auto-convert.
|
||||
$setting = new admin_setting_configtext(
|
||||
'tiny_mediacms/autoconvert_baseurl',
|
||||
new lang_string('autoconvert_baseurl', 'tiny_mediacms'),
|
||||
new lang_string('autoconvert_baseurl_desc', 'tiny_mediacms'),
|
||||
'https://lti.mediacms.io', // Default matching filter
|
||||
PARAM_URL
|
||||
);
|
||||
$settings->add($setting);
|
||||
// Editor-specific settings: Auto-convert default options
|
||||
|
||||
// Auto-convert embed options.
|
||||
$setting = new admin_setting_configcheckbox(
|
||||
|
||||
@@ -24,7 +24,9 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$plugin->version = 2026020200; // Updated 2026-02-02
|
||||
$plugin->requires = 2024100100;
|
||||
$plugin->version = 2026021200; // 2026-02-12 - Unified settings release
|
||||
$plugin->requires = 2024100700; // Requires Moodle 4.5+
|
||||
$plugin->component = 'tiny_mediacms';
|
||||
$plugin->dependencies = ['filter_mediacms' => 2026020100]; // Keep dependency on our filter
|
||||
$plugin->maturity = MATURITY_STABLE;
|
||||
$plugin->release = 'v1.0.0';
|
||||
$plugin->dependencies = ['filter_mediacms' => 2026021200]; // Requires filter plugin for shared settings
|
||||
|
||||
Reference in New Issue
Block a user