Completed
Push — 1.10.x ( 986d2b...f19030 )
by Angel Fernando Quiroz
69:29 queued 19:50
created
plugin/bbb/cron.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -1,16 +1,16 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-require __DIR__ . '/../../vendor/autoload.php';
4
-if (file_exists(__DIR__ . '/config.vm.php')) {
3
+require __DIR__.'/../../vendor/autoload.php';
4
+if (file_exists(__DIR__.'/config.vm.php')) {
5 5
 
6
-    require_once dirname(__FILE__) . '/config.php';
6
+    require_once dirname(__FILE__).'/config.php';
7 7
 
8
-    require __DIR__ . '/lib/vm/AbstractVM.php';
9
-    require __DIR__ . '/lib/vm/VMInterface.php';
10
-    require __DIR__ . '/lib/vm/DigitalOceanVM.php';
11
-    require __DIR__ . '/lib/VM.php';
8
+    require __DIR__.'/lib/vm/AbstractVM.php';
9
+    require __DIR__.'/lib/vm/VMInterface.php';
10
+    require __DIR__.'/lib/vm/DigitalOceanVM.php';
11
+    require __DIR__.'/lib/VM.php';
12 12
 
13
-    $config = require __DIR__ . '/config.vm.php';
13
+    $config = require __DIR__.'/config.vm.php';
14 14
 
15 15
     $vm = new VM($config);
16 16
 
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
             if (empty($activeSessions)) {
22 22
                 $vm->runCron();
23 23
             } else {
24
-                echo "Can't run cron active sessions found: " . $activeSessions;
24
+                echo "Can't run cron active sessions found: ".$activeSessions;
25 25
             }
26 26
         }
27 27
     }
Please login to merge, or discard this patch.
plugin/bbb/lib/bbb_api.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -55,25 +55,25 @@  discard block
 block discarded – undo
55 55
 	*/
56 56
 		// BASE CONFIGS - set these for your BBB server in config.php and they will
57 57
 		// simply flow in here via the constants:
58
-		$this->_securitySalt 		= CONFIG_SECURITY_SALT;
59
-		$this->_bbbServerBaseUrl 	= CONFIG_SERVER_BASE_URL;
58
+		$this->_securitySalt = CONFIG_SECURITY_SALT;
59
+		$this->_bbbServerBaseUrl = CONFIG_SERVER_BASE_URL;
60 60
 	}
61 61
 
62
-	private function _processXmlResponse($url){
62
+	private function _processXmlResponse($url) {
63 63
 	/*
64 64
 	A private utility method used by other public methods to process XML responses.
65 65
 	*/
66 66
 		if (extension_loaded('curl')) {
67
-			$ch = curl_init() or die ( curl_error($ch) );
67
+			$ch = curl_init() or die (curl_error($ch));
68 68
 			$timeout = 10;
69
-			curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, false);
70
-			curl_setopt( $ch, CURLOPT_URL, $url );
71
-			curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );
72
-			curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT, $timeout);
73
-			$data = curl_exec( $ch );
74
-			curl_close( $ch );
75
-
76
-			if($data)
69
+			curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
70
+			curl_setopt($ch, CURLOPT_URL, $url);
71
+			curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
72
+			curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
73
+			$data = curl_exec($ch);
74
+			curl_close($ch);
75
+
76
+			if ($data)
77 77
 				return (new SimpleXMLElement($data));
78 78
 			else
79 79
 				return false;
@@ -137,10 +137,10 @@  discard block
 block discarded – undo
137 137
 		'&duration='.urlencode($creationParams['duration']);
138 138
 		//'&meta_category='.urlencode($creationParams['meta_category']);
139 139
 		$welcomeMessage = $creationParams['welcomeMsg'];
140
-		if(trim($welcomeMessage))
140
+		if (trim($welcomeMessage))
141 141
 			$params .= '&welcome='.urlencode($welcomeMessage);
142 142
 		// Return the complete URL:
143
-		return ( $creationUrl.$params.'&checksum='.sha1("create".$params.$this->_securitySalt) );
143
+		return ($creationUrl.$params.'&checksum='.sha1("create".$params.$this->_securitySalt));
144 144
 	}
145 145
 
