Passed
Push — 1.10.x ( 04397c...5e25f1 )
by Angel Fernando Quiroz
181:14 queued 130:00
created
main/badge/issued.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 $skillId = isset($_GET['skill']) ? intval($_GET['skill']) : 0;
13 13
 
14 14
 if (!isset($_GET['user'], $_GET['skill'])) {
15
-    header('Location: ' . api_get_path(WEB_PATH));
15
+    header('Location: '.api_get_path(WEB_PATH));
16 16
     exit;
17 17
 }
18 18
 
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
         Display::return_message(get_lang('NoResults'), 'error')
26 26
     );
27 27
 
28
-    header('Location: ' . api_get_path(WEB_PATH));
28
+    header('Location: '.api_get_path(WEB_PATH));
29 29
     exit;
30 30
 }
31 31
 
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
         Display::return_message(get_lang('TheUserXNotYetAchievedTheSkillX'), 'error')
41 41
     );
42 42
 
43
-    header('Location: ' . api_get_path(WEB_PATH));
43
+    header('Location: '.api_get_path(WEB_PATH));
44 44
     exit;
45 45
 }
46 46
 
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
         'date_issued' => api_format_date($userSkillDate, DATE_TIME_FORMAT_LONG)
79 79
     ];
80 80
 
81
-    $assertionUrl = api_get_path(WEB_CODE_PATH) . "badge/assertion.php?";
81
+    $assertionUrl = api_get_path(WEB_CODE_PATH)."badge/assertion.php?";
82 82
     $assertionUrl .= http_build_query(array(
83 83
         'user' => $user->getId(),
84 84
         'skill' => $skill->getId(),
@@ -100,11 +100,11 @@  discard block
 block discarded – undo
100 100
         $backpack = $configBackpack;
101 101
     }
102 102
 
103
-    $htmlHeadXtra[] = '<script src="' . $backpack . 'issuer.js"></script>';
103
+    $htmlHeadXtra[] = '<script src="'.$backpack.'issuer.js"></script>';
104 104
 }
105 105
 $objSkill = new Skill();
106 106
 $skills = $objSkill->get($skillId);
107
-$unbakedBadge = api_get_path(SYS_UPLOAD_PATH) . "badges/".$skills['icon'];
107
+$unbakedBadge = api_get_path(SYS_UPLOAD_PATH)."badges/".$skills['icon'];
108 108
 
109 109
 $unbakedBadge = file_get_contents($unbakedBadge);
110 110
 $badgeInfoError = false;
@@ -119,12 +119,12 @@  discard block
 block discarded – undo
119 119
         mkdir($bakedBadge, api_get_permissions_for_new_directories(), true);
120 120
     }
121 121
     $skillRelUserId = $userSkills[0]->getId();
122
-    if (!file_exists($bakedBadge . "/badge_" . $skillRelUserId)) {
123
-        file_put_contents($bakedBadge . "/badge_" . $skillRelUserId . ".png", $bakedInfo);
122
+    if (!file_exists($bakedBadge."/badge_".$skillRelUserId)) {
123
+        file_put_contents($bakedBadge."/badge_".$skillRelUserId.".png", $bakedInfo);
124 124
     }
125 125
     
126 126
     //Process to validate a baked badge
127
-    $badgeContent = file_get_contents($bakedBadge . "/badge_" . $skillRelUserId . ".png");
127
+    $badgeContent = file_get_contents($bakedBadge."/badge_".$skillRelUserId.".png");
128 128
     $verifyBakedBadge = $png->extractBadgeInfo($badgeContent);
129 129
     if (!is_array($verifyBakedBadge)) {
130 130
         $badgeInfoError = true;
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
 
133 133
     if (!$badgeInfoError) {
134 134
         $personalBadge = UserManager::getUserPathById($userId, "web");
135
-        $personalBadge = $personalBadge."badges/badge_" . $skillRelUserId . ".png";  
135
+        $personalBadge = $personalBadge."badges/badge_".$skillRelUserId.".png";  
136 136
     }
137 137
 }
138 138
 
Please login to merge, or discard this patch.
main/help/faq.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
     $form = new FormValidator('set_faq', 'post', 'faq.php?edit=true');
24 24
     $form->addHtmlEditor('faq_content', null, false, false, array('ToolbarSet' => 'FAQ', 'Width' => '100%', 'Height' => '300'));
25 25
     $form->addButtonSave(get_lang('Ok'), 'faq_submit');
26
-    $faq_content = @(string)file_get_contents(api_get_path(SYS_APP_PATH).'home/faq.html');
26
+    $faq_content = @(string) file_get_contents(api_get_path(SYS_APP_PATH).'home/faq.html');
27 27
     $faq_content = api_to_system_encoding($faq_content, api_detect_encoding(strip_tags($faq_content)));
28 28
     $form->setDefaults(array('faq_content' => $faq_content));
29 29
     if ($form->validate()) {
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
         $form->display();
42 42
     }
43 43
 } else {
44
-	$faq_content = @(string)file_get_contents(api_get_path(SYS_APP_PATH).'home/'.$faq_file);
44
+	$faq_content = @(string) file_get_contents(api_get_path(SYS_APP_PATH).'home/'.$faq_file);
45 45
 	$faq_content = api_to_system_encoding($faq_content, api_detect_encoding(strip_tags($faq_content)));
46 46
 	echo $faq_content;
47 47
 }
