@@ -25,7 +25,7 @@ discard block  | 
                                                    ||
| 25 | 25 | |
| 26 | 26 |  defined('MOODLE_INTERNAL') || die; | 
                                                        
| 27 | 27 | |
| 28 | -require_once($CFG->dirroot.'/mod/bigbluebuttonbn/backup/moodle2/backup_bigbluebuttonbn_stepslib.php');  | 
                                                        |
| 28 | +require_once($CFG->dirroot . '/mod/bigbluebuttonbn/backup/moodle2/backup_bigbluebuttonbn_stepslib.php');  | 
                                                        |
| 29 | 29 | |
| 30 | 30 | /**  | 
                                                        
| 31 | 31 | * Backup task that provides all the settings and steps to perform one complete backup of the activity.  | 
                                                        
@@ -62,14 +62,14 @@ discard block  | 
                                                    ||
| 62 | 62 |      public static function encode_content_links($content) { | 
                                                        
| 63 | 63 | global $CFG;  | 
                                                        
| 64 | 64 | |
| 65 | - $base = preg_quote($CFG->wwwroot.'/mod/bigbluebuttonbn', '#');  | 
                                                        |
| 65 | + $base = preg_quote($CFG->wwwroot . '/mod/bigbluebuttonbn', '#');  | 
                                                        |
| 66 | 66 | |
| 67 | 67 | // Link to the list of bigbluebuttonbns.  | 
                                                        
| 68 | -        $pattern = '#('.$base."\/index.php\?id\=)([0-9]+)#"; | 
                                                        |
| 68 | +        $pattern = '#(' . $base . "\/index.php\?id\=)([0-9]+)#"; | 
                                                        |
| 69 | 69 | $content = preg_replace($pattern, '$@BIGBLUEBUTTONBNINDEX*$2@$', $content);  | 
                                                        
| 70 | 70 | |
| 71 | 71 | // Link to bigbluebuttonbn view by moduleid.  | 
                                                        
| 72 | -        $pattern = '#('.$base."\/view.php\?id\=)([0-9]+)#"; | 
                                                        |
| 72 | +        $pattern = '#(' . $base . "\/view.php\?id\=)([0-9]+)#"; | 
                                                        |
| 73 | 73 | $content = preg_replace($pattern, '$@BIGBLUEBUTTONBNVIEWBYID*$2@$', $content);  | 
                                                        
| 74 | 74 | |
| 75 | 75 | return $content;  | 
                                                        
@@ -48,7 +48,7 @@  | 
                                                    ||
| 48 | 48 |          $logs = new backup_nested_element('logs'); | 
                                                        
| 49 | 49 | |
| 50 | 50 |          $log = new backup_nested_element('log', array('id'), array( | 
                                                        
| 51 | - 'courseid', 'bigbluebuttonbnid', 'userid', 'timecreated', 'meetingid', 'log', 'meta', ));  | 
                                                        |
| 51 | + 'courseid', 'bigbluebuttonbnid', 'userid', 'timecreated', 'meetingid', 'log', 'meta',));  | 
                                                        |
| 52 | 52 | |
| 53 | 53 | // Build the tree.  | 
                                                        
| 54 | 54 | $bigbluebuttonbn->add_child($logs);  | 
                                                        
@@ -25,7 +25,7 @@  | 
                                                    ||
| 25 | 25 | |
| 26 | 26 |  defined('MOODLE_INTERNAL') || die(); | 
                                                        
| 27 | 27 | |
| 28 | -require_once($CFG->dirroot.'/mod/bigbluebuttonbn/backup/moodle2/restore_bigbluebuttonbn_stepslib.php');  | 
                                                        |
| 28 | +require_once($CFG->dirroot . '/mod/bigbluebuttonbn/backup/moodle2/restore_bigbluebuttonbn_stepslib.php');  | 
                                                        |
| 29 | 29 | |
| 30 | 30 | /**  | 
                                                        
| 31 | 31 | * Restore task that provides all the settings and steps to perform one complete restore of the activity.  | 
                                                        
@@ -98,7 +98,7 @@ discard block  | 
                                                    ||
| 98 | 98 | * recordings from a different activity even from a different course.  | 
                                                        
| 99 | 99 | **/  | 
                                                        
