Skip to content

Commit

Permalink
Style improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Thies committed Apr 12, 2024
1 parent 11b070e commit 2c74c8b
Show file tree
Hide file tree
Showing 62 changed files with 153 additions and 166 deletions.
3 changes: 1 addition & 2 deletions backup/moodle2/backup_deft_block_task.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,13 @@
// More information about the backup process: {@link https://docs.moodle.org/dev/Backup_API}.
// More information about the restore process: {@link https://docs.moodle.org/dev/Restore_API}.

require_once($CFG->dirroot.'//blocks/deft/backup/moodle2/backup_deft_stepslib.php');
require_once($CFG->dirroot . '/blocks/deft/backup/moodle2/backup_deft_stepslib.php');

/**
* Provides all the settings and steps to perform a complete backup of block_deft.
* @package block_deft
*/
class backup_deft_block_task extends backup_block_task {

/**
* Defines particular settings for the plugin.
*/
Expand Down
1 change: 0 additions & 1 deletion backup/moodle2/backup_deft_stepslib.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
* Define the complete structure for backup, with file and id annotations.
*/
class backup_deft_block_structure_step extends backup_block_structure_step {

/**
* Defines the structure of the resulting xml file.
*
Expand Down
3 changes: 1 addition & 2 deletions backup/moodle2/restore_deft_block_task.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
// More information about the backup process: {@link https://docs.moodle.org/dev/Backup_API}.
// More information about the restore process: {@link https://docs.moodle.org/dev/Restore_API}.

require_once($CFG->dirroot.'//blocks/deft/backup/moodle2/restore_deft_stepslib.php');
require_once($CFG->dirroot . '/blocks/deft/backup/moodle2/restore_deft_stepslib.php');

/**
* Restore task for block_deft.
Expand All @@ -37,7 +37,6 @@
* @copyright 2022 Daniel Thies <[email protected]>
*/
class restore_deft_block_task extends restore_block_task {

/**
* Defines particular settings that the block can have.
*/
Expand Down
1 change: 0 additions & 1 deletion backup/moodle2/restore_deft_stepslib.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
* Defines the structure step to restore one deft block.
*/
class restore_deft_block_structure_step extends restore_structure_step {

/**
* Defines the structure to be restored.
*/
Expand Down
1 change: 0 additions & 1 deletion block_deft.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class block_deft extends block_base {

/**
* Initializes class member variables.
*/
Expand Down
11 changes: 7 additions & 4 deletions classes/admin_setting_deftoverview.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,17 @@
* @copyright Daniel Thies
*/
class admin_setting_deftoverview extends admin_setting {

/**
* Calls parent::__construct with specific arguments
*/
public function __construct() {
$this->nosave = true;
parent::__construct('blockdeftoverviewui',
new lang_string('overview', 'block_deft'), '', '');
parent::__construct(
'blockdeftoverviewui',
new lang_string('overview', 'block_deft'),
'',
''
);
}

/**
Expand Down Expand Up @@ -80,7 +83,7 @@ public function write_setting($data) {
* @param string $query
* @return string
*/
public function output_html($data, $query='') {
public function output_html($data, $query = '') {
global $DB, $OUTPUT;

$return = "";
Expand Down
1 change: 0 additions & 1 deletion classes/cache/results.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class results implements cache_data_source {

/** @var overrides the singleton instance of this class. */
protected static $instance = null;

Expand Down
1 change: 0 additions & 1 deletion classes/cache/tasks.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class tasks implements cache_data_source {

/** @var overrides the singleton instance of this class. */
protected static $instance = null;

Expand Down
2 changes: 0 additions & 2 deletions classes/event/audiobridge_launched.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class audiobridge_launched extends base {

/**
* Set all required data properties:
*
Expand Down Expand Up @@ -86,5 +85,4 @@ public function get_url() {
public function get_description() {
return "The user with id '$this->userid' joined audiobridge in venue for task with id '$this->objectid'.";
}

}
2 changes: 0 additions & 2 deletions classes/event/choice_submitted.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class choice_submitted extends base {

/**
* Set all required data properties:
*
Expand Down Expand Up @@ -86,5 +85,4 @@ public function get_url() {
public function get_description() {
return "The user with id '$this->userid' has submitted choice in task with id '$this->objectid'.";
}

}
2 changes: 0 additions & 2 deletions classes/event/hand_lower_sent.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class hand_lower_sent extends base {

/**
* Set all required data properties:
*
Expand Down Expand Up @@ -86,5 +85,4 @@ public function get_url() {
public function get_description() {
return "The user with id '$this->userid' has lowered hand in venue for task with id '$this->objectid'.";
}

}
2 changes: 0 additions & 2 deletions classes/event/hand_raise_sent.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class hand_raise_sent extends base {

/**
* Set all required data properties:
*
Expand Down Expand Up @@ -86,5 +85,4 @@ public function get_url() {
public function get_description() {
return "The user with id '$this->userid' has raised hand in venue with task id '$this->objectid'.";
}

}
1 change: 0 additions & 1 deletion classes/event/mute_switched.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class mute_switched extends base {

/**
* Set all required data properties:
*
Expand Down
2 changes: 0 additions & 2 deletions classes/event/task_created.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class task_created extends base {

/**
* Set all required data properties:
*
Expand Down Expand Up @@ -86,5 +85,4 @@ public function get_url() {
public function get_description() {
return "The user with id '$this->userid' created the task with id '$this->objectid'.";
}

}
2 changes: 0 additions & 2 deletions classes/event/task_deleted.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class task_deleted extends base {

/**
* Set all required data properties:
*
Expand Down Expand Up @@ -86,5 +85,4 @@ public function get_url() {
public function get_description() {
return "The user with id '$this->userid' deleted the task with id '$this->objectid'.";
}

}
2 changes: 0 additions & 2 deletions classes/event/task_updated.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class task_updated extends base {

/**
* Set all required data properties:
*
Expand Down Expand Up @@ -86,5 +85,4 @@ public function get_url() {
public function get_description() {
return "The user with id '$this->userid' updated the task with id '$this->objectid'.";
}

}
2 changes: 0 additions & 2 deletions classes/event/venue_ended.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class venue_ended extends base {

/**
* Set all required data properties:
*
Expand Down Expand Up @@ -86,5 +85,4 @@ public function get_url() {
public function get_description() {
return "The user with id '$this->userid' has left the venue in task with id '$this->objectid'.";
}

}
2 changes: 0 additions & 2 deletions classes/event/venue_started.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class venue_started extends base {

/**
* Set all required data properties:
*
Expand Down Expand Up @@ -86,5 +85,4 @@ public function get_url() {
public function get_description() {
return "The user with id '$this->userid' has entered the venue in task with id '$this->objectid'.";
}

}
2 changes: 0 additions & 2 deletions classes/event/video_ended.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class video_ended extends base {

/**
* Set all required data properties:
*
Expand Down Expand Up @@ -86,5 +85,4 @@ public function get_url() {
public function get_description() {
return "The user with id '$this->userid' ended video in venue for task with id '$this->objectid'.";
}

}
2 changes: 0 additions & 2 deletions classes/event/video_started.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class video_started extends base {

/**
* Set all required data properties:
*
Expand Down Expand Up @@ -86,5 +85,4 @@ public function get_url() {
public function get_description() {
return "The user with id '$this->userid' started video in venue for task with id '$this->objectid'.";
}

}
1 change: 0 additions & 1 deletion classes/external/get_participants.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class get_participants extends external_api {

/**
* Get parameter definition for send_signal.
*
Expand Down
1 change: 0 additions & 1 deletion classes/external/join_room.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class join_room extends external_api {

/**
* Get parameter definition for raise hand
*
Expand Down
13 changes: 7 additions & 6 deletions classes/external/publish_feed.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class publish_feed extends external_api {

/**
* Get parameter definition for raise hand
*
Expand Down Expand Up @@ -99,11 +98,13 @@ public static function execute($id, $publish, $room): array {
'component' => 'block_deft',
]);
$data = json_decode($record->data) ?? new stdClass();
if (!$publish && !empty($data->feed) && $DB->get_record_select(
'block_deft_peer',
"type = 'video' AND id = :feed",
['feed' => $data->feed]
)) {
if (
!$publish && !empty($data->feed) && $DB->get_record_select(
'block_deft_peer',
"type = 'video' AND id = :feed",
['feed' => $data->feed]
)
) {
$DB->set_field('block_deft_peer', 'status', 1, [
'id' => $data->feed,
]);
Expand Down
1 change: 0 additions & 1 deletion classes/external/raise_hand.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class raise_hand extends external_api {

/**
* Get parameter definition for raise hand
*
Expand Down
1 change: 0 additions & 1 deletion classes/external/renew_token.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class renew_token extends external_api {

/**
* Get parameter definition for renew_token.
*
Expand Down
1 change: 0 additions & 1 deletion classes/external/send_signal.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class send_signal extends external_api {

/**
* Get parameter definition for send_signal.
*
Expand Down
19 changes: 12 additions & 7 deletions classes/external/venue_settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class venue_settings extends external_api {

/**
* Get parameter definition for send_signal.
*
Expand Down Expand Up @@ -107,11 +106,13 @@ public static function execute($mute, $status, $peerid, $uuid): array {
]);
}

if ($record = $DB->get_record('block_deft_peer', [
if (
$record = $DB->get_record('block_deft_peer', [
'id' => $peerid,
'mute' => $mute,
'status' => $status,
])) {
])
) {
// No changes needed.
return [
'status' => false,
Expand All @@ -136,19 +137,23 @@ public static function execute($mute, $status, $peerid, $uuid): array {
'objectid' => $task->id,
];

if ($status && $feed = $DB->get_record_sql("
if (
$status && $feed = $DB->get_record_sql("
SELECT f.*
FROM {block_deft_peer} f
JOIN {block_deft_peer} p ON p.sessionid = f.sessionid AND p.uuid = f.uuid
WHERE f.type = 'video' AND p.id = ?", [$peerid])) {
WHERE f.type = 'video' AND p.id = ?", [$peerid])
) {
$feed->status = $status;
$feed->timemodified = time();
$DB->update_record('block_deft_peer', $feed);

if ($room = $DB->get_record('block_deft_room', [
if (
$room = $DB->get_record('block_deft_room', [
'itemid' => $task->id,
'component' => 'block_deft',
])) {
])
) {
$data = json_decode($room->plugindata);
$data->feed = 0;
$room->plugindata = json_encode($data);
Expand Down
1 change: 0 additions & 1 deletion classes/form/add_comment.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
* @copyright 2022 Daniel Thies <[email protected]>
*/
class add_comment extends dynamic_form {

/**
* Form definition
*/
Expand Down
1 change: 0 additions & 1 deletion classes/form/delete_comment.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
* @copyright 2022 Daniel Thies <[email protected]>
*/
class delete_comment extends add_comment {

/**
* Form definition
*/
Expand Down
Loading

0 comments on commit 2c74c8b

Please sign in to comment.