146 146
 	public function createMeetingWithXmlResponseArray($creationParams) {
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
 		$xml = $this->_processXmlResponse($this->getCreateMeetingURL($creationParams));
166 166
 
167 167
         if ($xml) {
168
-			if($xml->meetingID)
168
+			if ($xml->meetingID)
169 169
 				return array(
170 170
 					'returncode' => $xml->returncode,
171 171
 					'message' => $xml->message,
@@ -283,7 +283,7 @@  discard block
 block discarded – undo
283 283
 		$meetingId = '1234'		-- REQUIRED - The unique id for the meeting
284 284
 		*/
285 285
 		$xml = $this->_processXmlResponse($this->getIsMeetingRunningUrl($meetingId));
286
-		if($xml) {
286
+		if ($xml) {
287 287
 			return array(
288 288
 				'returncode' => $xml->returncode,
289 289
 				'running' => $xml->running 	// -- Returns true/false.
@@ -310,7 +310,7 @@  discard block
 block discarded – undo
310 310
 		and then handle the results that we get in the XML response.
311 311
 		*/
312 312
 		$xml = $this->_processXmlResponse($this->getGetMeetingsUrl());
313
-		if($xml) {
313
+		if ($xml) {
314 314
 			// If we don't get a success code, stop processing and return just the returncode:
315 315
 			if ($xml->returncode != 'SUCCESS') {
316 316
 				$result = array(
@@ -379,7 +379,7 @@  discard block
 block discarded – undo
379 379
 		);
380 380
 		*/
381 381
 		$xml = $this->_processXmlResponse($this->getMeetingInfoUrl($infoParams));
382
-		if($xml) {
382
+		if ($xml) {
383 383
 			// If we don't get a success code or messageKey, find out why:
384 384
 			if (($xml->returncode != 'SUCCESS') || ($xml->messageKey == null)) {
385 385
 				$result = array(
@@ -454,7 +454,7 @@  discard block
 block discarded – undo
454 454
 		probably be required in user code when 'recording' is set to true.
455 455
 		*/
456 456
 		$xml = $this->_processXmlResponse($this->getRecordingsUrl($recordingParams));
457
-		if($xml) {
457
+		if ($xml) {
458 458
 			// If we don't get a success code or messageKey, find out why:
459 459
 			if (($xml->returncode != 'SUCCESS') || ($xml->messageKey == null)) {
460 460
 				$result = array(
@@ -524,7 +524,7 @@  discard block
 block discarded – undo
524 524
 		);
525 525
 		*/
526 526
 		$xml = $this->_processXmlResponse($this->getPublishRecordingsUrl($recordingParams));
527
-		if($xml) {
527
+		if ($xml) {
528 528
 			return array(
529 529
 				'returncode' => $xml->returncode,
530 530
 				'published' => $xml->published 	// -- Returns true/false.
@@ -557,7 +557,7 @@  discard block
 block discarded – undo
557 557
 		*/
558 558
 
559 559
 		$xml = $this->_processXmlResponse($this->getDeleteRecordingsUrl($recordingParams));
560
-		if($xml) {
560
+		if ($xml) {
561 561
 			return array(
562 562
 				'returncode' => $xml->returncode,
563 563
 				'deleted' => $xml->deleted 	// -- Returns true/false.
Please login to merge, or discard this patch.
plugin/bbb/lib/VM.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@
 block discarded – undo
70 70
 
71 71
         foreach ($vmList as $vm) {
72 72
             if (isset($vm['enabled']) && $vm['enabled'] == true) {
73
-                $className = $vm['name'] . 'VM';
73
+                $className = $vm['name'].'VM';
74 74
 
75 75
                 return new $className($vm);
76 76
                 break;
Please login to merge, or discard this patch.
plugin/bbb/lib/vm/DigitalOceanVM.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
                         break;
101 101
                 }
102 102
             } else {
103
-                throw new \Exception(" Id " . $this->vmId . " doesn't exists.");
103
+                throw new \Exception(" Id ".$this->vmId." doesn't exists.");
104 104
             }
105 105
         } catch (Exception $e) {
106 106
             die($e->getMessage());
@@ -118,22 +118,22 @@  discard block
 block discarded – undo
118 118
 
119 119
         $powerOff = $droplets->powerOff($this->vmId);
120 120
 
121
-        $this->addMessage('Power off droplet #' . $this->vmId);
121
+        $this->addMessage('Power off droplet #'.$this->vmId);
122 122
 
123 123
         $this->waitForEvent($powerOff->event_id);
124 124
 
125
-        $this->addMessage('Current status: ' . $dropletInfo->droplet->status);
125
+        $this->addMessage('Current status: '.$dropletInfo->droplet->status);
126 126
 
127 127
         $resizeDroplet = $droplets->resize(
128 128
             $this->vmId,
129 129
             array('size_id' => intval($sizeId))
130 130
         );
131
-        $this->addMessage('Resize droplet to size id: ' . $sizeId);
131
+        $this->addMessage('Resize droplet to size id: '.$sizeId);
132 132
         $this->waitForEvent($resizeDroplet->event_id);
133 133
 
134 134
         $powerOn = $droplets->powerOn($this->vmId);
135 135
         $this->waitForEvent($powerOn->event_id);
136
-        $this->addMessage('Power on droplet #' . $this->vmId);
136
+        $this->addMessage('Power on droplet #'.$this->vmId);
137 137
 
138 138
     }
139 139
 
Please login to merge, or discard this patch.
plugin/dashboard/block_course/block_course.class.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -63,19 +63,19 @@  discard block
 block discarded – undo
63 63
         $content = $this->get_content_html();
64 64
         $html = '
65 65
 		            <div class="panel panel-default" id="intro">
66
-		                <div class="panel-heading">' . get_lang('CoursesInformation') . '
66
+		                <div class="panel-heading">' . get_lang('CoursesInformation').'
67 67
 		                    <div class="pull-right"><a class="btn btn-danger btn-xs" onclick="javascript:if(!confirm(\'' . addslashes(
68 68
                 api_htmlentities(
69 69
                     get_lang('ConfirmYourChoice'),
70 70
                     ENT_QUOTES,
71 71
                     $charset
72 72
                 )
73
-            ) . '\')) return false;" href="index.php?action=disable_block&path=' . $this->path . '">
73
+            ).'\')) return false;" href="index.php?action=disable_block&path='.$this->path.'">
74 74
                 <em class="fa fa-times"></em>
75 75
                 </a></div>
76 76
 		                </div>
77 77
 		                <div class="panel-body">
78
-		                   ' . $content . '
78
+		                   ' . $content.'
79 79
 		                </div>
80 80
 		            </div>
81 81
 				';
@@ -93,17 +93,17 @@  discard block
 block discarded – undo
93 93
     {
94 94
         $course_data = $this->get_course_information_data();
95 95
         //$content = '<div style="margin:10px;">';
96
-        $content = '<h4>' . get_lang(
96
+        $content = '<h4>'.get_lang(
97 97
                 'YourCourseList'
98
-            ) . '</h4>';
98
+            ).'</h4>';
99 99
         $data_table = null;
100 100
         if (!empty($course_data)) {
101 101
             $data_table .= '<table class="data_table" width:"95%">';
102 102
             $data_table .= '<tr>
103
-	    						<th>' . get_lang('CourseTitle') . '</th>
104
-	    						<th width="20%">' . get_lang('NbStudents') . '</th>
105
-	    						<th width="20%">' . get_lang('AvgTimeSpentInTheCourse') . '</th>
106
-	    						<th width="20%">' . get_lang('ThematicAdvance') . '</th>
103
+	    						<th>' . get_lang('CourseTitle').'</th>
104
+	    						<th width="20%">' . get_lang('NbStudents').'</th>
105
+	    						<th width="20%">' . get_lang('AvgTimeSpentInTheCourse').'</th>
106
+	    						<th width="20%">' . get_lang('ThematicAdvance').'</th>
107 107
 	    					</tr>';
108 108
             $i = 1;
109 109
             foreach ($course_data as $course) {
@@ -112,12 +112,12 @@  discard block
 block discarded – undo
112 112
                 } else {
113 113
                     $class_tr = 'row_even';
114 114
                 }
115
-                $data_table .= '<tr class="' . $class_tr . '">';
115
+                $data_table .= '<tr class="'.$class_tr.'">';
116 116
                 if (!isset($course[2])) {
117 117
                     $course[2] = '0:00:00';
118 118
                 }
119 119
                 foreach ($course as $cell) {
120
-                    $data_table .= '<td align="right">' . $cell . '</td>';
120
+                    $data_table .= '<td align="right">'.$cell.'</td>';
121 121
                 }
122 122
                 $data_table .= '</tr>';
123 123
                 $i++;
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
         }
129 129
         $content .= $data_table;
130 130
         if (!empty($course_data)) {
131
-            $content .= '<div style="text-align:right;margin-top:10px;"><a href="' . api_get_path(WEB_CODE_PATH) . 'mySpace/course.php?follow">' . get_lang('SeeMore') . '</a></div>';
131
+            $content .= '<div style="text-align:right;margin-top:10px;"><a href="'.api_get_path(WEB_CODE_PATH).'mySpace/course.php?follow">'.get_lang('SeeMore').'</a></div>';
132 132
         }
133 133
         //$content .= '</div>';
134 134
 
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
 
164 164
             // students directly subscribed to the course
165 165
             $sql = "SELECT user_id FROM $tbl_course_user as course_rel_user
166
-                    WHERE course_rel_user.status=" . STUDENT . " AND course_rel_user.c_id='$courseId'";
166
+                    WHERE course_rel_user.status=".STUDENT." AND course_rel_user.c_id='$courseId'";
167 167
             $rs = Database::query($sql);
168 168
             $users = array();
169 169
             while ($row = Database::fetch_array($rs)) {
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
             );
183 183
 
184 184
             if (!empty($tematic_advance)) {
185
-                $tematic_advance_progress = '<a title="' . get_lang('GoToThematicAdvance') . '" href="' . api_get_path(WEB_CODE_PATH) . 'course_progress/index.php?cidReq=' . $course_code . '&action=thematic_details">' . $tematic_advance . '%</a>';
185
+                $tematic_advance_progress = '<a title="'.get_lang('GoToThematicAdvance').'" href="'.api_get_path(WEB_CODE_PATH).'course_progress/index.php?cidReq='.$course_code.'&action=thematic_details">'.$tematic_advance.'%</a>';
186 186
             } else {
187 187
                 $tematic_advance_progress = '0%';
188 188
             }
Please login to merge, or discard this patch.
plugin/dashboard/block_student_graph/block_student_graph.class.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -29,15 +29,15 @@  discard block
 block discarded – undo
29 29
 	/**
30 30
 	 * Constructor
31 31
 	 */
32
-    public function __construct ($user_id)
32
+    public function __construct($user_id)
33 33
     {
34
-    	$this->user_id  = $user_id;
35
-    	$this->path 	= 'block_student_graph';
34
+    	$this->user_id = $user_id;
35
+    	$this->path = 'block_student_graph';
36 36
     	if ($this->is_block_visible_for_user($user_id)) {
37 37
     		/*if (api_is_platform_admin()) {
38 38
 	    		$this->students = UserManager::get_user_list(array('status' => STUDENT));
39 39
 	    	} else if (api_is_drh()) {*/
40
-	    		$this->students =  UserManager::get_users_followed_by_drh($user_id, STUDENT);
40
+	    		$this->students = UserManager::get_users_followed_by_drh($user_id, STUDENT);
41 41
 	    	//}
42 42
     	}
43 43
     }
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 		$html = '<div class="panel panel-default" id="intro">
76 76
 	                <div class="panel-heading">
77 77
 	                    '.get_lang('StudentsInformationsGraph').'
78
-	                    <div class="pull-right"><a class="btn btn-danger btn-xs" onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang('ConfirmYourChoice'),ENT_QUOTES,$charset)).'\')) return false;" href="index.php?action=disable_block&path='.$this->path.'">
78
+	                    <div class="pull-right"><a class="btn btn-danger btn-xs" onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES, $charset)).'\')) return false;" href="index.php?action=disable_block&path='.$this->path.'">
79 79
 	                    <em class="fa fa-times"></em>
80 80
 	                    </a></div>
81 81
 	                </div>
@@ -155,9 +155,9 @@  discard block
 block discarded – undo
155 155
             $myCache = new pCache(array('CacheFolder' => substr($cachePath, 0, strlen($cachePath) - 1)));
156 156
             $chartHash = $myCache->getHash($dataSet);
157 157
             if ($myCache->isInCache($chartHash)) {
158
-                $imgPath = api_get_path(SYS_ARCHIVE_PATH) . $chartHash;
158
+                $imgPath = api_get_path(SYS_ARCHIVE_PATH).$chartHash;
159 159
                 $myCache->saveFromCache($chartHash, $imgPath);
160
-                $imgPath = api_get_path(WEB_ARCHIVE_PATH) . $chartHash;
160
+                $imgPath = api_get_path(WEB_ARCHIVE_PATH).$chartHash;
161 161
             } else {
162 162
 
163 163
                 $maxCounts = max(count($usernames), count($faults));
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
                 /* Set the default font */
183 183
                 $myPicture->setFontProperties(
184 184
                     array(
185
-                        'FontName' => api_get_path(SYS_FONTS_PATH) . 'opensans/OpenSans-Regular.ttf',
185
+                        'FontName' => api_get_path(SYS_FONTS_PATH).'opensans/OpenSans-Regular.ttf',
186 186
                         'FontSize' => 10
187 187
                     )
188 188
                 );
@@ -228,13 +228,13 @@  discard block
 block discarded – undo
228 228
 
229 229
                 /* Write and save into cache */
230 230
                 $myCache->writeToCache($chartHash, $myPicture);
231
-                $imgPath = api_get_path(SYS_ARCHIVE_PATH) . $chartHash;
231
+                $imgPath = api_get_path(SYS_ARCHIVE_PATH).$chartHash;
232 232
                 $myCache->saveFromCache($chartHash, $imgPath);
233
-                $imgPath = api_get_path(WEB_ARCHIVE_PATH) . $chartHash;
233
+                $imgPath = api_get_path(WEB_ARCHIVE_PATH).$chartHash;
234 234
             }
235
-            $graph = '<img src="' . $imgPath . '" >';
235
+            $graph = '<img src="'.$imgPath.'" >';
236 236
 		} else {
237
-			$graph = '<p>'.api_convert_encoding(get_lang('GraphicNotAvailable'),'UTF-8').'</p>';
237
+			$graph = '<p>'.api_convert_encoding(get_lang('GraphicNotAvailable'), 'UTF-8').'</p>';
238 238
 		}
239 239
 
240 240
  		return $graph;
Please login to merge, or discard this patch.
plugin/dashboard/block_teacher/block_teacher.class.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -27,10 +27,10 @@  discard block
 block discarded – undo
27 27
 	/**
28 28
 	 * Controller
29 29
 	 */
30
-    public function __construct ($user_id)
30
+    public function __construct($user_id)
31 31
     {
32
-    	$this->user_id  = $user_id;
33
-    	$this->path 	= 'block_teacher';
32
+    	$this->user_id = $user_id;
33
+    	$this->path = 'block_teacher';
34 34
     	if ($this->is_block_visible_for_user($user_id)) {
35 35
 	        $this->teachers = UserManager::get_users_followed_by_drh($user_id, COURSEMANAGER);
36 36
     	}
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
                 <div class="panel panel-default" id="intro">
70 70
                     <div class="panel-heading">
71 71
                         '.get_lang('TeachersInformationsList').'
72
-                        <div class="pull-right"><a class="btn btn-danger btn-xs" onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang('ConfirmYourChoice'),ENT_QUOTES,$charset)).'\')) return false;" href="index.php?action=disable_block&path='.$this->path.'">
72
+                        <div class="pull-right"><a class="btn btn-danger btn-xs" onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES, $charset)).'\')) return false;" href="index.php?action=disable_block&path='.$this->path.'">
73 73
                         <em class="fa fa-times"></em>
74 74
                         </a></div>
75 75
                     </div>
@@ -112,18 +112,18 @@  discard block
 block discarded – undo
112 112
 
113 113
 	 			$teacher_id = $teacher['user_id'];
114 114
 	 			$firstname 	= $teacher['firstname'];
115
-	 			$lastname 	= $teacher['lastname'];
116
-	 			$username	= $teacher['username'];
115
+	 			$lastname = $teacher['lastname'];
116
+	 			$username = $teacher['username'];
117 117
 
118 118
 	 			$time_on_platform = api_time_to_hms(Tracking :: get_time_spent_on_the_platform($teacher_id));
119 119
 	 			$last_connection = Tracking :: get_last_connection_date($teacher_id);
120 120
 
121
-				if ($i%2 == 0) $class_tr = 'row_odd';
121
+				if ($i % 2 == 0) $class_tr = 'row_odd';
122 122
 			    else $class_tr = 'row_even';
123 123
 
124 124
 				$teachers_table .= '
125 125
 									<tr class="'.$class_tr.'">
126
-										<td>'.api_get_person_name($firstname,$lastname).' ('.$username.')</td>
126
+										<td>'.api_get_person_name($firstname, $lastname).' ('.$username.')</td>
127 127
 										<td align="right">'.$time_on_platform.'</td>
128 128
 										<td align="right">'.$last_connection.'</td>
129 129
 									</tr>
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
         $teachers_table = null;
156 156
  		if (count($teachers) > 0) {
157 157
  			$a_last_week = get_last_week();
158
- 			$last_week 	 = date('Y-m-d',$a_last_week[0]).' '.get_lang('To').' '.date('Y-m-d', $a_last_week[6]);
158
+ 			$last_week 	 = date('Y-m-d', $a_last_week[0]).' '.get_lang('To').' '.date('Y-m-d', $a_last_week[6]);
159 159
 
160 160
 	 		$teachers_table .= '<table class="data_table" width:"95%">';
161 161
 	 		$teachers_table .= '
@@ -171,13 +171,13 @@  discard block
 block discarded – undo
171 171
 	 			$teacher_id = $teacher['user_id'];
172 172
 	 			$firstname  = $teacher['firstname'];
173 173
 	 			$lastname   = $teacher['lastname'];
174
-				$username	= $teacher['username'];
175
-	 			$time_on_platform = api_time_to_hms(Tracking :: get_time_spent_on_the_platform($teacher_id,true));
174
+				$username = $teacher['username'];
175
+	 			$time_on_platform = api_time_to_hms(Tracking :: get_time_spent_on_the_platform($teacher_id, true));
176 176
 
177
-	 			if ($i%2 == 0) $class_tr = 'row_odd';
177
+	 			if ($i % 2 == 0) $class_tr = 'row_odd';
178 178
 	    		else $class_tr = 'row_even';
179 179
 	    		$teachers_table .= '<tr class="'.$class_tr.'">
180
-										<td>'.api_get_person_name($firstname,$lastname).' ('.$username.')</td>
180
+										<td>'.api_get_person_name($firstname, $lastname).' ('.$username.')</td>
181 181
 										<td align="right">'.$time_on_platform.'</td>
182 182
 									</tr>';
183 183
 
Please login to merge, or discard this patch.
plugin/dashboard/block_student/block_student.class.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -21,12 +21,12 @@  discard block
 block discarded – undo
21 21
 	/**
22 22
 	 * Constructor
23 23
 	 */
24
-    public function __construct ($user_id)
24
+    public function __construct($user_id)
25 25
     {
26
-    	$this->user_id  = $user_id;
27
-    	$this->path 	= 'block_student';
26
+    	$this->user_id = $user_id;
27
+    	$this->path = 'block_student';
28 28
     	if ($this->is_block_visible_for_user($user_id)) {
29
-            $this->students =  UserManager::get_users_followed_by_drh($user_id, STUDENT);
29
+            $this->students = UserManager::get_users_followed_by_drh($user_id, STUDENT);
30 30
     	}
31 31
     }
32 32
 
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 		$html = '<div class="panel panel-default" id="intro">
62 62
                     <div class="panel-heading">
63 63
                         '.get_lang('StudentsInformationsList').'
64
-                        <div class="pull-right"><a class="btn btn-danger btn-xs" onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang('ConfirmYourChoice'),ENT_QUOTES,$charset)).'\')) return false;" href="index.php?action=disable_block&path='.$this->path.'">
64
+                        <div class="pull-right"><a class="btn btn-danger btn-xs" onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES, $charset)).'\')) return false;" href="index.php?action=disable_block&path='.$this->path.'">
65 65
                             <em class="fa fa-times"></em>
66 66
                         </a>
67 67
                         </div>
@@ -102,9 +102,9 @@  discard block
 block discarded – undo
102 102
 
103 103
 	 			$courses_by_user = CourseManager::get_courses_list_by_user_id($student['user_id'], true);
104 104
 	 			$count_courses = count($courses_by_user);
105
-				$rowspan = $count_courses?$count_courses+1:2;
105
+				$rowspan = $count_courses ? $count_courses + 1 : 2;
106 106
 
107
-				if ($i%2 == 0) {
107
+				if ($i % 2 == 0) {
108 108
                     $style = ' style="background-color:#F2F2F2" ';
109 109
                 } else {
110 110
                     $style = ' style="background-color:#FFF" ';
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
 	 			$student_id = $student['user_id'];
170 170
 	 			$firstname  = $student['firstname'];
171 171
 	 			$lastname   = $student['lastname'];
172
-	 			$username	= $student['username'];
172
+	 			$username = $student['username'];
173 173
 
174 174
 
175 175
 				// get average of faults in attendances by student
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
 	 				$cats = Category::load(null, null, $course_code, null, null, null, false);
189 189
 	 				$scoretotal = array();
190 190
 	 				if (isset($cats) && isset($cats[0])) {
191
-		 				$scoretotal= $cats[0]->calc_score($student_id, null, $course_code);
191
+		 				$scoretotal = $cats[0]->calc_score($student_id, null, $course_code);
192 192
 	 				}
193 193
 
194 194
 	 				if (!empty($scoretotal)) {
@@ -198,10 +198,10 @@  discard block
 block discarded – undo
198 198
 	 			}
199 199
 
200 200
 	 			if (!empty($weight)) {
201
-	 				$evaluations_avg = '<a title="'.get_lang('GoToStudentDetails').'" href="'.api_get_path(WEB_CODE_PATH).'mySpace/myStudents.php?student='.$student_id.'">'.round($score,2).'/'.round($weight,2).'('.round(($score / $weight) * 100,2) . ' %)</a>';
201
+	 				$evaluations_avg = '<a title="'.get_lang('GoToStudentDetails').'" href="'.api_get_path(WEB_CODE_PATH).'mySpace/myStudents.php?student='.$student_id.'">'.round($score, 2).'/'.round($weight, 2).'('.round(($score / $weight) * 100, 2).' %)</a>';
202 202
 	 			}
203 203
 
204
-	 			if ($i%2 == 0) {
204
+	 			if ($i % 2 == 0) {
205 205
                     $class_tr = 'row_odd';
206 206
                 } else {
207 207
                     $class_tr = 'row_even';
Please login to merge, or discard this patch.
plugin/dashboard/block_evaluation_graph/block_evaluation_graph.class.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
     	$this->bg_height = 350;
40 40
     	if ($this->is_block_visible_for_user($user_id)) {
41 41
             if (!api_is_session_admin()) {
42
-                $this->courses  = CourseManager::get_courses_followed_by_drh($user_id);
42
+                $this->courses = CourseManager::get_courses_followed_by_drh($user_id);
43 43
             }
44 44
             $this->sessions = SessionManager::get_sessions_followed_by_drh($user_id);
45 45
     	}
@@ -78,13 +78,13 @@  discard block
 block discarded – undo
78 78
 		$html = '<div class="panel panel-default" id="intro">
79 79
                     <div class="panel-heading">
80 80
                         '.get_lang('EvaluationsGraph').'
81
-                        <div class="pull-right"><a class="btn btn-danger btn-xs" onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang('ConfirmYourChoice'),ENT_QUOTES,$charset)).'\')) return false;" href="index.php?action=disable_block&path='.$this->path.'">
81
+                        <div class="pull-right"><a class="btn btn-danger btn-xs" onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES, $charset)).'\')) return false;" href="index.php?action=disable_block&path='.$this->path.'">
82 82
                         <em class="fa fa-times"></em>
83 83
                         </a></div>
84 84
                     </div>
85 85
                     <div class="panel-body">';
86 86
         if (empty($evaluations_base_courses_graph) && empty($evaluations_courses_in_sessions_graph)) {
87
-            $html .= '<p>'.api_convert_encoding(get_lang('GraphicNotAvailable'),'UTF-8').'</p>';
87
+            $html .= '<p>'.api_convert_encoding(get_lang('GraphicNotAvailable'), 'UTF-8').'</p>';
88 88
         } else {
89 89
             // display evaluations base courses graph
90 90
             if (!empty($evaluations_base_courses_graph)) {
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
 					$alleval = $cats[0]->get_evaluations(null, true, $course_code);
133 133
 					$alllinks = $cats[0]->get_links(null, true);
134 134
 					$users = GradebookUtils::get_all_users($alleval, $alllinks);
135
-					$datagen = new FlatViewDataGenerator ($users, $alleval, $alllinks);
135
+					$datagen = new FlatViewDataGenerator($users, $alleval, $alllinks);
136 136
 					$evaluation_sumary = $datagen->get_evaluation_sumary_results();
137 137
 					if (!empty($evaluation_sumary)) {
138 138
 						$items = array_keys($evaluation_sumary);
@@ -158,16 +158,16 @@  discard block
 block discarded – undo
158 158
 
159 159
                         $dataSet->normalize(100, '%');
160 160
 
161
-                        $dataSet->loadPalette(api_get_path(SYS_CODE_PATH) . 'palettes/pchart/default.color', true);
161
+                        $dataSet->loadPalette(api_get_path(SYS_CODE_PATH).'palettes/pchart/default.color', true);
162 162
 
163 163
                         // Cache definition
164 164
                         $cachePath = api_get_path(SYS_ARCHIVE_PATH);
165 165
                         $myCache = new pCache(array('CacheFolder' => substr($cachePath, 0, strlen($cachePath) - 1)));
166 166
                         $chartHash = $myCache->getHash($dataSet);
167 167
                         if ($myCache->isInCache($chartHash)) {
168
-                            $imgPath = api_get_path(SYS_ARCHIVE_PATH) . $chartHash;
168
+                            $imgPath = api_get_path(SYS_ARCHIVE_PATH).$chartHash;
169 169
                             $myCache->saveFromCache($chartHash, $imgPath);
170
-                            $imgPath = api_get_path(WEB_ARCHIVE_PATH) . $chartHash;
170
+                            $imgPath = api_get_path(WEB_ARCHIVE_PATH).$chartHash;
171 171
                         } else {
172 172
                             /* Create the pChart object */
173 173
                             $widthSize = $this->bg_width;
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
                             /* Set the default font */
197 197
                             $myPicture->setFontProperties(
198 198
                                 array(
199
-                                    'FontName' => api_get_path(SYS_FONTS_PATH) . 'opensans/OpenSans-Regular.ttf',
199
+                                    'FontName' => api_get_path(SYS_FONTS_PATH).'opensans/OpenSans-Regular.ttf',
200 200
                                     'FontSize' => 10
201 201
                                 )
202 202
                             );
@@ -276,12 +276,12 @@  discard block
 block discarded – undo
276 276
                             /* Write and save into cache */
277 277
 
278 278
                             $myCache->writeToCache($chartHash, $myPicture);
279
-                            $imgPath = api_get_path(SYS_ARCHIVE_PATH) . $chartHash;
279
+                            $imgPath = api_get_path(SYS_ARCHIVE_PATH).$chartHash;
280 280
                             $myCache->saveFromCache($chartHash, $imgPath);
281
-                            $imgPath = api_get_path(WEB_ARCHIVE_PATH) . $chartHash;
281
+                            $imgPath = api_get_path(WEB_ARCHIVE_PATH).$chartHash;
282 282
                         }
283 283
                         if (!empty($imgPath)) {
284
-                            $courses_graph[$course_code] = '<img src="' . $imgPath . '">';
284
+                            $courses_graph[$course_code] = '<img src="'.$imgPath.'">';
285 285
                         }
286 286
 					}
287 287
 				}
@@ -310,7 +310,7 @@  discard block
 block discarded – undo
310 310
 						$alleval = $cats[0]->get_evaluations(null, true, $course_code);
311 311
 						$alllinks = $cats[0]->get_links(null, true);
312 312
 						$users = GradebookUtils::get_all_users($alleval, $alllinks);
313
-						$datagen = new FlatViewDataGenerator ($users, $alleval, $alllinks);
313
+						$datagen = new FlatViewDataGenerator($users, $alleval, $alllinks);
314 314
 						$evaluation_sumary = $datagen->get_evaluation_sumary_results();
315 315
 						if (!empty($evaluation_sumary)) {
316 316
 							$items = array_keys($evaluation_sumary);
@@ -336,16 +336,16 @@  discard block
 block discarded – undo
336 336
 
337 337
                             $dataSet->normalize(100, '%');
338 338
 
339
-                            $dataSet->loadPalette(api_get_path(SYS_CODE_PATH) . 'palettes/pchart/default.color', true);
339
+                            $dataSet->loadPalette(api_get_path(SYS_CODE_PATH).'palettes/pchart/default.color', true);
340 340
 
341 341
                             // Cache definition
342 342
                             $cachePath = api_get_path(SYS_ARCHIVE_PATH);
343 343
                             $myCache = new pCache(array('CacheFolder' => substr($cachePath, 0, strlen($cachePath) - 1)));
344 344
                             $chartHash = $myCache->getHash($dataSet);
345 345
                             if ($myCache->isInCache($chartHash)) {
346
-                                $imgPath = api_get_path(SYS_ARCHIVE_PATH) . $chartHash;
346
+                                $imgPath = api_get_path(SYS_ARCHIVE_PATH).$chartHash;
347 347
                                 $myCache->saveFromCache($chartHash, $imgPath);
348
-                                $imgPath = api_get_path(WEB_ARCHIVE_PATH) . $chartHash;
348
+                                $imgPath = api_get_path(WEB_ARCHIVE_PATH).$chartHash;
349 349
                             } else {
350 350
                                 /* Create the pChart object */
351 351
                                 $widthSize = $this->bg_width;
@@ -374,7 +374,7 @@  discard block
 block discarded – undo
374 374
                                 /* Set the default font */
375 375
                                 $myPicture->setFontProperties(
376 376
                                     array(
377
-                                        'FontName' => api_get_path(SYS_FONTS_PATH) . 'opensans/OpenSans-Regular.ttf',
377
+                                        'FontName' => api_get_path(SYS_FONTS_PATH).'opensans/OpenSans-Regular.ttf',
378 378
                                         'FontSize' => 10
379 379
                                     )
380 380
                                 );
@@ -448,12 +448,12 @@  discard block
 block discarded – undo
448 448
 
449 449
                                 /* Write and save into cache */
450 450
                                 $myCache->writeToCache($chartHash, $myPicture);
451
-                                $imgPath = api_get_path(SYS_ARCHIVE_PATH) . $chartHash;
451
+                                $imgPath = api_get_path(SYS_ARCHIVE_PATH).$chartHash;
452 452
                                 $myCache->saveFromCache($chartHash, $imgPath);
453
-                                $imgPath = api_get_path(WEB_ARCHIVE_PATH) . $chartHash;
453
+                                $imgPath = api_get_path(WEB_ARCHIVE_PATH).$chartHash;
454 454
                             }
455 455
                             if (!empty($imgPath)) {
456
-                                $courses_graph[$course_code] = '<img src="' . $imgPath . '">';
456
+                                $courses_graph[$course_code] = '<img src="'.$imgPath.'">';
457 457
                             }
458 458
 						}
459 459
 					}
Please login to merge, or discard this patch.