Skip to content

Commit

Permalink
changes according to requests
Browse files Browse the repository at this point in the history
  • Loading branch information
ferishili committed Mar 12, 2024
1 parent e1748de commit c54935d
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 15 deletions.
7 changes: 3 additions & 4 deletions batchupload.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
use block_opencast\local\upload_helper;
use core\output\notification;
use tool_opencast\local\settings_api;
use moodle_exception;

global $PAGE, $OUTPUT, $CFG, $USER, $SITE, $DB;

Expand Down Expand Up @@ -87,8 +86,8 @@
$records = $DB->get_records('tool_opencast_series', ['series' => $series, 'ocinstanceid' => $ocinstanceid]);
$haspermission = false;
foreach ($records as $record) {
$cc = context_course::instance($record->courseid, IGNORE_MISSING);
if ($cc && has_capability('block/opencast:addvideo', $cc)) {
$coursecontext = context_course::instance($record->courseid, IGNORE_MISSING);
if ($coursecontext && has_capability('block/opencast:addvideo', $coursecontext)) {
$haspermission = true;
break;
}
Expand Down Expand Up @@ -199,7 +198,7 @@
$id = $field->name;
if (property_exists($data, $field->name) && $data->$id) {
if ($field->name == 'subjects') {
!is_array($data->$id) ? $data->$id = [$data->$id] : $data->$id = $data->$id;
$data->$id = !is_array($data->$id) ? [$data->$id] : $data->$id;
}
$obj = [
'id' => $id,
Expand Down
4 changes: 1 addition & 3 deletions classes/local/batchupload_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,8 @@
use coding_exception;
use core\notification;
use html_writer;
use local_chunkupload\chunkupload_form_element;
use moodle_url;
use moodleform;
use MoodleQuickForm;

defined('MOODLE_INTERNAL') || die();

Expand All @@ -55,7 +53,7 @@ class batchupload_form extends moodleform {
* Form definition.
*/
public function definition() {
global $CFG, $DB, $PAGE , $OUTPUT;
global $DB, $PAGE;
// Get the renderer to use its methods.
$renderer = $PAGE->get_renderer('block_opencast');
$ocinstanceid = $this->_customdata['ocinstanceid'];
Expand Down
10 changes: 5 additions & 5 deletions lang/en/block_opencast.php
Original file line number Diff line number Diff line change
Expand Up @@ -903,17 +903,17 @@
$string['batchupload'] = 'Add videos (batch)';
$string['batchupload_errornotenabled'] = 'Unfortunately the batch video upload feature is unavailable for this Opencast instance, please try to contanct your system administrator.';
$string['batchupload_metadata_header'] = 'Batch Metadata';
$string['batchupload_metadata_desc'] = 'By uploading batch of videos to Opencast at once, the following metadata will be set for each video.';
$string['batchupload_metadata_desc'] = 'By uploading a batch of videos to Opencast at once, the following metadata will be set for each video.';
$string['batchupload_visibility_header'] = 'Batch Visibility';
$string['batchupload_visibility_desc'] = 'The batch visibility setting will be applied for each uploaded video in the batch.';
$string['heading_batchable'] = 'Batchable';
$string['descriptionmdbatchable'] = 'Batchable';
$string['descriptionmdbatchable_help'] = 'When enabled, the metadata field will be provide for batch videos upload.';
$string['descriptionmdbatchable_help'] = 'When enabled, the metadata field can be set for batch video upload.';
$string['batchupload_form_header'] = 'Batch Upload Files';
$string['batchuploadexplanation'] = 'In this section you are able to Upload multiple files at once. <br /> NOTE: Please keep in mind that the batch video upload is only available for presenter flavors.';
$string['batchuploadexplanation'] = 'In this section you are able to upload multiple files at once. <br /> NOTE: Please keep in mind that the batch video upload is only available for presenter flavors.';
$string['batchupload_filemanager_presenter_title'] = 'Presenter videos';
$string['batchupload_emptyvideosuploaderror'] = 'You must upload at least one presenter video file.';
$string['batchupload_jobssaved'] = 'Batch of {$a} Video(s) successfully uploaded. <br> The videos are queued for transffering to Opencast, therefore, you do not need to wait on this page for them to finish.';
$string['batchupload_errorsaveuploadjobs'] = 'There were error uploading {$a->count} out of {$a->total} video(s).';
$string['batchupload_jobssaved'] = 'Batch of {$a} Video(s) successfully uploaded. <br> The videos are queued for transferring to Opencast. Therefore, you do not need to wait on this page for them to finish.';
$string['batchupload_errorsaveuploadjobs'] = 'There were errors uploading {$a->count} out of {$a->total} video(s).';
// Deprecated since version 2021062300.
$string['video_already_uploaded'] = 'Video already uploaded';
2 changes: 1 addition & 1 deletion settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@
$uploadtimeouturl = new moodle_url('/admin/settings.php?section=block_opencast_sharedsettings');
$uploadtimeoutlink = html_writer::link($uploadtimeouturl,
get_string('uploadtimeout', 'block_opencast'), ['target' => '_blank']);
$toolopencastinstanceurl = new moodle_url('admin/settings.php?section=tool_opencast_configuration_' . $instance->id);
$toolopencastinstanceurl = new moodle_url('/admin/settings.php?section=tool_opencast_configuration_' . $instance->id);
$toolopencastinstancelink = html_writer::link($toolopencastinstanceurl,
get_string('configuration_instance', 'tool_opencast', $instance->name), ['target' => '_blank']);
$stringobj = new \stdClass();
Expand Down
4 changes: 2 additions & 2 deletions version.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
defined('MOODLE_INTERNAL') || die();

$plugin->component = 'block_opencast';
$plugin->release = 'v4.3-r1-i-350';
$plugin->version = 2023112202;
$plugin->release = 'v4.3-r1';
$plugin->version = 2023112200;
$plugin->requires = 2022112800; // Requires Moodle 4.1+.
$plugin->maturity = MATURITY_STABLE;
$plugin->dependencies = [
Expand Down

0 comments on commit c54935d

Please sign in to comment.