Skip to content
1 change: 0 additions & 1 deletion backup/moodle2/backup_clickmeeting_activity_task.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class backup_clickmeeting_activity_task extends backup_activity_task {

/**
* Define (add) particular settings this activity can have
*/
Expand Down
1 change: 0 additions & 1 deletion backup/moodle2/backup_clickmeeting_stepslib.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
* Define the complete choice structure
*/
class backup_activity_structure_step extends \backup_activity_structure_step {

/**
* Define the complete structure for backup
*/
Expand Down
14 changes: 9 additions & 5 deletions backup/moodle2/restore_clickmeeting_activity_task.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class restore_clickmeeting_activity_task extends restore_activity_task {

/**
* Define (add) particular settings this activity can have
*/
Expand Down Expand Up @@ -68,7 +67,6 @@ public static function define_decode_rules() {
$rules[] = new restore_decode_rule('CLICKMEETINGINDEX', '/mod/clickmeeting/index.php?id=$1', 'course');

return $rules;

}

/**
Expand Down Expand Up @@ -104,11 +102,17 @@ public static function define_restore_log_rules_for_course() {
$rules = [];

// Fix old wrong uses (missing extension)
$rules[] = new restore_log_rule('clickmeeting', 'view all', 'index?id={course}', null,
null, null, 'index.php?id={course}');
$rules[] = new restore_log_rule(
'clickmeeting',
'view all',
'index?id={course}',
null,
null,
null,
'index.php?id={course}'
);
$rules[] = new restore_log_rule('clickmeeting', 'view all', 'index.php?id={course}', null);

return $rules;
}

}
1 change: 0 additions & 1 deletion backup/moodle2/restore_clickmeeting_stepslib.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class restore_activity_structure_step extends \restore_activity_structure_step {

/**
* Defines table structure
*/
Expand Down
3 changes: 1 addition & 2 deletions classes/privacy/provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@
/**
* Ad hoc task that performs the actions for approved data privacy requests.
*/
class provider implements metadata_provider, request_plugin_provider, core_userlist_provider {

class provider implements core_userlist_provider, metadata_provider, request_plugin_provider {
/**
* Returns metadata about this system.
*
Expand Down
40 changes: 30 additions & 10 deletions db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ function xmldb_clickmeeting_upgrade($oldversion) {

// First example, some fields were added to install.xml on 2007/04/01
if ($oldversion < 2007040100) {

// Define field course to be added to clickmeeting
$table = new xmldb_table('clickmeeting');
$field = new xmldb_field('course', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, '0', 'id');
Expand All @@ -89,8 +88,16 @@ function xmldb_clickmeeting_upgrade($oldversion) {

// Define field introformat to be added to clickmeeting
$table = new xmldb_table('clickmeeting');
$field = new xmldb_field('introformat', XMLDB_TYPE_INTEGER, '4', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, '0',
'intro');
$field = new xmldb_field(
'introformat',
XMLDB_TYPE_INTEGER,
'4',
XMLDB_UNSIGNED,
XMLDB_NOTNULL,
null,
'0',
'intro'
);

// Add field introformat
if (!$dbman->field_exists($table, $field)) {
Expand All @@ -106,11 +113,18 @@ function xmldb_clickmeeting_upgrade($oldversion) {
// two more fields and one index were added to install.xml (note the micro increment
// "01" in the last two digits of the version
if ($oldversion < 2007040101) {

// Define field timecreated to be added to clickmeeting
$table = new xmldb_table('clickmeeting');
$field = new xmldb_field('timecreated', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, '0',
'introformat');
$field = new xmldb_field(
'timecreated',
XMLDB_TYPE_INTEGER,
'10',
XMLDB_UNSIGNED,
XMLDB_NOTNULL,
null,
'0',
'introformat'
);

// Add field timecreated
if (!$dbman->field_exists($table, $field)) {
Expand All @@ -119,8 +133,16 @@ function xmldb_clickmeeting_upgrade($oldversion) {

// Define field timemodified to be added to clickmeeting
$table = new xmldb_table('clickmeeting');
$field = new xmldb_field('timemodified', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, '0',
'timecreated');
$field = new xmldb_field(
'timemodified',
XMLDB_TYPE_INTEGER,
'10',
XMLDB_UNSIGNED,
XMLDB_NOTNULL,
null,
'0',
'timecreated'
);

// Add field timemodified
if (!$dbman->field_exists($table, $field)) {
Expand All @@ -143,14 +165,12 @@ function xmldb_clickmeeting_upgrade($oldversion) {
// Third example, the next day, 2007/04/02 (with the trailing 00), some actions were performed to install.php,
// related with the module
if ($oldversion < 2007040200) {

// insert here code to perform some actions (same as in install.php)

upgrade_mod_savepoint(true, 2007040200, 'clickmeeting');
}

if ($oldversion < 2018101000) {

$table = new xmldb_table('clickmeeting');
$field = new xmldb_field('user_id', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, '0', 'description');

Expand Down
7 changes: 4 additions & 3 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@

// Replace clickmeeting with the name of your module and remove this line

require_once(dirname(dirname(dirname(__FILE__))).'/config.php');
require_once(dirname(__FILE__).'/lib.php');
require_once(dirname(dirname(dirname(__FILE__))) . '/config.php');
require_once(dirname(__FILE__) . '/lib.php');

$id = required_param('id', PARAM_INT); // course

Expand Down Expand Up @@ -76,7 +76,8 @@
} else {
$link = html_writer::link(
new moodle_url('/mod/clickmeeting/view.php', ['id' => $clickmeeting->coursemodule]),
format_string($clickmeeting->name, true));
format_string($clickmeeting->name, true)
);
}

if ($course->format == 'weeks' || $course->format == 'topics') {
Expand Down
28 changes: 14 additions & 14 deletions lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ function clickmeeting_check_conference_availability($starttime, $duration, $id =
];

$curl = clickmeeting_init_curl();
$curl->post($apiurl.'conference/availability', $params);
$curl->post($apiurl . 'conference/availability', $params);

return 200 === $curl->get_info()['http_code'];
}
Expand Down Expand Up @@ -138,7 +138,7 @@ function clickmeeting_add_conference($params) {
$apiurl = get_config('clickmeeting', 'apiurl');

$curlhandle = clickmeeting_init_curl();
$result = $curlhandle->post($apiurl.'conferences', $params);
$result = $curlhandle->post($apiurl . 'conferences', $params);

return $result;
}
Expand All @@ -154,7 +154,7 @@ function clickmeeting_edit_conference($conferenceid, $params) {
$apiurl = get_config('clickmeeting', 'apiurl');

$curlhandle = clickmeeting_init_curl();
$result = $curlhandle->put($apiurl.'conferences/'.$conferenceid, [], ['CURLOPT_POSTFIELDS' => http_build_query($params, '', '&')]);
$result = $curlhandle->put($apiurl . 'conferences/' . $conferenceid, [], ['CURLOPT_POSTFIELDS' => http_build_query($params, '', '&')]);

return $result;
}
Expand All @@ -174,7 +174,7 @@ function clickmeeting_edit_conference_title($conferenceid, $title) {
];

$curlhandle = clickmeeting_init_curl();
$result = $curlhandle->put($apiurl.'conferences/'.$conferenceid, [], ['CURLOPT_POSTFIELDS' => http_build_query($params, '', '&')]);
$result = $curlhandle->put($apiurl . 'conferences/' . $conferenceid, [], ['CURLOPT_POSTFIELDS' => http_build_query($params, '', '&')]);

return $result;
}
Expand All @@ -189,7 +189,7 @@ function clickmeeting_delete_conference($conferenceid) {
$apiurl = get_config('clickmeeting', 'apiurl');

$curlhandle = clickmeeting_init_curl();
$result = $curlhandle->delete($apiurl.'conferences/'.$conferenceid);
$result = $curlhandle->delete($apiurl . 'conferences/' . $conferenceid);

return $result;
}
Expand All @@ -208,7 +208,7 @@ function clickmeeting_generate_token($roomid) {
$params['how_many'] = 1;

$curlhandle = clickmeeting_init_curl();
$result = $curlhandle->post($apiurl.'conferences/'.$roomid.'/tokens', $params);
$result = $curlhandle->post($apiurl . 'conferences/' . $roomid . '/tokens', $params);
$decoder = json_decode($result, true);

return $decoder['access_tokens'][0]['token'];
Expand Down Expand Up @@ -259,7 +259,7 @@ function clickmeeting_get_login_url($roomid, $email, $nickname, $role, $auth, $a
}

$curlhandle = clickmeeting_init_curl();
$result = $curlhandle->post($apiurl.'conferences/'.$roomid.'/room/autologin_hash', $params);
$result = $curlhandle->post($apiurl . 'conferences/' . $roomid . '/room/autologin_hash', $params);
$decoded = json_decode($result, true);

return !empty($decoded['autologin_hash'])
Expand Down Expand Up @@ -343,7 +343,7 @@ function clickmeeting_add_instance(stdClass $clickmeeting, mod_clickmeeting_mod_
$error = '';
if (!empty($r['code'])) {
foreach ($r['errors'] as $err) {
$error .= $err['message'].'<br />';
$error .= $err['message'] . '<br />';
}
throw new \moodle_exception($error, 'error');
}
Expand Down Expand Up @@ -425,7 +425,7 @@ function clickmeeting_update_instance(stdClass $clickmeeting, mod_clickmeeting_m
if (!empty($r['code'])) {
$error = '';
foreach ($r['errors'] as $err) {
$error .= $err['message'].'<br />';
$error .= $err['message'] . '<br />';
}
throw new \moodle_exception($error, 'error');
}
Expand Down Expand Up @@ -640,7 +640,7 @@ function clickmeeting_scale_used_anywhere($scaleid) {
*/
function clickmeeting_grade_item_update(stdClass $clickmeeting) {
global $CFG, $DB;
require_once($CFG->libdir.'/gradelib.php');
require_once($CFG->libdir . '/gradelib.php');

$item = [];
$item['itemname'] = clean_param($clickmeeting->name, PARAM_NOTAGS);
Expand Down Expand Up @@ -683,7 +683,7 @@ function clickmeeting_generate_password($length) {
*/
function clickmeeting_update_grades(stdClass $clickmeeting, $userid = 0) {
global $CFG, $DB;
require_once($CFG->libdir.'/gradelib.php');
require_once($CFG->libdir . '/gradelib.php');

$grades = []; // populate array of grade objects indexed by userid

Expand Down Expand Up @@ -771,7 +771,7 @@ function clickmeeting_extend_navigation(navigation_node $navref, stdClass $cours
* @param settings_navigation $settingsnav
* @param navigation_node $clickmeetingnode
*/
function clickmeeting_extend_settings_navigation(settings_navigation $settingsnav, navigation_node $clickmeetingnode=null) {
function clickmeeting_extend_settings_navigation(settings_navigation $settingsnav, navigation_node $clickmeetingnode = null) {
}

/**
Expand Down Expand Up @@ -808,10 +808,10 @@ function clickmeeting_init_curl() {
*/
function clickmeeting_page_view($clickmeeting, $course, $cm, $context) {

$params = array(
$params = [
'context' => $context,
'objectid' => $clickmeeting->id,
);
];

$event = mod_clickmeeting\event\course_module_viewed::create($params);
$event->add_record_snapshot('course_modules', $cm);
Expand Down
5 changes: 2 additions & 3 deletions mod_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,12 @@

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

require_once($CFG->dirroot.'/course/moodleform_mod.php');
require_once($CFG->dirroot . '/course/moodleform_mod.php');

/**
* Module instance settings form
*/
class mod_clickmeeting_mod_form extends moodleform_mod {

/**
* Defines webinar open to all
*/
Expand Down Expand Up @@ -71,7 +70,7 @@ public function definition() {

$conferencestarttime = required_param('start_time', PARAM_TEXT);
$conferenceduration = required_param('duration', PARAM_INT);
if (clickmeeting_check_conference_availability($conferencestarttime, $conferenceduration, $conferenceid)) {
if (clickmeeting_check_conference_availability($conferencestarttime, $conferenceduration, $conferenceid)) {
http_response_code(200);
echo 'SUCCESS';
} else {
Expand Down
24 changes: 14 additions & 10 deletions settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,22 @@
defined('MOODLE_INTERNAL') || die;

if ($ADMIN->fulltree) {
require_once(dirname(__FILE__).'/lib.php');
require_once(dirname(__FILE__) . '/lib.php');

$settings->add(new admin_setting_configtext('clickmeeting/apiurl',
get_string('settings:apiurl', 'clickmeeting'),
get_string('settings:apiurldesc', 'clickmeeting'),
'https://api.clickmeeting.com/v1/',
PARAM_URL));
$settings->add(new admin_setting_configtext(
'clickmeeting/apiurl',
get_string('settings:apiurl', 'clickmeeting'),
get_string('settings:apiurldesc', 'clickmeeting'),
'https://api.clickmeeting.com/v1/',
PARAM_URL
));

$settings->add(new admin_setting_configtext('clickmeeting/apikey',
get_string('settings:apikey', 'clickmeeting'),
get_string('settings:apikeydesc', 'clickmeeting'),
''));
$settings->add(new admin_setting_configtext(
'clickmeeting/apikey',
get_string('settings:apikey', 'clickmeeting'),
get_string('settings:apikeydesc', 'clickmeeting'),
''
));

$settings->add(new admin_setting_configduration(
'clickmeeting/graceperiod',
Expand Down
16 changes: 8 additions & 8 deletions view.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

require_once(dirname(dirname(dirname(__FILE__))).'/config.php');
require_once(dirname(__FILE__).'/lib.php');
require_once(dirname(dirname(dirname(__FILE__))) . '/config.php');
require_once(dirname(__FILE__) . '/lib.php');

$id = optional_param('id', 0, PARAM_INT); // course_module ID, or
$n = optional_param('n', 0, PARAM_INT); // clickmeeting instance ID - it should be named as the first character of the module
Expand Down Expand Up @@ -100,22 +100,22 @@
// Output starts here
echo $OUTPUT->header();

echo '<b style="font-size: 110%;">'.get_string('view:room_name', 'clickmeeting').': </b>'.$clickmeeting->name;
echo '<b style="font-size: 110%;">' . get_string('view:room_name', 'clickmeeting') . ': </b>' . $clickmeeting->name;
echo '<br /><br />';

if (!clickmeeting_is_room_historical($conference->conference_id)) {
$timestamp = strtotime('+'.$clickmeeting->duration.' hours', $clickmeeting->timestart);
echo '<b style="font-size: 110%;">'.get_string('view:room_date', 'clickmeeting').': </b>'.$clickmeeting->start_time.' - '.date('Y-m-d H:i:s', $timestamp);
$timestamp = strtotime('+' . $clickmeeting->duration . ' hours', $clickmeeting->timestart);
echo '<b style="font-size: 110%;">' . get_string('view:room_date', 'clickmeeting') . ': </b>' . $clickmeeting->start_time . ' - ' . date('Y-m-d H:i:s', $timestamp);
echo '<br /><br />';
echo '<b style="font-size: 110%;">'.get_string('view:room_description', 'clickmeeting').': </b>'.$clickmeeting->description;
echo '<b style="font-size: 110%;">' . get_string('view:room_description', 'clickmeeting') . ': </b>' . $clickmeeting->description;
echo '<br /><br />';
if (clickmeeting_is_password_protected($clickmeeting)) {
echo '<b style="font-size: 110%;">'.get_string('view:password', 'clickmeeting').': </b>'.$conference->password;
echo '<b style="font-size: 110%;">' . get_string('view:password', 'clickmeeting') . ': </b>' . $conference->password;
echo '<br /><br />';
}
$loginurl = sprintf('%s?l=%s', $conference->room_url, $loginhash);
echo '<div style="text-align: center;" class="bt-green">';
echo '<a class="enter_meeting" href="'.$loginurl.'" target="_blank">'.get_string('view:joinmeeting', 'clickmeeting').'</a>';
echo '<a class="enter_meeting" href="' . $loginurl . '" target="_blank">' . get_string('view:joinmeeting', 'clickmeeting') . '</a>';
echo '</div>';
} else {
echo '<b style="font-size: 110%;">' . get_string('view:oldmeeting', 'clickmeeting') . '</b>';
Expand Down
Loading