Completed
Push — 1.11.x ( a69e20...60645e )
by José
113:03 queued 73:51
created
main/inc/lib/webservices/MessagesWebService.class.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
                 'hasAttachments' => $hasAttachments,
119 119
                 'platform' => array(
120 120
                     'website' => api_get_path(WEB_PATH),
121
-                    'messagingTool' => api_get_path(WEB_PATH) . 'main/messages/inbox.php'
121
+                    'messagingTool' => api_get_path(WEB_PATH).'main/messages/inbox.php'
122 122
                 )
123 123
             );
124 124
         }
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
         }
202 202
 
203 203
         $headers = [
204
-            'Authorization: key=' . $gdcApiKey,
204
+            'Authorization: key='.$gdcApiKey,
205 205
             'Content-Type: application/json'
206 206
         ];
207 207
 
Please login to merge, or discard this patch.
main/inc/lib/geometry.lib.php 1 patch
Spacing   +55 added lines, -55 removed lines patch added patch discarded remove patch
@@ -13,8 +13,8 @@  discard block
 block discarded – undo
13 13
  * @returns an array such as: for all i in [0..max[x][ : for all j in [0..max[y][ : array[i][j] = FALSE
14 14
  */
15 15
 function poly_init($max) {
16
-    return array_fill(0, $max["x"]-1,
17
-            array_fill(0, $max["y"]-1, FALSE));
16
+    return array_fill(0, $max["x"] - 1,
17
+            array_fill(0, $max["y"] - 1, FALSE));
18 18
 }
19 19
 
20 20
 
@@ -69,18 +69,18 @@  discard block
 block discarded – undo
69 69
     	array_push($bords[$poly[0]['y']], $poly[0]['x']);
70 70
 
71 71
     $i = 1; // we re-use $i and $old_pente bellow the loop
72
-    $old_pente=0;
73
-    for (    ;    // for each points of the polygon but the first
74
-        $i<sizeof($poly) && (!empty($poly[$i]['x']) && !empty($poly[$i]['y'])); $i++) {
72
+    $old_pente = 0;
73
+    for (;    // for each points of the polygon but the first
74
+        $i < sizeof($poly) && (!empty($poly[$i]['x']) && !empty($poly[$i]['y'])); $i++) {
75 75
 
76 76
         /* special cases */
77
-        if ($poly[$i-1]['y'] == $poly[$i]['y']) {
78
-            if ($poly[$i-1]['x'] == $poly[$i]['x'])
77
+        if ($poly[$i - 1]['y'] == $poly[$i]['y']) {
78
+            if ($poly[$i - 1]['x'] == $poly[$i]['x'])
79 79
                 continue; // twice the same point
80 80
             else {    //  infinite elevation of the edge
81 81
             	if (is_array($bords[$poly[$i]['y']]))
82
-                	array_push($bords[$poly[$i]['y']],$poly[$i]['x']);
83
-                $old_pente=0;
82
+                	array_push($bords[$poly[$i]['y']], $poly[$i]['x']);
83
+                $old_pente = 0;
84 84
                 continue;
85 85
             }
86 86
         }
@@ -93,17 +93,17 @@  discard block
 block discarded – undo
93 93
 
94 94
         /* computing the elevation of the edge going */
95 95
         //        from $poly[$i-1] to $poly[$i]
96
-        $pente = ($poly[$i-1]['x']-$poly[$i]['x'])/
97
-                 ($poly[$i-1]['y']-$poly[$i]['y']);
96
+        $pente = ($poly[$i - 1]['x'] - $poly[$i]['x']) /
97
+                 ($poly[$i - 1]['y'] - $poly[$i]['y']);
98 98
 
99 99
         // if the sign of the elevation change from the one of the
100 100
         // previous edge, the point must be added a second time inside
101 101
         // $bords
102
-        if ($i>1)
103
-            if (($old_pente<0 && $pente>0)
104
-                    || ($old_pente>0 && $pente<0)) {
102
+        if ($i > 1)
103
+            if (($old_pente < 0 && $pente > 0)
104
+                    || ($old_pente > 0 && $pente < 0)) {
105 105
 				if (is_array($bords[$poly[$i]['y']])) //avoid warning
106
-                	array_push($bords[$poly[$i]['y']],$poly[$i]['x']);
106
+                	array_push($bords[$poly[$i]['y']], $poly[$i]['x']);
107 107
 
108 108
                 if (DEBUG)
109 109
                     echo '*('.$poly[$i]['x'].
@@ -111,8 +111,8 @@  discard block
 block discarded – undo
111 111
         	}
112 112
 
113 113
         /* detect the direction of the elevation in Y */
114
-        $dy_inc = ($poly[$i]['y']-$poly[$i-1]['y']) > 0 ? 1 : -1;
115
-        $x = $poly[$i-1]['x'];
114
+        $dy_inc = ($poly[$i]['y'] - $poly[$i - 1]['y']) > 0 ? 1 : -1;
115
+        $x = $poly[$i - 1]['x'];
116 116
 //        if (DEBUG) echo "init: ".$poly[$i-1]['y']."  dy_inc: ".$dy_inc.
117 117
 //            "   end: ".$poly[$i]['y']."   pente:".$pente;
118 118
 
@@ -121,10 +121,10 @@  discard block
 block discarded – undo
121 121
 
122 122
         // we iterate w/ $dy in ]$poly[$i-1]['y'],$poly[$i-1]['y'][
123 123
         //    w/ $dy_inc as increment
124
-        for ($dy = $poly[$i-1]['y']+$dy_inc;
124
+        for ($dy = $poly[$i - 1]['y'] + $dy_inc;
125 125
             $dy != $poly[$i]['y'];
126 126
             $dy += $dy_inc) {
127
-            $x += $pente*$dy_inc;
127
+            $x += $pente * $dy_inc;
128 128
             array_push($bords[$dy], $x);
129 129
 //            if (DEBUG) echo '/('.$x.';'.$dy.')   ';
130 130
         }
@@ -132,47 +132,47 @@  discard block
 block discarded – undo
132 132
     }
133 133
 
134 134
     // closing the polygone (the edge between $poly[$i-1] and $poly[0])
135
-    if ($poly[$i-1]['y']!=$poly[0]['y']) {// droite--> rien à faire
135
+    if ($poly[$i - 1]['y'] != $poly[0]['y']) {// droite--> rien à faire
136 136
 
137 137
         // elevation between $poly[0]['x'] and $poly[1]['x'])
138
-        $rest = $poly[0]['y']-$poly[1]['y'];
139
-        if ($rest!=0)
140
-        	$pente1 = ($poly[0]['x']-$poly[1]['x'])/($rest);
138
+        $rest = $poly[0]['y'] - $poly[1]['y'];
139
+        if ($rest != 0)
140
+        	$pente1 = ($poly[0]['x'] - $poly[1]['x']) / ($rest);
141 141
         else
142 142
 			$pente1 = 0;
143 143
 
144 144
         // elevation between $poly[$i-1]['x'] and $poly[0]['x'])
145
-        $pente = ($poly[$i-1]['x']-$poly[0]['x'])/
146
-            ($poly[$i-1]['y']-$poly[0]['y']);
145
+        $pente = ($poly[$i - 1]['x'] - $poly[0]['x']) /
146
+            ($poly[$i - 1]['y'] - $poly[0]['y']);
147 147
 
148 148
 //        if (DEBUG) echo 'start('.$poly[$i-1]['x'].','.$poly[$i-1]['y'].
149 149
 //                ')-end('.$poly[0]['x'].','.$poly[0]['y'].
150 150
 //                ')-pente'.$pente;
151 151
 
152 152
         // doubling the first point if needed (see above)
153
-        if (($pente1<0 && $pente>0) || ($pente1>0 && $pente<0)) {
153
+        if (($pente1 < 0 && $pente > 0) || ($pente1 > 0 && $pente < 0)) {
154 154
         	if (is_array($bords[$poly[$i - 1]['y']]))
155
-            	array_push($bords[$poly[$i - 1]['y']],  round($poly[$i - 1]['x']));
155
+            	array_push($bords[$poly[$i - 1]['y']], round($poly[$i - 1]['x']));
156 156
             //if (DEBUG) echo '('.$poly[$i-1]['x'].';'.$poly[$i-1]['y'].')   ';
157 157
         }
158 158
         //  doubling the last point if neededd
159
-        if (($old_pente<0 && $pente>0) || ($old_pente>0 && $pente<0)) {
160
-        	if (is_array($bords[$poly[$i-1]['y']])) //avoid warning
161
-            	array_push($bords[$poly[$i-1]['y']], round($poly[$i-1]['x']));
159
+        if (($old_pente < 0 && $pente > 0) || ($old_pente > 0 && $pente < 0)) {
160
+        	if (is_array($bords[$poly[$i - 1]['y']])) //avoid warning
161
+            	array_push($bords[$poly[$i - 1]['y']], round($poly[$i - 1]['x']));
162 162
             //if (DEBUG) echo '*('.$poly[$i-1]['x'].';'.$poly[$i-1]['y'].')   ';
163 163
         }
164 164
 
165 165
 
166
-        $dy_inc = ($poly[0]['y']-$poly[$i-1]['y']) > 0 ? 1 : -1;
167
-        $x = $poly[$i-1]['x'];
166
+        $dy_inc = ($poly[0]['y'] - $poly[$i - 1]['y']) > 0 ? 1 : -1;
167
+        $x = $poly[$i - 1]['x'];
168 168
 //        if (DEBUG) echo "init: ".$poly[$i-1]['y']."  dy_inc: ".$dy_inc.
169 169
 //            "   end: ".$poly[0]['y'];
170 170
 
171
-        for ($dy = $poly[$i-1]['y']+$dy_inc;
171
+        for ($dy = $poly[$i - 1]['y'] + $dy_inc;
172 172
             $dy != $poly[0]['y'];
173 173
             $dy += $dy_inc)
174 174
         {
175
-            $x += $pente*$dy_inc;
175
+            $x += $pente * $dy_inc;
176 176
             array_push($bords[$dy], round($x));
177 177
 //            if (DEBUG) echo '/('.$x.';'.$dy.')   ';
178 178
         }
@@ -182,20 +182,20 @@  discard block
 block discarded – undo
182 182
     /* basic idea: we sort a column of edges.
183 183
         For each pair of point, we color the points in between */
184 184
     $n = count($bords);
185
-    for ($i = 0; $i<$n; $i++) {  // Y
185
+    for ($i = 0; $i < $n; $i++) {  // Y
186 186
         //error_log(__FILE__.' - Border Num '.$i,0);
187 187
         if (is_array($bords[$i])) {
188 188
        		sort($bords[$i]);
189 189
         }
190 190
 
191
-        for ($j = 0; $j<sizeof($bords[$i]);$j+=2) { // bords
191
+        for ($j = 0; $j < sizeof($bords[$i]); $j += 2) { // bords
192 192
             if (!isset($bords[$i][$j + 1])) {
193 193
                 break;
194 194
             }
195 195
 
196
-            for ($k = round($bords[$i][$j]); $k<=$bords[$i][$j+1];$k++) {
196
+            for ($k = round($bords[$i][$j]); $k <= $bords[$i][$j + 1]; $k++) {
197 197
                 $res[$k][$i] = true; //filling the array with trues
198
-                if ($test == 1)  {
198
+                if ($test == 1) {
199 199
                 	/*how to draw the polygon in a human way:
200 200
                 	In ubuntu : sudo apt-get install gnuplot
201 201
                 	Create an empty file with all points with the result of this echos (No commas, no point, no headers)
@@ -222,19 +222,19 @@  discard block
 block discarded – undo
222 222
  *
223 223
  * @return string     html code of the representation of the polygone image
224 224
  */
225
-function poly_dump(&$poly, $max, $format='raw') {
225
+function poly_dump(&$poly, $max, $format = 'raw') {
226 226
     if ($format == 'html') {
227 227
         $s = "<div style='font-size: 8px; line-height:3px'><pre>\n";
228 228
     }
229
-    for ($i=0; $i<$max['y']; $i++) {
230
-        for($j=0; $j<$max['x']; $j++)
231
-            if($poly[$j][$i] == TRUE)
232
-                $s .= ($format=='html'?"<b>1</b>":'1');
229
+    for ($i = 0; $i < $max['y']; $i++) {
230
+        for ($j = 0; $j < $max['x']; $j++)
231
+            if ($poly[$j][$i] == TRUE)
232
+                $s .= ($format == 'html' ? "<b>1</b>" : '1');
233 233
             else
234 234
                 $s .= "0";
235
-        $s .= ($format=='html'?"<br />\n":"\n");
235
+        $s .= ($format == 'html' ? "<br />\n" : "\n");
236 236
     }
237
-    $s .= ($format=='html'?"</pre></div>\n":"\n");
237
+    $s .= ($format == 'html' ? "</pre></div>\n" : "\n");
238 238
     return $s;
239 239
 }
240 240
 
@@ -252,8 +252,8 @@  discard block
 block discarded – undo
252 252
     $surfaceOf1 = 0;
253 253
     $surfaceOf2 = 0;
254 254
 
255
-    for ($i=0; $i<$max['x']; $i++)
256
-        for($j=0; $j<$max['y']; $j++) {
255
+    for ($i = 0; $i < $max['x']; $i++)
256
+        for ($j = 0; $j < $max['y']; $j++) {
257 257
             if (isset($poly1[$i][$j]) && ($poly1[$i][$j] == TRUE)) {
258 258
                 $surfaceOf1++;
259 259
                 if (isset($poly2[$i][$j]) && ($poly2[$i][$j] == FALSE))
@@ -263,7 +263,7 @@  discard block
 block discarded – undo
263 263
                 $surfaceOf2++;
264 264
         }
265 265
 
266
-    return array (
266
+    return array(
267 267
         "s1" => $surfaceOf1,
268 268
         "s2" => $surfaceOf2,
269 269
         "both" => $surfaceOf1 - $onlyIn1,
@@ -282,8 +282,8 @@  discard block
 block discarded – undo
282 282
  */
283 283
 function poly_touch(&$poly1, &$poly2, $max) {
284 284
 
285
-    for ($i=0; $i<$max['x']; $i++) {
286
-        for($j=0; $j<$max['y']; $j++) {
285
+    for ($i = 0; $i < $max['x']; $i++) {
286
+        for ($j = 0; $j < $max['y']; $j++) {
287 287
             if (isset($poly1[$i][$j]) && ($poly1[$i][$j] == true)
288 288
                 && isset($poly2[$i][$j]) && ($poly2[$i][$j] == true)) {
289 289
                     return true;
@@ -301,12 +301,12 @@  discard block
 block discarded – undo
301 301
  * @return  array   An array of points in the right format to use with the
302 302
  *                  local functions
303 303
  */
304
-function convert_coordinates($coords,$sep='|') {
304
+function convert_coordinates($coords, $sep = '|') {
305 305
     $points = array();
306
-    $pairs = explode($sep,$coords);
306
+    $pairs = explode($sep, $coords);
307 307
     foreach ($pairs as $idx => $pcoord) {
308
-        list($x,$y) = explode(';',$pcoord);
309
-        $points[] = array('x'=>$x,'y'=>$y);
308
+        list($x, $y) = explode(';', $pcoord);
309
+        $points[] = array('x'=>$x, 'y'=>$y);
310 310
     }
311 311
 	return $points;
312 312
 }
@@ -336,7 +336,7 @@  discard block
 block discarded – undo
336 336
             $my = $coord['y'];
337 337
         }
338 338
     }
339
-    return array('x'=>$mx,'y'=>$my);
339
+    return array('x'=>$mx, 'y'=>$my);
340 340
 }
341 341
 
342 342
 /**
Please login to merge, or discard this patch.
main/forum/viewthread_threaded.inc.php 1 patch
Spacing   +94 added lines, -94 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
  * @package chamilo.forum
22 22
  */
23 23
 
24
-$forumUrl = api_get_path(WEB_CODE_PATH) . 'forum/';
24
+$forumUrl = api_get_path(WEB_CODE_PATH).'forum/';
25 25
 $_user = api_get_user_info();
26 26
 $sortDirection = isset($_GET['posts_order']) && $_GET['posts_order'] === 'desc' ? 'DESC' : 'ASC';
27 27
 $rows = getPosts($current_forum, $_GET['thread'], $sortDirection, true);
@@ -42,13 +42,13 @@  discard block
 block discarded – undo
42 42
 // Are we in a lp ?
43 43
 $origin = '';
44 44
 if (isset($_GET['origin'])) {
45
-    $origin =  Security::remove_XSS($_GET['origin']);
45
+    $origin = Security::remove_XSS($_GET['origin']);
46 46
 }
47 47
 
48 48
 // Delete attachment file.
49 49
 if (
50 50
     isset($_GET['action']) &&
51
-    $_GET['action']=='delete_attach' &&
51
+    $_GET['action'] == 'delete_attach' &&
52 52
     isset($_GET['id_attach'])
53 53
 ) {
54 54
     delete_attachment(0, $_GET['id_attach']);
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 
60 60
 // Displaying the thread (structure)
61 61
 
62
-$thread_structure = "<div class=\"structure\">" .get_lang('Structure')."</div>";
62
+$thread_structure = "<div class=\"structure\">".get_lang('Structure')."</div>";
63 63
 $counter = 0;
64 64
 $count = 0;
65 65
 $prev_next_array = array();
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 foreach ($rows as $post) {
72 72
     $counter++;
73 73
     $indent = $post['indent_cnt'] * '20';
74
-    $thread_structure .= "<div style=\"margin-left: " . $indent . "px;\">";
74
+    $thread_structure .= "<div style=\"margin-left: ".$indent."px;\">";
75 75
 
76 76
     if (
77 77
         !empty($whatsnew_post_info[$forumId][$post['thread_id']]) &&
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
             $counter == 1 AND !isset($_GET['post'])
90 90
         )
91 91
     ) {
92
-        $thread_structure .= '<strong>' .prepare4display($post['post_title']) . '</strong></div>';
92
+        $thread_structure .= '<strong>'.prepare4display($post['post_title']).'</strong></div>';
93 93
         $prev_next_array[] = $post['post_id'];
94 94
     } else {
95 95
         if ($post['visible'] == '0') {
@@ -98,10 +98,10 @@  discard block
 block discarded – undo
98 98
             $class = '';
99 99
         }
100 100
         $count_loop = ($count == 0) ? '&id=1' : '';
101
-        $thread_structure .= "<a href=\"viewthread.php?" . api_get_cidreq() .
102
-            "&forum=" . $forumId . "&thread=" . $threadId .
103
-            "&post=" . $post['post_id'] . "&origin=$origin$count_loop\"" .
104
-            "$class>" . prepare4display($post['post_title']) . "</a></div>";
101
+        $thread_structure .= "<a href=\"viewthread.php?".api_get_cidreq().
102
+            "&forum=".$forumId."&thread=".$threadId.
103
+            "&post=".$post['post_id']."&origin=$origin$count_loop\"".
104
+            "$class>".prepare4display($post['post_title'])."</a></div>";
105 105
         $prev_next_array[] = $post['post_id'];
106 106
     }
107 107
     $count++;
@@ -148,43 +148,43 @@  discard block
 block discarded – undo
148 148
 $class_next = '';
149 149
 
150 150
 // Links
151
-$first_href = $forumUrl . 'viewthread.php?' . api_get_cidreq() .
152
-    '&forum=' . $forumId . '&thread=' . $threadId .
153
-    '&gradebook=' . $gradebook . '&id=1&post=' . $prev_next_array[0];
154
-$last_href 	= $forumUrl . 'viewthread.php?' . api_get_cidreq() .
155
-    '&forum=' . $forumId . '&thread=' . $threadId .
156
-    '&gradebook=' . $gradebook . '&post=' . $prev_next_array[$max-1];
157
-$prev_href	= $forumUrl . 'viewthread.php?' . api_get_cidreq() .
158
-    '&forum=' . $forumId . '&thread=' . $threadId .
159
-    '&gradebook=' . $gradebook . '&post=' . $prev_next_array[$prev_id];
160
-$next_href	= $forumUrl . 'viewthread.php?' . api_get_cidreq() .
161
-    '&forum=' . $forumId . '&thread=' . $threadId .
162
-    '&post=' . $prev_next_array[$next_id];
151
+$first_href = $forumUrl.'viewthread.php?'.api_get_cidreq().
152
+    '&forum='.$forumId.'&thread='.$threadId.
153
+    '&gradebook='.$gradebook.'&id=1&post='.$prev_next_array[0];
154
+$last_href 	= $forumUrl.'viewthread.php?'.api_get_cidreq().
155
+    '&forum='.$forumId.'&thread='.$threadId.
156
+    '&gradebook='.$gradebook.'&post='.$prev_next_array[$max - 1];
157
+$prev_href	= $forumUrl.'viewthread.php?'.api_get_cidreq().
158
+    '&forum='.$forumId.'&thread='.$threadId.
159
+    '&gradebook='.$gradebook.'&post='.$prev_next_array[$prev_id];
160
+$next_href	= $forumUrl.'viewthread.php?'.api_get_cidreq().
161
+    '&forum='.$forumId.'&thread='.$threadId.
162
+    '&post='.$prev_next_array[$next_id];
163 163
 
164 164
 echo '<center style="margin-top: 10px; margin-bottom: 10px;">';
165 165
 // Go to: first and previous
166 166
 if (((int) $current_id) > 0) {
167
-    echo '<a href="' . $first_href . '" ' . $class . ' title=' .
168
-        $first_message . '>' . $first_img . ' ' . $first_message .'</a>';
169
-    echo '<a href="' . $prev_href . '" ' . $class_prev . ' title=' .
170
-        $prev_message . '>' . $prev_img . ' ' . $prev_message . '</a>';
167
+    echo '<a href="'.$first_href.'" '.$class.' title='.
168
+        $first_message.'>'.$first_img.' '.$first_message.'</a>';
169
+    echo '<a href="'.$prev_href.'" '.$class_prev.' title='.
170
+        $prev_message.'>'.$prev_img.' '.$prev_message.'</a>';
171 171
 } else {
172
-    echo '<b><span class="invisible">' .
173
-        $first_img . ' ' . $first_message . '</b></span>';
174
-    echo '<b><span class="invisible">' .
175
-        $prev_img . ' ' . $prev_message . '</b></span>';
172
+    echo '<b><span class="invisible">'.
173
+        $first_img.' '.$first_message.'</b></span>';
174
+    echo '<b><span class="invisible">'.
175
+        $prev_img.' '.$prev_message.'</b></span>';
176 176
 }
177 177
 
178 178
 // Current counter
179
-echo ' [ ' . ($current_id + 1) . ' / ' . $max . ' ] ';
179
+echo ' [ '.($current_id + 1).' / '.$max.' ] ';
180 180
 
181 181
 // Go to: next and last
182 182
 if (($current_id + 1) < $max) {
183
-    echo '<a href="' . $next_href . '" ' . $class_next . ' title=' . $next_message . '>' . $next_message . ' ' . $next_img . '</a>';
184
-    echo '<a href="' . $last_href . '" ' . $class . ' title=' . $last_message . '>' . $last_message . ' ' . $last_img . '</a>';
183
+    echo '<a href="'.$next_href.'" '.$class_next.' title='.$next_message.'>'.$next_message.' '.$next_img.'</a>';
184
+    echo '<a href="'.$last_href.'" '.$class.' title='.$last_message.'>'.$last_message.' '.$last_img.'</a>';
185 185
 } else {
186
-    echo '<b><span class="invisible">' . $next_message . ' ' . $next_img . '</b></span>';
187
-    echo '<b><span class="invisible">' . $last_message . ' ' . $last_img . '</b></span>';
186
+    echo '<b><span class="invisible">'.$next_message.' '.$next_img.'</b></span>';
187
+    echo '<b><span class="invisible">'.$last_message.' '.$last_img.'</b></span>';
188 188
 }
189 189
 echo '</center>';
190 190
 
@@ -218,18 +218,18 @@  discard block
 block discarded – undo
218 218
 }
219 219
 
220 220
 if (api_get_course_setting('allow_user_image_forum')) {
221
-    echo '<br />' . display_user_image($rows[$display_post_id]['user_id'], $name, $origin) . '<br />';
221
+    echo '<br />'.display_user_image($rows[$display_post_id]['user_id'], $name, $origin).'<br />';
222 222
 }
223 223
 echo display_user_link(
224 224
     $rows[$display_post_id]['user_id'],
225 225
     $name,
226 226
     $origin,
227 227
     $username
228
-) . "<br />";
228
+)."<br />";
229 229
 
230 230
 echo api_convert_and_format_date(
231 231
     $rows[$display_post_id]['post_date']
232
-) . '<br /><br />';
232
+).'<br /><br />';
233 233
 // Get attach id
234 234
 $attachment_list = get_attachment($display_post_id);
235 235
 $id_attach = !empty($attachment_list) ? $attachment_list['id'] : '';
@@ -248,16 +248,16 @@  discard block
 block discarded – undo
248 248
     )
249 249
 ) {
250 250
     if ($locked == false) {
251
-        echo "<a href=\"editpost.php?" . api_get_cidreq() .
252
-            "&forum=" . $forumId . "&thread=" . $threadId .
253
-            "&post=" . $rows[$display_post_id]['post_id'] .
254
-            "&id_attach=" . $id_attach . "\">" .
251
+        echo "<a href=\"editpost.php?".api_get_cidreq().
252
+            "&forum=".$forumId."&thread=".$threadId.
253
+            "&post=".$rows[$display_post_id]['post_id'].
254
+            "&id_attach=".$id_attach."\">".
255 255
             Display::return_icon(
256 256
                 'edit.png',
257 257
                 get_lang('Edit'),
258 258
                 array(),
259 259
                 ICON_SIZE_SMALL
260
-            ) . '</a>';
260
+            ).'</a>';
261 261
     }
262 262
 }
263 263
 
@@ -273,7 +273,7 @@  discard block
 block discarded – undo
273 273
     sort($id_posts, SORT_NUMERIC);
274 274
     reset($id_posts);
275 275
     // The post minor
276
-    $post_minor = (int)$id_posts[0];
276
+    $post_minor = (int) $id_posts[0];
277 277
 }
278 278
 
279 279
 if (
@@ -282,13 +282,13 @@  discard block
 block discarded – undo
282 282
     !(api_is_course_coach() && $current_forum['session_id'] != $sessionId)
283 283
 ) {
284 284
     if ($locked == false) {
285
-        echo "<a href=\"" . api_get_self() . "?" . api_get_cidreq() .
286
-            "&forum=" . $forumId . "&thread=" . $threadId .
287
-            "&action=delete&content=post&id=" .
288
-            $rows[$display_post_id]['post_id'] .
289
-            "\" onclick=\"javascript:if(!confirm('" .
290
-            addslashes(api_htmlentities(get_lang('DeletePost'), ENT_QUOTES)) .
291
-            "')) return false;\">" . Display::return_icon(
285
+        echo "<a href=\"".api_get_self()."?".api_get_cidreq().
286
+            "&forum=".$forumId."&thread=".$threadId.
287
+            "&action=delete&content=post&id=".
288
+            $rows[$display_post_id]['post_id'].
289
+            "\" onclick=\"javascript:if(!confirm('".
290
+            addslashes(api_htmlentities(get_lang('DeletePost'), ENT_QUOTES)).
291
+            "')) return false;\">".Display::return_icon(
292 292
                 'delete.png',
293 293
                 get_lang('Delete'),
294 294
                 array(),
@@ -307,16 +307,16 @@  discard block
 block discarded – undo
307 307
     );
308 308
 
309 309
     if (!isset($_GET['id']) && $post_id > $post_minor) {
310
-        echo "<a href=\"viewthread.php?" . api_get_cidreq() .
311
-            "&forum=" . $forumId . "&thread=" . $threadId .
312
-            "&origin=" . $origin . "&action=move&post=" .
313
-            $rows[$display_post_id]['post_id'] . "\">" .
310
+        echo "<a href=\"viewthread.php?".api_get_cidreq().
311
+            "&forum=".$forumId."&thread=".$threadId.
312
+            "&origin=".$origin."&action=move&post=".
313
+            $rows[$display_post_id]['post_id']."\">".
314 314
             Display::return_icon(
315 315
                 'move.png',
316 316
                 get_lang('MovePost'),
317 317
                 array(),
318 318
                 ICON_SIZE_SMALL
319
-            ) . "</a>";
319
+            )."</a>";
320 320
 
321 321
     }
322 322
 }
@@ -339,16 +339,16 @@  discard block
 block discarded – undo
339 339
         );
340 340
 
341 341
         if ($locked == false) {
342
-            echo "<a href=\"forumqualify.php?" . api_get_cidreq() .
343
-                "&forum=" . $forumId . "&thread=" . $threadId .
344
-                "&action=list&post=" . $rows[$display_post_id]['post_id'] .
345
-                "&user=" . $rows[$display_post_id]['user_id'] . "&user_id=" .
346
-                $rows[$display_post_id]['user_id'] . "&origin=" . $origin .
347
-                "&idtextqualify=" . $current_qualify_thread .
348
-                "\" >" . Display::return_icon(
342
+            echo "<a href=\"forumqualify.php?".api_get_cidreq().
343
+                "&forum=".$forumId."&thread=".$threadId.
344
+                "&action=list&post=".$rows[$display_post_id]['post_id'].
345
+                "&user=".$rows[$display_post_id]['user_id']."&user_id=".
346
+                $rows[$display_post_id]['user_id']."&origin=".$origin.
347
+                "&idtextqualify=".$current_qualify_thread.
348
+                "\" >".Display::return_icon(
349 349
                     'quiz.gif',
350 350
                     get_lang('Qualify')
351
-                ) . "</a>";
351
+                )."</a>";
352 352
         }
353 353
     }
354 354
 }
@@ -360,33 +360,33 @@  discard block
 block discarded – undo
360 360
         ($current_forum['allow_anonymous'] == 1 && !$_user['user_id'])
361 361
     ) {
362 362
         if (!api_is_anonymous() && api_is_allowed_to_session_edit(false, true)) {
363
-            echo '<a href="reply.php?' . api_get_cidreq() .
364
-                '&forum=' . $forumId . '&thread=' . $threadId .
365
-                '&post=' . $rows[$display_post_id]['post_id'] .
366
-                '&action=replymessage&origin=' . $origin . '">' .
363
+            echo '<a href="reply.php?'.api_get_cidreq().
364
+                '&forum='.$forumId.'&thread='.$threadId.
365
+                '&post='.$rows[$display_post_id]['post_id'].
366
+                '&action=replymessage&origin='.$origin.'">'.
367 367
                 Display::return_icon(
368 368
                     'message_reply_forum.png',
369 369
                     get_lang('ReplyToMessage')
370
-                ) . "</a>";
371
-            echo '<a href="reply.php?' . api_get_cidreq() .
372
-                '&forum=' . $forumId . '&thread=' . $threadId .
373
-                '&post=' . $rows[$display_post_id]['post_id'] .
374
-                '&action=quote&origin=' . $origin . '">' .
370
+                )."</a>";
371
+            echo '<a href="reply.php?'.api_get_cidreq().
372
+                '&forum='.$forumId.'&thread='.$threadId.
373
+                '&post='.$rows[$display_post_id]['post_id'].
374
+                '&action=quote&origin='.$origin.'">'.
375 375
                 Display::return_icon(
376 376
                     'quote.gif',
377 377
                     get_lang('QuoteMessage')
378
-                ) . "</a>";
378
+                )."</a>";
379 379
         }
380 380
     }
381 381
 } else {
382 382
     if ($current_forum_category && $current_forum_category['locked'] == 1) {
383
-        echo get_lang('ForumcategoryLocked') . '<br />';
383
+        echo get_lang('ForumcategoryLocked').'<br />';
384 384
     }
385 385
     if ($current_forum['locked'] == 1) {
386
-        echo get_lang('ForumLocked') . '<br />';
386
+        echo get_lang('ForumLocked').'<br />';
387 387
     }
388 388
     if ($current_thread['locked'] == 1) {
389
-        echo get_lang('ThreadLocked') . '<br />';
389
+        echo get_lang('ThreadLocked').'<br />';
390 390
     }
391 391
 }
392 392
 
@@ -405,17 +405,17 @@  discard block
 block discarded – undo
405 405
     $rows[$display_post_id]['post_notification'] == '1' AND
406 406
     $rows[$display_post_id]['poster_id'] == $_user['user_id']
407 407
 ) {
408
-    $post_image .= Display::return_icon('forumnotification.gif',get_lang('YouWillBeNotified'));
408
+    $post_image .= Display::return_icon('forumnotification.gif', get_lang('YouWillBeNotified'));
409 409
 }
410 410
 // The post title
411
-echo "<td class=\"$titleclass\">" .
412
-    prepare4display($rows[$display_post_id]['post_title']) . "</td>";
411
+echo "<td class=\"$titleclass\">".
412
+    prepare4display($rows[$display_post_id]['post_title'])."</td>";
413 413
 echo "</tr>";
414 414
 
415 415
 // The post message
416 416
 echo "<tr>";
417
-echo "<td class=\"$messageclass\">" .
418
-    prepare4display($rows[$display_post_id]['post_text']) . "</td>";
417
+echo "<td class=\"$messageclass\">".
418
+    prepare4display($rows[$display_post_id]['post_text'])."</td>";
419 419
 echo "</tr>";
420 420
 
421 421
 // The check if there is an attachment
@@ -428,24 +428,24 @@  discard block
 block discarded – undo
428 428
         echo Display::return_icon('attachment.gif', get_lang('Attachment'));
429 429
         echo '<a href="download.php?file=';
430 430
         echo $realname;
431
-        echo ' "> ' . $user_filename . ' </a>';
432
-        echo '<span class="forum_attach_comment">' .
433
-            Security::remove_XSS($attachment['comment'], STUDENT) . '</span>';
431
+        echo ' "> '.$user_filename.' </a>';
432
+        echo '<span class="forum_attach_comment">'.
433
+            Security::remove_XSS($attachment['comment'], STUDENT).'</span>';
434 434
 
435 435
         if (
436
-            ($current_forum['allow_edit'] == 1 &&$rows[$display_post_id]['user_id'] == $_user['user_id']) ||
436
+            ($current_forum['allow_edit'] == 1 && $rows[$display_post_id]['user_id'] == $_user['user_id']) ||
437 437
             (api_is_allowed_to_edit(false, true) && !(api_is_course_coach() && $current_forum['session_id'] != $sessionId))
438 438
         ) {
439
-            echo '&nbsp;&nbsp;<a href="' . api_get_self() . '?' .
440
-                api_get_cidreq() . '&origin=' .
441
-                Security::remove_XSS($_GET['origin']) .
442
-                '&action=delete_attach&id_attach=' .
443
-                $attachment['id'] . '&forum=' . $forumId .
444
-                '&thread=' . $threadId .
445
-                '" onclick="javascript:if(!confirm(\'' .
439
+            echo '&nbsp;&nbsp;<a href="'.api_get_self().'?'.
440
+                api_get_cidreq().'&origin='.
441
+                Security::remove_XSS($_GET['origin']).
442
+                '&action=delete_attach&id_attach='.
443
+                $attachment['id'].'&forum='.$forumId.
444
+                '&thread='.$threadId.
445
+                '" onclick="javascript:if(!confirm(\''.
446 446
                 addslashes(api_htmlentities(
447 447
                     get_lang('ConfirmYourChoice'), ENT_QUOTES)
448
-                ) . '\')) return false;">' . Display::return_icon(
448
+                ).'\')) return false;">'.Display::return_icon(
449 449
                     'delete.gif',
450 450
                     get_lang('Delete')
451 451
                 ).'</a><br />';
Please login to merge, or discard this patch.
main/forum/viewthread.php 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
  */
8 8
 
9 9
 require_once '../inc/global.inc.php';
10
-$current_course_tool  = TOOL_FORUM;
10
+$current_course_tool = TOOL_FORUM;
11 11
 
12 12
 $this_section = SECTION_COURSES;
13 13
 
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 // Are we in a lp ?
24 24
 $origin = '';
25 25
 if (isset($_GET['origin'])) {
26
-    $origin =  Security::remove_XSS($_GET['origin']);
26
+    $origin = Security::remove_XSS($_GET['origin']);
27 27
 }
28 28
 $my_search = null;
29 29
 $gradebook = null;
@@ -36,10 +36,10 @@  discard block
 block discarded – undo
36 36
 // Note pcool: I tried to use only one sql statement (and function) for this,
37 37
 // but the problem is that the visibility of the forum AND forum category are stored in the item_property table.
38 38
 // Note: This has to be validated that it is an existing thread
39
-$current_thread	= get_thread_information($_GET['thread']);
39
+$current_thread = get_thread_information($_GET['thread']);
40 40
 // Note: This has to be validated that it is an existing forum.
41
-$current_forum	= get_forum_information($current_thread['forum_id']);
42
-$current_forum_category	= get_forumcategory_information($current_forum['forum_category']);
41
+$current_forum = get_forum_information($current_thread['forum_id']);
42
+$current_forum_category = get_forumcategory_information($current_forum['forum_category']);
43 43
 $whatsnew_post_info = isset($_SESSION['whatsnew_post_info']) ? $_SESSION['whatsnew_post_info'] : null;
44 44
 /* Header and Breadcrumbs */
45 45
 
@@ -49,8 +49,8 @@  discard block
 block discarded – undo
49 49
 }
50 50
 
51 51
 if (!empty($gradebook) && $gradebook == 'view') {
52
-    $interbreadcrumb[] = array (
53
-        'url' => '../gradebook/' . $_SESSION['gradebook_dest'],
52
+    $interbreadcrumb[] = array(
53
+        'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
54 54
         'name' => get_lang('ToolGradebook')
55 55
     );
56 56
 }
@@ -65,15 +65,15 @@  discard block
 block discarded – undo
65 65
         'name' => get_lang('Groups')
66 66
     );
67 67
     $interbreadcrumb[] = array(
68
-        'url' => api_get_path(WEB_CODE_PATH).'group/group_space.php?' . api_get_cidreq(),
69
-        'name' => get_lang('GroupSpace') . ' ' . $group_properties['name']
68
+        'url' => api_get_path(WEB_CODE_PATH).'group/group_space.php?'.api_get_cidreq(),
69
+        'name' => get_lang('GroupSpace').' '.$group_properties['name']
70 70
     );
71 71
     $interbreadcrumb[] = array(
72
-        'url' => api_get_path(WEB_CODE_PATH).'forum/viewforum.php?forum=' . intval($_GET['forum']) . '&' . api_get_cidreq(). "&search=" . Security::remove_XSS(urlencode($my_search)),
72
+        'url' => api_get_path(WEB_CODE_PATH).'forum/viewforum.php?forum='.intval($_GET['forum']).'&'.api_get_cidreq()."&search=".Security::remove_XSS(urlencode($my_search)),
73 73
         'name' => Security::remove_XSS($current_forum['forum_title'])
74 74
     );
75 75
     $interbreadcrumb[] = array(
76
-        'url' => api_get_path(WEB_CODE_PATH).'forum/viewthread.php?forum=' . intval($_GET['forum']) . '&' . api_get_cidreq(). '&thread=' . intval($_GET['thread']),
76
+        'url' => api_get_path(WEB_CODE_PATH).'forum/viewthread.php?forum='.intval($_GET['forum']).'&'.api_get_cidreq().'&thread='.intval($_GET['thread']),
77 77
         'name' => Security::remove_XSS($current_thread['thread_title'])
78 78
     );
79 79
 
@@ -84,15 +84,15 @@  discard block
 block discarded – undo
84 84
         Display::display_reduced_header();
85 85
     } else {
86 86
         $interbreadcrumb[] = array(
87
-            'url' => api_get_path(WEB_CODE_PATH).'forum/index.php?'.api_get_cidreq().'&search=' . Security::remove_XSS(urlencode($my_search)),
87
+            'url' => api_get_path(WEB_CODE_PATH).'forum/index.php?'.api_get_cidreq().'&search='.Security::remove_XSS(urlencode($my_search)),
88 88
             'name' => $nameTools
89 89
         );
90 90
         $interbreadcrumb[] = array(
91
-            'url' => api_get_path(WEB_CODE_PATH).'forum/viewforumcategory.php?forumcategory='. $current_forum_category['cat_id']. "&search=". Security::remove_XSS(urlencode($my_search)),
91
+            'url' => api_get_path(WEB_CODE_PATH).'forum/viewforumcategory.php?forumcategory='.$current_forum_category['cat_id']."&search=".Security::remove_XSS(urlencode($my_search)),
92 92
             'name' => Security::remove_XSS($current_forum_category['cat_title'])
93 93
         );
94 94
         $interbreadcrumb[] = array(
95
-            'url' => api_get_path(WEB_CODE_PATH).'forum/viewforum.php?'.api_get_cidreq().'&forum=' . intval($_GET['forum']). "&search=". Security::remove_XSS(urlencode($my_search)),
95
+            'url' => api_get_path(WEB_CODE_PATH).'forum/viewforum.php?'.api_get_cidreq().'&forum='.intval($_GET['forum'])."&search=".Security::remove_XSS(urlencode($my_search)),
96 96
             'name' => Security::remove_XSS($current_forum['forum_title'])
97 97
         );
98 98
         $interbreadcrumb[] = array(
@@ -161,9 +161,9 @@  discard block
 block discarded – undo
161 161
     echo '<div class="actions">';
162 162
     echo '<span style="float:right;">'.search_link().'</span>';
163 163
     if ($origin != 'learnpath') {
164
-        echo '<a href="' . $forumUrl . 'viewforum.php?forum='
165
-            . intval($_GET['forum']) . '&' . api_get_cidreq() . '">'
166
-            . Display::return_icon('back.png', get_lang('BackToForum'), '', ICON_SIZE_MEDIUM) . '</a>';
164
+        echo '<a href="'.$forumUrl.'viewforum.php?forum='
165
+            . intval($_GET['forum']).'&'.api_get_cidreq().'">'
166
+            . Display::return_icon('back.png', get_lang('BackToForum'), '', ICON_SIZE_MEDIUM).'</a>';
167 167
     }
168 168
     // The reply to thread link should only appear when the forum_category is
169 169
     // not locked AND the forum is not locked AND the thread is not locked.
@@ -179,9 +179,9 @@  discard block
 block discarded – undo
179 179
         if ($_user['user_id'] || ($current_forum['allow_anonymous'] == 1 && !$_user['user_id'])) {
180 180
             // reply link
181 181
             if (!api_is_anonymous() && api_is_allowed_to_session_edit(false, true)) {
182
-                echo '<a href="' . $forumUrl . 'reply.php?' . api_get_cidreq() . '&forum='
183
-                    . intval($_GET['forum']) . '&thread='
184
-                    . intval($_GET['thread']) . '&action=replythread">'
182
+                echo '<a href="'.$forumUrl.'reply.php?'.api_get_cidreq().'&forum='
183
+                    . intval($_GET['forum']).'&thread='
184
+                    . intval($_GET['thread']).'&action=replythread">'
185 185
                     . Display::return_icon('reply_thread.png', get_lang('ReplyToThread'), '', ICON_SIZE_MEDIUM)
186 186
                     . '</a>';
187 187
             }
@@ -205,13 +205,13 @@  discard block
 block discarded – undo
205 205
 
206 206
     // The different views of the thread.
207 207
     if ($origin != 'learnpath') {
208
-        $my_url = '<a href="' . $forumUrl . 'viewthread.php?' . api_get_cidreq() . '&' . api_get_cidreq()
209
-            . '&forum=' . intval($_GET['forum']) . '&thread=' . intval($_GET['thread'])
210
-            . '&search=' . Security::remove_XSS(urlencode($my_search));
211
-        echo $my_url . '&view=flat">'
208
+        $my_url = '<a href="'.$forumUrl.'viewthread.php?'.api_get_cidreq().'&'.api_get_cidreq()
209
+            . '&forum='.intval($_GET['forum']).'&thread='.intval($_GET['thread'])
210
+            . '&search='.Security::remove_XSS(urlencode($my_search));
211
+        echo $my_url.'&view=flat">'
212 212
             . Display::return_icon('forum_listview.png', get_lang('FlatView'), null, ICON_SIZE_MEDIUM)
213 213
             . '</a>';
214
-        echo $my_url . '&view=nested">'
214
+        echo $my_url.'&view=nested">'
215 215
             . Display::return_icon('forum_nestedview.png', get_lang('NestedView'), null, ICON_SIZE_MEDIUM)
216 216
             . '</a>';
217 217
     }
Please login to merge, or discard this patch.
main/admin/access_urls.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
     exit;
20 20
 }
21 21
 
22
-$interbreadcrumb[] = array ("url" => 'index.php', 'name' => get_lang('PlatformAdmin'));
22
+$interbreadcrumb[] = array("url" => 'index.php', 'name' => get_lang('PlatformAdmin'));
23 23
 $tool_name = get_lang('MultipleAccessURLs');
24 24
 Display :: display_header($tool_name);
25 25
 
@@ -55,12 +55,12 @@  discard block
 block discarded – undo
55 55
         case 'register':
56 56
             // we are going to register the admin
57 57
             if (api_is_platform_admin()) {
58
-                if ($current_access_url_id!=-1) {
58
+                if ($current_access_url_id != -1) {
59 59
                     $url_str = '';
60 60
                     foreach ($url_list as $my_url) {
61 61
                         if (!in_array($my_url['id'], $my_user_url_list)) {
62 62
                             UrlManager::add_user_to_url(api_get_user_id(), $my_url['id']);
63
-                            $url_str.=$my_url['url'].' <br />';
63
+                            $url_str .= $my_url['url'].' <br />';
64 64
                         }
65 65
                     }
66 66
                     Display:: display_normal_message(
@@ -84,16 +84,16 @@  discard block
 block discarded – undo
84 84
         $url_string .= $my_url['url'].' <br />';
85 85
     }
86 86
 }
87
-if(!empty($url_string)) {
88
-	Display :: display_warning_message(get_lang('AdminShouldBeRegisterInSite').'<br />'.$url_string,false);
87
+if (!empty($url_string)) {
88
+	Display :: display_warning_message(get_lang('AdminShouldBeRegisterInSite').'<br />'.$url_string, false);
89 89
 }
90 90
 
91 91
 // checking the current installation
92
-if ($current_access_url_id==-1) {
92
+if ($current_access_url_id == -1) {
93 93
 	Display::display_warning_message(get_lang('URLNotConfiguredPleaseChangedTo').': '.api_get_path(WEB_PATH));
94
-} elseif(api_is_platform_admin()) {
95
-    $quant= UrlManager::relation_url_user_exist(api_get_user_id(),$current_access_url_id);
96
-    if ($quant==0) {
94
+} elseif (api_is_platform_admin()) {
95
+    $quant = UrlManager::relation_url_user_exist(api_get_user_id(), $current_access_url_id);
96
+    if ($quant == 0) {
97 97
         Display:: display_warning_message(
98 98
             '<a href="'.api_get_self().'?action=register&sec_token='.$parameters['sec_token'].'">'.get_lang('ClickToRegisterAdmin').'</a>',
99 99
             false
@@ -142,16 +142,16 @@  discard block
 block discarded – undo
142 142
 
143 143
     //Status
144 144
     $active = $row['active'];
145
-    if ($active=='1') {
146
-        $action='lock';
147
-        $image='right';
145
+    if ($active == '1') {
146
+        $action = 'lock';
147
+        $image = 'right';
148 148
     }
149
-    if ($active=='0') {
150
-        $action='unlock';
151
-        $image='wrong';
149
+    if ($active == '0') {
150
+        $action = 'unlock';
151
+        $image = 'wrong';
152 152
     }
153 153
     // you cannot lock the default
154
-    if ($row['id']=='1') {
154
+    if ($row['id'] == '1') {
155 155
         $status = Display::return_icon($image.'.gif', get_lang(ucfirst($action)));
156 156
     } else {
157 157
         $status = '<a href="access_urls.php?action='.$action.'&amp;url_id='.$row['id'].'">'.
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
     $url_id = $row['id'];
162 162
     $actions = Display::url(Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL), "access_url_edit.php?url_id=$url_id");
163 163
     if ($url_id != '1') {
164
-        $actions .= '<a href="access_urls.php?action=delete_url&amp;url_id='.$url_id.'" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES,$charset))."'".')) return false;">'.
164
+        $actions .= '<a href="access_urls.php?action=delete_url&amp;url_id='.$url_id.'" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"), ENT_QUOTES, $charset))."'".')) return false;">'.
165 165
             Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL).'</a>';
166 166
     }
167 167
     $urls[] = array($url, $description, $status, $actions);
Please login to merge, or discard this patch.
main/admin/user_import.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -215,8 +215,8 @@  discard block
 block discarded – undo
215 215
             // We are sure that the extra field exists.
216 216
             foreach ($extra_fields as $extras) {
217 217
                 if (isset($user[$extras[1]])) {
218
-                    $key 	= $extras[1];
219
-                    $value 	= $user[$extras[1]];
218
+                    $key = $extras[1];
219
+                    $value = $user[$extras[1]];
220 220
                     UserManager::update_extra_field_value($user_id, $key, $value);
221 221
                 }
222 222
             }
@@ -252,7 +252,7 @@  discard block
 block discarded – undo
252 252
     global $current_tag;
253 253
     switch ($data) {
254 254
         case 'Contact':
255
-            $user = array ();
255
+            $user = array();
256 256
             break;
257 257
         default:
258 258
             $current_tag = $data;
@@ -345,7 +345,7 @@  discard block
 block discarded – undo
345 345
     $allowed_file_mimetype = array('csv', 'xml');
346 346
     $error_kind_file = false;
347 347
 
348
-    $checkUniqueEmail = isset($_POST['check_unique_email']) ? $_POST['check_unique_email'] :null;
348
+    $checkUniqueEmail = isset($_POST['check_unique_email']) ? $_POST['check_unique_email'] : null;
349 349
 
350 350
     $uploadInfo = pathinfo($_FILES['import_file']['name']);
351 351
     $ext_import_file = $uploadInfo['extension'];
@@ -354,7 +354,7 @@  discard block
 block discarded – undo
354 354
         if (strcmp($file_type, 'csv') === 0 &&
355 355
             $ext_import_file == $allowed_file_mimetype[0]
356 356
         ) {
357
-            $users	= parse_csv_data($_FILES['import_file']['tmp_name']);
357
+            $users = parse_csv_data($_FILES['import_file']['tmp_name']);
358 358
             $errors = validate_data($users, $checkUniqueEmail);
359 359
             $error_kind_file = false;
360 360
         } elseif (strcmp($file_type, 'xml') === 0 && $ext_import_file == $allowed_file_mimetype[1]) {
Please login to merge, or discard this patch.
main/calendar/agenda.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -274,7 +274,7 @@
 block discarded – undo
274 274
             }
275 275
             break;
276 276
         case "delete":
277
-            if (!(api_is_course_coach() && !api_is_element_in_the_session(TOOL_AGENDA, $eventId) )) {
277
+            if (!(api_is_course_coach() && !api_is_element_in_the_session(TOOL_AGENDA, $eventId))) {
278 278
                 // a coach can only delete an element belonging to his session
279 279
                 $content = $agenda->deleteEvent($eventId);
280 280
             }
Please login to merge, or discard this patch.
main/inc/lib/formvalidator/FormValidator.class.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
         $renderer->setHeaderTemplate('<legend>{header}</legend>');
100 100
 
101 101
         //Set required field template
102
-        $this->setRequiredNote('<span class="form_required">*</span> <small>' . get_lang('ThisFieldIsRequired') . '</small>');
102
+        $this->setRequiredNote('<span class="form_required">*</span> <small>'.get_lang('ThisFieldIsRequired').'</small>');
103 103
         $noteTemplate = <<<EOT
104 104
 	<div class="form-group">
105 105
 		<div class="col-sm-offset-2 col-sm-10">{requiredNote}</div>
@@ -851,9 +851,9 @@  discard block
 block discarded – undo
851 851
             $label = get_lang('PleaseStandBy');
852 852
         }
853 853
         $this->with_progress_bar = true;
854
-        $this->updateAttributes("onsubmit=\"javascript: myUpload.start('dynamic_div','".Display::returnIconPath('progress_bar.gif')."','" . $label . "','" . $this->getAttribute('id') . "')\"");
855
-        $this->addElement('html', '<script language="javascript" src="' . api_get_path(WEB_LIBRARY_PATH) . 'javascript/upload.js" type="text/javascript"></script>');
856
-        $this->addElement('html', '<script type="text/javascript">var myUpload = new upload(' . (abs(intval($delay)) * 1000) . ');</script>');
854
+        $this->updateAttributes("onsubmit=\"javascript: myUpload.start('dynamic_div','".Display::returnIconPath('progress_bar.gif')."','".$label."','".$this->getAttribute('id')."')\"");
855
+        $this->addElement('html', '<script language="javascript" src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/upload.js" type="text/javascript"></script>');
856
+        $this->addElement('html', '<script type="text/javascript">var myUpload = new upload('.(abs(intval($delay)) * 1000).');</script>');
857 857
     }
858 858
 
859 859
     /**
@@ -870,11 +870,11 @@  discard block
 block discarded – undo
870 870
             return;
871 871
         }
872 872
 
873
-        $xajax_upload = new xajax(api_get_path(WEB_LIBRARY_PATH) . 'upload.xajax.php');
873
+        $xajax_upload = new xajax(api_get_path(WEB_LIBRARY_PATH).'upload.xajax.php');
874 874
 
875 875
         $xajax_upload->registerFunction('updateProgress');
876 876
         // IMPORTANT : must be the first element of the form
877
-        $el = $this->insertElementBefore(FormValidator::createElement('html', '<input type="hidden" name="UPLOAD_IDENTIFIER" value="' . $upload_id . '" />'), $element_after);
877
+        $el = $this->insertElementBefore(FormValidator::createElement('html', '<input type="hidden" name="UPLOAD_IDENTIFIER" value="'.$upload_id.'" />'), $element_after);
878 878
 
879 879
         $this->addElement('html', '<br />');
880 880
 
@@ -882,7 +882,7 @@  discard block
 block discarded – undo
882 882
         $this->addElement(
883 883
             'html',
884 884
             '<div id="dynamic_div_container" style="display:none">
885
-                <div id="dynamic_div_label">' . get_lang('UploadFile') . '</div>
885
+                <div id="dynamic_div_label">' . get_lang('UploadFile').'</div>
886 886
                 <div id="dynamic_div_frame" style="width:214px; height:12px; border:1px solid grey; background-image:url(' . Display::returnIconPath('real_upload_frame.gif').');">
887 887
                     <div id="dynamic_div_filled" style="width:0%;height:100%;background-image:url(' . Display::returnIconPath('real_upload_step.gif').');background-repeat:repeat-x;background-position:center;"></div>
888 888
                 </div>
@@ -893,7 +893,7 @@  discard block
 block discarded – undo
893 893
             $this->addElement('html', '
894 894
 			<div id="dynamic_div_waiter_container" style="display:none">
895 895
 				<div id="dynamic_div_waiter_label">
896
-					' . get_lang('SlideshowConversion') . '
896
+					' . get_lang('SlideshowConversion').'
897 897
 				</div>
898 898
 				<div id="dynamic_div_waiter_frame">
899 899
 					'.Display::return_icon('real_upload_frame.gif').'
@@ -903,18 +903,18 @@  discard block
 block discarded – undo
903 903
         }
904 904
 
905 905
         // Get the xajax code
906
-        $this->addElement('html', $xajax_upload->getJavascript(api_get_path(WEB_LIBRARY_PATH) . 'xajax'));
906
+        $this->addElement('html', $xajax_upload->getJavascript(api_get_path(WEB_LIBRARY_PATH).'xajax'));
907 907
 
908 908
         // Get the upload code
909
-        $this->addElement('html', '<script language="javascript" src="' . api_get_path(WEB_LIBRARY_PATH) . 'javascript/upload.js" type="text/javascript"></script>');
910
-        $this->addElement('html', '<script type="text/javascript">var myUpload = new upload(' . (abs(intval($delay)) * 1000) . ');</script>');
909
+        $this->addElement('html', '<script language="javascript" src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/upload.js" type="text/javascript"></script>');
910
+        $this->addElement('html', '<script type="text/javascript">var myUpload = new upload('.(abs(intval($delay)) * 1000).');</script>');
911 911
 
912 912
         if (!$wait_after_upload) {
913 913
             $wait_after_upload = 0;
914 914
         }
915 915
 
916 916
         // Add the upload event
917
-        $this->updateAttributes("onsubmit=\"javascript: myUpload.startRealUpload('dynamic_div','" . $upload_id . "','" . $this->getAttribute('id') . "'," . $wait_after_upload . ")\"");
917
+        $this->updateAttributes("onsubmit=\"javascript: myUpload.startRealUpload('dynamic_div','".$upload_id."','".$this->getAttribute('id')."',".$wait_after_upload.")\"");
918 918
     }
919 919
 
920 920
     /**
Please login to merge, or discard this patch.
main/forum/newthread.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -54,12 +54,12 @@  discard block
 block discarded – undo
54 54
 
55 55
 /* Breadcrumbs */
56 56
 
57
-if (isset($_SESSION['gradebook'])){
57
+if (isset($_SESSION['gradebook'])) {
58 58
     $gradebook = Security::remove_XSS($_SESSION['gradebook']);
59 59
 }
60 60
 
61 61
 if (!empty($gradebook) && $gradebook == 'view') {
62
-    $interbreadcrumb[] = array (
62
+    $interbreadcrumb[] = array(
63 63
         'url' => '../gradebook/'.Security::remove_XSS($_SESSION['gradebook_dest']),
64 64
         'name' => get_lang('ToolGradebook')
65 65
     );
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
     $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'group/group.php?'.$cidreq, 'name' => get_lang('Groups'));
118 118
     $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'group/group_space.php?'.$cidreq, 'name' => get_lang('GroupSpace').' '.$groupProperties['name']);
119 119
     $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/viewforum.php?'.$cidreq.'&forum='.intval($_GET['forum']), 'name' => $current_forum['forum_title']);
120
-    $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/newthread.php?'.$cidreq.'&forum='.intval($_GET['forum']),'name' => get_lang('NewTopic'));
120
+    $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/newthread.php?'.$cidreq.'&forum='.intval($_GET['forum']), 'name' => get_lang('NewTopic'));
121 121
 } else {
122 122
     $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/index.php?'.$cidreq, 'name' => $nameTools);
123 123
     $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/viewforumcategory.php?'.$cidreq.'&forumcategory='.$current_forum_category['cat_id'], 'name' => $current_forum_category['cat_title']);
@@ -127,9 +127,9 @@  discard block
 block discarded – undo
127 127
 
128 128
 /* Resource Linker */
129 129
 if (isset($_POST['add_resources']) AND $_POST['add_resources'] == get_lang('Resources')) {
130
-    $_SESSION['formelements']	= $_POST;
131
-    $_SESSION['origin']			= $_SERVER['REQUEST_URI'];
132
-    $_SESSION['breadcrumbs']	= $interbreadcrumb;
130
+    $_SESSION['formelements'] = $_POST;
131
+    $_SESSION['origin'] = $_SERVER['REQUEST_URI'];
132
+    $_SESSION['breadcrumbs'] = $interbreadcrumb;
133 133
     header('Location: ../resourcelinker/resourcelinker.php');
134 134
     exit;
135 135
 }
Please login to merge, or discard this patch.