diff --git a/config-dist.php b/config-dist.php index d57651a5a..c0cfd089b 100644 --- a/config-dist.php +++ b/config-dist.php @@ -106,14 +106,12 @@ // recordings from a different activity even from a different course. // // When the value is set to 1 (checked) the bigbluebuttonbn rooms or -// activities will have the 'import recordings' capability enabled by -// default. -$BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_importrecordings_default = 0; +// activities will have the 'import recordings' capability enabled. +$BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_importrecordings_enabled = 0; // When the value is set to 1 (checked) the import recordings capability -// can be enabled/disabled by the user creating or editing the room or -// activity. -$BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_importrecordings_editable = 0; +// can import recordings from deleted activities. +$BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_importrecordings_from_deleted_activities_enabled = 0; //========================================================================= diff --git a/lang/en/bigbluebuttonbn.php b/lang/en/bigbluebuttonbn.php index 4c2a32ffd..11de10f7d 100644 --- a/lang/en/bigbluebuttonbn.php +++ b/lang/en/bigbluebuttonbn.php @@ -47,6 +47,8 @@ $string['config_feature_importrecordings_description'] = 'These settings are feature specific'; $string['config_feature_importrecordings_enabled'] = 'Import recordings enabled'; $string['config_feature_importrecordings_enabled_description'] = 'When this and the recording feature are enabled, it is possible to import recordings from different courses into an activity.'; +$string['config_feature_importrecordings_from_deleted_activities_enabled'] = 'Import recordings from deleted activities enabled'; +$string['config_feature_importrecordings_from_deleted_activities_enabled_description'] = 'When this and the import recording feature are enabled, it is possible to import recordings from activities that are no longer in the course.'; $string['config_feature_waitformoderator'] = 'Configuration for "Wait for moderator" feature'; $string['config_feature_waitformoderator_description'] = 'These settings are feature specific'; diff --git a/locallib.php b/locallib.php index 08dd6d91f..d4098017d 100644 --- a/locallib.php +++ b/locallib.php @@ -1315,6 +1315,11 @@ function bigbluebuttonbn_get_cfg_importrecordings_enabled() { return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_importrecordings_enabled)? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_importrecordings_enabled: (isset($CFG->bigbluebuttonbn_importrecordings_enabled)? $CFG->bigbluebuttonbn_importrecordings_enabled: false)); } +function bigbluebuttonbn_get_cfg_importrecordings_from_deleted_activities_enabled() { + global $BIGBLUEBUTTONBN_CFG, $CFG; + return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_importrecordings_from_deleted_activities_enabled)? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_importrecordings_from_deleted_activities_enabled: (isset($CFG->bigbluebuttonbn_importrecordings_from_deleted_activities_enabled)? $CFG->bigbluebuttonbn_importrecordings_from_deleted_activities_enabled: false)); +} + function bigbluebuttonbn_get_cfg_waitformoderator_default() { global $BIGBLUEBUTTONBN_CFG, $CFG; return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_waitformoderator_default)? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_waitformoderator_default: (isset($CFG->bigbluebuttonbn_waitformoderator_default)? $CFG->bigbluebuttonbn_waitformoderator_default: false)); @@ -1499,6 +1504,12 @@ function bigbluebuttonbn_getRecordingsArrayByCourse($courseID, $URL, $SALT) { $meetingID = ''; if ( is_numeric($courseID) ) { $results = bigbluebuttonbn_getRecordedMeetings($courseID); + + if( bigbluebuttonbn_get_cfg_importrecordings_from_deleted_activities_enabled() ) { + $results_deleted = bigbluebuttonbn_getRecordedMeetingsDeleted($courseID); + $results = array_merge($results, $results_deleted); + } + if( $results ) { //Eliminates duplicates $mIDs = array(); diff --git a/settings.php b/settings.php index 5eec10b72..a33e5970c 100644 --- a/settings.php +++ b/settings.php @@ -91,16 +91,26 @@ } //// Configuration for 'import recordings' feature - if( !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_importrecordings_enabled) ) { + if( !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_importrecordings_enabled) || + !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_importrecordings_from_deleted_activities_enabled) ) { $settings->add( new admin_setting_heading('bigbluebuttonbn_importrecordings', get_string('config_feature_importrecordings', 'bigbluebuttonbn'), get_string('config_feature_importrecordings_description', 'bigbluebuttonbn'))); - // default value for 'import recordings' feature - $settings->add(new admin_setting_configcheckbox('bigbluebuttonbn_importrecordings_enabled', - get_string('config_feature_importrecordings_enabled', 'bigbluebuttonbn'), - get_string('config_feature_importrecordings_enabled_description', 'bigbluebuttonbn'), - 0)); + if( !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_importrecordings_enabled) ) { + // default value for 'import recordings' feature + $settings->add(new admin_setting_configcheckbox('bigbluebuttonbn_importrecordings_enabled', + get_string('config_feature_importrecordings_enabled', 'bigbluebuttonbn'), + get_string('config_feature_importrecordings_enabled_description', 'bigbluebuttonbn'), + 0)); + } + if( !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_importrecordings_from_deleted_activities_enabled) ) { + // consider deleted activities for 'import recordings' feature + $settings->add(new admin_setting_configcheckbox('bigbluebuttonbn_importrecordings_from_deleted_activities_enabled', + get_string('config_feature_importrecordings_from_deleted_activities_enabled', 'bigbluebuttonbn'), + get_string('config_feature_importrecordings_from_deleted_activities_enabled_description', 'bigbluebuttonbn'), + 0)); + } } //// Configuration for wait for moderator feature diff --git a/version.php b/version.php index 8d8924f0a..d5fbb1a70 100644 --- a/version.php +++ b/version.php @@ -11,7 +11,7 @@ defined('MOODLE_INTERNAL') || die; -$plugin->version = 2016051902; +$plugin->version = 2016051903; $plugin->requires = 2013111800; $plugin->cron = 0; $plugin->component = 'mod_bigbluebuttonbn';