Skip to content

Commit

Permalink
somthing went wrong with cbf so another run...
Browse files Browse the repository at this point in the history
  • Loading branch information
NinaHerrmann committed Nov 22, 2023
1 parent e9ff7d7 commit 880b7a3
Show file tree
Hide file tree
Showing 89 changed files with 685 additions and 1,134 deletions.
8 changes: 4 additions & 4 deletions addlti.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@
$seriesid = required_param('seriesid', PARAM_ALPHANUMEXT);

// Set base URL.
$baseurl = new moodle_url('/blocks/opencast/addlti.php', array('courseid' => $courseid, 'ocinstanceid' => $ocinstanceid));
$baseurl = new moodle_url('/blocks/opencast/addlti.php', ['courseid' => $courseid, 'ocinstanceid' => $ocinstanceid]);
$PAGE->set_url($baseurl);

// Remember URLs for redirecting.
$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]);
$redirecturlcancel = $redirecturloverview;

// Require login and course membership.
Expand Down Expand Up @@ -77,7 +77,7 @@

// Use Add LTI form.
$addltiform = new addlti_form(null,
array('courseid' => $courseid, 'ocinstanceid' => $ocinstanceid, 'seriesid' => $seriesid));
['courseid' => $courseid, 'ocinstanceid' => $ocinstanceid, 'seriesid' => $seriesid]);