| 100 | 100 | |
| 101 | - /*  | 
                                                        |
| 101 | + /*  | 
                                                        |
| 102 | 102 | * When the value is set to 1 (checked) the bigbluebuttonbn rooms or  | 
                                                        
| 103 | 103 | * activities will have the 'import recordings' capability enabled.  | 
                                                        
| 104 | 104 | * $CFG->bigbluebuttonbn['importrecordings_enabled'] = 0;  | 
                                                        
@@ -119,7 +119,7 @@ discard block  | 
                                                    ||
| 119 | 119 | * 'Join session' button enabled  | 
                                                        
| 120 | 120 | **/  | 
                                                        
| 121 | 121 | |
| 122 | - /*  | 
                                                        |
| 122 | + /*  | 
                                                        |
| 123 | 123 | * When the value is set to 1 (checked) the bigbluebuttonbn rooms or  | 
                                                        
| 124 | 124 | * activities will have the 'wait for moderator' capability enabled by  | 
                                                        
| 125 | 125 | * default.  | 
                                                        
@@ -298,27 +298,27 @@ discard block  | 
                                                    ||
| 298 | 298 | * $CFG->bigbluebuttonbn['general_warning_message'] = "Would you like to record your BigBlueButton sessions for later viewing? ";  | 
                                                        
| 299 | 299 | */  | 
                                                        
| 300 | 300 | |
| 301 | - /*  | 
                                                        |
| 301 | + /*  | 
                                                        |
| 302 | 302 | * The warning box is always shown to administrators, but it is also possible to define other roles  | 
                                                        
| 303 | 303 | * to whom the it will be shown. The roles are based on the shortnames defined by Moodle:  | 
                                                        
| 304 | 304 | * 'manager,coursecreator,editingteacher,teacher,student,guest,user,frontpage'  | 
                                                        
| 305 | 305 | * $CFG->bigbluebuttonbn['general_warning_roles'] = 'editingteacher,teacher';  | 
                                                        
| 306 | 306 | */  | 
                                                        
| 307 | 307 | |
| 308 | - /*  | 
                                                        |
| 308 | + /*  | 
                                                        |
| 309 | 309 | * As the general_warning_message is shown in a box, its type can be defined with general_warning_type  | 
                                                        
| 310 | 310 | * The default type is 'info' which is normaly rendered in blue when using a bootstrap theme.  | 
                                                        
| 311 | 311 | * All the modifiers for boxed in bootstrap can be used [info|success|warning|danger].  | 
                                                        
| 312 | 312 | * $CFG->bigbluebuttonbn['general_warning_box_type'] = 'info';  | 
                                                        
| 313 | 313 | */  | 
                                                        
| 314 | 314 | |
| 315 | - /*  | 
                                                        |
| 315 | + /*  | 
                                                        |
| 316 | 316 | * Additionally, when general_warning_button_href value is different than "", a button  | 
                                                        
| 317 | 317 | * can also be shown right after the message.  | 
                                                        
| 318 | 318 | * $CFG->bigbluebuttonbn['general_warning_button_href'] = "http://blindsidenetworks.com/";  | 
                                                        
| 319 | 319 | */  | 
                                                        
| 320 | 320 | |
| 321 | - /*  | 
                                                        |
| 321 | + /*  | 
                                                        |
| 322 | 322 | * Finally, the text and class for the button can be modified  | 
                                                        
| 323 | 323 | * $CFG->bigbluebuttonbn['general_warning_button_text'] = "Upgrade your site";  | 
                                                        
| 324 | 324 | * $CFG->bigbluebuttonbn['general_warning_button_class'] = "btn btn-primary";  | 
                                                        
@@ -47,7 +47,7 @@ discard block  | 
                                                    ||
| 47 | 47 |      public static function notification_process($context, $bigbluebuttonbn, $action) { | 
                                                        
| 48 | 48 | global $USER;  | 
                                                        
| 49 | 49 | // Prepare message.  | 
                                                        
| 50 | - $msg = (object) array();  | 
                                                        |
| 50 | + $msg = (object)array();  | 
                                                        |
| 51 | 51 | // Build the message_body.  | 
                                                        
| 52 | 52 | $msg->action = $action;  | 
                                                        
| 53 | 53 | $msg->activity_type = '';  | 
                                                        
@@ -72,26 +72,26 @@ discard block  | 
                                                    ||
| 72 | 72 | * @return string  | 
                                                        
| 73 | 73 | */  | 
                                                        