Please login to merge, or discard this patch.
main/reports/reports.lib.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -3,11 +3,11 @@  discard block
 block discarded – undo
3 3
 require_once '../inc/global.inc.php';
4 4
 
5 5
 
6
-define ('REPORTS_PROGRESS_COMPLETED', 1);
6
+define('REPORTS_PROGRESS_COMPLETED', 1);
7 7
 
8 8
 $reports_modules = array();
9 9
 
10
-$reports_enabled_modules = array('quiz','course','scorm');
10
+$reports_enabled_modules = array('quiz', 'course', 'scorm');
11 11
 
12 12
 $reports_enabled_templates = array('exercicesMultiCourses', 'courseTime', 'courseArticulate');
13 13
 
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
 
159 159
 // return a sql clause returning triplet of (course, $session, $uid) the
160 160
 // current user is authorized to reed
161
-function reports_getVisibilitySQL () {
161
+function reports_getVisibilitySQL() {
162 162
 	return "select cru.user_id from ".Database::get_main_table(TABLE_MAIN_COURSE_USER).' cru';
163 163
 	// fixme sessions
164 164
 }
Please login to merge, or discard this patch.
main/reports/index.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@
 block discarded – undo
22 22
 $this_section = SECTION_REPORTS;
23 23
 
24 24
 // setting the name of the tool
25
-$tool_name=get_lang('Reports');
25
+$tool_name = get_lang('Reports');
26 26
 
27 27
 // Displaying the header
28 28
 foreach (array('jquery.ba-bbq.min.js', 'jquery.validate.js', 'jquery.form.js', 'jquery.form.wizard.js', 'jquery.dataTables.min.js') as $js)
Please login to merge, or discard this patch.
main/reports/multiquery.lib.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -4,20 +4,20 @@  discard block
 block discarded – undo
4 4
 function multiquery_query($array) {
5 5
 	$result = array();
6 6
 	$field = 0;
7
-	for ($i = 0; $i <sizeof($array); $i++) {
7
+	for ($i = 0; $i < sizeof($array); $i++) {
8 8
 		// mysql handler
9 9
 		$result[$i]['mysql'] = mysql_query($array[$i]);
10 10
 
11
-		if (! $result[$i]['mysql'])
11
+		if (!$result[$i]['mysql'])
12 12
 			die("error in query $i : ".$array[$i]);
13 13
 
14 14
 		// fields
15 15
 		$result[$i]['num_fields'] = mysql_num_fields($result[$i]['mysql']);
16 16
 		for ($j = 0; $j < $result[$i]['num_fields']; $j++) {
17 17
 			$name = mysql_field_name($result[$i]['mysql'], $j);
18
-			$result['field'][$field]['query']=$i;
19
-			$result['field'][$field]['name']=$name;
20
-			$result['field'][$field]['id']=$j;
18
+			$result['field'][$field]['query'] = $i;
19
+			$result['field'][$field]['name'] = $name;
20
+			$result['field'][$field]['id'] = $j;
21 21
 			$result['field_assoc'][$name][$field];
22 22
 			$field++;
23 23
 		}
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 	$result['num_queries'] = sizeof($array);
26 26
 	// rows
27 27
 	$numberOfResult = mysql_num_rows($result[0]['mysql']);
28
-	for ($i = 1; $i <$result['num_queries']; $i++) 
28
+	for ($i = 1; $i < $result['num_queries']; $i++) 
29 29
 		if ($numberOfResult != mysql_num_rows($result[$i]['mysql']))
30 30
 			die("wrong number of row: $numberOfResult vs ".
31 31
 				mysql_num_rows($result[$i]['mysql'])." on query $i");
Please login to merge, or discard this patch.
main/reports/modules/quiz.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php 
2 2
 
3
-$reports_modules['quiz'] = array ();
3
+$reports_modules['quiz'] = array();
4 4
 
5 5
 
6 6
 function reports_modules_quiz_init() {
@@ -28,6 +28,6 @@  discard block
 block discarded – undo
28 28
 			REPORTS_PROGRESS_COMPLETED.' as progress, '.
29 29
 			'exe_duration as time, exe_date as ts from '.
30 30
 			Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES).
31
-			' where c_id = ' . $courseId .
31
+			' where c_id = '.$courseId.
32 32
 			' and exe_exo_id='.$quiz['child_id']);
33 33
 }
Please login to merge, or discard this patch.
main/reports/modules/scorm.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php 
2 2
 
3
-$reports_modules['scorm'] = array ();
3
+$reports_modules['scorm'] = array();
4 4
 
5 5
 
6 6
 function reports_modules_scorm_init() {
Please login to merge, or discard this patch.
main/reports/modules/course.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-$reports_modules['course'] = array ();
3
+$reports_modules['course'] = array();
4 4
 
5 5
 
6 6
 function reports_modules_course_init() {
@@ -24,6 +24,6 @@  discard block
 block discarded – undo
24 24
 			'NULL as progress, '.
25 25
 			'(sum(logout_course_date) - sum(login_course_date)) as time, null as ts from '.
26 26
 			Database::get_main_table(TABLE_STATISTIC_TRACK_E_COURSE_ACCESS).
27
-			' where c_id = ' . $course['real_id'] .
27
+			' where c_id = '.$course['real_id'].
28 28
 			' group by user_id');
29 29
 }
Please login to merge, or discard this patch.
main/reports/reports.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 $this_section = SECTION_REPORTS;
25 25
 
26 26
 // setting the name of the tool
27
-$tool_name=get_lang('Reports');
27
+$tool_name = get_lang('Reports');
28 28
 
29 29
 // loading templates
30 30
 reports_loadTemplates();
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 }
69 69
 
70 70
 // outputing a link to csv file instead of outputing csv data directly
71
-if ($_REQUEST['format'] == 'csv')  {
71
+if ($_REQUEST['format'] == 'csv') {
72 72
 	// converting post vars to get uri
73 73
 	$params = '';
74 74
 	$kv = array();
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 
97 97
 if (is_array($reports_template[$_REQUEST['type']])) {
98 98
 	$query = $reports_template[$_REQUEST['type']]['getSQL']();
99
-	if (! is_array($query))
99
+	if (!is_array($query))
100 100
 		$query = array($query);
101 101
 	if ($_REQUEST['format'] == 'sql')
102 102
 		die(var_export($query, true));
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
 	$columns = array();
151 151
 	$columns_islink = array();
152 152
 	echo '<thead><tr>';
153
-	for ($i=0; $i < $nfields; $i++)	{
153
+	for ($i = 0; $i < $nfields; $i++) {
154 154
 		$columns[$i] = multiquery_field_name($result, $i);
155 155
 		if (substr($columns[$i], -5, 5) != '_link') {
156 156
 			$column_islink[$i] = false;
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
 	// checking resolving link column id
163 163
 	$columns_flip = array_flip($columns);
164 164
 	$columns_link = array();
165
-	for ($i=0; $i < $nfields; $i++)
165
+	for ($i = 0; $i < $nfields; $i++)
166 166
 		if ($column_islink[$i] == false && array_key_exists($columns[$i].'_link', $columns_flip))
167 167
 			$columns_link[$i] = $columns_flip[$columns[$i].'_link'];
168 168
 		else
@@ -170,10 +170,10 @@  discard block
 block discarded – undo
170 170
 	echo '</tr></thead><tbody>';
171 171
 	while ($row = multiquery_fetch_row($result)) {
172 172
 		echo '<tr>';
173
-		for ($i = 0; $i<$nfields; $i++)
174
-			if (!$columns_islink[$i]){ // ignore links
173
+		for ($i = 0; $i < $nfields; $i++)
174
+			if (!$columns_islink[$i]) { // ignore links
175 175
 				if ($columns_link[$i] != '') // link is defined
176
-					if (substr($columns_link[$i],0,10) == 'javascript') {
176
+					if (substr($columns_link[$i], 0, 10) == 'javascript') {
177 177
 						echo '<td><a href="#" onclick="'.$row[$columns_link[$i]].'">'.$row[$i].'</a></td>';
178 178
 					}
179 179
 					else {
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
 	$nfields = multiquery_num_fields($result);
202 202
 	$columns = array();
203 203
 	$columns_islink = array();
204
-	for ($i=0; $i < $nfields; $i++)	{
204
+	for ($i = 0; $i < $nfields; $i++) {
205 205
 		$columns[$i] = multiquery_field_name($result, $i);
206 206
 		if (substr($columns[$i], -5, 5) != '_link') {
207 207
 			$column_islink[$i] = false;
@@ -212,16 +212,16 @@  discard block
 block discarded – undo
212 212
 
213 213
 	echo "\n";
214 214
 	while ($row = multiquery_fetch_row($result)) {
215
-		for ($i = 0; $i<$nfields; $i++)
215
+		for ($i = 0; $i < $nfields; $i++)
216 216
 			if (!$columns_islink[$i]) // ignore links
217
-				echo csv_escaping($row[$i]).',';  // fixme
217
+				echo csv_escaping($row[$i]).','; // fixme
218 218
 		echo "\n";
219 219
 	}
220 220
 } else die(get_lang('UnknownFormat'));
221 221
 
222 222
 function csv_escaping($value, $csv_separator = ',') {
223
-	$value = str_replace('"','""',$value);
224
-	if (strpos($value, '""') or strpos($value, $csv_separator) or $value != trim($value) ) {
223
+	$value = str_replace('"', '""', $value);
224
+	if (strpos($value, '""') or strpos($value, $csv_separator) or $value != trim($value)) {
225 225
 		$value = '"'.$value.'"';
226 226
 	}
227 227
 	return $value;
Please login to merge, or discard this patch.