-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #349 from Opencast-Moodle/update4.3
Using moodle bautifier to fix at least the most obvious problem
- Loading branch information
Showing
147 changed files
with
3,779 additions
and
3,259 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,22 +21,29 @@ | |
* @copyright 2020 Alexander Bias, Ulm University <[email protected]>, 2021 Justus Dieckmann WWU | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
|
||
use block_opencast\local\activitymodulemanager; | ||
use block_opencast\local\addactivity_form; | ||
use block_opencast\local\apibridge; | ||
use core\output\notification; | ||
use tool_opencast\local\settings_api; | ||
|
||
require_once('../../config.php'); | ||
|
||
global $PAGE, $OUTPUT, $CFG, $USER; | ||
|
||
$courseid = required_param('courseid', PARAM_INT); | ||
$ocinstanceid = optional_param('ocinstanceid', \tool_opencast\local\settings_api::get_default_ocinstance()->id, PARAM_INT); | ||
$ocinstanceid = optional_param('ocinstanceid', settings_api::get_default_ocinstance()->id, PARAM_INT); | ||
$seriesid = required_param('seriesid', PARAM_ALPHANUMEXT); | ||
$submitbutton2 = optional_param('submitbutton2', '', PARAM_ALPHA); | ||
|
||
$baseurl = new moodle_url('/blocks/opencast/addactivity.php', | ||
array('courseid' => $courseid, 'ocinstanceid' => $ocinstanceid, 'seriesid' => $seriesid)); | ||
['courseid' => $courseid, 'ocinstanceid' => $ocinstanceid, 'seriesid' => $seriesid]); | ||
$PAGE->set_url($baseurl); | ||
|
||
$redirecturloverview = new moodle_url('/blocks/opencast/index.php', | ||
array('courseid' => $courseid, 'ocinstanceid' => $ocinstanceid)); | ||
$redirecturlcourse = new moodle_url('/course/view.php', array('id' => $courseid)); | ||
['courseid' => $courseid, 'ocinstanceid' => $ocinstanceid]); | ||
$redirecturlcourse = new moodle_url('/course/view.php', ['id' => $courseid]); | ||
|
||
require_login($courseid, false); | ||
|
||
|
@@ -47,7 +54,7 @@ | |
$PAGE->navbar->add(get_string('addactivity_addbuttontitle', 'block_opencast'), $baseurl); | ||
|
||
// Check if the Opencast Activity module feature is enabled and working. | ||
if (\block_opencast\local\activitymodulemanager::is_enabled_and_working_for_series($ocinstanceid) == false) { | ||
if (activitymodulemanager::is_enabled_and_working_for_series($ocinstanceid) == false) { | ||
throw new moodle_exception('add opencast activity series module not enabled or working', | ||
'block_opencast', $redirecturloverview); | ||
} | ||
|
@@ -57,18 +64,18 @@ | |
require_capability('block/opencast:addactivity', $coursecontext); | ||
|
||
// Existing Opencast Activity module check. | ||
$moduleid = \block_opencast\local\activitymodulemanager::get_module_for_series($ocinstanceid, $courseid, $seriesid); | ||
$moduleid = activitymodulemanager::get_module_for_series($ocinstanceid, $courseid, $seriesid); | ||
if ($moduleid) { | ||
// Redirect to Opencast videos overview page. | ||
redirect($redirecturloverview, | ||
get_string('addactivity_moduleexists', 'block_opencast'), null, | ||
\core\output\notification::NOTIFY_WARNING); | ||
notification::NOTIFY_WARNING); | ||
} | ||
|
||
$addactivityform = new \block_opencast\local\addactivity_form(null, | ||
array('courseid' => $courseid, 'ocinstanceid' => $ocinstanceid, 'seriesid' => $seriesid)); | ||
$addactivityform = new addactivity_form(null, | ||
['courseid' => $courseid, 'ocinstanceid' => $ocinstanceid, 'seriesid' => $seriesid]); | ||
|
||
$apibridge = \block_opencast\local\apibridge::get_instance($ocinstanceid); | ||
$apibridge = apibridge::get_instance($ocinstanceid); | ||
|
||
if ($addactivityform->is_cancelled()) { | ||
redirect($redirecturloverview); | ||
|
@@ -118,11 +125,11 @@ | |
redirect($redirecturloverview, | ||
get_string('series_not_found', 'block_opencast', $data->seriesid), | ||
null, | ||
\core\output\notification::NOTIFY_ERROR); | ||
notification::NOTIFY_ERROR); | ||
} | ||
|
||
// Create the module. | ||
$result = \block_opencast\local\activitymodulemanager::create_module_for_series($courseid, $ocinstanceid, | ||
$result = activitymodulemanager::create_module_for_series($courseid, $ocinstanceid, | ||
$data->title, $seriesid, $sectionid, $introtext, $introformat, $availability, $data->allowdownload); | ||
|
||
// Check if the module was created successfully. | ||
|
@@ -133,15 +140,15 @@ | |
redirect($redirecturlcourse, | ||
get_string('addactivity_modulecreated', 'block_opencast', $data->title), | ||
null, | ||
\core\output\notification::NOTIFY_SUCCESS); | ||
notification::NOTIFY_SUCCESS); | ||
|
||
// Form was submitted with first submit button. | ||
} else { | ||
// Redirect to Opencast videos overview page. | ||
redirect($redirecturloverview, | ||
get_string('addactivity_modulecreated', 'block_opencast', $data->title), | ||
null, | ||
\core\output\notification::NOTIFY_SUCCESS); | ||
notification::NOTIFY_SUCCESS); | ||
} | ||
|
||
// Otherwise. | ||
|
@@ -150,7 +157,7 @@ | |
redirect($redirecturloverview, | ||
get_string('addactivity_modulenotcreated', 'block_opencast', $data->title), | ||
null, | ||
\core\output\notification::NOTIFY_ERROR); | ||
notification::NOTIFY_ERROR); | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,22 +21,28 @@ | |
* @copyright 2020 Alexander Bias, Ulm University <[email protected]>, 2021 Justus Dieckmann WWU | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
|
||
use block_opencast\local\activitymodulemanager; | ||
use block_opencast\local\addactivityepisode_form; | ||
use core\output\notification; | ||
use tool_opencast\local\settings_api; | ||
|
||
require_once('../../config.php'); | ||
|
||
global $PAGE, $OUTPUT, $CFG; | ||
|
||
$episodeuuid = required_param('episodeuuid', PARAM_ALPHANUMEXT); | ||
$courseid = required_param('courseid', PARAM_INT); | ||
$submitbutton2 = optional_param('submitbutton2', '', PARAM_ALPHA); | ||
$ocinstanceid = optional_param('ocinstanceid', \tool_opencast\local\settings_api::get_default_ocinstance()->id, PARAM_INT); | ||
$ocinstanceid = optional_param('ocinstanceid', settings_api::get_default_ocinstance()->id, PARAM_INT); | ||
|
||
$baseurl = new moodle_url('/blocks/opencast/addactivityepisode.php', | ||
array('episodeuuid' => $episodeuuid, 'courseid' => $courseid, 'ocinstanceid' => $ocinstanceid)); | ||
['episodeuuid' => $episodeuuid, 'courseid' => $courseid, 'ocinstanceid' => $ocinstanceid]); | ||
$PAGE->set_url($baseurl); | ||
|
||
$redirecturloverview = new moodle_url('/blocks/opencast/index.php', | ||
array('courseid' => $courseid, 'ocinstanceid' => $ocinstanceid)); | ||
$redirecturlcourse = new moodle_url('/course/view.php', array('id' => $courseid)); | ||
['courseid' => $courseid, 'ocinstanceid' => $ocinstanceid]); | ||
$redirecturlcourse = new moodle_url('/course/view.php', ['id' => $courseid]); | ||
|
||
require_login($courseid, false); | ||
|
||
|
@@ -47,7 +53,7 @@ | |
$PAGE->navbar->add(get_string('addactivityepisode_addicontitle', 'block_opencast'), $baseurl); | ||
|
||
// Check if the Opencast Activity module feature is enabled and working. | ||
if (\block_opencast\local\activitymodulemanager::is_enabled_and_working_for_episodes($ocinstanceid) == false) { | ||
if (activitymodulemanager::is_enabled_and_working_for_episodes($ocinstanceid) == false) { | ||
throw new moodle_exception('add opencast activity episode module not enabled or working', | ||
'block_opencast', $redirecturloverview); | ||
} | ||
|
@@ -57,15 +63,15 @@ | |
require_capability('block/opencast:addactivityepisode', $coursecontext); | ||
|
||
// Existing Opencast Activity module check. | ||
$moduleid = \block_opencast\local\activitymodulemanager::get_module_for_episode($courseid, $episodeuuid, $ocinstanceid); | ||
$moduleid = activitymodulemanager::get_module_for_episode($courseid, $episodeuuid, $ocinstanceid); | ||
if ($moduleid) { | ||
// Redirect to Opencast videos overview page. | ||
redirect($redirecturloverview, | ||
get_string('addactivityepisode_moduleexists', 'block_opencast'), null, \core\output\notification::NOTIFY_WARNING); | ||
get_string('addactivityepisode_moduleexists', 'block_opencast'), null, notification::NOTIFY_WARNING); | ||
} | ||
|
||
$addactivityform = new \block_opencast\local\addactivityepisode_form(null, | ||
array('episodeuuid' => $episodeuuid, 'courseid' => $courseid, 'ocinstanceid' => $ocinstanceid)); | ||
$addactivityform = new addactivityepisode_form(null, | ||
['episodeuuid' => $episodeuuid, 'courseid' => $courseid, 'ocinstanceid' => $ocinstanceid]); | ||
|
||
if ($addactivityform->is_cancelled()) { | ||
redirect($redirecturloverview); | ||
|
@@ -110,7 +116,7 @@ | |
} | ||
|
||
// Create the module. | ||
$result = \block_opencast\local\activitymodulemanager::create_module_for_episode($courseid, $ocinstanceid, | ||
$result = activitymodulemanager::create_module_for_episode($courseid, $ocinstanceid, | ||
$data->title, $episodeuuid, $sectionid, $introtext, $introformat, $availability, $data->allowdownload); | ||
|
||
// Check if the module was created successfully. | ||
|
@@ -121,15 +127,15 @@ | |
redirect($redirecturlcourse, | ||
get_string('addactivityepisode_modulecreated', 'block_opencast', $data->title), | ||
null, | ||
\core\output\notification::NOTIFY_SUCCESS); | ||
notification::NOTIFY_SUCCESS); | ||
|
||
// Form was submitted with first submit button. | ||
} else { | ||
// Redirect to Opencast videos overview page. | ||
redirect($redirecturloverview, | ||
get_string('addactivityepisode_modulecreated', 'block_opencast', $data->title), | ||
null, | ||
\core\output\notification::NOTIFY_SUCCESS); | ||
notification::NOTIFY_SUCCESS); | ||
} | ||
|
||
// Otherwise. | ||
|
@@ -138,7 +144,7 @@ | |
redirect($redirecturloverview, | ||
get_string('addactivityepisode_modulenotcreated', 'block_opencast', $data->title), | ||
null, | ||
\core\output\notification::NOTIFY_ERROR); | ||
notification::NOTIFY_ERROR); | ||
} | ||
} | ||
|
||
|
Oops, something went wrong.