| 74 | 74 |      public static function notification_msg_html($msg) { | 
                                                        
| 75 | - $messagetext = '<p>'.$msg->activity_type.' "'.$msg->activity_title.'" '.  | 
                                                        |
| 76 | -            get_string('email_body_notification_meeting_has_been', 'bigbluebuttonbn').' '.$msg->action.'.</p>'."\n"; | 
                                                        |
| 77 | - $messagetext .= '<p><b>'.$msg->activity_title.'</b> '.  | 
                                                        |
| 78 | -            get_string('email_body_notification_meeting_details', 'bigbluebuttonbn').':'."\n"; | 
                                                        |
| 79 | - $messagetext .= '<table border="0" style="margin: 5px 0 0 20px"><tbody>'."\n";  | 
                                                        |
| 80 | - $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'.  | 
                                                        |
| 81 | -            get_string('email_body_notification_meeting_title', 'bigbluebuttonbn').': </td><td>'."\n"; | 
                                                        |
| 82 | - $messagetext .= $msg->activity_title.'</td></tr>'."\n";  | 
                                                        |
| 83 | - $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'.  | 
                                                        |
| 84 | -            get_string('email_body_notification_meeting_description', 'bigbluebuttonbn').': </td><td>'."\n"; | 
                                                        |
| 85 | - $messagetext .= $msg->activity_description.'</td></tr>'."\n";  | 
                                                        |
| 86 | - $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'.  | 
                                                        |
| 87 | -            get_string('email_body_notification_meeting_start_date', 'bigbluebuttonbn').': </td><td>'."\n"; | 
                                                        |
| 88 | - $messagetext .= $msg->activity_openingtime.'</td></tr>'."\n";  | 
                                                        |
| 89 | - $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'.  | 
                                                        |
| 90 | -            get_string('email_body_notification_meeting_end_date', 'bigbluebuttonbn').': </td><td>'."\n"; | 
                                                        |
| 91 | - $messagetext .= $msg->activity_closingtime.'</td></tr>'."\n";  | 
                                                        |
| 92 | - $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'.$msg->action.' '.  | 
                                                        |
| 93 | -            get_string('email_body_notification_meeting_by', 'bigbluebuttonbn').': </td><td>'."\n"; | 
                                                        |
| 94 | - $messagetext .= $msg->activity_owner.'</td></tr></tbody></table></p>'."\n";  | 
                                                        |
| 75 | + $messagetext = '<p>' . $msg->activity_type . ' "' . $msg->activity_title . '" ' .  | 
                                                        |
| 76 | +            get_string('email_body_notification_meeting_has_been', 'bigbluebuttonbn') . ' ' . $msg->action . '.</p>' . "\n"; | 
                                                        |
| 77 | + $messagetext .= '<p><b>' . $msg->activity_title . '</b> ' .  | 
                                                        |
| 78 | +            get_string('email_body_notification_meeting_details', 'bigbluebuttonbn') . ':' . "\n"; | 
                                                        |
| 79 | + $messagetext .= '<table border="0" style="margin: 5px 0 0 20px"><tbody>' . "\n";  | 
                                                        |
| 80 | + $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' .  | 
                                                        |
| 81 | +            get_string('email_body_notification_meeting_title', 'bigbluebuttonbn') . ': </td><td>' . "\n"; | 
                                                        |
| 82 | + $messagetext .= $msg->activity_title . '</td></tr>' . "\n";  | 
                                                        |
| 83 | + $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' .  | 
                                                        |
| 84 | +            get_string('email_body_notification_meeting_description', 'bigbluebuttonbn') . ': </td><td>' . "\n"; | 
                                                        |
| 85 | + $messagetext .= $msg->activity_description . '</td></tr>' . "\n";  | 
                                                        |
| 86 | + $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' .  | 
                                                        |
| 87 | +            get_string('email_body_notification_meeting_start_date', 'bigbluebuttonbn') . ': </td><td>' . "\n"; | 
                                                        |
| 88 | + $messagetext .= $msg->activity_openingtime . '</td></tr>' . "\n";  | 
                                                        |
| 89 | + $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' .  | 
                                                        |
| 90 | +            get_string('email_body_notification_meeting_end_date', 'bigbluebuttonbn') . ': </td><td>' . "\n"; | 
                                                        |
| 91 | + $messagetext .= $msg->activity_closingtime . '</td></tr>' . "\n";  | 
                                                        |
| 92 | + $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' . $msg->action . ' ' .  | 
                                                        |
| 93 | +            get_string('email_body_notification_meeting_by', 'bigbluebuttonbn') . ': </td><td>' . "\n"; | 
                                                        |
| 94 | + $messagetext .= $msg->activity_owner . '</td></tr></tbody></table></p>' . "\n";  | 
                                                        |
| 95 | 95 | return $messagetext;  | 
                                                        
| 96 | 96 | }  | 
                                                        
