-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
2,469 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
53 changes: 53 additions & 0 deletions
53
tab/venue/backup/moodle2/backup_videotimetab_venue_subplugin.class.php
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 |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<?php | ||
// This file is part of Moodle - http://moodle.org/ | ||
// | ||
// Moodle is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// Moodle is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
/** | ||
* Defines backup_videotimetab_venue_subplugin class | ||
* | ||
* @package videotimetab_venue | ||
* @copyright 2023 bdecent gmbh <https://bdecent.de> | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
|
||
/** | ||
* Defines backup_videotimetab_venue_subplugin class | ||
* | ||
* Provides the step to perform back up of sublugin data | ||
*/ | ||
class backup_videotimetab_venue_subplugin extends backup_subplugin { | ||
|
||
/** | ||
* Defined suplugin structure step | ||
*/ | ||
protected function define_videotime_subplugin_structure() { | ||
|
||
// Create XML elements. | ||
$subplugin = $this->get_subplugin_element(); | ||
$subpluginwrapper = new backup_nested_element($this->get_recommended_name()); | ||
$subplugintablesettings = new backup_nested_element('videotimetab_venue', | ||
null, array('videotime')); | ||
|
||
// Connect XML elements into the tree. | ||
$subplugin->add_child($subpluginwrapper); | ||
$subpluginwrapper->add_child($subplugintablesettings); | ||
|
||
// Set source to populate the data. | ||
$subplugintablesettings->set_source_table('videotimetab_venue', | ||
array('videotime' => backup::VAR_ACTIVITYID)); | ||
|
||
return $subplugin; | ||
} | ||
} |
66 changes: 66 additions & 0 deletions
66
tab/venue/backup/moodle2/restore_videotimetab_venue_subplugin.class.php
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 |
---|---|---|
@@ -0,0 +1,66 @@ | ||
<?php | ||
// This file is part of Moodle - http://moodle.org/ | ||
// | ||
// Moodle is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// Moodle is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
/** | ||
* videotime restore task | ||
* | ||
* provides all the settings and steps to perform one * complete restore of the activity | ||
* | ||
* @package videotimetab_venue | ||
* @copyright 2023 bdecent gmbh <https://bdecent.de> | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
|
||
defined('MOODLE_INTERNAL') || die(); | ||
|
||
require_once($CFG->dirroot . '/mod/videotime/backup/moodle2/restore_videotime_stepslib.php'); // Because it exists (must). | ||
|
||
/** | ||
* Define restore step for videotime tab plugin | ||
* | ||
* restore subplugin class that provides the data | ||
* needed to restore one videotimetab_venue subplugin. | ||
*/ | ||
class restore_videotimetab_venue_subplugin extends restore_subplugin { | ||
|
||
/** | ||
* Define subplugin structure | ||
* | ||
*/ | ||
protected function define_videotime_subplugin_structure() { | ||
|
||
$paths = array(); | ||
|
||
$elename = $this->get_namefor(''); | ||
$elepath = $this->get_pathfor('/videotimetab_venue'); | ||
$paths[] = new restore_path_element($elename, $elepath); | ||
|
||
return $paths; | ||
} | ||
|
||
/** | ||
* Processes the videotimetab_venue element, if it is in the file. | ||
* @param array $data the data read from the XML file. | ||
*/ | ||
public function process_videotimetab_venue($data) { | ||
global $DB; | ||
|
||
$data = (object)$data; | ||
$oldvideotime = $data->videotime; | ||
$data->videotime = $this->get_new_parentid('videotime'); | ||
$DB->insert_record('videotimetab_venue', $data); | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,90 @@ | ||
<?php | ||
// This file is part of Moodle - https://moodle.org/ | ||
// | ||
// Moodle is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// Moodle is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with Moodle. If not, see <https://www.gnu.org/licenses/>. | ||
|
||
namespace videotimetab_venue\event; | ||
|
||
use \core\event\base; | ||
|
||
/** | ||
* The audiobridge launched event | ||
* | ||
* @package videotimetab_venue | ||
* @category event | ||
* @copyright 2023 bdecent gmbh <https://bdecent.de> | ||
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
class audiobridge_launched extends base { | ||
|
||
/** | ||
* Set all required data properties: | ||
* | ||
* @return void | ||
*/ | ||
protected function init() { | ||
$this->data['crud'] = 'r'; | ||
$this->data['edulevel'] = self::LEVEL_PARTICIPATING; | ||
$this->data['objecttable'] = 'videotime'; | ||
} | ||
|
||
/** | ||
* Validate their custom data (such as $this->data['other'], contextlevel, etc.). | ||
* | ||
* Throw \coding_exception or debugging() notice in case of any problems. | ||
*/ | ||
protected function validate_data() { | ||
// Override if you want to validate event properties when | ||
// creating new events. | ||
} | ||
|
||
/** | ||
* Returns localised general event name. | ||
* | ||
* Override in subclass, we can not make it static and abstract at the same time. | ||
* | ||
* @return string | ||
*/ | ||
public static function get_name() { | ||
return get_string('eventaudiobridgelaunched', 'block_deft'); | ||
} | ||
|
||
/** | ||
* Get backup mappinig | ||
* | ||
* @return array | ||
*/ | ||
public static function get_objectid_mapping() { | ||
return ['db' => 'videotime', 'restore' => 'id']; | ||
} | ||
|
||
/** | ||
* Get URL related to the action. | ||
* | ||
* @return \moodle_url | ||
*/ | ||
public function get_url() { | ||
return new \moodle_url('/mod/videotime/view.php', ['v' => $this->objectid]); | ||
} | ||
|
||
/** | ||
* Returns non-localised event description with id's for admin use only. | ||
* | ||
* @return string | ||
*/ | ||
public function get_description() { | ||
return "The user with id '$this->userid' joined audiobridge in venue tab for Video Time activity with id '$this->objectid'."; | ||
} | ||
|
||
} |
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 |
---|---|---|
@@ -0,0 +1,79 @@ | ||
<?php | ||
// This file is part of Moodle - https://moodle.org/ | ||
// | ||
// Moodle is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// Moodle is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with Moodle. If not, see <https://www.gnu.org/licenses/>. | ||
|
||
namespace videotimetab_venue\event; | ||
|
||
use \core\event\base; | ||
|
||
/** | ||
* The hand lower event | ||
* | ||
* @package videotimetab_venue | ||
* @category event | ||
* @copyright 2023 bdecent gmbh <https://bdecent.de> | ||
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
class hand_lower_sent extends base { | ||
|
||
/** | ||
* Set all required data properties: | ||
* | ||
* @return void | ||
*/ | ||
protected function init() { | ||
$this->data['crud'] = 'r'; | ||
$this->data['edulevel'] = self::LEVEL_PARTICIPATING; | ||
$this->data['objecttable'] = 'videotime'; | ||
} | ||
|
||
/** | ||
* Returns localised general event name. | ||
* | ||
* Override in subclass, we can not make it static and abstract at the same time. | ||
* | ||
* @return string | ||
*/ | ||
public static function get_name() { | ||
return get_string('eventhandlowersent', 'block_deft'); | ||
} | ||
|
||
/** | ||
* Get backup mappinig | ||
* | ||
* @return array | ||
*/ | ||
public static function get_objectid_mapping() { | ||
return ['db' => 'videotime', 'restore' => 'id']; | ||
} | ||
|
||
/** | ||
* Get URL related to the action. | ||
* | ||
* @return \moodle_url | ||
*/ | ||
public function get_url() { | ||
return new \moodle_url('/mod/videotime/view.php', ['v' => $this->objectid]); | ||
} | ||
|
||
/** | ||
* Returns non-localised event description with id's for admin use only. | ||
* | ||
* @return string | ||
*/ | ||
public function get_description() { | ||
return "The user with id '$this->userid' has lowered hand in venue tab of Video Time activity with id '$this->objectid'."; | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,79 @@ | ||
<?php | ||
// This file is part of Moodle - https://moodle.org/ | ||
// | ||
// Moodle is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// Moodle is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with Moodle. If not, see <https://www.gnu.org/licenses/>. | ||
|
||
namespace videotimetab_venue\event; | ||
|
||
use \core\event\base; | ||
|
||
/** | ||
* The hand raise event | ||
* | ||
* @package videotimetab_venue | ||
* @category event | ||
* @copyright 2023 bdecent gmbh <https://bdecent.de> | ||
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
class hand_raise_sent extends base { | ||
|
||
/** | ||
* Set all required data properties: | ||
* | ||
* @return void | ||
*/ | ||
protected function init() { | ||
$this->data['crud'] = 'r'; | ||
$this->data['edulevel'] = self::LEVEL_PARTICIPATING; | ||
$this->data['objecttable'] = 'videotime'; | ||
} | ||
|
||
/** | ||
* Returns localised general event name. | ||
* | ||
* Override in subclass, we can not make it static and abstract at the same time. | ||
* | ||
* @return string | ||
*/ | ||
public static function get_name() { | ||
return get_string('eventhandraisesent', 'block_deft'); | ||
} | ||
|
||
/** | ||
* Get backup mappinig | ||
* | ||
* @return array | ||
*/ | ||
public static function get_objectid_mapping() { | ||
return ['db' => 'videotime', 'restore' => 'id']; | ||
} | ||
|
||
/** | ||
* Get URL related to the action. | ||
* | ||
* @return \moodle_url | ||
*/ | ||
public function get_url() { | ||
return new \moodle_url('/mod/videotime/view.php', ['v' => $this->objectid]); | ||
} | ||
|
||
/** | ||
* Returns non-localised event description with id's for admin use only. | ||
* | ||
* @return string | ||
*/ | ||
public function get_description() { | ||
return "The user with id '$this->userid' has raised hand in venue tab of Video Time activity with id '$this->objectid'."; | ||
} | ||
} |
Oops, something went wrong.