Skip to content

Commit

Permalink
Fixing coding issues.
Browse files Browse the repository at this point in the history
Also, removing "Add to calendar" since it gives error for non-hosts.
  • Loading branch information
rlorenzo committed Sep 21, 2018
1 parent 425ae53 commit e2be38b
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 29 deletions.
2 changes: 1 addition & 1 deletion classes/privacy/provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class provider implements
*/
public static function get_metadata(\core_privacy\local\metadata\collection $collection):
\core_privacy\local\metadata\collection {
// Add all user data fields to the collection.
// Add all user data fields to the collection.

$collection->add_database_table('mdl_zoom_meeting_participants', [
'name' => 'privacy:metadata:mdl_zoom_meeting_participants:name',
Expand Down
4 changes: 3 additions & 1 deletion classes/task/get_meeting_reports.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ private function format_participant($participant, $detailsid, $names, $emails) {
$name = $names[$moodleuserid];
} else if (!empty($participant->name) && ($moodleuserid = array_search($participant->name, $names))) {
$name = $names[$moodleuserid];
} else if (!empty($participant->user_email) && ($moodleuser = $DB->get_record('user', array('email' => $participant->user_email, 'deleted' => 0, 'suspended' => 0), '*', IGNORE_MULTIPLE))) {
} else if (!empty($participant->user_email) &&
($moodleuser = $DB->get_record('user', array('email' => $participant->user_email,
'deleted' => 0, 'suspended' => 0), '*', IGNORE_MULTIPLE))) {
// This is the case where someone attends the meeting, but is not enrolled in the class.
$moodleuserid = $moodleuser->id;
$name = strtoupper(fullname($moodleuser));
Expand Down
3 changes: 2 additions & 1 deletion db/services.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
'classname' => 'mod_zoom_external',
'methodname' => 'get_state',
'classpath' => 'mod/zoom/classes/external.php',
'description' => 'Determine if a zoom meeting is available, meeting status, and the start time, duration, and other meeting options.',
'description' => 'Determine if a zoom meeting is available, meeting '
. 'status, and the start time, duration, and other meeting options.',
'type' => 'read',
'capabilities' => 'mod/zoom:view',
'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE, 'local_mobile'),
Expand Down
1 change: 1 addition & 0 deletions jwt/BeforeValidException.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?php
//@codingStandardsIgnoreStart - Ignore library file.
namespace Firebase\JWT;
class BeforeValidException extends \UnexpectedValueException {}
1 change: 1 addition & 0 deletions jwt/ExpiredException.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?php
//@codingStandardsIgnoreStart - Ignore library file.
namespace Firebase\JWT;
class ExpiredException extends \UnexpectedValueException {}
2 changes: 1 addition & 1 deletion jwt/JWT.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php

//@codingStandardsIgnoreStart - Ignore library file.
namespace Firebase\JWT;
use \DomainException;
use \InvalidArgumentException;
Expand Down
7 changes: 4 additions & 3 deletions jwt/SignatureInvalidException.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?php
namespace Firebase\JWT;
class SignatureInvalidException extends \UnexpectedValueException {}
<?php
//@codingStandardsIgnoreStart - Ignore library file.
namespace Firebase\JWT;
class SignatureInvalidException extends \UnexpectedValueException {}
2 changes: 0 additions & 2 deletions loadmeeting.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

global $CFG, $DB;

require_once(dirname(dirname(dirname(__FILE__))).'/config.php');
require_once($CFG->libdir . '/gradelib.php');
require_once($CFG->libdir . '/moodlelib.php');
Expand Down
2 changes: 1 addition & 1 deletion participants.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
$name = $p->name;
if (!empty($moodleuser->email)) {
$row[] = html_writer::link("mailto:$moodleuser->email", $name);
} else if (!empty($p->user_email)){
} else if (!empty($p->user_email)) {
$row[] = html_writer::link("mailto:$p->user_email", $name);
} else {
$row[] = $name;
Expand Down
34 changes: 15 additions & 19 deletions view.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,6 @@
$PAGE->set_title(format_string($zoom->name));
$PAGE->set_heading(format_string($course->fullname));

/*
* Other things you may want to set - remove if not needed.
* $PAGE->set_cacheable(false);
* $PAGE->set_focuscontrol('some-html-id');
* $PAGE->add_body_class('zoom-'.$somevar);
*/

$zoomuserid = zoom_get_user_id(false);
$userishost = ($zoomuserid == $zoom->host_id);

Expand Down Expand Up @@ -147,18 +140,21 @@
}
}

// Generate add-to-calendar buttons if meeting was found.
if (!$showrecreate) {
$googlelink = 'https://ucla.zoom.us/meeting/' . $zoom->meeting_id . '/calendar/google/add';
$outlooklink = 'https://ucla.zoom.us/meeting/' . $zoom->meeting_id . '/ics';
$googleicon = $OUTPUT->pix_icon('i/google', get_string('googleiconalt', 'mod_zoom'), 'mod_zoom');
$windowsicon = $OUTPUT->pix_icon('i/windows', get_string('windowsiconalt', 'mod_zoom'), 'mod_zoom');
$googlebutton = html_writer::div($googleicon . ' ' . get_string('googlecalendar', 'mod_zoom'), 'btn btn-primary');
$outlookbutton = html_writer::div($windowsicon . ' ' . get_string('outlook', 'mod_zoom'), 'btn btn-primary');
$googlehtml = html_writer::link($googlelink, $googlebutton, array('target' => '_blank'));
$outlookhtml = html_writer::link($outlooklink, $outlookbutton, array('target' => '_blank'));
$table->data[] = array(get_string('addtocalendar', 'mod_zoom'), $googlehtml . $outlookhtml);
}
//@codingStandardsIgnoreStart
// TODO: Commenting out because it requires user to be host. Need to generate ical file ourselves.
//// Generate add-to-calendar buttons if meeting was found.
//if (!$showrecreate) {
// $googlelink = 'https://ucla.zoom.us/meeting/' . $zoom->meeting_id . '/calendar/google/add';
// $outlooklink = 'https://ucla.zoom.us/meeting/' . $zoom->meeting_id . '/ics';
// $googleicon = $OUTPUT->pix_icon('i/google', get_string('googleiconalt', 'mod_zoom'), 'mod_zoom');
// $windowsicon = $OUTPUT->pix_icon('i/windows', get_string('windowsiconalt', 'mod_zoom'), 'mod_zoom');
// $googlebutton = html_writer::div($googleicon . ' ' . get_string('googlecalendar', 'mod_zoom'), 'btn btn-primary');
// $outlookbutton = html_writer::div($windowsicon . ' ' . get_string('outlook', 'mod_zoom'), 'btn btn-primary');
// $googlehtml = html_writer::link($googlelink, $googlebutton, array('target' => '_blank'));
// $outlookhtml = html_writer::link($outlooklink, $outlookbutton, array('target' => '_blank'));
// $table->data[] = array(get_string('addtocalendar', 'mod_zoom'), $googlehtml . $outlookhtml);
//}
//@codingStandardsIgnoreEnd

if ($zoom->recurring) {
$recurringmessage = new html_table_cell(get_string('recurringmeetinglong', 'mod_zoom'));
Expand Down

0 comments on commit e2be38b

Please sign in to comment.