| 97 | 97 | |
@@ -108,14 +108,14 @@ discard block  | 
                                                    ||
| 108 | 108 | global $DB;  | 
                                                        
| 109 | 109 |          $course = $DB->get_record('course', array('id' => $bigbluebuttonbn->course), '*', MUST_EXIST); | 
                                                        
| 110 | 110 | // Complete message.  | 
                                                        
| 111 | - $msg = (object) array();  | 
                                                        |
| 111 | + $msg = (object)array();  | 
                                                        |
| 112 | 112 | $msg->user_name = fullname($sender);  | 
                                                        
| 113 | 113 | $msg->user_email = $sender->email;  | 
                                                        
| 114 | 114 | $msg->course_name = "$course->fullname";  | 
                                                        
| 115 | -        $message .= '<p><hr/><br/>'.get_string('email_footer_sent_by', 'bigbluebuttonbn').' '. | 
                                                        |
| 116 | -            $msg->user_name.'('.$msg->user_email.') '; | 
                                                        |
| 117 | -        $message .= get_string('email_footer_sent_from', 'bigbluebuttonbn').' '.$msg->course_name.'.</p>'; | 
                                                        |
| 118 | - $users = (array) get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true);  | 
                                                        |
| 115 | +        $message .= '<p><hr/><br/>' . get_string('email_footer_sent_by', 'bigbluebuttonbn') . ' ' . | 
                                                        |
| 116 | +            $msg->user_name . '(' . $msg->user_email . ') '; | 
                                                        |
| 117 | +        $message .= get_string('email_footer_sent_from', 'bigbluebuttonbn') . ' ' . $msg->course_name . '.</p>'; | 
                                                        |
| 118 | + $users = (array)get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true);  | 
                                                        |
