Skip to content

Commit

Permalink
add setting for global download default
Browse files Browse the repository at this point in the history
  • Loading branch information
Tamara Gunkel committed Nov 17, 2021
1 parent 95a0727 commit 1faf5d8
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 6 deletions.
3 changes: 3 additions & 0 deletions lang/en/opencast.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,11 @@
$string['privacy:metadata'] = 'Opencast Activities are just a way to show Opencast videos inside moodle. They do not store any user related data.';

$string['settings:api-channel'] = 'Opencast Channel';
$string['settings:download_header'] = 'Student Download Configuration';
$string['settings:download-channel'] = 'Opencast Download Channel';
$string['settings:download-channel_desc'] = 'Opencast publication channel from which the videos are served when downloading them.';
$string['settings:download-default'] = 'Allow download by default';
$string['settings:download-default_desc'] = 'If activated, the checkbox for allowing downloads in activity forms is checked by default.';
$string['settings:configurl'] = 'URL to Paella config.json';
$string['settings:configurl_desc'] = 'URL of the config.json used by Paella Player. Can either be a absolute URL or a URL relative to the wwwroot.';
$string['settings:global_download'] = 'Force student download';
Expand Down
2 changes: 1 addition & 1 deletion mod_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function definition() {
} else {
$mform->addElement('advcheckbox', 'allowdownload', get_string('allowdownload', 'mod_opencast'));
$mform->setType('allowdownload', PARAM_INT);
$mform->setDefault('allowdownload', '0');
$mform->setDefault('allowdownload', get_config('mod_opencast', 'download_default_' . $ocinstanceid));
}

$mform->addElement('hidden', 'ocinstanceid');
Expand Down
16 changes: 13 additions & 3 deletions settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,24 @@
new lang_string('settings:api-channel', 'mod_opencast'), '', 'api',
PARAM_ALPHANUMEXT));


$settings->add(new admin_setting_configtext('mod_opencast/configurl_' . $ocinstance->id,
new lang_string('settings:configurl', 'mod_opencast'),
new lang_string('settings:configurl_desc', 'mod_opencast'), '/mod/opencast/config.json'));

$settings->add(
new admin_setting_heading('mod_opencast/download_' . $ocinstance->id,
$ocinstance->name . ': ' . get_string('settings:download_header', 'mod_opencast'),
''));

$settings->add(new admin_setting_configtext('mod_opencast/download_channel_' . $ocinstance->id,
new lang_string('settings:download-channel', 'mod_opencast'),
new lang_string('settings:download-channel_desc', 'mod_opencast'), 'api',
PARAM_ALPHANUMEXT));

$settings->add(new admin_setting_configtext('mod_opencast/configurl_' . $ocinstance->id,
new lang_string('settings:configurl', 'mod_opencast'),
new lang_string('settings:configurl_desc', 'mod_opencast'), '/mod/opencast/config.json'));
$settings->add(new admin_setting_configcheckbox('mod_opencast/download_default_' . $ocinstance->id,
new lang_string('settings:download-default', 'mod_opencast'),
new lang_string('settings:download-default_desc', 'mod_opencast'), 0));

$settings->add(new admin_setting_configcheckbox('mod_opencast/global_download_' . $ocinstance->id,
new lang_string('settings:global_download', 'mod_opencast'),
Expand Down
4 changes: 2 additions & 2 deletions version.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
defined('MOODLE_INTERNAL') || die();

$plugin->component = 'mod_opencast';
$plugin->release = 'v3.11-r2';
$plugin->version = 2021111600;
$plugin->release = 'v3.11-r3';
$plugin->version = 2021111700;
$plugin->requires = 2019111800;
$plugin->maturity = MATURITY_STABLE;
$plugin->dependencies = array(
Expand Down

0 comments on commit 1faf5d8

Please sign in to comment.