Skip to content

Commit

Permalink
Merge branch 'MDL-74081-400' of https://github.com/call-learning/moodle
Browse files Browse the repository at this point in the history
… into MOODLE_400_STABLE
  • Loading branch information
junpataleta committed Sep 8, 2022
2 parents 4b434b3 + 4519964 commit 02425dd
Show file tree
Hide file tree
Showing 44 changed files with 210 additions and 199 deletions.
Expand Up @@ -35,8 +35,7 @@
* @copyright 2010 onwards, Blindside Networks Inc
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class backup_bigbluebuttonbn_activity_task extends backup_activity_task
{
class backup_bigbluebuttonbn_activity_task extends backup_activity_task {
/**
* Define (add) particular settings this activity can have.
*
Expand Down
Expand Up @@ -24,8 +24,6 @@
* @author Jesus Federico (jesus [at] blindsidenetworks [dt] com)
*/

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

/**
* Define all the backup steps that will be used by the backup_bigbluebuttonbn_activity_task.
*
Expand Down
Expand Up @@ -35,8 +35,7 @@
* @copyright 2010 onwards, Blindside Networks Inc
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class restore_bigbluebuttonbn_activity_task extends restore_activity_task
{
class restore_bigbluebuttonbn_activity_task extends restore_activity_task {
/**
* Define (add) particular settings this activity can have.
*
Expand Down
Expand Up @@ -24,8 +24,6 @@
* @author Jesus Federico (jesus [at] blindsidenetworks [dt] com)
*/

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

/**
* Define all the restore steps that will be used by the restore_url_activity_task.
*
Expand Down Expand Up @@ -107,7 +105,7 @@ protected function process_bigbluebuttonbn_recordings(array $data) {
/**
* Actions to be executed after the restore is completed
*
* @return array
* @return void
*/
protected function after_execute() {
// Add bigbluebuttonbn related files, no need to match by itemname (just internally handled context).
Expand Down
Expand Up @@ -26,13 +26,14 @@
class activity_management_viewed extends base {
/**
* Init method.
*
* @param string $crud
* @param int $edulevel
*/
protected function init($crud = 'r', $edulevel = self::LEVEL_PARTICIPATING) {
parent::init($crud, $edulevel);
$this->description = "The user with id '##userid' viewed the bigbluebuttonbn activity management page for ".
"the course module id '##contextinstanceid'.";
$this->description = "The user with id '##userid' viewed the bigbluebuttonbn activity management page for " .
"the course module id '##contextinstanceid'.";
}

/**
Expand Down
70 changes: 37 additions & 33 deletions mod/bigbluebuttonbn/classes/event/base.php
Expand Up @@ -16,6 +16,9 @@

namespace mod_bigbluebuttonbn\event;

use coding_exception;
use moodle_url;

/**
* The mod_bigbluebuttonbn abstract base event class. Most mod_bigbluebuttonbn events can extend this class.
*
Expand All @@ -25,6 +28,13 @@
*/
abstract class base extends \core\event\base {

/**
* Object Id Mapping.
*
* @var array
*/
protected static $objectidmapping = ['db' => 'bigbluebuttonbn', 'restore' => 'bigbluebuttonbn'];

/** @var $bigbluebuttonbn */
protected $bigbluebuttonbn;

Expand All @@ -35,31 +45,13 @@ abstract class base extends \core\event\base {
*/
protected $description;

/**
* Object Id Mapping.
*
* @var array
*/
protected static $objectidmapping = ['db' => 'bigbluebuttonbn', 'restore' => 'bigbluebuttonbn'];

/**
* Legacy log data.
*
* @var array
*/
protected $legacylogdata;

/**
* Init method.
* @param string $crud
* @param int $edulevel
*/
protected function init($crud = 'r', $edulevel = self::LEVEL_PARTICIPATING) {
$this->data['crud'] = $crud;
$this->data['edulevel'] = $edulevel;
$this->data['objecttable'] = 'bigbluebuttonbn';
}

/**
* Returns description of what happened.
*
Expand All @@ -83,26 +75,22 @@ public function get_description() {
/**
* Returns relevant URL.
*
* @return \moodle_url
* @return moodle_url
*/
public function get_url() {
return new \moodle_url('/mod/bigbluebuttonbn/view.php', ['id' => $this->contextinstanceid]);
return new moodle_url('/mod/bigbluebuttonbn/view.php', ['id' => $this->contextinstanceid]);
}

/**
* Sets the legacy event log data.
* Init method.
*
* @param string $action The current action
* @param string $info A detailed description of the change. But no more than 255 characters.
* @param string $url The url to the assign module instance.
* @param string $crud
* @param int $edulevel
*/
public function set_legacy_logdata($action = '', $info = '', $url = '') {
$fullurl = 'view.php?id=' . $this->contextinstanceid;
if ($url != '') {
$fullurl .= '&' . $url;
}

$this->legacylogdata = [$this->courseid, 'bigbluebuttonbn', $action, $fullurl, $info, $this->contextinstanceid];
protected function init($crud = 'r', $edulevel = self::LEVEL_PARTICIPATING) {
$this->data['crud'] = $crud;
$this->data['edulevel'] = $edulevel;
$this->data['objecttable'] = 'bigbluebuttonbn';
}

/**
Expand All @@ -118,16 +106,32 @@ protected function get_legacy_logdata() {
return null;
}

/**
* Sets the legacy event log data.
*
* @param string $action The current action
* @param string $info A detailed description of the change. But no more than 255 characters.
* @param string $url The url to the assign module instance.
*/
public function set_legacy_logdata($action = '', $info = '', $url = '') {
$fullurl = 'view.php?id=' . $this->contextinstanceid;
if ($url != '') {
$fullurl .= '&' . $url;
}

$this->legacylogdata = [$this->courseid, 'bigbluebuttonbn', $action, $fullurl, $info, $this->contextinstanceid];
}

/**
* Custom validation.
*
* @throws \coding_exception
* @throws coding_exception
*/
protected function validate_data() {
parent::validate_data();

if ($this->contextlevel != CONTEXT_MODULE) {
throw new \coding_exception('Context level must be CONTEXT_MODULE.');
throw new coding_exception('Context level must be CONTEXT_MODULE.');
}
}
}
6 changes: 2 additions & 4 deletions mod/bigbluebuttonbn/classes/event/course_module_viewed.php
Expand Up @@ -23,12 +23,10 @@
* @copyright 2010 onwards, Blindside Networks Inc
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class course_module_viewed extends \core\event\course_module_viewed
{
class course_module_viewed extends \core\event\course_module_viewed {
/**
* Init method.
* @param string $crud
* @param int $edulevel
*
*/
protected function init() {
$this->data['crud'] = 'r';
Expand Down
1 change: 1 addition & 0 deletions mod/bigbluebuttonbn/classes/event/events.php
Expand Up @@ -27,6 +27,7 @@ class events {

/**
* Event name matcher.
*
* @var $events
*/
public static $events = [
Expand Down
8 changes: 4 additions & 4 deletions mod/bigbluebuttonbn/classes/event/live_session_event.php
Expand Up @@ -23,17 +23,17 @@
* @copyright 2010 onwards, Blindside Networks Inc
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class live_session_event extends base
{
class live_session_event extends base {
/**
* Init method.
*
* @param string $crud
* @param int $edulevel
*/
protected function init($crud = 'r', $edulevel = self::LEVEL_OTHER) {
parent::init($crud, $edulevel);
$this->description = "The user with id '##userid' triggered action ##other in a ".
"bigbluebutton meeting for the bigbluebuttonbn activity with id ".
$this->description = "The user with id '##userid' triggered action ##other in a " .
"bigbluebutton meeting for the bigbluebuttonbn activity with id " .
"'##objectid' for the course id '##courseid'.";
}

Expand Down
6 changes: 3 additions & 3 deletions mod/bigbluebuttonbn/classes/event/meeting_created.php
Expand Up @@ -23,16 +23,16 @@
* @copyright 2010 onwards, Blindside Networks Inc
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class meeting_created extends base
{
class meeting_created extends base {
/**
* Init method.
*
* @param string $crud
* @param int $edulevel
*/
protected function init($crud = 'r', $edulevel = self::LEVEL_OTHER) {
parent::init($crud, $edulevel);
$this->description = "The user with id '##userid' created a bigbluebutton meeting for ".
$this->description = "The user with id '##userid' created a bigbluebutton meeting for " .
"the bigbluebuttonbn activity with id '##objectid' for the course id '##courseid'.";
}

Expand Down
9 changes: 5 additions & 4 deletions mod/bigbluebuttonbn/classes/event/meeting_ended.php
Expand Up @@ -23,17 +23,17 @@
* @copyright 2010 onwards, Blindside Networks Inc
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class meeting_ended extends base
{
class meeting_ended extends base {
/**
* Init method.
*
* @param string $crud
* @param int $edulevel
*/
protected function init($crud = 'r', $edulevel = self::LEVEL_OTHER) {
parent::init($crud, $edulevel);
$this->description = "A bigbluebutton meeting for the bigbluebuttonbn activity with id ".
"'##objectid' for the course id '##courseid' has been forcibly ".
$this->description = "A bigbluebutton meeting for the bigbluebuttonbn activity with id " .
"'##objectid' for the course id '##courseid' has been forcibly " .
"ended by the user with id '##userid'.";
}

Expand All @@ -54,4 +54,5 @@ public static function get_name() {
public static function get_objectid_mapping() {
return ['db' => 'bigbluebuttonbn', 'restore' => 'bigbluebuttonbn'];
}

}
8 changes: 4 additions & 4 deletions mod/bigbluebuttonbn/classes/event/meeting_joined.php
Expand Up @@ -23,17 +23,17 @@
* @copyright 2010 onwards, Blindside Networks Inc
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class meeting_joined extends base
{
class meeting_joined extends base {
/**
* Init method.
*
* @param string $crud
* @param int $edulevel
*/
protected function init($crud = 'r', $edulevel = self::LEVEL_PARTICIPATING) {
parent::init($crud, $edulevel);
$this->description = "The user with id '##userid' has joined a bigbluebutton meeting for ".
"the bigbluebuttonbn activity with id '##objectid' for the course id ".
$this->description = "The user with id '##userid' has joined a bigbluebutton meeting for " .
"the bigbluebuttonbn activity with id '##objectid' for the course id " .
"'##courseid'.";
}

Expand Down
8 changes: 4 additions & 4 deletions mod/bigbluebuttonbn/classes/event/meeting_left.php
Expand Up @@ -23,17 +23,17 @@
* @copyright 2010 onwards, Blindside Networks Inc
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class meeting_left extends base
{
class meeting_left extends base {
/**
* Init method.
*
* @param string $crud
* @param int $edulevel
*/
protected function init($crud = 'r', $edulevel = self::LEVEL_PARTICIPATING) {
parent::init($crud, $edulevel);
$this->description = "The user with id '##userid' has left a bigbluebutton meeting for ".
"the bigbluebuttonbn activity with id '##objectid' for the course id ".
$this->description = "The user with id '##userid' has left a bigbluebutton meeting for " .
"the bigbluebuttonbn activity with id '##objectid' for the course id " .
"'##courseid'.";
}

Expand Down
6 changes: 3 additions & 3 deletions mod/bigbluebuttonbn/classes/event/recording_deleted.php
Expand Up @@ -23,16 +23,16 @@
* @copyright 2010 onwards, Blindside Networks Inc
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class recording_deleted extends base
{
class recording_deleted extends base {
/**
* Init method.
*
* @param string $crud
* @param int $edulevel
*/
protected function init($crud = 'r', $edulevel = self::LEVEL_OTHER) {
parent::init($crud, $edulevel);
$this->description = "The user with id '##userid' has deleted a recording with id ".
$this->description = "The user with id '##userid' has deleted a recording with id " .
"'##other' from the course id '##courseid'.";
}

Expand Down
6 changes: 3 additions & 3 deletions mod/bigbluebuttonbn/classes/event/recording_edited.php
Expand Up @@ -23,16 +23,16 @@
* @copyright 2010 onwards, Blindside Networks Inc
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class recording_edited extends base
{
class recording_edited extends base {
/**
* Init method.
*
* @param string $crud
* @param int $edulevel
*/
protected function init($crud = 'r', $edulevel = self::LEVEL_OTHER) {
parent::init($crud, $edulevel);
$this->description = "The user with id '##userid' has edited a recording with id ".
$this->description = "The user with id '##userid' has edited a recording with id " .
"'##other' in the course id '##courseid'.";
}

Expand Down
6 changes: 3 additions & 3 deletions mod/bigbluebuttonbn/classes/event/recording_imported.php
Expand Up @@ -23,16 +23,16 @@
* @copyright 2010 onwards, Blindside Networks Inc
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class recording_imported extends base
{
class recording_imported extends base {
/**
* Init method.
*
* @param string $crud
* @param int $edulevel
*/
protected function init($crud = 'r', $edulevel = self::LEVEL_OTHER) {
parent::init($crud, $edulevel);
$this->description = "The user with id '##userid' has imported a recording with id ".
$this->description = "The user with id '##userid' has imported a recording with id " .
"'##other' in the course id '##courseid'.";
}

Expand Down

0 comments on commit 02425dd

Please sign in to comment.