| 119 | 119 |          foreach ($users as $user) { | 
                                                        
| 120 | 120 |              if ($user->id != $sender->id) { | 
                                                        
| 121 | 121 | message_post_message($sender, $user, $message, FORMAT_HTML);  | 
                                                        
@@ -28,7 +28,7 @@ discard block  | 
                                                    ||
| 28 | 28 |  defined('MOODLE_INTERNAL') || die(); | 
                                                        
| 29 | 29 | |
| 30 | 30 | require_once($CFG->dirroot . '/mod/bigbluebuttonbn/locallib.php');  | 
                                                        
| 31 | -require_once($CFG->libdir.'/adminlib.php');  | 
                                                        |
| 31 | +require_once($CFG->libdir . '/adminlib.php');  | 
                                                        |
| 32 | 32 | |
| 33 | 33 | /**  | 
                                                        
| 34 | 34 | * Helper class for rendering HTML for settings.php.  | 
                                                        
@@ -66,7 +66,7 @@ discard block  | 
                                                    ||
| 66 | 66 |              $itemname = get_string('config_' . $name, 'bigbluebuttonbn'); | 
                                                        
| 67 | 67 | }  | 
                                                        
| 68 | 68 |          if ($itemdescription === null) { | 
                                                        
| 69 | -            $itemdescription = get_string('config_' .$name . '_description', 'bigbluebuttonbn'); | 
                                                        |
| 69 | +            $itemdescription = get_string('config_' . $name . '_description', 'bigbluebuttonbn'); | 
                                                        |
| 70 | 70 | }  | 
                                                        
| 71 | 71 |          $item = new \admin_setting_heading('bigbluebuttonbn_config_' . $name, $itemname, $itemdescription); | 
                                                        
| 72 | 72 | $this->settings->add($item);  | 
                                                        
@@ -148,7 +148,7 @@ discard block  | 
                                                    ||
| 148 | 148 |      public function render_warning_message($name, $message, $type = 'warning', $closable = true) { | 
                                                        
| 149 | 149 | global $OUTPUT;  | 
                                                        
| 150 | 150 |          $output = $OUTPUT->box_start('box boxalignleft adminerror alert alert-' . $type . ' alert-block fade in', | 
                                                        
| 151 | - 'bigbluebuttonbn_' . $name)."\n";  | 
                                                        |
| 151 | + 'bigbluebuttonbn_' . $name) . "\n";  | 
                                                        |
| 152 | 152 |          if ($closable) { | 
                                                        
| 153 | 153 | $output .= ' <button type="button" class="close" data-dismiss="alert">×</button>' . "\n";  | 
                                                        
| 154 | 154 | }  | 
                                                        
@@ -52,7 +52,7 @@  | 
                                                    ||
| 52 | 52 | $params .= '&' . $key . '=' . urlencode($value);  | 
                                                        
| 53 | 53 | }  | 
                                                        
| 54 | 54 |          foreach ($metadata as $key => $value) { | 
                                                        
| 55 | - $params .= '&' . 'meta_' . $key.'=' . urlencode($value);  | 
                                                        |
| 55 | + $params .= '&' . 'meta_' . $key . '=' . urlencode($value);  | 
                                                        |
| 56 | 56 | }  | 
                                                        
| 57 | 57 | return $baseurl . $params . '&checksum=' . sha1($action . $params . self::sanitized_secret());  | 
                                                        
| 58 | 58 | }  | 
                                                        
@@ -205,7 +205,7 @@  | 
                                                    ||
| 205 | 205 | !isset($CFG->bigbluebuttonbn['recordings_imported_editable']) ||  | 
                                                        
| 206 | 206 | !isset($CFG->bigbluebuttonbn['recordings_preview_default']) ||  | 
                                                        
| 207 | 207 | !isset($CFG->bigbluebuttonbn['recordings_preview_editable'])  | 
                                                        
| 208 | - );  | 
                                                        |
| 208 | + );  | 
                                                        |
| 209 | 209 | }  | 
                                                        
| 210 | 210 | |
| 211 | 211 | /**  | 
                                                        
@@ -28,7 +28,7 @@ discard block  | 
                                                    ||
| 28 | 28 |  defined('MOODLE_INTERNAL') || die(); | 
                                                        
| 29 | 29 | |
| 30 | 30 | require_once($CFG->dirroot . '/mod/bigbluebuttonbn/locallib.php');  | 
                                                        
| 31 | -require_once($CFG->libdir.'/adminlib.php');  | 
                                                        |
| 31 | +require_once($CFG->libdir . '/adminlib.php');  | 
                                                        |
| 32 | 32 | |
| 33 | 33 | /**  | 
                                                        
| 34 | 34 | * Helper class for validating settings used HTML for settings.php.  | 
                                                        
@@ -62,7 +62,7 @@ discard block  | 
                                                    ||
| 62 | 62 | !isset($CFG->bigbluebuttonbn['recording_all_from_start_default']) ||  | 
                                                        
| 63 | 63 | !isset($CFG->bigbluebuttonbn['recording_all_from_start_editable']) ||  | 
                                                        
| 64 | 64 | !isset($CFG->bigbluebuttonbn['recording_hide_button_default']) ||  | 
                                                        
| 65 | - !isset($CFG->bigbluebuttonbn['recording_hide_button_editable']) );  | 
                                                        |
| 65 | + !isset($CFG->bigbluebuttonbn['recording_hide_button_editable']));  | 
                                                        |
| 66 | 66 | }  | 
                                                        
| 67 | 67 | |
| 68 | 68 | /**  | 
                                                        
@@ -80,7 +80,7 @@  | 
                                                    ||
| 80 | 80 | 'objectid' => $this->objectid,  | 
                                                        
| 81 | 81 | 'contextinstanceid' => $this->contextinstanceid,  | 
                                                        
| 82 | 82 | 'other' => $this->other  | 
                                                        
| 83 | - );  | 
                                                        |
| 83 | + );  | 
                                                        |
| 84 | 84 | $string = $this->description;  | 
                                                        
| 85 | 85 |          foreach ($vars as $key => $value) { | 
                                                        
| 86 | 86 |              $string = str_replace("##" . $key, $value, $string); |