// Get API bridge instance.
$apibridge = apibridge::get_instance($ocinstanceid);
Expand Down
19 changes: 7 additions & 12 deletions backup/moodle2/backup_opencast_block_task.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,13 @@
* @author Andreas Wagner
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class backup_opencast_block_task extends backup_block_task
{
class backup_opencast_block_task extends backup_block_task {


/**
* Add a setting to backup process, when course videos are available.
*/
protected function define_my_settings()
{
protected function define_my_settings() {
$ocinstances = settings_api::get_ocinstances();
foreach ($ocinstances as $ocinstance) {
// Check whether this feature is enabled and working at all.
Expand Down Expand Up @@ -89,8 +88,7 @@ protected function define_my_settings()
/**
* Add the structure step, when course videos are available.
*/
protected function define_my_steps()
{
protected function define_my_steps() {
$ocinstances = settings_api::get_ocinstances();
foreach ($ocinstances as $ocinstance) {
if (!$this->setting_exists('opencast_videos_include_' . $ocinstance->id)) {
Expand All @@ -108,17 +106,15 @@ protected function define_my_steps()
* No file areas are controlled by this block.
* @return array
*/
public function get_fileareas()
{
public function get_fileareas() {
return [];
}

/**
* We don't need to encode attrs in configdata.
* @return array
*/
public function get_configdata_encoded_attributes()
{
public function get_configdata_encoded_attributes() {
return [];
}

Expand All @@ -127,8 +123,7 @@ public function get_configdata_encoded_attributes()
* @param string $content
* @return string
*/
public static function encode_content_links($content)
{
public static function encode_content_links($content) {
return $content;
}

Expand Down
6 changes: 2 additions & 4 deletions backup/moodle2/backup_opencast_stepslib.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@
* @copyright 2018 Andreas Wagner, SYNERGY LEARNING
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class backup_opencast_block_structure_step extends backup_block_structure_step
{
class backup_opencast_block_structure_step extends backup_block_structure_step {

/**
* Defines the structure of the backup file.
Expand All @@ -48,8 +47,7 @@ class backup_opencast_block_structure_step extends backup_block_structure_step
* @throws base_step_exception
* @throws dml_exception
*/
protected function define_structure()
{
protected function define_structure() {
$ocinstanceid = intval(ltrim($this->get_name(), "opencast_structure_"));

// Root.
Expand Down
27 changes: 10 additions & 17 deletions backup/moodle2/restore_opencast_block_task.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
/**
* Define settings of the restore tasks for the opencast block.
*/
class restore_opencast_block_task extends restore_block_task
{
class restore_opencast_block_task extends restore_block_task {


/**
* Check, if it is possible to restore events into given target course.
Expand All @@ -47,8 +47,7 @@ class restore_opencast_block_task extends restore_block_task
* @param int $ocinstanceid Opencast instance id.
* @return boolean
*/
private function can_restore_events($ocinstanceid)
{
private function can_restore_events($ocinstanceid) {
$apibridge = apibridge::get_instance($ocinstanceid);

$courseid = $this->get_courseid();
Expand All @@ -69,8 +68,7 @@ private function can_restore_events($ocinstanceid)
* 1. course videos are available in backupfile AND
* 2. target course has not yet an assigned series.
*/
protected function define_my_settings()
{
protected function define_my_settings() {
$ocinstances = settings_api::get_ocinstances();
if (empty($ocinstances)) {
throw new dml_exception('dmlreadexception', null,
Expand All @@ -97,8 +95,7 @@ protected function define_my_settings()
/**
* Add a restore step, when required.
*/
protected function define_my_steps()
{
protected function define_my_steps() {
$ocinstances = settings_api::get_ocinstances();
if (empty($ocinstances)) {
throw new dml_exception('dmlreadexception', null,
Expand Down Expand Up @@ -126,35 +123,31 @@ protected function define_my_steps()
* No file areas are controlled by this block.
* @return array
*/
public function get_fileareas()
{
public function get_fileareas() {
return [];
}

/**
* We don't need to encode attrs in configdata.
* @return array
*/
public function get_configdata_encoded_attributes()
{
return array(); // We need to encode some attrs in configdata.
public function get_configdata_encoded_attributes() {
return []; // We need to encode some attrs in configdata.
}

/**
* Define the decoding rules for links belonging
* to the activity to be executed by the link decoder.
*/
public static function define_decode_rules()
{
public static function define_decode_rules() {
return [];
}

/**
* Define the contents in the activity that must be
* processed by the link decoder
*/
public static function define_decode_contents()
{
public static function define_decode_contents() {
return [];
}

Expand Down
21 changes: 8 additions & 13 deletions backup/moodle2/restore_opencast_stepslib.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
* @copyright 2018 Andreas Wagner, SYNERGY LEARNING
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class restore_opencast_block_structure_step extends restore_structure_step
{
class restore_opencast_block_structure_step extends restore_structure_step {


/** @var array Ids of the videos included in the backup. */
private $backupeventids = [];
Expand All @@ -57,16 +57,15 @@ class restore_opencast_block_structure_step extends restore_structure_step
*
* @return array of @restore_path_element elements
*/
protected function define_structure()
{
protected function define_structure() {
global $USER;
$ocinstanceid = intval(ltrim($this->get_name(), "opencast_structure_"));
$this->ocinstanceid = $ocinstanceid;

// Check, target series.
$courseid = $this->get_courseid();

$paths = array();
$paths = [];

// Get apibridge instance.
$apibridge = apibridge::get_instance($ocinstanceid);
Expand Down Expand Up @@ -105,8 +104,7 @@ protected function define_structure()
* @param array $data the event identifier
* @return void
*/
public function process_event($data)
{
public function process_event($data) {
$data = (object)$data;

// Collect eventids for notification.
Expand Down Expand Up @@ -136,8 +134,7 @@ public function process_event($data)
* @throws dml_exception
* @throws moodle_exception
*/
public function process_series($data)
{
public function process_series($data) {
global $USER;

$data = (object)$data;
Expand Down Expand Up @@ -168,8 +165,7 @@ public function process_series($data)
* @param array $data The import data needed for ACL change mode.
* @return void
*/
public function process_import($data)
{
public function process_import($data) {

$data = (object)$data;

Expand All @@ -183,8 +179,7 @@ public function process_import($data)
*
* @return void
*/
public function after_restore()
{
public function after_restore() {

$courseid = $this->get_courseid();

Expand Down
7 changes: 3 additions & 4 deletions backup/moodle2/settings/block_backup_setting.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
* @copyright 2018 Andreas Wagner, SYNERGY LEARNING
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class backup_block_opencast_setting extends backup_setting
{
class backup_block_opencast_setting extends backup_setting {


/**
* Create an instance of this class. Note that this is used to control level and layout of this setting.
Expand All @@ -41,8 +41,7 @@ class backup_block_opencast_setting extends backup_setting
* @param bool $visibility Is the setting visible in the UI
* @param int $status Status of the setting with regards to the locking
*/
public function __construct($name, $vtype, $value = null, $visibility = self::VISIBLE, $status = self::NOT_LOCKED)
{
public function __construct($name, $vtype, $value = null, $visibility = self::VISIBLE, $status = self::NOT_LOCKED) {

$this->level = self::COURSE_LEVEL;

Expand Down
4 changes: 2 additions & 2 deletions backup/moodle2/settings/block_restore_setting.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@
* @copyright 2018 Andreas Wagner, SYNERGY LEARNING
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class restore_block_opencast_setting extends backup_block_opencast_setting
{
class restore_block_opencast_setting extends backup_block_opencast_setting {

}
19 changes: 7 additions & 12 deletions classes/admin_setting_configeditabletable.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
* @copyright 2021 Tamara Gunkel, University of Münster
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class admin_setting_configeditabletable extends admin_setting
{
class admin_setting_configeditabletable extends admin_setting {

/** @var string Id of the div tag */
private $divid;
/** @var string Text for add button */
Expand All @@ -46,8 +46,7 @@ class admin_setting_configeditabletable extends admin_setting
* @param string $divid Id of the div tag
* @param string $buttontext Text of "Add row" button
*/
public function __construct($name, $divid, $buttontext)
{
public function __construct($name, $divid, $buttontext) {
$this->nosave = true;
$this->divid = $divid;
$this->buttontext = $buttontext;
Expand All @@ -59,8 +58,7 @@ public function __construct($name, $divid, $buttontext)
*
* @return bool Always returns true
*/
public function get_setting()
{
public function get_setting() {
return true;
}

Expand All @@ -69,8 +67,7 @@ public function get_setting()
*
* @return bool Always returns true
*/
public function get_defaultsetting()
{
public function get_defaultsetting() {
return true;
}

Expand All @@ -80,8 +77,7 @@ public function get_defaultsetting()
* @param mixed $data Gets converted to str for comparison against yes value
* @return string Always returns an empty string
*/
public function write_setting($data)
{
public function write_setting($data) {
// Do not write any setting.
return '';
}
Expand All @@ -93,8 +89,7 @@ public function write_setting($data)
* @param string $query
* @return string Returns an HTML string
*/
public function output_html($data, $query = '')
{
public function output_html($data, $query = '') {
return '<div class="mt-3" id="' . $this->divid .
'"></div><div class="d-flex"><button class="btn btn-primary mt-3 ml-auto mb-3" type="button" id="addrow-' .
$this->divid . '">' . $this->buttontext . '</button></div>';
Expand Down
10 changes: 4 additions & 6 deletions classes/admin_setting_configtextvalidate.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
* @copyright 2022 Tamara Gunkel, University of Münster
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class admin_setting_configtextvalidate extends admin_setting_configtext
{
class admin_setting_configtextvalidate extends admin_setting_configtext {

/** @var callable|null Validation function */
protected $validatefunction = null;

Expand All @@ -46,8 +46,7 @@ class admin_setting_configtextvalidate extends admin_setting_configtext
*
* @param callable|null $validatefunction Validate function or null to clear
*/
public function set_validate_function(?callable $validatefunction = null)
{
public function set_validate_function(?callable $validatefunction = null) {
$this->validatefunction = $validatefunction;
}

Expand All @@ -56,8 +55,7 @@ public function set_validate_function(?callable $validatefunction = null)
* @param string $data New setting data
* @return mixed true if ok string if error found
*/
public function validate($data)
{
public function validate($data) {
$valid = parent::validate($data);
if ($valid === true) {
// Parent validation was successful.
Expand Down
Loading

0 comments on commit 880b7a3

Please sign in to comment.