Completed
Push — 1.11.x ( 69878b...1da93a )
by José
64:32 queued 39:16
created
main/dropbox/dropbox_init.inc.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
 $is_courseTutor = api_is_course_tutor();
127 127
 $is_courseAdmin = api_is_course_admin();
128 128
 
129
-$current_course_tool  = TOOL_DROPBOX;
129
+$current_course_tool = TOOL_DROPBOX;
130 130
 
131 131
 // the dropbox configuration parameters
132 132
 $dropbox_cnf = require_once 'dropbox_config.inc.php';
@@ -278,10 +278,10 @@  discard block
 block discarded – undo
278 278
 $javascript .= "
279 279
 	</script>";
280 280
 $htmlHeadXtra[] = $javascript;
281
-$htmlHeadXtra[] ="<script>
281
+$htmlHeadXtra[] = "<script>
282 282
 function confirmation (name)
283 283
 {
284
-	if (confirm(\" ". get_lang("AreYouSureToDeleteJS") ." \"+ name + \" ?\"))
284
+	if (confirm(\" ". get_lang("AreYouSureToDeleteJS")." \"+ name + \" ?\"))
285 285
 		{return true;}
286 286
 	else
287 287
 		{return false;}
@@ -321,7 +321,7 @@  discard block
 block discarded – undo
321 321
 
322 322
 if ((!$is_allowed_in_course || !$is_course_member) && !api_is_allowed_to_edit(null, true)) {
323 323
     if ($origin != 'learnpath') {
324
-        api_not_allowed(true);//print headers/footers
324
+        api_not_allowed(true); //print headers/footers
325 325
     } else {
326 326
         api_not_allowed();
327 327
     }
Please login to merge, or discard this patch.
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
             $javascript .= "'".$dropbox_person->sentWork[$i]->title."'";
217 217
         }
218 218
     }
219
-	$javascript .= ");
219
+    $javascript .= ");
220 220
 
221 221
 		function checkfile(str)
222 222
 		{
@@ -326,15 +326,15 @@  discard block
 block discarded – undo
326 326
         'url' => api_get_path(WEB_CODE_PATH).'dropbox/index.php?'.api_get_cidreq(),
327 327
         'name' => get_lang('Dropbox', ''),
328 328
     );
329
-	$nameTools = get_lang('ReceivedFiles');
329
+    $nameTools = get_lang('ReceivedFiles');
330 330
 
331
-	if ($action == 'addreceivedcategory') {
331
+    if ($action == 'addreceivedcategory') {
332 332
         $interbreadcrumb[] = array(
333 333
             'url' => api_get_path(WEB_CODE_PATH).'dropbox/index.php?view=received&'.api_get_cidreq(),
334 334
             'name' => get_lang('ReceivedFiles'),
335 335
         );
336
-		$nameTools = get_lang('AddNewCategory');
337
-	}
336
+        $nameTools = get_lang('AddNewCategory');
337
+    }
338 338
 }
339 339
 
340 340
 if ($view == 'sent' || empty($view)) {
Please login to merge, or discard this patch.
main/inc/ajax/install.ajax.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 $action = $_GET['a'];
10 10
 
11 11
 switch ($action) {
12
-	case 'send_contact_information':
12
+    case 'send_contact_information':
13 13
         if (!empty($_POST)) {
14 14
             // get params from contact form
15 15
             $person_name = $_POST['person_name'];
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 
61 61
             }
62 62
         break;
63
-	default:
64
-		echo '';
63
+    default:
64
+        echo '';
65 65
 }
66 66
 exit;
Please login to merge, or discard this patch.
main/inc/lib/geometry.lib.php 3 patches
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.
Braces   +49 added lines, -28 removed lines patch added patch discarded remove patch
@@ -65,8 +65,10 @@  discard block
 block discarded – undo
65 65
     $bords = array_fill(0, $bord_lenght, array()); // building this array
66 66
 
67 67
     /* adding the first point of the polygone */
68
-    if (is_array($bords[$poly[0]['y']])) //avoid warning
68
+    if (is_array($bords[$poly[0]['y']])) {
69
+        //avoid warning
69 70
     	array_push($bords[$poly[0]['y']], $poly[0]['x']);
71
+    }
70 72
 
71 73
     $i = 1; // we re-use $i and $old_pente bellow the loop
72 74
     $old_pente=0;
@@ -75,11 +77,14 @@  discard block
 block discarded – undo
75 77
 
76 78
         /* special cases */
77 79
         if ($poly[$i-1]['y'] == $poly[$i]['y']) {
78
-            if ($poly[$i-1]['x'] == $poly[$i]['x'])
79
-                continue; // twice the same point
80
+            if ($poly[$i-1]['x'] == $poly[$i]['x']) {
81
+                            continue;
82
+            }
83
+            // twice the same point
80 84
             else {    //  infinite elevation of the edge
81
-            	if (is_array($bords[$poly[$i]['y']]))
82
-                	array_push($bords[$poly[$i]['y']],$poly[$i]['x']);
85
+            	if (is_array($bords[$poly[$i]['y']])) {
86
+            	                	array_push($bords[$poly[$i]['y']],$poly[$i]['x']);
87
+            	}
83 88
                 $old_pente=0;
84 89
                 continue;
85 90
             }
@@ -87,9 +92,13 @@  discard block
 block discarded – undo
87 92
 
88 93
 		//echo 'point:'.$poly[$i]['y']; bug here
89 94
         // adding the point as a part of an edge
90
-        if (is_array($bords[$poly[$i]['y']])) //avoid warning
95
+        if (is_array($bords[$poly[$i]['y']])) {
96
+            //avoid warning
91 97
         array_push($bords[$poly[$i]['y']], $poly[$i]['x']);
92
-        if (DEBUG) echo '('.$poly[$i]['x'].';'.$poly[$i]['y'].')   ';
98
+        }
99
+        if (DEBUG) {
100
+            echo '('.$poly[$i]['x'].';'.$poly[$i]['y'].')   ';
101
+        }
93 102
 
94 103
         /* computing the elevation of the edge going */
95 104
         //        from $poly[$i-1] to $poly[$i]
@@ -99,15 +108,17 @@  discard block
 block discarded – undo
99 108
         // if the sign of the elevation change from the one of the
100 109
         // previous edge, the point must be added a second time inside
101 110
         // $bords
102
-        if ($i>1)
103
-            if (($old_pente<0 && $pente>0)
111
+        if ($i>1) {
112
+                    if (($old_pente<0 && $pente>0)
104 113
                     || ($old_pente>0 && $pente<0)) {
105 114
 				if (is_array($bords[$poly[$i]['y']])) //avoid warning
106 115
                 	array_push($bords[$poly[$i]['y']],$poly[$i]['x']);
116
+        }
107 117
 
108
-                if (DEBUG)
109
-                    echo '*('.$poly[$i]['x'].
118
+                if (DEBUG) {
119
+                                    echo '*('.$poly[$i]['x'].
110 120
                         ';'.$poly[$i]['y'].')   ';
121
+                }
111 122
         	}
112 123
 
113 124
         /* detect the direction of the elevation in Y */
@@ -136,10 +147,11 @@  discard block
 block discarded – undo
136 147
 
137 148
         // elevation between $poly[0]['x'] and $poly[1]['x'])
138 149
         $rest = $poly[0]['y']-$poly[1]['y'];
139
-        if ($rest!=0)
140
-        	$pente1 = ($poly[0]['x']-$poly[1]['x'])/($rest);
141
-        else
142
-			$pente1 = 0;
150
+        if ($rest!=0) {
151
+                	$pente1 = ($poly[0]['x']-$poly[1]['x'])/($rest);
152
+        } else {
153
+        			$pente1 = 0;
154
+        }
143 155
 
144 156
         // elevation between $poly[$i-1]['x'] and $poly[0]['x'])
145 157
         $pente = ($poly[$i-1]['x']-$poly[0]['x'])/
@@ -151,14 +163,17 @@  discard block
 block discarded – undo
151 163
 
152 164
         // doubling the first point if needed (see above)
153 165
         if (($pente1<0 && $pente>0) || ($pente1>0 && $pente<0)) {
154
-        	if (is_array($bords[$poly[$i - 1]['y']]))
155
-            	array_push($bords[$poly[$i - 1]['y']],  round($poly[$i - 1]['x']));
166
+        	if (is_array($bords[$poly[$i - 1]['y']])) {
167
+        	            	array_push($bords[$poly[$i - 1]['y']],  round($poly[$i - 1]['x']));
168
+        	}
156 169
             //if (DEBUG) echo '('.$poly[$i-1]['x'].';'.$poly[$i-1]['y'].')   ';
157 170
         }
158 171
         //  doubling the last point if neededd
159 172
         if (($old_pente<0 && $pente>0) || ($old_pente>0 && $pente<0)) {
160
-        	if (is_array($bords[$poly[$i-1]['y']])) //avoid warning
173
+        	if (is_array($bords[$poly[$i-1]['y']])) {
174
+        	    //avoid warning
161 175
             	array_push($bords[$poly[$i-1]['y']], round($poly[$i-1]['x']));
176
+        	}
162 177
             //if (DEBUG) echo '*('.$poly[$i-1]['x'].';'.$poly[$i-1]['y'].')   ';
163 178
         }
164 179
 
@@ -227,11 +242,13 @@  discard block
 block discarded – undo
227 242
         $s = "<div style='font-size: 8px; line-height:3px'><pre>\n";
228 243
     }
229 244
     for ($i=0; $i<$max['y']; $i++) {
230
-        for($j=0; $j<$max['x']; $j++)
231
-            if($poly[$j][$i] == TRUE)
245
+        for($j=0; $j<$max['x']; $j++) {
246
+                    if($poly[$j][$i] == TRUE)
232 247
                 $s .= ($format=='html'?"<b>1</b>":'1');
233
-            else
234
-                $s .= "0";
248
+        }
249
+            else {
250
+                            $s .= "0";
251
+            }
235 252
         $s .= ($format=='html'?"<br />\n":"\n");
236 253
     }
237 254
     $s .= ($format=='html'?"</pre></div>\n":"\n");
@@ -252,15 +269,19 @@  discard block
 block discarded – undo
252 269
     $surfaceOf1 = 0;
253 270
     $surfaceOf2 = 0;
254 271
 
255
-    for ($i=0; $i<$max['x']; $i++)
256
-        for($j=0; $j<$max['y']; $j++) {
272
+    for ($i=0; $i<$max['x']; $i++) {
273
+            for($j=0;
274
+    }
275
+    $j<$max['y']; $j++) {
257 276
             if (isset($poly1[$i][$j]) && ($poly1[$i][$j] == TRUE)) {
258 277
                 $surfaceOf1++;
259
-                if (isset($poly2[$i][$j]) && ($poly2[$i][$j] == FALSE))
260
-                    $onlyIn1++;
278
+                if (isset($poly2[$i][$j]) && ($poly2[$i][$j] == FALSE)) {
279
+                                    $onlyIn1++;
280
+                }
281
+            }
282
+            if (isset($poly2[$i][$j]) && ($poly2[$i][$j] == TRUE)) {
283
+                            $surfaceOf2++;
261 284
             }
262
-            if (isset($poly2[$i][$j]) && ($poly2[$i][$j] == TRUE))
263
-                $surfaceOf2++;
264 285
         }
265 286
 
266 287
     return array (
Please login to merge, or discard this patch.
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -56,9 +56,9 @@  discard block
 block discarded – undo
56 56
      *        for all j in [O..max[y][ : for all i in bords[$j] :
57 57
      *            (i,j) is a point inside an edge of the polygone
58 58
      */
59
-	$bord_lenght = $max['x'];
59
+    $bord_lenght = $max['x'];
60 60
     if ($max['y'] > $bord_lenght) {
61
-     	$bord_lenght = $max['y'];
61
+            $bord_lenght = $max['y'];
62 62
     }
63 63
 
64 64
     //$bords = array_fill(0, $bord_lenght-1, array()); // building this array
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 
67 67
     /* adding the first point of the polygone */
68 68
     if (is_array($bords[$poly[0]['y']])) //avoid warning
69
-    	array_push($bords[$poly[0]['y']], $poly[0]['x']);
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 72
     $old_pente=0;
@@ -78,14 +78,14 @@  discard block
 block discarded – undo
78 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
-            	if (is_array($bords[$poly[$i]['y']]))
82
-                	array_push($bords[$poly[$i]['y']],$poly[$i]['x']);
81
+                if (is_array($bords[$poly[$i]['y']]))
82
+                    array_push($bords[$poly[$i]['y']],$poly[$i]['x']);
83 83
                 $old_pente=0;
84 84
                 continue;
85 85
             }
86 86
         }
87 87
 
88
-		//echo 'point:'.$poly[$i]['y']; bug here
88
+        //echo 'point:'.$poly[$i]['y']; bug here
89 89
         // adding the point as a part of an edge
90 90
         if (is_array($bords[$poly[$i]['y']])) //avoid warning
91 91
         array_push($bords[$poly[$i]['y']], $poly[$i]['x']);
@@ -102,13 +102,13 @@  discard block
 block discarded – undo
102 102
         if ($i>1)
103 103
             if (($old_pente<0 && $pente>0)
104 104
                     || ($old_pente>0 && $pente<0)) {
105
-				if (is_array($bords[$poly[$i]['y']])) //avoid warning
106
-                	array_push($bords[$poly[$i]['y']],$poly[$i]['x']);
105
+                if (is_array($bords[$poly[$i]['y']])) //avoid warning
106
+                    array_push($bords[$poly[$i]['y']],$poly[$i]['x']);
107 107
 
108 108
                 if (DEBUG)
109 109
                     echo '*('.$poly[$i]['x'].
110 110
                         ';'.$poly[$i]['y'].')   ';
111
-        	}
111
+            }
112 112
 
113 113
         /* detect the direction of the elevation in Y */
114 114
         $dy_inc = ($poly[$i]['y']-$poly[$i-1]['y']) > 0 ? 1 : -1;
@@ -137,9 +137,9 @@  discard block
 block discarded – undo
137 137
         // elevation between $poly[0]['x'] and $poly[1]['x'])
138 138
         $rest = $poly[0]['y']-$poly[1]['y'];
139 139
         if ($rest!=0)
140
-        	$pente1 = ($poly[0]['x']-$poly[1]['x'])/($rest);
140
+            $pente1 = ($poly[0]['x']-$poly[1]['x'])/($rest);
141 141
         else
142
-			$pente1 = 0;
142
+            $pente1 = 0;
143 143
 
144 144
         // elevation between $poly[$i-1]['x'] and $poly[0]['x'])
145 145
         $pente = ($poly[$i-1]['x']-$poly[0]['x'])/
@@ -151,14 +151,14 @@  discard block
 block discarded – undo
151 151
 
152 152
         // doubling the first point if needed (see above)
153 153
         if (($pente1<0 && $pente>0) || ($pente1>0 && $pente<0)) {
154
-        	if (is_array($bords[$poly[$i - 1]['y']]))
155
-            	array_push($bords[$poly[$i - 1]['y']],  round($poly[$i - 1]['x']));
154
+            if (is_array($bords[$poly[$i - 1]['y']]))
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 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']));
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
 
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 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
-       		sort($bords[$i]);
188
+                sort($bords[$i]);
189 189
         }
190 190
 
191 191
         for ($j = 0; $j<sizeof($bords[$i]);$j+=2) { // bords
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 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 198
                 if ($test == 1)  {
199
-                	/*how to draw the polygon in a human way:
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)
202 202
                 	In gnuplot:
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
                 	For 2 polygons:  plot "/home/jmontoya/test", "/home/jmontoya/test2"
205 205
                 	A new window will appear with the plot
206 206
                 	*/
207
-                	echo $k.'  '.$i; echo '<br />';
207
+                    echo $k.'  '.$i; echo '<br />';
208 208
                 }
209 209
             }
210 210
         }
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
         list($x,$y) = explode(';',$pcoord);
309 309
         $points[] = array('x'=>$x,'y'=>$y);
310 310
     }
311
-	return $points;
311
+    return $points;
312 312
 }
313 313
 
314 314
 /**
@@ -321,11 +321,11 @@  discard block
 block discarded – undo
321 321
     $mx = 0;
322 322
     $my = 0;
323 323
     foreach ($coords1 as $coord) {
324
-    	if ($coord['x'] > $mx) {
324
+        if ($coord['x'] > $mx) {
325 325
             $mx = $coord['x'];
326
-    	}
326
+        }
327 327
         if ($coord['y'] > $my) {
328
-        	$my = $coord['y'];
328
+            $my = $coord['y'];
329 329
         }
330 330
     }
331 331
     foreach ($coords2 as $coord) {
Please login to merge, or discard this patch.
main/inc/lib/document.lib.php 3 patches
Indentation   -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,6 @@
 block discarded – undo
16 16
  * @author Patrick Cool
17 17
  * @author René Haentjens, added CSV file import (October 2004)
18 18
  * @package chamilo.link
19
-
20 19
  */
21 20
 
22 21
 // Including libraries
Please login to merge, or discard this patch.
Doc Comments   +23 added lines, -18 removed lines patch added patch discarded remove patch
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
     /**
278 278
      *  @param string
279 279
      *  @param string
280
-     * 	@return true if the user is allowed to see the document, false otherwise
280
+     * 	@return boolean if the user is allowed to see the document, false otherwise
281 281
      * 	@author Sergio A Kessler, first version
282 282
      * 	@author Roan Embrechts, bugfix
283 283
      *  @todo not only check if a file is visible, but also check if the user is allowed to see the file??
@@ -1529,7 +1529,7 @@  discard block
 block discarded – undo
1529 1529
      * Return true if the documentpath have visibility=1 as
1530 1530
      * item_property (you should use the is_visible_by_id)
1531 1531
      *
1532
-     * @param string $document_path the relative complete path of the document
1532
+     * @param string $doc_path the relative complete path of the document
1533 1533
      * @param array  $course the _course array info of the document's course
1534 1534
      * @param int
1535 1535
      * @param string
@@ -1615,6 +1615,8 @@  discard block
 block discarded – undo
1615 1615
      * @param   int
1616 1616
      * @param   int
1617 1617
      * @param bool
1618
+     * @param integer $session_id
1619
+     * @param integer $user_id
1618 1620
      * @return  bool
1619 1621
      */
1620 1622
     public static function is_visible_by_id(
@@ -1966,7 +1968,7 @@  discard block
 block discarded – undo
1966 1968
      * Remove default certificate
1967 1969
      * @param string $course_id The course code
1968 1970
      * @param int $default_certificate_id The document id of the default certificate
1969
-     * @return void
1971
+     * @return false|null
1970 1972
      */
1971 1973
     public static function remove_attach_certificate($course_id, $default_certificate_id)
1972 1974
     {
@@ -2101,6 +2103,7 @@  discard block
 block discarded – undo
2101 2103
      * @param	bool  	is file or string html
2102 2104
      * @param	string	type (one of the app tools) - optional (otherwise takes the current item's type)
2103 2105
      * @param	int		level of recursivity we're in
2106
+     * @param string $source_html
2104 2107
      * @return	array	List of file paths. An additional field containing 'local' or 'remote' helps determine
2105 2108
      * if the file should be copied into the zip or just linked
2106 2109
      */
@@ -2940,6 +2943,7 @@  discard block
 block discarded – undo
2940 2943
 
2941 2944
     /**
2942 2945
      * Obtains the text inside the file with the right parser
2946
+     * @param string $doc_path
2943 2947
      */
2944 2948
     public static function get_text_content($doc_path, $doc_mime)
2945 2949
     {
@@ -3191,6 +3195,7 @@  discard block
 block discarded – undo
3191 3195
      * Shows a play icon next to the document title in the document list
3192 3196
      * @param int
3193 3197
      * @param string
3198
+     * @param integer|null $i
3194 3199
      * @return string	html content
3195 3200
      */
3196 3201
     public static function generate_media_preview($i, $type = 'simple')
@@ -4089,7 +4094,7 @@  discard block
 block discarded – undo
4089 4094
     }
4090 4095
 
4091 4096
     /**
4092
-     * @return array
4097
+     * @return string[]
4093 4098
      */
4094 4099
     public static function get_web_odf_extension_list()
4095 4100
     {
@@ -4098,10 +4103,10 @@  discard block
 block discarded – undo
4098 4103
 
4099 4104
     /**
4100 4105
      * Set of extension allowed to use Jodconverter
4101
-     * @param $mode 'from'
4106
+     * @param string $mode 'from'
4102 4107
      *              'to'
4103 4108
      *              'all'
4104
-     * @param $format   'text'
4109
+     * @param string $format   'text'
4105 4110
      *                  'spreadsheet'
4106 4111
      *                  'presentation'
4107 4112
      *                  'drawing'
@@ -4305,7 +4310,7 @@  discard block
 block discarded – undo
4305 4310
     }
4306 4311
 
4307 4312
     /**
4308
-     * @return array
4313
+     * @return string[]
4309 4314
      */
4310 4315
     public static function get_system_folders()
4311 4316
     {
@@ -4323,7 +4328,7 @@  discard block
 block discarded – undo
4323 4328
     }
4324 4329
 
4325 4330
     /**
4326
-     * @return array
4331
+     * @return string[]
4327 4332
      */
4328 4333
     public static function getProtectedFolderFromStudent()
4329 4334
     {
@@ -4479,7 +4484,7 @@  discard block
 block discarded – undo
4479 4484
      * Requires the ffmpeg lib. In ubuntu: sudo apt-get install ffmpeg
4480 4485
      * @param string $wavFile
4481 4486
      * @param bool $removeWavFileIfSuccess
4482
-     * @return bool
4487
+     * @return string|false
4483 4488
      */
4484 4489
     public static function convertWavToMp3($wavFile, $removeWavFileIfSuccess = false)
4485 4490
     {
@@ -5055,6 +5060,8 @@  discard block
 block discarded – undo
5055 5060
      * @param string	The current folder (path inside of the "document" directory, including the prefix "/")
5056 5061
      * @param string	Group directory, if empty, prevents documents to be uploaded (because group documents cannot be uploaded in root)
5057 5062
      * @param	boolean	Whether to change the renderer (this will add a template <span> to the QuickForm object displaying the form)
5063
+     * @param string $document_id
5064
+     * @param FormValidator $form
5058 5065
 
5059 5066
      * @return string html form
5060 5067
      */
@@ -5560,9 +5567,6 @@  discard block
 block discarded – undo
5560 5567
     /**
5561 5568
      * Creates the row of edit icons for a file/folder
5562 5569
      *
5563
-     * @param string $curdirpath current path (cfr open folder)
5564
-     * @param string $type (file/folder)
5565
-     * @param string $path dbase path of file/folder
5566 5570
      * @param int $visibility (1/0)
5567 5571
      * @param int $id dbase id of the document
5568 5572
      * @return string html img tags with hyperlinks
@@ -5896,7 +5900,7 @@  discard block
 block discarded – undo
5896 5900
     /**
5897 5901
      * Gets the path translated with title of docs and folders
5898 5902
      * @param string $path the real path
5899
-     * @return the path which should be displayed
5903
+     * @return string path which should be displayed
5900 5904
      */
5901 5905
     public static function get_titles_of_path($path)
5902 5906
     {
@@ -5952,7 +5956,8 @@  discard block
 block discarded – undo
5952 5956
 
5953 5957
     /**
5954 5958
      * Checks whether the user is in shared folder
5955
-     * @return return bool Return true when user is into shared folder
5959
+     * @param integer $current_session_id
5960
+     * @return boolean bool Return true when user is into shared folder
5956 5961
      */
5957 5962
     public static function is_shared_folder($curdirpath, $current_session_id)
5958 5963
     {
@@ -5968,7 +5973,7 @@  discard block
 block discarded – undo
5968 5973
 
5969 5974
     /**
5970 5975
      * Checks whether the user is into any user shared folder
5971
-     * @return return bool Return true when user is in any user shared folder
5976
+     * @return boolean bool Return true when user is in any user shared folder
5972 5977
      */
5973 5978
     public static function is_any_user_shared_folder($path, $current_session_id)
5974 5979
     {
@@ -6182,7 +6187,7 @@  discard block
 block discarded – undo
6182 6187
      * @param int $id
6183 6188
      * @param array $courseInfo
6184 6189
      * @param int $sessionId
6185
-     * @return bool
6190
+     * @return boolean|null
6186 6191
      */
6187 6192
     public static function downloadDeletedDocument($id, $courseInfo, $sessionId)
6188 6193
     {
@@ -6201,7 +6206,7 @@  discard block
 block discarded – undo
6201 6206
      * @param array $courseInfo
6202 6207
      * @param int $sessionId
6203 6208
      *
6204
-     * @return bool
6209
+     * @return false|null
6205 6210
      */
6206 6211
     public static function downloadAllDeletedDocument($courseInfo, $sessionId)
6207 6212
     {
@@ -6240,7 +6245,7 @@  discard block
 block discarded – undo
6240 6245
      * @param array $courseInfo
6241 6246
      * @param int $sessionId
6242 6247
      *
6243
-     * @return bool
6248
+     * @return false|null
6244 6249
      */
6245 6250
     public static function deleteDocumentsFromSession($courseInfo, $sessionId)
6246 6251
     {
Please login to merge, or discard this patch.
Spacing   +331 added lines, -331 removed lines patch added patch discarded remove patch
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
             return true;
291 291
         } else {
292 292
             $tbl_document = Database::get_course_table(TABLE_DOCUMENT);
293
-            $tbl_item_property = $this_course . 'item_property';
293
+            $tbl_item_property = $this_course.'item_property';
294 294
             $doc_url = Database::escape_string($doc_url);
295 295
             $query = "SELECT 1 FROM $tbl_document AS docs,$tbl_item_property AS props
296 296
                       WHERE
@@ -340,18 +340,18 @@  discard block
 block discarded – undo
340 340
             }
341 341
 
342 342
             header('Content-type: application/octet-stream');
343
-            header('Content-length: ' . $len);
343
+            header('Content-length: '.$len);
344 344
             if (preg_match("/MSIE 5.5/", $_SERVER['HTTP_USER_AGENT'])) {
345
-                header('Content-Disposition: filename= ' . $filename);
345
+                header('Content-Disposition: filename= '.$filename);
346 346
             } else {
347
-                header('Content-Disposition: attachment; filename= ' . $filename);
347
+                header('Content-Disposition: attachment; filename= '.$filename);
348 348
             }
349 349
             if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE')) {
350 350
                 header('Pragma: ');
351 351
                 header('Cache-Control: ');
352 352
                 header('Cache-Control: public'); // IE cannot download from sessions without a cache
353 353
             }
354
-            header('Content-Description: ' . $filename);
354
+            header('Content-Description: '.$filename);
355 355
             header('Content-Transfer-Encoding: binary');
356 356
 
357 357
             $res = fopen($full_file_name, 'r');
@@ -378,7 +378,7 @@  discard block
 block discarded – undo
378 378
                     } else {
379 379
                         $encoding = @api_detect_encoding_html(file_get_contents($full_file_name));
380 380
                         if (!empty($encoding)) {
381
-                            $content_type .= '; charset=' . $encoding;
381
+                            $content_type .= '; charset='.$encoding;
382 382
                         }
383 383
                     }
384 384
                     break;
@@ -388,7 +388,7 @@  discard block
 block discarded – undo
388 388
                     } else {
389 389
                         $encoding = @api_detect_encoding(strip_tags(file_get_contents($full_file_name)));
390 390
                         if (!empty($encoding)) {
391
-                            $content_type .= '; charset=' . $encoding;
391
+                            $content_type .= '; charset='.$encoding;
392 392
                         }
393 393
                     }
394 394
                     break;
@@ -397,13 +397,13 @@  discard block
 block discarded – undo
397 397
                     header('Content-type: application/octet-stream');
398 398
                     break;
399 399
             }
400
-            header('Content-type: ' . $content_type);
401
-            header('Content-Length: ' . $len);
400
+            header('Content-type: '.$content_type);
401
+            header('Content-Length: '.$len);
402 402
             $user_agent = strtolower($_SERVER['HTTP_USER_AGENT']);
403 403
             if (strpos($user_agent, 'msie')) {
404
-                header('Content-Disposition: ; filename= ' . $filename);
404
+                header('Content-Disposition: ; filename= '.$filename);
405 405
             } else {
406
-                header('Content-Disposition: inline; filename= ' . $filename);
406
+                header('Content-Disposition: inline; filename= '.$filename);
407 407
             }
408 408
 
409 409
             if ($fixLinksHttpToHttps) {
@@ -444,18 +444,18 @@  discard block
 block discarded – undo
444 444
 
445 445
             header('Content-type: application/octet-stream');
446 446
             //header('Content-Type: application/force-download');
447
-            header('Content-length: ' . $len);
447
+            header('Content-length: '.$len);
448 448
             if (preg_match("/MSIE 5.5/", $_SERVER['HTTP_USER_AGENT'])) {
449
-                header('Content-Disposition: filename= ' . $filename);
449
+                header('Content-Disposition: filename= '.$filename);
450 450
             } else {
451
-                header('Content-Disposition: attachment; filename= ' . $filename);
451
+                header('Content-Disposition: attachment; filename= '.$filename);
452 452
             }
453 453
             if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE')) {
454 454
                 header('Pragma: ');
455 455
                 header('Cache-Control: ');
456 456
                 header('Cache-Control: public'); // IE cannot download from sessions without a cache
457 457
             }
458
-            header('Content-Description: ' . $filename);
458
+            header('Content-Description: '.$filename);
459 459
             header('Content-transfer-encoding: binary');
460 460
             echo $full_string;
461 461
 
@@ -468,30 +468,30 @@  discard block
 block discarded – undo
468 468
 
469 469
             $content_type = self::file_get_mime_type($filename);
470 470
             header('Expires: Wed, 01 Jan 1990 00:00:00 GMT');
471
-            header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
471
+            header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
472 472
             header('Cache-Control: no-cache, must-revalidate');
473 473
             header('Pragma: no-cache');
474 474
             switch ($content_type) {
475 475
                 case 'text/html':
476 476
                     $encoding = @api_detect_encoding_html($full_string);
477 477
                     if (!empty($encoding)) {
478
-                        $content_type .= '; charset=' . $encoding;
478
+                        $content_type .= '; charset='.$encoding;
479 479
                     }
480 480
                     break;
481 481
                 case 'text/plain':
482 482
                     $encoding = @api_detect_encoding(strip_tags($full_string));
483 483
                     if (!empty($encoding)) {
484
-                        $content_type .= '; charset=' . $encoding;
484
+                        $content_type .= '; charset='.$encoding;
485 485
                     }
486 486
                     break;
487 487
             }
488
-            header('Content-type: ' . $content_type);
489
-            header('Content-Length: ' . $len);
488
+            header('Content-type: '.$content_type);
489
+            header('Content-Length: '.$len);
490 490
             $user_agent = strtolower($_SERVER['HTTP_USER_AGENT']);
491 491
             if (strpos($user_agent, 'msie')) {
492
-                header('Content-Disposition: ; filename= ' . $filename);
492
+                header('Content-Disposition: ; filename= '.$filename);
493 493
             } else {
494
-                header('Content-Disposition: inline; filename= ' . $filename);
494
+                header('Content-Disposition: inline; filename= '.$filename);
495 495
             }
496 496
             echo($full_string);
497 497
             //You have to ensure that the calling script then stops processing (exit();)
@@ -586,9 +586,9 @@  discard block
 block discarded – undo
586 586
             if (!empty($students)) {
587 587
                 $conditionList = array();
588 588
                 foreach ($students as $studentId => $studentInfo) {
589
-                    $conditionList[] = '/shared_folder/sf_user_' . $studentInfo['user_id'];
589
+                    $conditionList[] = '/shared_folder/sf_user_'.$studentInfo['user_id'];
590 590
                 }
591
-                $sharedCondition .= ' AND docs.path IN ("' . implode('","', $conditionList) . '")';
591
+                $sharedCondition .= ' AND docs.path IN ("'.implode('","', $conditionList).'")';
592 592
             }
593 593
         }
594 594
 
@@ -615,8 +615,8 @@  discard block
 block discarded – undo
615 615
                     last.tool = '".TOOL_DOCUMENT."' AND 
616 616
                     docs.c_id = {$_course['real_id']} AND
617 617
                     last.c_id = {$_course['real_id']} AND
618
-                    docs.path LIKE '" . Database::escape_string($path . $added_slash.'%'). "' AND
619
-                    docs.path NOT LIKE '" . Database::escape_string($path . $added_slash.'%/%')."' AND
618
+                    docs.path LIKE '".Database::escape_string($path.$added_slash.'%')."' AND
619
+                    docs.path NOT LIKE '" . Database::escape_string($path.$added_slash.'%/%')."' AND
620 620
                     docs.path NOT LIKE '%_DELETED_%' AND
621 621
                     $userGroupFilter AND
622 622
                     last.visibility $visibility_bit
@@ -657,7 +657,7 @@  discard block
 block discarded – undo
657 657
                     $table_template = Database::get_main_table(TABLE_MAIN_TEMPLATES);
658 658
                     $sql = "SELECT id FROM $table_template
659 659
                             WHERE
660
-                                course_code = '" . $_course['code'] . "' AND
660
+                                course_code = '".$_course['code']."' AND
661 661
                                 user_id = '".api_get_user_id()."' AND
662 662
                                 ref_doc = '".$row['id']."'";
663 663
                     $template_result = Database::query($sql);
@@ -770,7 +770,7 @@  discard block
 block discarded – undo
770 770
         $conditionList = array();
771 771
         if (!empty($students)) {
772 772
             foreach ($students as $studentId => $studentInfo) {
773
-                $conditionList[] = '/shared_folder/sf_user_' . $studentInfo['user_id'];
773
+                $conditionList[] = '/shared_folder/sf_user_'.$studentInfo['user_id'];
774 774
             }
775 775
         }
776 776
 
@@ -799,7 +799,7 @@  discard block
 block discarded – undo
799 799
                        INNER JOIN $TABLE_DOCUMENT  AS docs
800 800
                        ON (
801 801
                             docs.id = last.ref AND
802
-                            last.tool = '" . TOOL_DOCUMENT . "' AND
802
+                            last.tool = '".TOOL_DOCUMENT."' AND
803 803
                             last.c_id = {$_course['real_id']} AND
804 804
                             docs.c_id = {$_course['real_id']}
805 805
                        )
@@ -816,7 +816,7 @@  discard block
 block discarded – undo
816 816
                         INNER JOIN $TABLE_DOCUMENT  AS docs
817 817
                         ON (
818 818
                             docs.id = last.ref AND
819
-                            last.tool = '" . TOOL_DOCUMENT . "' AND
819
+                            last.tool = '".TOOL_DOCUMENT."' AND
820 820
                             last.c_id = {$_course['real_id']} AND
821 821
                             docs.c_id = {$_course['real_id']}
822 822
                         )
@@ -874,7 +874,7 @@  discard block
 block discarded – undo
874 874
                         ON (docs.id = last.ref AND last.c_id = docs.c_id)
875 875
                     WHERE
876 876
                         $fileType
877
-                        last.tool = '" . TOOL_DOCUMENT . "' AND
877
+                        last.tool = '".TOOL_DOCUMENT."' AND
878 878
                         $groupCondition AND
879 879
                         $visibilityCondition
880 880
                         $show_users_condition
@@ -902,7 +902,7 @@  discard block
 block discarded – undo
902 902
                     ON (docs.id = last.ref AND last.c_id = docs.c_id)
903 903
                     WHERE                        
904 904
                         docs.filetype = 'folder' AND
905
-                        last.tool = '" . TOOL_DOCUMENT . "' AND
905
+                        last.tool = '".TOOL_DOCUMENT."' AND
906 906
                         $groupCondition AND
907 907
                         last.visibility = 0 $condition_session AND
908 908
                         last.c_id = {$_course['real_id']} AND
@@ -918,9 +918,9 @@  discard block
 block discarded – undo
918 918
                         FROM $TABLE_ITEMPROPERTY AS last, $TABLE_DOCUMENT AS docs
919 919
                         WHERE
920 920
                             docs.id = last.ref AND
921
-                            docs.path LIKE '" . Database::escape_string($row['path'].'/%') . "' AND
921
+                            docs.path LIKE '".Database::escape_string($row['path'].'/%')."' AND
922 922
                             docs.filetype = 'folder' AND
923
-                            last.tool = '" . TOOL_DOCUMENT . "' AND
923
+                            last.tool = '" . TOOL_DOCUMENT."' AND
924 924
                             $groupCondition AND
925 925
                             last.visibility = 1 $condition_session AND
926 926
                             last.c_id = {$_course['real_id']} AND
@@ -997,7 +997,7 @@  discard block
 block discarded – undo
997 997
                                 tp.c_id = $course_id AND
998 998
                                 td.session_id = $sessionId AND
999 999
                                 tp.ref= td.id AND
1000
-                                (path='" . $path . "' OR path LIKE BINARY '" . $path . "/%' ) ";
1000
+                                (path='".$path."' OR path LIKE BINARY '".$path."/%' ) ";
1001 1001
                     // Get all id's of documents that are deleted
1002 1002
                     $what_to_check_result = Database::query($sql);
1003 1003
 
@@ -1344,7 +1344,7 @@  discard block
 block discarded – undo
1344 1344
             $res = Database::query($sql);
1345 1345
             if (Database::num_rows($res) > 0) {
1346 1346
                 $row2 = Database::fetch_array($res);
1347
-                require_once api_get_path(LIBRARY_PATH) . 'search/ChamiloIndexer.class.php';
1347
+                require_once api_get_path(LIBRARY_PATH).'search/ChamiloIndexer.class.php';
1348 1348
                 $di = new ChamiloIndexer();
1349 1349
                 $di->remove_document((int) $row2['search_did']);
1350 1350
             }
@@ -1353,7 +1353,7 @@  discard block
 block discarded – undo
1353 1353
             Database::query($sql);
1354 1354
 
1355 1355
             // remove terms from db
1356
-            require_once api_get_path(LIBRARY_PATH) . 'specific_fields_manager.lib.php';
1356
+            require_once api_get_path(LIBRARY_PATH).'specific_fields_manager.lib.php';
1357 1357
             delete_all_values_for_item($course_id, TOOL_DOCUMENT, $document_id);
1358 1358
         }
1359 1359
     }
@@ -1439,12 +1439,12 @@  discard block
 block discarded – undo
1439 1439
             $path = str_replace('%2F', '/', $url_path);
1440 1440
             $pathinfo = pathinfo($row['path']);
1441 1441
 
1442
-            $row['url'] = api_get_path(WEB_CODE_PATH) . 'document/showinframes.php?cidReq=' . $course_code . '&id=' . $id;
1443
-            $row['document_url'] = api_get_path(WEB_CODE_PATH) . 'document/document.php?cidReq=' . $course_code . '&id=' . $id;
1444
-            $row['absolute_path'] = api_get_path(SYS_COURSE_PATH) . $course_info['path'] . '/document' . $row['path'];
1445
-            $row['absolute_path_from_document'] = '/document' . $row['path'];
1446
-            $row['absolute_parent_path'] = api_get_path(SYS_COURSE_PATH).$course_info['path'].'/document'.$pathinfo['dirname'] . '/';
1447
-            $row['direct_url'] = $www . $path;
1442
+            $row['url'] = api_get_path(WEB_CODE_PATH).'document/showinframes.php?cidReq='.$course_code.'&id='.$id;
1443
+            $row['document_url'] = api_get_path(WEB_CODE_PATH).'document/document.php?cidReq='.$course_code.'&id='.$id;
1444
+            $row['absolute_path'] = api_get_path(SYS_COURSE_PATH).$course_info['path'].'/document'.$row['path'];
1445
+            $row['absolute_path_from_document'] = '/document'.$row['path'];
1446
+            $row['absolute_parent_path'] = api_get_path(SYS_COURSE_PATH).$course_info['path'].'/document'.$pathinfo['dirname'].'/';
1447
+            $row['direct_url'] = $www.$path;
1448 1448
             $row['basename'] = basename($row['path']);
1449 1449
 
1450 1450
             if (dirname($row['path']) == '.') {
@@ -1464,7 +1464,7 @@  discard block
 block discarded – undo
1464 1464
                 $real_dir = '';
1465 1465
 
1466 1466
                 for ($i = 1; $i < $array_len; $i++) {
1467
-                    $real_dir .= '/' . (isset($dir_array[$i]) ? $dir_array[$i] : '');
1467
+                    $real_dir .= '/'.(isset($dir_array[$i]) ? $dir_array[$i] : '');
1468 1468
                     $parent_id = self::get_document_id($course_info, $real_dir);
1469 1469
                     if ($session_id != 0 && empty($parent_id)) {
1470 1470
                         $parent_id = self::get_document_id($course_info, $real_dir, 0);
@@ -1538,21 +1538,21 @@  discard block
 block discarded – undo
1538 1538
         $user_id = intval($user_id);
1539 1539
         $document_id = intval($document_id);
1540 1540
 
1541
-        $sql = 'SELECT id FROM ' . $table_template . '
1541
+        $sql = 'SELECT id FROM '.$table_template.'
1542 1542
                 WHERE
1543
-                    course_code="' . $course_code . '" AND
1544
-                    user_id="' . $user_id . '" AND
1545
-                    ref_doc="' . $document_id . '"';
1543
+                    course_code="' . $course_code.'" AND
1544
+                    user_id="' . $user_id.'" AND
1545
+                    ref_doc="' . $document_id.'"';
1546 1546
         $result = Database::query($sql);
1547 1547
         $template_id = Database::result($result, 0, 0);
1548 1548
 
1549
-        my_delete(api_get_path(SYS_CODE_PATH) . 'upload/template_thumbnails/' . $template_id . '.jpg');
1549
+        my_delete(api_get_path(SYS_CODE_PATH).'upload/template_thumbnails/'.$template_id.'.jpg');
1550 1550
 
1551
-        $sql = 'DELETE FROM ' . $table_template . '
1551
+        $sql = 'DELETE FROM '.$table_template.'
1552 1552
                 WHERE
1553
-                    course_code="' . $course_code . '" AND
1554
-                    user_id="' . $user_id . '" AND
1555
-                    ref_doc="' . $document_id . '"';
1553
+                    course_code="' . $course_code.'" AND
1554
+                    user_id="' . $user_id.'" AND
1555
+                    ref_doc="' . $document_id.'"';
1556 1556
 
1557 1557
         Database::query($sql);
1558 1558
     }
@@ -1613,7 +1613,7 @@  discard block
 block discarded – undo
1613 1613
                 INNER JOIN $propTable ip
1614 1614
                 ON (d.id = ip.ref AND d.c_id  = $course_id AND ip.c_id = $course_id)
1615 1615
         		WHERE
1616
-        		    ip.tool = '" . TOOL_DOCUMENT . "' $condition AND
1616
+        		    ip.tool = '".TOOL_DOCUMENT."' $condition AND
1617 1617
         			filetype = '$file_type' AND
1618 1618
         			locate(concat(path,'/'), '$doc_path')=1
1619 1619
                 ";
@@ -1777,12 +1777,12 @@  discard block
 block discarded – undo
1777 1777
         if (empty($session_id)) {
1778 1778
             $sql_session = 'AND (session_id = 0 OR isnull(session_id)) ';
1779 1779
         } elseif ($session_id > 0) {
1780
-            $sql_session = 'AND session_id=' . intval($session_id);
1780
+            $sql_session = 'AND session_id='.intval($session_id);
1781 1781
         } else {
1782 1782
             $sql_session = '';
1783 1783
         }
1784
-        $sql = 'UPDATE ' . $tbl_category . ' SET document_id="' . intval($document_id) . '"
1785
-                WHERE course_code="' . Database::escape_string($course_id) . '" ' . $sql_session;
1784
+        $sql = 'UPDATE '.$tbl_category.' SET document_id="'.intval($document_id).'"
1785
+                WHERE course_code="' . Database::escape_string($course_id).'" '.$sql_session;
1786 1786
         Database::query($sql);
1787 1787
     }
1788 1788
 
@@ -1804,12 +1804,12 @@  discard block
 block discarded – undo
1804 1804
         if (empty($session_id)) {
1805 1805
             $sql_session = 'AND (session_id = 0 OR isnull(session_id)) ';
1806 1806
         } elseif ($session_id > 0) {
1807
-            $sql_session = 'AND session_id=' . intval($session_id);
1807
+            $sql_session = 'AND session_id='.intval($session_id);
1808 1808
         } else {
1809 1809
             $sql_session = '';
1810 1810
         }
1811
-        $sql = 'SELECT document_id FROM ' . $tbl_category . '
1812
-                WHERE course_code="' . Database::escape_string($course_id) . '" ' . $sql_session;
1811
+        $sql = 'SELECT document_id FROM '.$tbl_category.'
1812
+                WHERE course_code="' . Database::escape_string($course_id).'" '.$sql_session;
1813 1813
 
1814 1814
         $rs = Database::query($sql);
1815 1815
         $num = Database::num_rows($rs);
@@ -1850,7 +1850,7 @@  discard block
 block discarded – undo
1850 1850
             $all_user_info = array();
1851 1851
             if (Database::num_rows($rs)) {
1852 1852
                 $row = Database::fetch_array($rs);
1853
-                $filepath = api_get_path(SYS_COURSE_PATH) . $course_info['path'] . '/document' . $row['path'];
1853
+                $filepath = api_get_path(SYS_COURSE_PATH).$course_info['path'].'/document'.$row['path'];
1854 1854
                 if (is_file($filepath)) {
1855 1855
                     $my_content_html = file_get_contents($filepath);
1856 1856
                 }
@@ -1933,9 +1933,9 @@  discard block
 block discarded – undo
1933 1933
             $date_no_time = api_convert_and_format_date(api_get_utc_datetime(), DATE_FORMAT_LONG_NO_DAY);
1934 1934
         }
1935 1935
 
1936
-        $url = api_get_path(WEB_PATH) . 'certificates/index.php?id=' . $info_grade_certificate['id'];
1936
+        $url = api_get_path(WEB_PATH).'certificates/index.php?id='.$info_grade_certificate['id'];
1937 1937
 
1938
-        $externalStyleFile = api_get_path(SYS_CSS_PATH) . 'themes/' . api_get_visual_theme() . '/certificate.css';
1938
+        $externalStyleFile = api_get_path(SYS_CSS_PATH).'themes/'.api_get_visual_theme().'/certificate.css';
1939 1939
         $externalStyle = '';
1940 1940
 
1941 1941
         if (is_file($externalStyleFile)) {
@@ -1957,7 +1957,7 @@  discard block
 block discarded – undo
1957 1957
             $course_info['name'],
1958 1958
             $info_grade_certificate['grade'],
1959 1959
             $url,
1960
-            '<a href="' . $url . '" target="_blank">' . get_lang('CertificateOnlineLink') . '</a>',
1960
+            '<a href="'.$url.'" target="_blank">'.get_lang('CertificateOnlineLink').'</a>',
1961 1961
             '((certificate_barcode))',
1962 1962
             $externalStyle
1963 1963
         );
@@ -1983,7 +1983,7 @@  discard block
 block discarded – undo
1983 1983
         if (!empty($extraFields)) {
1984 1984
             foreach ($extraFields as $extraField) {
1985 1985
                 $valueExtra = isset($extra_user_info_data[$extraField['variable']]) ? $extra_user_info_data[$extraField['variable']] : '';
1986
-                $info_to_be_replaced_in_content_html[] = '((' . strtolower($extraField['variable']) . '))';
1986
+                $info_to_be_replaced_in_content_html[] = '(('.strtolower($extraField['variable']).'))';
1987 1987
                 $info_to_replace_in_content_html[] = $valueExtra;
1988 1988
             }
1989 1989
         }
@@ -2011,17 +2011,17 @@  discard block
 block discarded – undo
2011 2011
             $tbl_category = Database :: get_main_table(TABLE_MAIN_GRADEBOOK_CATEGORY);
2012 2012
             $session_id = api_get_session_id();
2013 2013
             if ($session_id == 0 || is_null($session_id)) {
2014
-                $sql_session = 'AND (session_id=' . intval($session_id) . ' OR isnull(session_id)) ';
2014
+                $sql_session = 'AND (session_id='.intval($session_id).' OR isnull(session_id)) ';
2015 2015
             } elseif ($session_id > 0) {
2016
-                $sql_session = 'AND session_id=' . intval($session_id);
2016
+                $sql_session = 'AND session_id='.intval($session_id);
2017 2017
             } else {
2018 2018
                 $sql_session = '';
2019 2019
             }
2020 2020
 
2021
-            $sql = 'UPDATE ' . $tbl_category . ' SET document_id=null
2021
+            $sql = 'UPDATE '.$tbl_category.' SET document_id=null
2022 2022
                     WHERE
2023
-                        course_code = "' . Database::escape_string($course_id) . '" AND
2024
-                        document_id="' . $default_certificate_id . '" ' . $sql_session;
2023
+                        course_code = "' . Database::escape_string($course_id).'" AND
2024
+                        document_id="' . $default_certificate_id.'" '.$sql_session;
2025 2025
             Database::query($sql);
2026 2026
         }
2027 2027
     }
@@ -2037,10 +2037,10 @@  discard block
 block discarded – undo
2037 2037
         if (!empty($courseInfo)) {
2038 2038
             $to_group_id = 0;
2039 2039
             $to_user_id = null;
2040
-            $course_dir = $courseInfo['path'] . "/document/";
2040
+            $course_dir = $courseInfo['path']."/document/";
2041 2041
             $sys_course_path = api_get_path(SYS_COURSE_PATH);
2042
-            $base_work_dir = $sys_course_path . $course_dir;
2043
-            $base_work_dir_test = $base_work_dir . 'certificates';
2042
+            $base_work_dir = $sys_course_path.$course_dir;
2043
+            $base_work_dir_test = $base_work_dir.'certificates';
2044 2044
             $dir_name = '/certificates';
2045 2045
             $post_dir_name = get_lang('CertificatesFiles');
2046 2046
             $visibility_command = 'invisible';
@@ -2265,9 +2265,9 @@  discard block
 block discarded – undo
2265 2265
                                             //$new_abs_path = realpath($dir.'/'.$second_part);
2266 2266
                                             $dir = '';
2267 2267
                                             if (!empty($abs_path)) {
2268
-                                                $dir = dirname($abs_path) . '/';
2268
+                                                $dir = dirname($abs_path).'/';
2269 2269
                                             }
2270
-                                            $new_abs_path = realpath($dir . $second_part);
2270
+                                            $new_abs_path = realpath($dir.$second_part);
2271 2271
                                             $in_files_list[] = self::get_resources_from_source_html($new_abs_path, true, TOOL_DOCUMENT, $recursivity + 1);
2272 2272
                                             if (count($in_files_list) > 0) {
2273 2273
                                                 $files_list = array_merge($files_list, $in_files_list);
@@ -2280,9 +2280,9 @@  discard block
 block discarded – undo
2280 2280
                                             $files_list[] = array($second_part, 'local', 'rel');
2281 2281
                                             $dir = '';
2282 2282
                                             if (!empty($abs_path)) {
2283
-                                                $dir = dirname($abs_path) . '/';
2283
+                                                $dir = dirname($abs_path).'/';
2284 2284
                                             }
2285
-                                            $new_abs_path = realpath($dir . $second_part);
2285
+                                            $new_abs_path = realpath($dir.$second_part);
2286 2286
                                             $in_files_list[] = self::get_resources_from_source_html($new_abs_path, true, TOOL_DOCUMENT, $recursivity + 1);
2287 2287
                                             if (count($in_files_list) > 0) {
2288 2288
                                                 $files_list = array_merge($files_list, $in_files_list);
@@ -2316,9 +2316,9 @@  discard block
 block discarded – undo
2316 2316
                                             $files_list[] = array($source, 'local', 'rel');
2317 2317
                                             $dir = '';
2318 2318
                                             if (!empty($abs_path)) {
2319
-                                                $dir = dirname($abs_path) . '/';
2319
+                                                $dir = dirname($abs_path).'/';
2320 2320
                                             }
2321
-                                            $new_abs_path = realpath($dir . $source);
2321
+                                            $new_abs_path = realpath($dir.$source);
2322 2322
                                             $in_files_list[] = self::get_resources_from_source_html($new_abs_path, true, TOOL_DOCUMENT, $recursivity + 1);
2323 2323
                                             if (count($in_files_list) > 0) {
2324 2324
                                                 $files_list = array_merge($files_list, $in_files_list);
@@ -2331,9 +2331,9 @@  discard block
 block discarded – undo
2331 2331
                                             $files_list[] = array($source, 'local', 'rel');
2332 2332
                                             $dir = '';
2333 2333
                                             if (!empty($abs_path)) {
2334
-                                                $dir = dirname($abs_path) . '/';
2334
+                                                $dir = dirname($abs_path).'/';
2335 2335
                                             }
2336
-                                            $new_abs_path = realpath($dir . $source);
2336
+                                            $new_abs_path = realpath($dir.$source);
2337 2337
                                             $in_files_list[] = self::get_resources_from_source_html($new_abs_path, true, TOOL_DOCUMENT, $recursivity + 1);
2338 2338
                                             if (count($in_files_list) > 0) {
2339 2339
                                                 $files_list = array_merge($files_list, $in_files_list);
@@ -2367,9 +2367,9 @@  discard block
 block discarded – undo
2367 2367
                                     $files_list[] = array($source, 'local', 'rel');
2368 2368
                                     $dir = '';
2369 2369
                                     if (!empty($abs_path)) {
2370
-                                        $dir = dirname($abs_path) . '/';
2370
+                                        $dir = dirname($abs_path).'/';
2371 2371
                                     }
2372
-                                    $new_abs_path = realpath($dir . $source);
2372
+                                    $new_abs_path = realpath($dir.$source);
2373 2373
                                     $in_files_list[] = self::get_resources_from_source_html($new_abs_path, true, TOOL_DOCUMENT, $recursivity + 1);
2374 2374
                                     if (count($in_files_list) > 0) {
2375 2375
                                         $files_list = array_merge($files_list, $in_files_list);
@@ -2382,9 +2382,9 @@  discard block
 block discarded – undo
2382 2382
                                     $files_list[] = array($source, 'local', 'rel');
2383 2383
                                     $dir = '';
2384 2384
                                     if (!empty($abs_path)) {
2385
-                                        $dir = dirname($abs_path) . '/';
2385
+                                        $dir = dirname($abs_path).'/';
2386 2386
                                     }
2387
-                                    $new_abs_path = realpath($dir . $source);
2387
+                                    $new_abs_path = realpath($dir.$source);
2388 2388
                                     $in_files_list[] = self::get_resources_from_source_html($new_abs_path, true, TOOL_DOCUMENT, $recursivity + 1);
2389 2389
                                     if (count($in_files_list) > 0) {
2390 2390
                                         $files_list = array_merge($files_list, $in_files_list);
@@ -2443,24 +2443,24 @@  discard block
 block discarded – undo
2443 2443
             // then possible closing brackets if we were in the opening bracket case
2444 2444
             // OR something like @import()
2445 2445
             $res = preg_match_all(
2446
-                '/(((([A-Za-z_:])([A-Za-z0-9_:\.-]*))' .
2446
+                '/(((([A-Za-z_:])([A-Za-z0-9_:\.-]*))'.
2447 2447
                 // '/(((([A-Za-z_:])([A-Za-z0-9_:\.-]|[^\x00-\x7F])*)' . -> seems to be taking too much
2448 2448
                 // '/(((([A-Za-z_:])([^\x00-\x7F])*)' . -> takes only last letter of parameter name
2449
-                '([ \n\t\r]+)?(' .
2449
+                '([ \n\t\r]+)?('.
2450 2450
                 // '(=([ \n\t\r]+)?("[^"]+"|\'[^\']+\'|[^ \n\t\r]+))' . -> doesn't restrict close enough to the url itself
2451
-                '(=([ \n\t\r]+)?("[^"\)]+"|\'[^\'\)]+\'|[^ \n\t\r\)]+))' .
2452
-                '|' .
2451
+                '(=([ \n\t\r]+)?("[^"\)]+"|\'[^\'\)]+\'|[^ \n\t\r\)]+))'.
2452
+                '|'.
2453 2453
                 // '(\(([ \n\t\r]+)?("[^"]+"|\'[^\']+\'|[^ \n\t\r]+)\))' . -> doesn't restrict close enough to the url itself
2454
-                '(\(([ \n\t\r]+)?("[^"\)]+"|\'[^\'\)]+\'|[^ \n\t\r\)]+)\))' .
2455
-                '))' .
2456
-                '|' .
2454
+                '(\(([ \n\t\r]+)?("[^"\)]+"|\'[^\'\)]+\'|[^ \n\t\r\)]+)\))'.
2455
+                '))'.
2456
+                '|'.
2457 2457
                 // '(@import([ \n\t\r]+)?("[^"]+"|\'[^\']+\'|[^ \n\t\r]+)))?/', -> takes a lot (like 100's of thousands of empty possibilities)
2458 2458
                 '(@import([ \n\t\r]+)?("[^"]+"|\'[^\']+\'|[^ \n\t\r]+)))/',
2459 2459
                 $attrString,
2460 2460
                 $regs
2461 2461
             );
2462 2462
         } catch (Exception $e) {
2463
-            error_log('Caught exception: ' . $e->getMessage(), 0);
2463
+            error_log('Caught exception: '.$e->getMessage(), 0);
2464 2464
         }
2465 2465
         if ($res) {
2466 2466
             for ($i = 0; $i < count($regs[1]); $i++) {
@@ -2538,14 +2538,14 @@  discard block
 block discarded – undo
2538 2538
                 $orig_course_info_path = $origin_course_info_path;
2539 2539
             }
2540 2540
         } else {
2541
-            $orig_course_path = api_get_path(SYS_COURSE_PATH).$orig_course_info['path'] . '/';
2541
+            $orig_course_path = api_get_path(SYS_COURSE_PATH).$orig_course_info['path'].'/';
2542 2542
             $orig_course_info_path = $orig_course_info['path'];
2543 2543
         }
2544 2544
 
2545 2545
         $destination_course_code = CourseManager::get_course_id_from_path($destination_course_directory);
2546 2546
         $destination_course_info = api_get_course_info($destination_course_code);
2547
-        $dest_course_path = api_get_path(SYS_COURSE_PATH) . $destination_course_directory . '/';
2548
-        $dest_course_path_rel = api_get_path(REL_COURSE_PATH) . $destination_course_directory . '/';
2547
+        $dest_course_path = api_get_path(SYS_COURSE_PATH).$destination_course_directory.'/';
2548
+        $dest_course_path_rel = api_get_path(REL_COURSE_PATH).$destination_course_directory.'/';
2549 2549
 
2550 2550
         $user_id = api_get_user_id();
2551 2551
 
@@ -2554,7 +2554,7 @@  discard block
 block discarded – undo
2554 2554
 
2555 2555
                 // Get information about source url
2556 2556
                 $real_orig_url = $source[0]; // url
2557
-                $scope_url = $source[1];   // scope (local, remote)
2557
+                $scope_url = $source[1]; // scope (local, remote)
2558 2558
                 $type_url = $source[2]; // type (rel, abs, url)
2559 2559
 
2560 2560
                 // Get path and query from origin url
@@ -2566,7 +2566,7 @@  discard block
 block discarded – undo
2566 2566
                 $dest_url_query = '';
2567 2567
 
2568 2568
                 if (!empty($real_orig_query)) {
2569
-                    $dest_url_query = '?' . $real_orig_query;
2569
+                    $dest_url_query = '?'.$real_orig_query;
2570 2570
                     if (strpos($dest_url_query, $origin_course_code) !== false) {
2571 2571
                         $dest_url_query = str_replace($origin_course_code, $destination_course_code, $dest_url_query);
2572 2572
                     }
@@ -2647,7 +2647,7 @@  discard block
 block discarded – undo
2647 2647
 
2648 2648
                                 //$destination_url = $url_course_path . $destination_course_directory . '/' . $document_file . $dest_url_query;
2649 2649
                                 // See BT#7780
2650
-                                $destination_url = $dest_course_path_rel . $document_file . $dest_url_query;
2650
+                                $destination_url = $dest_course_path_rel.$document_file.$dest_url_query;
2651 2651
 
2652 2652
                                 // If the course code doesn't exist in the path? what we do? Nothing! see BT#1985
2653 2653
                                 if (strpos($real_orig_path, $origin_course_code) === false) {
@@ -2682,14 +2682,14 @@  discard block
 block discarded – undo
2682 2682
     public function replace_urls_inside_content_html_when_moving_file($file_name, $original_path, $destiny_path)
2683 2683
     {
2684 2684
         if (substr($original_path, strlen($original_path) - 1, strlen($original_path)) == '/') {
2685
-            $original = $original_path . $file_name;
2685
+            $original = $original_path.$file_name;
2686 2686
         } else {
2687
-            $original = $original_path . '/' . $file_name;
2687
+            $original = $original_path.'/'.$file_name;
2688 2688
         }
2689 2689
         if (substr($destiny_path, strlen($destiny_path) - 1, strlen($destiny_path)) == '/') {
2690
-            $destination = $destiny_path . $file_name;
2690
+            $destination = $destiny_path.$file_name;
2691 2691
         } else {
2692
-            $destination = $destiny_path . '/' . $file_name;
2692
+            $destination = $destiny_path.'/'.$file_name;
2693 2693
         }
2694 2694
         $original_count = count(explode('/', $original));
2695 2695
         $destination_count = count(explode('/', $destination));
@@ -2703,8 +2703,8 @@  discard block
 block discarded – undo
2703 2703
             $mode = 'inside';
2704 2704
         }
2705 2705
         //We do not select the $original_path becayse the file was already moved
2706
-        $content_html = file_get_contents($destiny_path . '/' . $file_name);
2707
-        $destination_file = $destiny_path . '/' . $file_name;
2706
+        $content_html = file_get_contents($destiny_path.'/'.$file_name);
2707
+        $destination_file = $destiny_path.'/'.$file_name;
2708 2708
 
2709 2709
         $pre_original = strstr($original_path, 'document');
2710 2710
         $pre_destin = strstr($destiny_path, 'document');
@@ -2726,11 +2726,11 @@  discard block
 block discarded – undo
2726 2726
         }
2727 2727
 
2728 2728
         if ($pre_original != '') {
2729
-            $pre_original = '..' . $pre_original . '/';
2729
+            $pre_original = '..'.$pre_original.'/';
2730 2730
         }
2731 2731
 
2732 2732
         if ($pre_destin != '') {
2733
-            $pre_destin = '..' . $pre_destin . '/';
2733
+            $pre_destin = '..'.$pre_destin.'/';
2734 2734
         }
2735 2735
 
2736 2736
         $levels = explode('/', $pre_original);
@@ -2748,7 +2748,7 @@  discard block
 block discarded – undo
2748 2748
         //echo '$count_pre_destination_levels '. $count_pre_destination_levels;
2749 2749
         $pre_remove = '';
2750 2750
         for ($i = 1; $i <= $count_pre_destination_levels; $i++) {
2751
-            $pre_remove .='..\/';
2751
+            $pre_remove .= '..\/';
2752 2752
         }
2753 2753
 
2754 2754
         $orig_source_html = DocumentManager::get_resources_from_source_html($content_html);
@@ -2756,9 +2756,9 @@  discard block
 block discarded – undo
2756 2756
         foreach ($orig_source_html as $source) {
2757 2757
 
2758 2758
             // get information about source url
2759
-            $real_orig_url = $source[0];   // url
2760
-            $scope_url = $source[1];   // scope (local, remote)
2761
-            $type_url = $source[2];   // tyle (rel, abs, url)
2759
+            $real_orig_url = $source[0]; // url
2760
+            $scope_url = $source[1]; // scope (local, remote)
2761
+            $type_url = $source[2]; // tyle (rel, abs, url)
2762 2762
             // Get path and query from origin url
2763 2763
             $orig_parse_url = parse_url($real_orig_url);
2764 2764
             $real_orig_path = $orig_parse_url['path'];
@@ -2785,11 +2785,11 @@  discard block
 block discarded – undo
2785 2785
                         $real_orig_url_temp = '';
2786 2786
                         if ($mode == 'inside') {
2787 2787
                             $real_orig_url_temp = str_replace('../', '', $real_orig_url);
2788
-                            $destination_url = $link_to_add . $real_orig_url_temp;
2788
+                            $destination_url = $link_to_add.$real_orig_url_temp;
2789 2789
                         } else {
2790 2790
                             $real_orig_url_temp = $real_orig_url;
2791 2791
 
2792
-                            $destination_url = preg_replace("/" . $pre_remove . "/", '', $real_orig_url, 1);
2792
+                            $destination_url = preg_replace("/".$pre_remove."/", '', $real_orig_url, 1);
2793 2793
                         }
2794 2794
                         if ($real_orig_url == $destination_url) {
2795 2795
                             //echo 'continue2';
@@ -2815,7 +2815,7 @@  discard block
 block discarded – undo
2815 2815
     {
2816 2816
         $course_data = api_get_course_info($course_code);
2817 2817
         $document_data = self::get_document_data_by_id($document_id, $course_code);
2818
-        $file_path = api_get_path(SYS_COURSE_PATH) . $course_data['path'] . '/document' . $document_data['path'];
2818
+        $file_path = api_get_path(SYS_COURSE_PATH).$course_data['path'].'/document'.$document_data['path'];
2819 2819
         $pdf = new PDF('A4-L', 'L');
2820 2820
         $pdf->html_to_pdf($file_path, $document_data['title'], $course_code);
2821 2821
     }
@@ -2850,9 +2850,9 @@  discard block
 block discarded – undo
2850 2850
     ) {
2851 2851
         $course_info = api_get_course_info();
2852 2852
         $sessionId = api_get_session_id();
2853
-        $course_dir = $course_info['path'] . '/document';
2853
+        $course_dir = $course_info['path'].'/document';
2854 2854
         $sys_course_path = api_get_path(SYS_COURSE_PATH);
2855
-        $base_work_dir = $sys_course_path . $course_dir;
2855
+        $base_work_dir = $sys_course_path.$course_dir;
2856 2856
 
2857 2857
         $group_properties = GroupManager::get_group_properties(api_get_group_id());
2858 2858
         $groupIid = isset($group_properties['iid']) ? $group_properties['iid'] : 0;
@@ -3040,7 +3040,7 @@  discard block
 block discarded – undo
3040 3040
         }
3041 3041
         if (isset($output)) {
3042 3042
             foreach ($output as & $line) {
3043
-                $content .= $line . "\n";
3043
+                $content .= $line."\n";
3044 3044
             }
3045 3045
             return $content;
3046 3046
         } else {
@@ -3072,13 +3072,13 @@  discard block
 block discarded – undo
3072 3072
         $group_condition = null;
3073 3073
         if (isset($group_id)) {
3074 3074
             $group_id = intval($group_id);
3075
-            $group_condition = " AND props.to_group_id='" . $group_id . "' ";
3075
+            $group_condition = " AND props.to_group_id='".$group_id."' ";
3076 3076
         }
3077 3077
 
3078 3078
         $session_condition = null;
3079 3079
         if (isset($session_id)) {
3080 3080
             $session_id = intval($session_id);
3081
-            $session_condition = " AND props.session_id='" . $session_id . "' ";
3081
+            $session_condition = " AND props.session_id='".$session_id."' ";
3082 3082
         }
3083 3083
 
3084 3084
         $sql = "SELECT SUM(size)
@@ -3088,7 +3088,7 @@  discard block
 block discarded – undo
3088 3088
                 WHERE
3089 3089
                     props.c_id 	= $course_id AND
3090 3090
                     docs.c_id 	= $course_id AND
3091
-                    props.tool 	= '" . TOOL_DOCUMENT . "' AND
3091
+                    props.tool 	= '".TOOL_DOCUMENT."' AND
3092 3092
                     props.visibility <> 2
3093 3093
                     $group_condition
3094 3094
                     $session_condition
@@ -3111,8 +3111,8 @@  discard block
 block discarded – undo
3111 3111
         $course_quota_m = round($course_quota / 1048576);
3112 3112
         $already_consumed_space_m = round($already_consumed_space / 1048576);
3113 3113
 
3114
-        $message = get_lang('MaximumAllowedQuota') . ' <strong>' . $course_quota_m . ' megabyte</strong>.<br />';
3115
-        $message .= get_lang('CourseCurrentlyUses') . ' <strong>' . $already_consumed_space_m . ' megabyte</strong>.<br />';
3114
+        $message = get_lang('MaximumAllowedQuota').' <strong>'.$course_quota_m.' megabyte</strong>.<br />';
3115
+        $message .= get_lang('CourseCurrentlyUses').' <strong>'.$already_consumed_space_m.' megabyte</strong>.<br />';
3116 3116
 
3117 3117
         $percentage = round(($already_consumed_space / $course_quota * 100), 1);
3118 3118
 
@@ -3120,33 +3120,33 @@  discard block
 block discarded – undo
3120 3120
 
3121 3121
         // Decide where to place percentage in graph
3122 3122
         if ($percentage >= 50) {
3123
-            $text_in_filled = '&nbsp;' . $other_percentage . '%';
3123
+            $text_in_filled = '&nbsp;'.$other_percentage.'%';
3124 3124
             $text_in_unfilled = '';
3125 3125
         } else {
3126
-            $text_in_unfilled = '&nbsp;' . $other_percentage . '%';
3126
+            $text_in_unfilled = '&nbsp;'.$other_percentage.'%';
3127 3127
             $text_in_filled = '';
3128 3128
         }
3129 3129
 
3130 3130
         // Decide the background colour of the graph
3131 3131
         if ($percentage < 65) {
3132
-            $colour = '#00BB00';        // Safe - green
3132
+            $colour = '#00BB00'; // Safe - green
3133 3133
         } elseif ($percentage < 90) {
3134
-            $colour = '#ffd400';        // Filling up - yelloworange
3134
+            $colour = '#ffd400'; // Filling up - yelloworange
3135 3135
         } else {
3136
-            $colour = '#DD0000';        // Full - red
3136
+            $colour = '#DD0000'; // Full - red
3137 3137
         }
3138 3138
 
3139 3139
         // This is used for the table width: a table of only 100 pixels looks too small
3140 3140
         $visual_percentage = 4 * $percentage;
3141 3141
         $visual_other_percentage = 4 * $other_percentage;
3142 3142
 
3143
-        $message .= get_lang('PercentageQuotaInUse') . ': <strong>' . $percentage . '%</strong>.<br />' .
3144
-            get_lang('PercentageQuotaFree') . ': <strong>' . $other_percentage . '%</strong>.<br />';
3143
+        $message .= get_lang('PercentageQuotaInUse').': <strong>'.$percentage.'%</strong>.<br />'.
3144
+            get_lang('PercentageQuotaFree').': <strong>'.$other_percentage.'%</strong>.<br />';
3145 3145
 
3146
-        $show_percentage = '&nbsp;' . $percentage . '%';
3147
-        $message .= '<div style="width: 80%; text-align: center; -moz-border-radius: 5px 5px 5px 5px; border: 1px solid #aaa; background-image: url(\'' . api_get_path(WEB_CODE_PATH) . 'css/' . api_get_visual_theme() . '/images/bg-header4.png\');" class="document-quota-bar">' .
3148
-            '<div style="width:' . $percentage . '%; background-color: #bbb; border-right:3px groove #bbb; -moz-border-radius:5px;">&nbsp;</div>' .
3149
-            '<span style="margin-top: -15px; margin-left:-15px; position: absolute;font-weight:bold;">' . $show_percentage . '</span></div>';
3146
+        $show_percentage = '&nbsp;'.$percentage.'%';
3147
+        $message .= '<div style="width: 80%; text-align: center; -moz-border-radius: 5px 5px 5px 5px; border: 1px solid #aaa; background-image: url(\''.api_get_path(WEB_CODE_PATH).'css/'.api_get_visual_theme().'/images/bg-header4.png\');" class="document-quota-bar">'.
3148
+            '<div style="width:'.$percentage.'%; background-color: #bbb; border-right:3px groove #bbb; -moz-border-radius:5px;">&nbsp;</div>'.
3149
+            '<span style="margin-top: -15px; margin-left:-15px; position: absolute;font-weight:bold;">'.$show_percentage.'</span></div>';
3150 3150
         echo $message;
3151 3151
     }
3152 3152
 
@@ -3162,7 +3162,7 @@  discard block
 block discarded – undo
3162 3162
         $percentage = $already_consumed_space / $course_quota * 100;
3163 3163
         $percentage = round($percentage, 1);
3164 3164
         $message = get_lang('YouAreCurrentlyUsingXOfYourX');
3165
-        $message = sprintf($message, $already_consumed_space_m, $percentage . '%', $course_quota_m . ' ');
3165
+        $message = sprintf($message, $already_consumed_space_m, $percentage.'%', $course_quota_m.' ');
3166 3166
         echo Display::div($message, array('id' => 'document_quota'));
3167 3167
     }
3168 3168
 
@@ -3194,13 +3194,13 @@  discard block
 block discarded – undo
3194 3194
      */
3195 3195
     public static function generate_jplayer_jquery($params = array())
3196 3196
     {
3197
-        $js_path = api_get_path(WEB_LIBRARY_PATH) . 'javascript/';
3197
+        $js_path = api_get_path(WEB_LIBRARY_PATH).'javascript/';
3198 3198
 
3199 3199
         $js = '
3200
-            $("#jquery_jplayer_' . $params['count'] . '").jPlayer({
3200
+            $("#jquery_jplayer_' . $params['count'].'").jPlayer({
3201 3201
                 ready: function() {
3202 3202
                     $(this).jPlayer("setMedia", {
3203
-                        ' . $params['extension'] . ' : "' . $params['url'] . '"
3203
+                        ' . $params['extension'].' : "'.$params['url'].'"
3204 3204
                     });
3205 3205
                 },
3206 3206
                 play: function() { // To avoid both jPlayers playing together.
@@ -3208,12 +3208,12 @@  discard block
 block discarded – undo
3208 3208
                 },
3209 3209
                 //errorAlerts: true,
3210 3210
                 //warningAlerts: true,
3211
-                swfPath: "' . $js_path . 'jquery-jplayer/jplayer/",
3211
+                swfPath: "' . $js_path.'jquery-jplayer/jplayer/",
3212 3212
                 //supplied: "m4a, oga, mp3, ogg, wav",
3213
-                supplied: "' . $params['extension'] . '",
3213
+                supplied: "' . $params['extension'].'",
3214 3214
                 wmode: "window",
3215 3215
                 solution: "flash, html",  // Do not change this setting
3216
-                cssSelectorAncestor: "#jp_container_' . $params['count'] . '",
3216
+                cssSelectorAncestor: "#jp_container_' . $params['count'].'",
3217 3217
             });  	 ' . "\n\n";
3218 3218
 
3219 3219
         return $js;
@@ -3243,16 +3243,16 @@  discard block
 block discarded – undo
3243 3243
         }
3244 3244
 
3245 3245
         //Shows only the play button
3246
-        $html = '<div id="jquery_jplayer_' . $i . '" class="jp-jplayer"></div>
3247
-                <div id="jp_container_' . $i . '" class="jp-audio">
3246
+        $html = '<div id="jquery_jplayer_'.$i.'" class="jp-jplayer"></div>
3247
+                <div id="jp_container_' . $i.'" class="jp-audio">
3248 3248
                     <div class="jp-type-single">
3249 3249
                         <div class="jp-gui jp-interface">
3250 3250
                             <ul class="jp-controls">
3251 3251
                                 <li><a href="javascript:;" class="jp-play" tabindex="1">play</a></li>
3252 3252
                                 <li><a href="javascript:;" class="jp-pause" tabindex="1">pause</a></li>
3253
-                                ' . $extra_controls . '
3253
+                                ' . $extra_controls.'
3254 3254
                             </ul>
3255
-                            ' . $progress . '
3255
+                            ' . $progress.'
3256 3256
                         </div>
3257 3257
                     </div>
3258 3258
                 </div>';
@@ -3305,8 +3305,8 @@  discard block
 block discarded – undo
3305 3305
                     </div>
3306 3306
                 </div>
3307 3307
                 <div class="jp-no-solution">
3308
-                    <span>' . get_lang('UpdateRequire') . '</span>
3309
-                    ' . get_lang("ToPlayTheMediaYouWillNeedToUpdateYourBrowserToARecentVersionYouCanAlsoDownloadTheFile") . '
3308
+                    <span>' . get_lang('UpdateRequire').'</span>
3309
+                    ' . get_lang("ToPlayTheMediaYouWillNeedToUpdateYourBrowserToARecentVersionYouCanAlsoDownloadTheFile").'
3310 3310
                 </div>
3311 3311
             </div>
3312 3312
         </div>';
@@ -3387,7 +3387,7 @@  discard block
 block discarded – undo
3387 3387
 
3388 3388
         $add_folder_filter = null;
3389 3389
         if (!empty($filter_by_folder)) {
3390
-            $add_folder_filter = " AND docs.path LIKE '" . Database::escape_string($filter_by_folder) . "%'";
3390
+            $add_folder_filter = " AND docs.path LIKE '".Database::escape_string($filter_by_folder)."%'";
3391 3391
         }
3392 3392
 
3393 3393
         // If we are in LP display hidden folder https://support.chamilo.org/issues/6679
@@ -3422,7 +3422,7 @@  discard block
 block discarded – undo
3422 3422
 
3423 3423
                 $notLikeCondition = null;
3424 3424
                 for ($i = 1; $i <= $num; $i++) {
3425
-                    $repeat = str_repeat('/%', $i+1);
3425
+                    $repeat = str_repeat('/%', $i + 1);
3426 3426
                     $notLikeCondition .= " AND docs.path NOT LIKE '".Database::escape_string($cleanedPath.$repeat)."' ";
3427 3427
                 }
3428 3428
 
@@ -3447,7 +3447,7 @@  discard block
 block discarded – undo
3447 3447
                 ON (docs.id = last.ref AND docs.c_id = last.c_id)
3448 3448
                 WHERE
3449 3449
                     docs.path NOT LIKE '%_DELETED_%' AND
3450
-                    last.tool = '" . TOOL_DOCUMENT . "' $condition_session AND
3450
+                    last.tool = '".TOOL_DOCUMENT."' $condition_session AND
3451 3451
                     (last.visibility = '1' $lp_visibility_condition) AND
3452 3452
                     last.visibility <> 2 AND
3453 3453
                     docs.c_id = {$course_info['real_id']} AND
@@ -3477,7 +3477,7 @@  discard block
 block discarded – undo
3477 3477
                 Display::url(
3478 3478
                     Display::return_icon('close.png', get_lang('Close'), array(), ICON_SIZE_SMALL),
3479 3479
                     ' javascript:void(0);',
3480
-                    array('id' => 'close_div_' . $course_info['real_id'] . '_' . $session_id, 'class' => 'close_div')
3480
+                    array('id' => 'close_div_'.$course_info['real_id'].'_'.$session_id, 'class' => 'close_div')
3481 3481
                 ),
3482 3482
                 array('style' => 'position:absolute;right:10px')
3483 3483
             );
@@ -3584,7 +3584,7 @@  discard block
 block discarded – undo
3584 3584
                     $('#'+tempId).hide();
3585 3585
                 } else {
3586 3586
                     image.addClass('open');
3587
-                    image.attr('src', '" . Display::returnIconPath('nolines_minus.gif') . "');
3587
+                    image.attr('src', '" . Display::returnIconPath('nolines_minus.gif')."');
3588 3588
                     $('#'+id).hide();
3589 3589
                     $('#'+tempId).show();
3590 3590
 
@@ -3631,7 +3631,7 @@  discard block
 block discarded – undo
3631 3631
         $target,
3632 3632
         $overwrite_url
3633 3633
     ) {
3634
-        $img_sys_path = api_get_path(SYS_CODE_PATH) . 'img/';
3634
+        $img_sys_path = api_get_path(SYS_CODE_PATH).'img/';
3635 3635
         $web_code_path = api_get_path(WEB_CODE_PATH);
3636 3636
 
3637 3637
         $documentId = $resource['id'];
@@ -3646,7 +3646,7 @@  discard block
 block discarded – undo
3646 3646
         // It's a file.
3647 3647
         $icon = choose_image($path);
3648 3648
         $position = strrpos($icon, '.');
3649
-        $icon = substr($icon, 0, $position) . '_small.gif';
3649
+        $icon = substr($icon, 0, $position).'_small.gif';
3650 3650
         $my_file_title = $resource['title'];
3651 3651
         $visibility = $resource['visibility'];
3652 3652
 
@@ -3658,29 +3658,29 @@  discard block
 block discarded – undo
3658 3658
         // Show the "image name" not the filename of the image.
3659 3659
         if ($lp_id) {
3660 3660
             // LP URL
3661
-            $url = api_get_path(WEB_CODE_PATH) . 'lp/lp_controller.php?'.api_get_cidreq().'&amp;action=add_item&amp;type=' . TOOL_DOCUMENT . '&amp;file=' . $documentId . '&amp;lp_id=' . $lp_id;
3661
+            $url = api_get_path(WEB_CODE_PATH).'lp/lp_controller.php?'.api_get_cidreq().'&amp;action=add_item&amp;type='.TOOL_DOCUMENT.'&amp;file='.$documentId.'&amp;lp_id='.$lp_id;
3662 3662
             if (!empty($overwrite_url)) {
3663
-                $url = $overwrite_url . '&cidReq=' . $course_info['code'] . '&id_session=' . $session_id . '&document_id=' . $documentId.'';
3663
+                $url = $overwrite_url.'&cidReq='.$course_info['code'].'&id_session='.$session_id.'&document_id='.$documentId.'';
3664 3664
             }
3665 3665
         } else {
3666 3666
             // Direct document URL
3667
-            $url = $web_code_path . 'document/document.php?cidReq=' . $course_info['code'] . '&id_session=' . $session_id . '&id=' . $documentId;
3667
+            $url = $web_code_path.'document/document.php?cidReq='.$course_info['code'].'&id_session='.$session_id.'&id='.$documentId;
3668 3668
             if (!empty($overwrite_url)) {
3669
-                $url = $overwrite_url . '&cidReq=' . $course_info['code'] . '&id_session=' . $session_id . '&document_id=' . $documentId;
3669
+                $url = $overwrite_url.'&cidReq='.$course_info['code'].'&id_session='.$session_id.'&document_id='.$documentId;
3670 3670
             }
3671 3671
         }
3672 3672
 
3673 3673
         $img = Display::returnIconPath($icon);
3674
-        if (!file_exists($img_sys_path . $icon)) {
3674
+        if (!file_exists($img_sys_path.$icon)) {
3675 3675
             $img = Display::returnIconPath('default_small.gif');
3676 3676
         }
3677 3677
 
3678 3678
         $link = Display::url(
3679
-            '<img alt="" src="' . $img . '" title="" />&nbsp;' . $my_file_title, $url,
3679
+            '<img alt="" src="'.$img.'" title="" />&nbsp;'.$my_file_title, $url,
3680 3680
             array('target' => $target, 'class' => 'moved')
3681 3681
         );
3682 3682
 
3683
-        $directUrl = $web_code_path . 'document/document.php?cidReq=' . $course_info['code'] . '&id_session=' . $session_id . '&id=' . $documentId;
3683
+        $directUrl = $web_code_path.'document/document.php?cidReq='.$course_info['code'].'&id_session='.$session_id.'&id='.$documentId;
3684 3684
 
3685 3685
         $link .= Display::url(
3686 3686
             Display::return_icon('preview_view.png', get_lang('Preview')),
@@ -3695,12 +3695,12 @@  discard block
 block discarded – undo
3695 3695
         $return = null;
3696 3696
 
3697 3697
         if ($lp_id == false) {
3698
-            $return .= '<li class="doc_resource '.$visibilityClass.' " data_id="' . $documentId . '" data_type="document" title="' . $my_file_title . '" >';
3698
+            $return .= '<li class="doc_resource '.$visibilityClass.' " data_id="'.$documentId.'" data_type="document" title="'.$my_file_title.'" >';
3699 3699
         } else {
3700
-            $return .= '<li class="doc_resource lp_resource_element '.$visibilityClass.' " data_id="' . $documentId . '" data_type="document" title="' . $my_file_title . '" >';
3700
+            $return .= '<li class="doc_resource lp_resource_element '.$visibilityClass.' " data_id="'.$documentId.'" data_type="document" title="'.$my_file_title.'" >';
3701 3701
         }
3702 3702
 
3703
-        $return .= '<div class="item_data" style="margin-left:' . ($num  * 5 ) . 'px;margin-right:5px;">';
3703
+        $return .= '<div class="item_data" style="margin-left:'.($num * 5).'px;margin-right:5px;">';
3704 3704
 
3705 3705
         if ($add_move_button) {
3706 3706
             $return .= '<a class="moved" href="#">';
@@ -3765,7 +3765,7 @@  discard block
 block discarded – undo
3765 3765
             if (isset($resource['visible']) && $resource['visible'] == 0) {
3766 3766
                 $folder_class_hidden = "doc_folder_hidden"; // in base.css
3767 3767
             }
3768
-            $onclick = 'onclick="javascript: testResources(\'res_' . $resource['id'] . '\',\'img_' . $resource['id'] . '\')"';
3768
+            $onclick = 'onclick="javascript: testResources(\'res_'.$resource['id'].'\',\'img_'.$resource['id'].'\')"';
3769 3769
         }
3770 3770
         $return = null;
3771 3771
 
@@ -3773,22 +3773,22 @@  discard block
 block discarded – undo
3773 3773
             $return = '<ul class="lp_resource">';
3774 3774
         }
3775 3775
 
3776
-        $return .= '<li class="doc_folder '.$folder_class_hidden.'" id="doc_id_' . $resource['id'] . '"  style="margin-left:' . ($num * 18) . 'px; ">';
3776
+        $return .= '<li class="doc_folder '.$folder_class_hidden.'" id="doc_id_'.$resource['id'].'"  style="margin-left:'.($num * 18).'px; ">';
3777 3777
 
3778 3778
         $image = Display::returnIconPath('nolines_plus.gif');
3779 3779
         if (empty($path)) {
3780 3780
             $image = Display::returnIconPath('nolines_minus.gif');
3781 3781
         }
3782
-        $return .= '<img style="cursor: pointer;" src="'.$image.'" align="absmiddle" id="img_'.$resource['id'] . '" '.$onclick.'>';
3782
+        $return .= '<img style="cursor: pointer;" src="'.$image.'" align="absmiddle" id="img_'.$resource['id'].'" '.$onclick.'>';
3783 3783
         $return .= Display::return_icon('lp_folder.gif').'&nbsp;';
3784 3784
         $return .= '<span '.$onclick.' style="cursor: pointer;" >'.$title.'</span>';
3785 3785
         $return .= '</li>';
3786 3786
 
3787 3787
         if (empty($path)) {
3788 3788
             if ($folderId == false) {
3789
-                $return .= '<div id="res_' . $resource['id'] . '" >';
3789
+                $return .= '<div id="res_'.$resource['id'].'" >';
3790 3790
             } else {
3791
-                $return .= '<div id="res_' . $resource['id'] . '" style="display: none;" >';
3791
+                $return .= '<div id="res_'.$resource['id'].'" style="display: none;" >';
3792 3792
             }
3793 3793
         }
3794 3794
 
@@ -3950,9 +3950,9 @@  discard block
 block discarded – undo
3950 3950
             $session_id = api_get_session_id();
3951 3951
         }
3952 3952
         $course_info = api_get_course_info($course_code);
3953
-        $course_dir = $course_info['path'] . '/document';
3953
+        $course_dir = $course_info['path'].'/document';
3954 3954
         $sys_course_path = api_get_path(SYS_COURSE_PATH);
3955
-        $base_work_dir = $sys_course_path . $course_dir;
3955
+        $base_work_dir = $sys_course_path.$course_dir;
3956 3956
 
3957 3957
         $course_id = $course_info['real_id'];
3958 3958
         $table_document = Database::get_course_table(TABLE_DOCUMENT);
@@ -3961,7 +3961,7 @@  discard block
 block discarded – undo
3961 3961
         $result = Database::query($qry);
3962 3962
         if (Database::num_rows($result) == 1) {
3963 3963
             $row = Database::fetch_array($result);
3964
-            $doc_path = api_get_path(SYS_COURSE_PATH) . $course_dir . $row['path'];
3964
+            $doc_path = api_get_path(SYS_COURSE_PATH).$course_dir.$row['path'];
3965 3965
             //TODO: mime_content_type is deprecated, fileinfo php extension is enabled by default as of PHP 5.3.0
3966 3966
             // now versions of PHP on Debian testing(5.2.6-5) and Ubuntu(5.2.6-2ubuntu) are lower, so wait for a while
3967 3967
             $doc_mime = mime_content_type($doc_path);
@@ -3992,8 +3992,8 @@  discard block
 block discarded – undo
3992 3992
                 $file_content = self::get_text_content($doc_path, $doc_mime);
3993 3993
                 $course_code = Database::escape_string($course_code);
3994 3994
 
3995
-                require_once api_get_path(LIBRARY_PATH) . 'search/ChamiloIndexer.class.php';
3996
-                require_once api_get_path(LIBRARY_PATH) . 'search/IndexableChunk.class.php';
3995
+                require_once api_get_path(LIBRARY_PATH).'search/ChamiloIndexer.class.php';
3996
+                require_once api_get_path(LIBRARY_PATH).'search/IndexableChunk.class.php';
3997 3997
 
3998 3998
                 $ic_slide = new IndexableChunk();
3999 3999
                 $ic_slide->addValue('title', $file_title);
@@ -4010,7 +4010,7 @@  discard block
 block discarded – undo
4010 4010
                 $di = new ChamiloIndexer();
4011 4011
                 $return = $di->connectDb(null, null, $lang);
4012 4012
 
4013
-                require_once api_get_path(LIBRARY_PATH) . 'specific_fields_manager.lib.php';
4013
+                require_once api_get_path(LIBRARY_PATH).'specific_fields_manager.lib.php';
4014 4014
                 $specific_fields = get_specific_field_list();
4015 4015
 
4016 4016
                 // process different depending on what to do if file exists
@@ -4047,7 +4047,7 @@  discard block
 block discarded – undo
4047 4047
                             } else { //if the specific field is not defined, force an empty one
4048 4048
                                 $sterms = '';
4049 4049
                             }
4050
-                            $all_specific_terms .= ' ' . $sterms;
4050
+                            $all_specific_terms .= ' '.$sterms;
4051 4051
                             $sterms = explode(',', $sterms);
4052 4052
                             foreach ($sterms as $sterm) {
4053 4053
                                 $sterm = trim($sterm);
@@ -4061,7 +4061,7 @@  discard block
 block discarded – undo
4061 4061
                             }
4062 4062
                         }
4063 4063
                         // Add terms also to content to make terms findable by probabilistic search
4064
-                        $file_content = $all_specific_terms . ' ' . $file_content;
4064
+                        $file_content = $all_specific_terms.' '.$file_content;
4065 4065
 
4066 4066
                         if (!$simulation) {
4067 4067
                             $ic_slide->addValue('content', $file_content);
@@ -4087,7 +4087,7 @@  discard block
 block discarded – undo
4087 4087
                         } else { //if the specific field is not defined, force an empty one
4088 4088
                             $sterms = '';
4089 4089
                         }
4090
-                        $all_specific_terms .= ' ' . $sterms;
4090
+                        $all_specific_terms .= ' '.$sterms;
4091 4091
                         if (!empty($sterms)) {
4092 4092
                             $sterms = explode(',', $sterms);
4093 4093
                             foreach ($sterms as $sterm) {
@@ -4099,7 +4099,7 @@  discard block
 block discarded – undo
4099 4099
                         }
4100 4100
                     }
4101 4101
                     // Add terms also to content to make terms findable by probabilistic search
4102
-                    $file_content = $all_specific_terms . ' ' . $file_content;
4102
+                    $file_content = $all_specific_terms.' '.$file_content;
4103 4103
                     if (!$simulation) {
4104 4104
                         $ic_slide->addValue('content', $file_content);
4105 4105
                         $di->addChunk($ic_slide);
@@ -4382,7 +4382,7 @@  discard block
 block discarded – undo
4382 4382
         $defaultVisibility = 'visible';
4383 4383
 
4384 4384
         if (isset($settings['documents'])) {
4385
-            $portalDefaultVisibility =  'invisible';
4385
+            $portalDefaultVisibility = 'invisible';
4386 4386
             if ($settings['documents'] == 'true') {
4387 4387
                 $portalDefaultVisibility = 'visible';
4388 4388
             }
@@ -4622,7 +4622,7 @@  discard block
 block discarded – undo
4622 4622
         //make htaccess with allow from all, and file index.html into temp/audio
4623 4623
         $htaccess = api_get_path(SYS_ARCHIVE_PATH).'temp/audio/.htaccess';
4624 4624
         if (!file_exists($htaccess)) {
4625
-            $htaccess_content="order deny,allow\r\nallow from all\r\nOptions -Indexes";
4625
+            $htaccess_content = "order deny,allow\r\nallow from all\r\nOptions -Indexes";
4626 4626
             $fp = @ fopen(api_get_path(SYS_ARCHIVE_PATH).'temp/audio/.htaccess', 'w');
4627 4627
             if ($fp) {
4628 4628
                 fwrite($fp, $htaccess_content);
@@ -4631,9 +4631,9 @@  discard block
 block discarded – undo
4631 4631
         }
4632 4632
 
4633 4633
         //encript temp name file
4634
-        $name_crip = sha1(uniqid());//encript
4635
-        $findext= explode(".", $file);
4636
-        $extension = $findext[count($findext)-1];
4634
+        $name_crip = sha1(uniqid()); //encript
4635
+        $findext = explode(".", $file);
4636
+        $extension = $findext[count($findext) - 1];
4637 4637
         $file_crip = $name_crip.'.'.$extension;
4638 4638
 
4639 4639
         //copy file to temp/audio directory
@@ -4737,7 +4737,7 @@  discard block
 block discarded – undo
4737 4737
         $comment = null;
4738 4738
 
4739 4739
         $fileName = api_replace_dangerous_char($title);
4740
-        $filePath = api_get_path(SYS_COURSE_PATH) . "{$courseData['path']}/document{$dir}";
4740
+        $filePath = api_get_path(SYS_COURSE_PATH)."{$courseData['path']}/document{$dir}";
4741 4741
         $fileFullPath = "{$filePath}/{$fileName}.html";
4742 4742
         $fileSize = 0;
4743 4743
         $fileType = 'file';
@@ -4789,7 +4789,7 @@  discard block
 block discarded – undo
4789 4789
             $fileSize,
4790 4790
             $title,
4791 4791
             $comment,
4792
-            0,//$readonly = 0,
4792
+            0, //$readonly = 0,
4793 4793
             true, //$save_visibility = true,
4794 4794
             null, //$group_id = null,
4795 4795
             $sessionId
@@ -5075,8 +5075,8 @@  discard block
 block discarded – undo
5075 5075
             $sessionId,
5076 5076
             $groupId
5077 5077
         )) {
5078
-            $uniqueName = self::addSuffixToFileName($name, '_' . $counter);
5079
-            $filePath = $path . $uniqueName;
5078
+            $uniqueName = self::addSuffixToFileName($name, '_'.$counter);
5079
+            $filePath = $path.$uniqueName;
5080 5080
             $counter++;
5081 5081
         }
5082 5082
 
@@ -5117,7 +5117,7 @@  discard block
 block discarded – undo
5117 5117
                     WHERE 
5118 5118
                         filetype = 'folder' AND 
5119 5119
                         c_id = $course_id AND 
5120
-                        path IN ('" . $folder_sql . "')";
5120
+                        path IN ('".$folder_sql."')";
5121 5121
             $res = Database::query($sql);
5122 5122
             $folder_titles = array();
5123 5123
             while ($obj = Database::fetch_object($res)) {
@@ -5154,9 +5154,9 @@  discard block
 block discarded – undo
5154 5154
                     $folder_titles[$folder] = cut($folder_titles[$folder], 80);
5155 5155
                     $counter = count($path_parts) - 2;
5156 5156
                     if ($counter > 0) {
5157
-                        $label = str_repeat('&nbsp;&nbsp;&nbsp;', $counter) . ' &mdash; ' . $folder_titles[$folder];
5157
+                        $label = str_repeat('&nbsp;&nbsp;&nbsp;', $counter).' &mdash; '.$folder_titles[$folder];
5158 5158
                     } else {
5159
-                        $label = ' &mdash; ' . $folder_titles[$folder];
5159
+                        $label = ' &mdash; '.$folder_titles[$folder];
5160 5160
                     }
5161 5161
                     $parent_select->addOption($label, $folder_id);
5162 5162
                     if ($selected != '') {
@@ -5174,7 +5174,7 @@  discard block
 block discarded – undo
5174 5174
                     } else {
5175 5175
                         $path_parts = explode('/', str_replace($group_dir, '', $folder));
5176 5176
                         $label = cut($label, 80);
5177
-                        $label = str_repeat('&nbsp;&nbsp;&nbsp;', count($path_parts) - 2) . ' &mdash; ' . $label;
5177
+                        $label = str_repeat('&nbsp;&nbsp;&nbsp;', count($path_parts) - 2).' &mdash; '.$label;
5178 5178
                     }
5179 5179
                     $parent_select->addOption($label, $folder_id);
5180 5180
                     if ($selected != '') {
@@ -5207,7 +5207,7 @@  discard block
 block discarded – undo
5207 5207
     ) {
5208 5208
         global $dbl_click_id;
5209 5209
         $course_info = api_get_course_info();
5210
-        $www = api_get_path(WEB_COURSE_PATH) . $course_info['path'] . '/document';
5210
+        $www = api_get_path(WEB_COURSE_PATH).$course_info['path'].'/document';
5211 5211
         $webOdflist = DocumentManager::get_web_odf_extension_list();
5212 5212
 
5213 5213
         // Get the title or the basename depending on what we're using
@@ -5231,11 +5231,11 @@  discard block
 block discarded – undo
5231 5231
 
5232 5232
         if (!$show_as_icon) {
5233 5233
             // Build download link (icon)
5234
-            $forcedownload_link = ($filetype == 'folder') ? api_get_self() . '?' . api_get_cidreq() . '&action=downloadfolder&id=' . $document_data['id'] : api_get_self() . '?' . api_get_cidreq() . '&amp;action=download&amp;id=' . $document_data['id'];
5234
+            $forcedownload_link = ($filetype == 'folder') ? api_get_self().'?'.api_get_cidreq().'&action=downloadfolder&id='.$document_data['id'] : api_get_self().'?'.api_get_cidreq().'&amp;action=download&amp;id='.$document_data['id'];
5235 5235
             // Folder download or file download?
5236 5236
             $forcedownload_icon = ($filetype == 'folder') ? 'save_pack.png' : 'save.png';
5237 5237
             // Prevent multiple clicks on zipped folder download
5238
-            $prevent_multiple_click = ($filetype == 'folder') ? " onclick=\"javascript: if(typeof clic_$dbl_click_id == 'undefined' || !clic_$dbl_click_id) { clic_$dbl_click_id=true; window.setTimeout('clic_" . ($dbl_click_id++) . "=false;',10000); } else { return false; }\"" : '';
5238
+            $prevent_multiple_click = ($filetype == 'folder') ? " onclick=\"javascript: if(typeof clic_$dbl_click_id == 'undefined' || !clic_$dbl_click_id) { clic_$dbl_click_id=true; window.setTimeout('clic_".($dbl_click_id++)."=false;',10000); } else { return false; }\"" : '';
5239 5239
         }
5240 5240
 
5241 5241
         $target = '_self';
@@ -5251,17 +5251,17 @@  discard block
 block discarded – undo
5251 5251
 
5252 5252
             if ($is_browser_viewable_file) {
5253 5253
                 if ($ext == 'pdf' || in_array($ext, $webOdflist)) {
5254
-                    $url = api_get_self() . '?' . api_get_cidreq() . '&amp;action=download&amp;id=' . $document_data['id'];
5254
+                    $url = api_get_self().'?'.api_get_cidreq().'&amp;action=download&amp;id='.$document_data['id'];
5255 5255
                 } else {
5256
-                    $url = 'showinframes.php?' . api_get_cidreq() . '&id=' . $document_data['id'];
5256
+                    $url = 'showinframes.php?'.api_get_cidreq().'&id='.$document_data['id'];
5257 5257
                 }
5258 5258
             } else {
5259 5259
                 // url-encode for problematic characters (we may not call them dangerous characters...)
5260
-                $path = str_replace('%2F', '/', $url_path) . '?' . api_get_cidreq();
5261
-                $url = $www . $path;
5260
+                $path = str_replace('%2F', '/', $url_path).'?'.api_get_cidreq();
5261
+                $url = $www.$path;
5262 5262
             }
5263 5263
         } else {
5264
-            $url = api_get_self() . '?' . api_get_cidreq() . '&id=' . $document_data['id'];
5264
+            $url = api_get_self().'?'.api_get_cidreq().'&id='.$document_data['id'];
5265 5265
         }
5266 5266
 
5267 5267
         // The little download icon
@@ -5271,10 +5271,10 @@  discard block
 block discarded – undo
5271 5271
         if ($path == '/shared_folder') {
5272 5272
             $tooltip_title_alt = get_lang('UserFolders');
5273 5273
         } elseif (strstr($path, 'shared_folder_session_')) {
5274
-            $tooltip_title_alt = get_lang('UserFolders') . ' (' . api_get_session_name(api_get_session_id()) . ')';
5274
+            $tooltip_title_alt = get_lang('UserFolders').' ('.api_get_session_name(api_get_session_id()).')';
5275 5275
         } elseif (strstr($tooltip_title, 'sf_user_')) {
5276 5276
             $userinfo = api_get_user_info(substr($tooltip_title, 8));
5277
-            $tooltip_title_alt = get_lang('UserFolder') . ' ' . $userinfo['complete_name'];
5277
+            $tooltip_title_alt = get_lang('UserFolder').' '.$userinfo['complete_name'];
5278 5278
         } elseif ($path == '/chat_files') {
5279 5279
             $tooltip_title_alt = get_lang('ChatFiles');
5280 5280
         } elseif ($path == '/learning_path') {
@@ -5306,35 +5306,35 @@  discard block
 block discarded – undo
5306 5306
                 ) {
5307 5307
                     //filter: when I am into a shared folder, I can only show "my shared folder" for donwload
5308 5308
                     if (DocumentManager::is_shared_folder($curdirpath, $current_session_id)) {
5309
-                        if (preg_match('/shared_folder\/sf_user_' . api_get_user_id() . '$/', urldecode($forcedownload_link)) ||
5310
-                            preg_match('/shared_folder_session_' . $current_session_id . '\/sf_user_' . api_get_user_id() . '$/', urldecode($forcedownload_link)) ||
5309
+                        if (preg_match('/shared_folder\/sf_user_'.api_get_user_id().'$/', urldecode($forcedownload_link)) ||
5310
+                            preg_match('/shared_folder_session_'.$current_session_id.'\/sf_user_'.api_get_user_id().'$/', urldecode($forcedownload_link)) ||
5311 5311
                             api_is_allowed_to_edit() || api_is_platform_admin()
5312 5312
                         ) {
5313
-                            $force_download_html = ($size == 0) ? '' : '<a href="' . $forcedownload_link . '" style="float:right"' . $prevent_multiple_click . '>' .
5314
-                                Display::return_icon($forcedownload_icon, get_lang('Download'), array(), ICON_SIZE_SMALL) . '</a>';
5313
+                            $force_download_html = ($size == 0) ? '' : '<a href="'.$forcedownload_link.'" style="float:right"'.$prevent_multiple_click.'>'.
5314
+                                Display::return_icon($forcedownload_icon, get_lang('Download'), array(), ICON_SIZE_SMALL).'</a>';
5315 5315
                         }
5316 5316
                     } elseif (!preg_match('/shared_folder/', urldecode($forcedownload_link)) ||
5317 5317
                         api_is_allowed_to_edit() ||
5318 5318
                         api_is_platform_admin()
5319 5319
                     ) {
5320
-                        $force_download_html = ($size == 0) ? '' : '<a href="' . $forcedownload_link . '" style="float:right"' . $prevent_multiple_click . '>' .
5321
-                            Display::return_icon($forcedownload_icon, get_lang('Download'), array(), ICON_SIZE_SMALL) . '</a>';
5320
+                        $force_download_html = ($size == 0) ? '' : '<a href="'.$forcedownload_link.'" style="float:right"'.$prevent_multiple_click.'>'.
5321
+                            Display::return_icon($forcedownload_icon, get_lang('Download'), array(), ICON_SIZE_SMALL).'</a>';
5322 5322
                     }
5323 5323
                 }
5324 5324
             } else {
5325
-                $force_download_html = ($size == 0) ? '' : '<a href="' . $forcedownload_link . '" style="float:right"' . $prevent_multiple_click . ' download="' . $document_data['basename'] . '">' .
5326
-                    Display::return_icon($forcedownload_icon, get_lang('Download'), array(), ICON_SIZE_SMALL) . '</a>';
5325
+                $force_download_html = ($size == 0) ? '' : '<a href="'.$forcedownload_link.'" style="float:right"'.$prevent_multiple_click.' download="'.$document_data['basename'].'">'.
5326
+                    Display::return_icon($forcedownload_icon, get_lang('Download'), array(), ICON_SIZE_SMALL).'</a>';
5327 5327
             }
5328 5328
 
5329 5329
             // Copy files to user's myfiles
5330 5330
             if (api_get_setting('allow_my_files') === 'true' &&
5331 5331
                 api_get_setting('users_copy_files') === 'true'
5332 5332
             ) {
5333
-                $copy_myfiles_link = ($filetype == 'file') ? api_get_self() . '?' . api_get_cidreq() . '&action=copytomyfiles&id=' . $document_data['id'] : api_get_self() . '?' . api_get_cidreq();
5333
+                $copy_myfiles_link = ($filetype == 'file') ? api_get_self().'?'.api_get_cidreq().'&action=copytomyfiles&id='.$document_data['id'] : api_get_self().'?'.api_get_cidreq();
5334 5334
                 if ($filetype == 'file') {
5335 5335
 
5336
-                    $copy_to_myfiles = '<a href="' . $copy_myfiles_link . '" style="float:right"' . $prevent_multiple_click . '>' .
5337
-                        Display::return_icon('briefcase.png', get_lang('CopyToMyFiles'), array(), ICON_SIZE_SMALL) . '&nbsp;&nbsp;</a>';
5336
+                    $copy_to_myfiles = '<a href="'.$copy_myfiles_link.'" style="float:right"'.$prevent_multiple_click.'>'.
5337
+                        Display::return_icon('briefcase.png', get_lang('CopyToMyFiles'), array(), ICON_SIZE_SMALL).'&nbsp;&nbsp;</a>';
5338 5338
 
5339 5339
                     if (api_get_setting('allow_my_files') === 'false') {
5340 5340
                         $copy_to_myfiles = '';
@@ -5353,13 +5353,13 @@  discard block
 block discarded – undo
5353 5353
                 $filetype == 'file' &&
5354 5354
                 in_array($extension, array('html', 'htm'))
5355 5355
             ) {
5356
-                $pdf_icon = ' <a style="float:right".' . $prevent_multiple_click . ' href="' . api_get_self() . '?' . api_get_cidreq() . '&action=export_to_pdf&id=' . $document_data['id'] . '">' .
5357
-                    Display::return_icon('pdf.png', get_lang('Export2PDF'), array(), ICON_SIZE_SMALL) . '</a> ';
5356
+                $pdf_icon = ' <a style="float:right".'.$prevent_multiple_click.' href="'.api_get_self().'?'.api_get_cidreq().'&action=export_to_pdf&id='.$document_data['id'].'">'.
5357
+                    Display::return_icon('pdf.png', get_lang('Export2PDF'), array(), ICON_SIZE_SMALL).'</a> ';
5358 5358
             }
5359 5359
 
5360 5360
             if ($is_browser_viewable_file) {
5361
-                $open_in_new_window_link = '<a href="' . $www . str_replace('%2F', '/', $url_path) . '?' . api_get_cidreq() . '" style="float:right"' . $prevent_multiple_click . ' target="_blank">' .
5362
-                    Display::return_icon('open_in_new_window.png', get_lang('OpenInANewWindow'), array(), ICON_SIZE_SMALL) . '&nbsp;&nbsp;</a>';
5361
+                $open_in_new_window_link = '<a href="'.$www.str_replace('%2F', '/', $url_path).'?'.api_get_cidreq().'" style="float:right"'.$prevent_multiple_click.' target="_blank">'.
5362
+                    Display::return_icon('open_in_new_window.png', get_lang('OpenInANewWindow'), array(), ICON_SIZE_SMALL).'&nbsp;&nbsp;</a>';
5363 5363
             }
5364 5364
 
5365 5365
             if ($filetype == 'file') {
@@ -5368,9 +5368,9 @@  discard block
 block discarded – undo
5368 5368
                     (preg_match('/wav$/i', urldecode($checkExtension))) ||
5369 5369
                     preg_match('/ogg$/i', urldecode($checkExtension))
5370 5370
                 ) {
5371
-                    return '<span style="float:left" ' . $visibility_class . '>' .
5372
-                    $title .
5373
-                    '</span>' . $force_download_html . $send_to . $copy_to_myfiles . $open_in_new_window_link . $pdf_icon;
5371
+                    return '<span style="float:left" '.$visibility_class.'>'.
5372
+                    $title.
5373
+                    '</span>'.$force_download_html.$send_to.$copy_to_myfiles.$open_in_new_window_link.$pdf_icon;
5374 5374
                 } elseif (
5375 5375
 
5376 5376
                     // Show preview
@@ -5383,7 +5383,7 @@  discard block
 block discarded – undo
5383 5383
                     preg_match('/svg$/i', urldecode($checkExtension))
5384 5384
                 ) {
5385 5385
                     // Simpler version of showinframesmin.php with no headers
5386
-                    $url = 'show_content.php?' . api_get_cidreq() . '&id=' . $document_data['id'];
5386
+                    $url = 'show_content.php?'.api_get_cidreq().'&id='.$document_data['id'];
5387 5387
                     $class = 'ajax';
5388 5388
                     if ($visibility == false) {
5389 5389
                         $class = "ajax text-muted";
@@ -5398,34 +5398,34 @@  discard block
 block discarded – undo
5398 5398
                             'style' => 'float:left;'
5399 5399
                         ]
5400 5400
                     )
5401
-                    . $force_download_html . $send_to . $copy_to_myfiles
5402
-                    . $open_in_new_window_link . $pdf_icon;
5401
+                    . $force_download_html.$send_to.$copy_to_myfiles
5402
+                    . $open_in_new_window_link.$pdf_icon;
5403 5403
                 } else {
5404 5404
                     // For a "PDF Download" of the file.
5405 5405
                     $pdfPreview = null;
5406 5406
                     if ($ext != 'pdf' && !in_array($ext, $webOdflist)) {
5407
-                        $url = 'showinframes.php?' . api_get_cidreq() . '&id=' . $document_data['id'];
5407
+                        $url = 'showinframes.php?'.api_get_cidreq().'&id='.$document_data['id'];
5408 5408
                     } else {
5409 5409
                         $pdfPreview = Display::url(
5410 5410
                             Display::return_icon('preview.gif', get_lang('Preview')),
5411
-                            api_get_path(WEB_CODE_PATH).'document/showinframes.php?' . api_get_cidreq() . '&id=' . $document_data['id'],
5411
+                            api_get_path(WEB_CODE_PATH).'document/showinframes.php?'.api_get_cidreq().'&id='.$document_data['id'],
5412 5412
                             array('style' => 'float:right')
5413 5413
                         );
5414 5414
                     }
5415 5415
                     // No plugin just the old and good showinframes.php page
5416
-                    return '<a href="' . $url . '" title="' . $tooltip_title_alt . '" style="float:left" ' . $visibility_class . ' >' . $title . '</a>' .
5417
-                    $pdfPreview.$force_download_html . $send_to . $copy_to_myfiles . $open_in_new_window_link . $pdf_icon;
5416
+                    return '<a href="'.$url.'" title="'.$tooltip_title_alt.'" style="float:left" '.$visibility_class.' >'.$title.'</a>'.
5417
+                    $pdfPreview.$force_download_html.$send_to.$copy_to_myfiles.$open_in_new_window_link.$pdf_icon;
5418 5418
                 }
5419 5419
             } else {
5420
-                return '<a href="' . $url . '" title="' . $tooltip_title_alt . '" ' . $visibility_class . ' style="float:left">' . $title . '</a>' .
5421
-                $force_download_html . $send_to . $copy_to_myfiles . $open_in_new_window_link . $pdf_icon;
5420
+                return '<a href="'.$url.'" title="'.$tooltip_title_alt.'" '.$visibility_class.' style="float:left">'.$title.'</a>'.
5421
+                $force_download_html.$send_to.$copy_to_myfiles.$open_in_new_window_link.$pdf_icon;
5422 5422
             }
5423 5423
             // end copy files to users myfiles
5424 5424
         } else {
5425 5425
             // Icon column
5426 5426
             if (preg_match('/shared_folder/', urldecode($checkExtension)) &&
5427 5427
                 preg_match('/shared_folder$/', urldecode($checkExtension)) == false &&
5428
-                preg_match('/shared_folder_session_' . $current_session_id . '$/', urldecode($url)) == false
5428
+                preg_match('/shared_folder_session_'.$current_session_id.'$/', urldecode($url)) == false
5429 5429
             ) {
5430 5430
                 if ($filetype == 'file') {
5431 5431
                     //Sound preview with jplayer
@@ -5445,19 +5445,19 @@  discard block
 block discarded – undo
5445 5445
                         preg_match('/bmp$/i', urldecode($checkExtension)) ||
5446 5446
                         preg_match('/svg$/i', urldecode($checkExtension))
5447 5447
                     ) {
5448
-                        $url = 'showinframes.php?' . api_get_cidreq() . '&id=' . $document_data['id'];
5449
-                        return '<a href="' . $url . '" title="' . $tooltip_title_alt . '" ' . $visibility_class . ' style="float:left">' .
5450
-                        DocumentManager::build_document_icon_tag($filetype, $path) .
5451
-                        Display::return_icon('shared.png', get_lang('ResourceShared'), array()) . '</a>';
5448
+                        $url = 'showinframes.php?'.api_get_cidreq().'&id='.$document_data['id'];
5449
+                        return '<a href="'.$url.'" title="'.$tooltip_title_alt.'" '.$visibility_class.' style="float:left">'.
5450
+                        DocumentManager::build_document_icon_tag($filetype, $path).
5451
+                        Display::return_icon('shared.png', get_lang('ResourceShared'), array()).'</a>';
5452 5452
                     } else {
5453
-                        return '<a href="' . $url . '" title="' . $tooltip_title_alt . '" ' . $visibility_class . ' style="float:left">' .
5454
-                        DocumentManager::build_document_icon_tag($filetype, $path) .
5455
-                        Display::return_icon('shared.png', get_lang('ResourceShared'), array()) . '</a>';
5453
+                        return '<a href="'.$url.'" title="'.$tooltip_title_alt.'" '.$visibility_class.' style="float:left">'.
5454
+                        DocumentManager::build_document_icon_tag($filetype, $path).
5455
+                        Display::return_icon('shared.png', get_lang('ResourceShared'), array()).'</a>';
5456 5456
                     }
5457 5457
                 } else {
5458
-                    return '<a href="' . $url . '" title="' . $tooltip_title_alt . '" target="' . $target . '"' . $visibility_class . ' style="float:left">' .
5459
-                    DocumentManager::build_document_icon_tag($filetype, $path) .
5460
-                    Display::return_icon('shared.png', get_lang('ResourceShared'), array()) . '</a>';
5458
+                    return '<a href="'.$url.'" title="'.$tooltip_title_alt.'" target="'.$target.'"'.$visibility_class.' style="float:left">'.
5459
+                    DocumentManager::build_document_icon_tag($filetype, $path).
5460
+                    Display::return_icon('shared.png', get_lang('ResourceShared'), array()).'</a>';
5461 5461
                 }
5462 5462
             } else {
5463 5463
                 if ($filetype == 'file') {
@@ -5480,16 +5480,16 @@  discard block
 block discarded – undo
5480 5480
                         preg_match('/bmp$/i', urldecode($checkExtension)) ||
5481 5481
                         preg_match('/svg$/i', urldecode($checkExtension))
5482 5482
                     ) {
5483
-                        $url = 'showinframes.php?' . api_get_cidreq() . '&id=' . $document_data['id']; //without preview
5484
-                        return '<a href="' . $url . '" title="' . $tooltip_title_alt . '" ' . $visibility_class . ' style="float:left">' .
5485
-                        DocumentManager::build_document_icon_tag($filetype, $path) . '</a>';
5483
+                        $url = 'showinframes.php?'.api_get_cidreq().'&id='.$document_data['id']; //without preview
5484
+                        return '<a href="'.$url.'" title="'.$tooltip_title_alt.'" '.$visibility_class.' style="float:left">'.
5485
+                        DocumentManager::build_document_icon_tag($filetype, $path).'</a>';
5486 5486
                     } else {
5487
-                        return '<a href="' . $url . '" title="' . $tooltip_title_alt . '" ' . $visibility_class . ' style="float:left">' .
5488
-                        DocumentManager::build_document_icon_tag($filetype, $path) . '</a>';
5487
+                        return '<a href="'.$url.'" title="'.$tooltip_title_alt.'" '.$visibility_class.' style="float:left">'.
5488
+                        DocumentManager::build_document_icon_tag($filetype, $path).'</a>';
5489 5489
                     }
5490 5490
                 } else {
5491
-                    return '<a href="' . $url . '" title="' . $tooltip_title_alt . '" target="' . $target . '"' . $visibility_class . ' style="float:left">' .
5492
-                    DocumentManager::build_document_icon_tag($filetype, $path) . '</a>';
5491
+                    return '<a href="'.$url.'" title="'.$tooltip_title_alt.'" target="'.$target.'"'.$visibility_class.' style="float:left">'.
5492
+                    DocumentManager::build_document_icon_tag($filetype, $path).'</a>';
5493 5493
                 }
5494 5494
             }
5495 5495
         }
@@ -5524,13 +5524,13 @@  discard block
 block discarded – undo
5524 5524
                 $userinfo = api_get_user_info(substr($basename, 8));
5525 5525
                 $icon = $userinfo['avatar_small'];
5526 5526
 
5527
-                $basename = get_lang('UserFolder') . ' ' . $userinfo['complete_name'];
5527
+                $basename = get_lang('UserFolder').' '.$userinfo['complete_name'];
5528 5528
                 $user_image = true;
5529 5529
             } elseif (strstr($path, 'shared_folder_session_')) {
5530 5530
                 if ($is_allowed_to_edit) {
5531
-                    $basename = '***(' . api_get_session_name($current_session_id) . ')*** ' . get_lang('HelpUsersFolder');
5531
+                    $basename = '***('.api_get_session_name($current_session_id).')*** '.get_lang('HelpUsersFolder');
5532 5532
                 } else {
5533
-                    $basename = get_lang('UserFolders') . ' (' . api_get_session_name($current_session_id) . ')';
5533
+                    $basename = get_lang('UserFolders').' ('.api_get_session_name($current_session_id).')';
5534 5534
                 }
5535 5535
                 $icon = 'folder_users.png';
5536 5536
             } else {
@@ -5639,16 +5639,16 @@  discard block
 block discarded – undo
5639 5639
         // Build URL-parameters for table-sorting
5640 5640
         $sort_params = array();
5641 5641
         if (isset($_GET['column'])) {
5642
-            $sort_params[] = 'column=' . Security::remove_XSS($_GET['column']);
5642
+            $sort_params[] = 'column='.Security::remove_XSS($_GET['column']);
5643 5643
         }
5644 5644
         if (isset($_GET['page_nr'])) {
5645
-            $sort_params[] = 'page_nr=' . Security::remove_XSS($_GET['page_nr']);
5645
+            $sort_params[] = 'page_nr='.Security::remove_XSS($_GET['page_nr']);
5646 5646
         }
5647 5647
         if (isset($_GET['per_page'])) {
5648
-            $sort_params[] = 'per_page=' . Security::remove_XSS($_GET['per_page']);
5648
+            $sort_params[] = 'per_page='.Security::remove_XSS($_GET['per_page']);
5649 5649
         }
5650 5650
         if (isset($_GET['direction'])) {
5651
-            $sort_params[] = 'direction=' . Security::remove_XSS($_GET['direction']);
5651
+            $sort_params[] = 'direction='.Security::remove_XSS($_GET['direction']);
5652 5652
         }
5653 5653
         $sort_params = implode('&amp;', $sort_params);
5654 5654
         $visibility_icon = ($visibility == 0) ? 'invisible' : 'visible';
@@ -5661,89 +5661,89 @@  discard block
 block discarded – undo
5661 5661
         if ($is_read_only /* or ($session_id!=api_get_session_id()) */) {
5662 5662
             if (api_is_course_admin() || api_is_platform_admin()) {
5663 5663
                 if ($extension == 'svg' && api_browser_support('svg') && api_get_setting('enabled_support_svg') == 'true') {
5664
-                    $modify_icons = '<a href="edit_draw.php?' . api_get_cidreq() . '&id=' . $document_id . '">' .
5665
-                        Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
5666
-                } elseif (in_array($extension, $web_odf_extension_list)  && api_get_setting('enabled_support_odf') === true) {
5667
-                    $modify_icons = '<a href="edit_odf.php?' . api_get_cidreq() . '&id=' . $document_id . '">' .
5668
-                        Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
5664
+                    $modify_icons = '<a href="edit_draw.php?'.api_get_cidreq().'&id='.$document_id.'">'.
5665
+                        Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>';
5666
+                } elseif (in_array($extension, $web_odf_extension_list) && api_get_setting('enabled_support_odf') === true) {
5667
+                    $modify_icons = '<a href="edit_odf.php?'.api_get_cidreq().'&id='.$document_id.'">'.
5668
+                        Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>';
5669 5669
                 } elseif ($extension == 'png' || $extension == 'jpg' || $extension == 'jpeg' || $extension == 'bmp' || $extension == 'gif' || $extension == 'pxd' && api_get_setting('enabled_support_pixlr') == 'true') {
5670
-                    $modify_icons = '<a href="edit_paint.php?' . api_get_cidreq() . '&id=' . $document_id . '">' .
5671
-                        Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
5670
+                    $modify_icons = '<a href="edit_paint.php?'.api_get_cidreq().'&id='.$document_id.'">'.
5671
+                        Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>';
5672 5672
                 } else {
5673
-                    $modify_icons = '<a href="edit_document.php?' . api_get_cidreq() . '&id=' . $document_id. '">' .
5674
-                        Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
5673
+                    $modify_icons = '<a href="edit_document.php?'.api_get_cidreq().'&id='.$document_id.'">'.
5674
+                        Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>';
5675 5675
                 }
5676 5676
             } else {
5677 5677
                 $modify_icons = Display::return_icon('edit_na.png', get_lang('Modify'), '', ICON_SIZE_SMALL);
5678 5678
             }
5679
-            $modify_icons .= '&nbsp;' . Display::return_icon('move_na.png', get_lang('Move'), array(), ICON_SIZE_SMALL);
5679
+            $modify_icons .= '&nbsp;'.Display::return_icon('move_na.png', get_lang('Move'), array(), ICON_SIZE_SMALL);
5680 5680
             if (api_is_allowed_to_edit() || api_is_platform_admin()) {
5681
-                $modify_icons .= '&nbsp;' . Display::return_icon($visibility_icon . '.png', get_lang('VisibilityCannotBeChanged'), '', ICON_SIZE_SMALL);
5681
+                $modify_icons .= '&nbsp;'.Display::return_icon($visibility_icon.'.png', get_lang('VisibilityCannotBeChanged'), '', ICON_SIZE_SMALL);
5682 5682
             }
5683
-            $modify_icons .= '&nbsp;' . Display::return_icon('delete_na.png', get_lang('Delete'), array(), ICON_SIZE_SMALL);
5683
+            $modify_icons .= '&nbsp;'.Display::return_icon('delete_na.png', get_lang('Delete'), array(), ICON_SIZE_SMALL);
5684 5684
         } else {
5685 5685
             //Edit button
5686 5686
             if (in_array($path, DocumentManager::get_system_folders())) {
5687 5687
                 $modify_icons = Display::return_icon('edit_na.png', get_lang('Modify'), '', ICON_SIZE_SMALL);
5688
-            } elseif ($is_certificate_mode ) {
5688
+            } elseif ($is_certificate_mode) {
5689 5689
                 // gradebook category doesn't seem to be taken into account
5690
-                $modify_icons = '<a href="edit_document.php?' . api_get_cidreq() . '&amp;id=' . $document_id . '&curdirpath=/certificates">' . Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
5690
+                $modify_icons = '<a href="edit_document.php?'.api_get_cidreq().'&amp;id='.$document_id.'&curdirpath=/certificates">'.Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>';
5691 5691
             } else {
5692 5692
                 if (api_get_session_id()) {
5693 5693
                     if ($document_data['session_id'] == api_get_session_id()) {
5694 5694
                         if ($extension == 'svg' && api_browser_support('svg') && api_get_setting('enabled_support_svg') == 'true') {
5695
-                            $modify_icons = '<a href="edit_draw.php?' . api_get_cidreq() . '&amp;id=' . $document_id  . '">' .
5696
-                                Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
5697
-                        } elseif (in_array($extension, $web_odf_extension_list)  && api_get_setting('enabled_support_odf') === true) {
5698
-                            $modify_icons = '<a href="edit_odf.php?' . api_get_cidreq() . '&id=' . $document_id  . '">' .
5699
-                                Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
5695
+                            $modify_icons = '<a href="edit_draw.php?'.api_get_cidreq().'&amp;id='.$document_id.'">'.
5696
+                                Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>';
5697
+                        } elseif (in_array($extension, $web_odf_extension_list) && api_get_setting('enabled_support_odf') === true) {
5698
+                            $modify_icons = '<a href="edit_odf.php?'.api_get_cidreq().'&id='.$document_id.'">'.
5699
+                                Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>';
5700 5700
                         } elseif ($extension == 'png' || $extension == 'jpg' || $extension == 'jpeg' || $extension == 'bmp' || $extension == 'gif' || $extension == 'pxd' && api_get_setting('enabled_support_pixlr') == 'true') {
5701
-                            $modify_icons = '<a href="edit_paint.php?' . api_get_cidreq() . '&id=' . $document_id  . '">' .
5702
-                                Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
5701
+                            $modify_icons = '<a href="edit_paint.php?'.api_get_cidreq().'&id='.$document_id.'">'.
5702
+                                Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>';
5703 5703
                         } else {
5704
-                            $modify_icons = '<a href="edit_document.php?' . api_get_cidreq() . '&amp;id=' . $document_id  . '">' .
5705
-                                Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
5704
+                            $modify_icons = '<a href="edit_document.php?'.api_get_cidreq().'&amp;id='.$document_id.'">'.
5705
+                                Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>';
5706 5706
                         }
5707 5707
                     } else {
5708
-                        $modify_icons .= '&nbsp;' . Display::return_icon('edit_na.png', get_lang('Edit'), array(), ICON_SIZE_SMALL) . '</a>';
5708
+                        $modify_icons .= '&nbsp;'.Display::return_icon('edit_na.png', get_lang('Edit'), array(), ICON_SIZE_SMALL).'</a>';
5709 5709
                     }
5710 5710
                 } else {
5711 5711
                     if ($extension == 'svg' && api_browser_support('svg') && api_get_setting('enabled_support_svg') == 'true') {
5712
-                        $modify_icons = '<a href="edit_draw.php?' . api_get_cidreq() . '&amp;id=' . $document_id  . '">' .
5713
-                            Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
5714
-                    } elseif (in_array($extension, $web_odf_extension_list)  && api_get_setting('enabled_support_odf') === true) {
5715
-                        $modify_icons = '<a href="edit_odf.php?' . api_get_cidreq() . '&id=' . $document_id  . '">' .
5716
-                            Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
5712
+                        $modify_icons = '<a href="edit_draw.php?'.api_get_cidreq().'&amp;id='.$document_id.'">'.
5713
+                            Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>';
5714
+                    } elseif (in_array($extension, $web_odf_extension_list) && api_get_setting('enabled_support_odf') === true) {
5715
+                        $modify_icons = '<a href="edit_odf.php?'.api_get_cidreq().'&id='.$document_id.'">'.
5716
+                            Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>';
5717 5717
                     } elseif ($extension == 'png' || $extension == 'jpg' || $extension == 'jpeg' || $extension == 'bmp' || $extension == 'gif' || $extension == 'pxd' && api_get_setting('enabled_support_pixlr') == 'true') {
5718
-                        $modify_icons = '<a href="edit_paint.php?' . api_get_cidreq() . '&amp;id=' . $document_id . '">' .
5719
-                            Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
5718
+                        $modify_icons = '<a href="edit_paint.php?'.api_get_cidreq().'&amp;id='.$document_id.'">'.
5719
+                            Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>';
5720 5720
                     } else {
5721
-                        $modify_icons = '<a href="edit_document.php?' . api_get_cidreq() . '&amp;id=' . $document_id  . '">' .
5722
-                            Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
5721
+                        $modify_icons = '<a href="edit_document.php?'.api_get_cidreq().'&amp;id='.$document_id.'">'.
5722
+                            Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>';
5723 5723
                     }
5724 5724
                 }
5725 5725
             }
5726 5726
 
5727 5727
             // Move button.
5728 5728
             if ($is_certificate_mode || in_array($path, DocumentManager::get_system_folders())) {
5729
-                $modify_icons .= '&nbsp;' . Display::return_icon('move_na.png', get_lang('Move'), array(), ICON_SIZE_SMALL) . '</a>';
5729
+                $modify_icons .= '&nbsp;'.Display::return_icon('move_na.png', get_lang('Move'), array(), ICON_SIZE_SMALL).'</a>';
5730 5730
             } else {
5731 5731
                 if (api_get_session_id()) {
5732 5732
                     if ($document_data['session_id'] == api_get_session_id()) {
5733
-                        $modify_icons .= '&nbsp;<a href="' . api_get_self() . '?' . api_get_cidreq() . '&amp;id=' . $parent_id . '&amp;move=' . $document_id .  '">' .
5734
-                            Display::return_icon('move.png', get_lang('Move'), array(), ICON_SIZE_SMALL) . '</a>';
5733
+                        $modify_icons .= '&nbsp;<a href="'.api_get_self().'?'.api_get_cidreq().'&amp;id='.$parent_id.'&amp;move='.$document_id.'">'.
5734
+                            Display::return_icon('move.png', get_lang('Move'), array(), ICON_SIZE_SMALL).'</a>';
5735 5735
                     } else {
5736
-                        $modify_icons .= '&nbsp;' . Display::return_icon('move_na.png', get_lang('Move'), array(), ICON_SIZE_SMALL) . '</a>';
5736
+                        $modify_icons .= '&nbsp;'.Display::return_icon('move_na.png', get_lang('Move'), array(), ICON_SIZE_SMALL).'</a>';
5737 5737
                     }
5738 5738
                 } else {
5739
-                    $modify_icons .= '&nbsp;<a href="' . api_get_self() . '?' . api_get_cidreq() . '&amp;id=' . $parent_id . '&amp;move=' . $document_id .  '">' .
5740
-                        Display::return_icon('move.png', get_lang('Move'), array(), ICON_SIZE_SMALL) . '</a>';
5739
+                    $modify_icons .= '&nbsp;<a href="'.api_get_self().'?'.api_get_cidreq().'&amp;id='.$parent_id.'&amp;move='.$document_id.'">'.
5740
+                        Display::return_icon('move.png', get_lang('Move'), array(), ICON_SIZE_SMALL).'</a>';
5741 5741
                 }
5742 5742
             }
5743 5743
 
5744 5744
             //Visibility button
5745 5745
             if ($is_certificate_mode) {
5746
-                $modify_icons .= '&nbsp;' . Display::return_icon($visibility_icon . '.png', get_lang('VisibilityCannotBeChanged'), array(), ICON_SIZE_SMALL) . '</a>';
5746
+                $modify_icons .= '&nbsp;'.Display::return_icon($visibility_icon.'.png', get_lang('VisibilityCannotBeChanged'), array(), ICON_SIZE_SMALL).'</a>';
5747 5747
             } else {
5748 5748
                 if (api_is_allowed_to_edit() || api_is_platform_admin()) {
5749 5749
                     if ($visibility_icon == 'invisible') {
@@ -5751,14 +5751,14 @@  discard block
 block discarded – undo
5751 5751
                     } else {
5752 5752
                         $tip_visibility = get_lang('Hide');
5753 5753
                     }
5754
-                    $modify_icons .= '&nbsp;<a href="' . api_get_self() . '?' . api_get_cidreq() . '&amp;id=' . $parent_id . '&amp;' . $visibility_command . '=' . $id . '&amp;' . $sort_params . '">' .
5755
-                        Display::return_icon($visibility_icon . '.png', $tip_visibility, '', ICON_SIZE_SMALL) . '</a>';
5754
+                    $modify_icons .= '&nbsp;<a href="'.api_get_self().'?'.api_get_cidreq().'&amp;id='.$parent_id.'&amp;'.$visibility_command.'='.$id.'&amp;'.$sort_params.'">'.
5755
+                        Display::return_icon($visibility_icon.'.png', $tip_visibility, '', ICON_SIZE_SMALL).'</a>';
5756 5756
                 }
5757 5757
             }
5758 5758
 
5759 5759
             // Delete button
5760 5760
             if (in_array($path, DocumentManager::get_system_folders())) {
5761
-                $modify_icons .= '&nbsp;' . Display::return_icon('delete_na.png', get_lang('ThisFolderCannotBeDeleted'), array(), ICON_SIZE_SMALL);
5761
+                $modify_icons .= '&nbsp;'.Display::return_icon('delete_na.png', get_lang('ThisFolderCannotBeDeleted'), array(), ICON_SIZE_SMALL);
5762 5762
             } else {
5763 5763
                 $titleToShow = addslashes(basename($document_data['title']));
5764 5764
 
@@ -5766,23 +5766,23 @@  discard block
 block discarded – undo
5766 5766
                     $_GET['curdirpath'] == '/certificates' &&
5767 5767
                     DocumentManager::get_default_certificate_id(api_get_course_id()) == $id
5768 5768
                 ) {
5769
-                    $modify_icons .= '&nbsp;<a href="' . api_get_self() . '?' . api_get_cidreq() . '&amp;curdirpath=' . $curdirpath . '&action=delete_item&id='.$parent_id.'&deleteid='.$document_id.'&amp;' . $sort_params . 'delete_certificate_id=' . $id . '" onclick="return confirmation(\'' . $titleToShow . '\');">' .
5770
-                        Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL) . '</a>';
5769
+                    $modify_icons .= '&nbsp;<a href="'.api_get_self().'?'.api_get_cidreq().'&amp;curdirpath='.$curdirpath.'&action=delete_item&id='.$parent_id.'&deleteid='.$document_id.'&amp;'.$sort_params.'delete_certificate_id='.$id.'" onclick="return confirmation(\''.$titleToShow.'\');">'.
5770
+                        Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL).'</a>';
5771 5771
                 } else {
5772 5772
                     if ($is_certificate_mode) {
5773
-                        $modify_icons .= '&nbsp;<a href="' . api_get_self() . '?' . api_get_cidreq() . '&amp;curdirpath=' . $curdirpath . '&action=delete_item&id='.$parent_id.'&deleteid=' . $document_id  . '&amp;' . $sort_params . '" onclick="return confirmation(\'' . $titleToShow . '\');">' .
5774
-                            Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL) . '</a>';
5773
+                        $modify_icons .= '&nbsp;<a href="'.api_get_self().'?'.api_get_cidreq().'&amp;curdirpath='.$curdirpath.'&action=delete_item&id='.$parent_id.'&deleteid='.$document_id.'&amp;'.$sort_params.'" onclick="return confirmation(\''.$titleToShow.'\');">'.
5774
+                            Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL).'</a>';
5775 5775
                     } else {
5776 5776
                         if (api_get_session_id()) {
5777 5777
                             if ($document_data['session_id'] == api_get_session_id()) {
5778
-                                $modify_icons .= '&nbsp;<a href="' . api_get_self() . '?' . api_get_cidreq() . '&amp;curdirpath=' . $curdirpath . '&action=delete_item&id='.$parent_id.'&deleteid='.$document_id  . '&amp;' . $sort_params . '" onclick="return confirmation(\'' . $titleToShow . '\');">'.
5779
-                                    Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL) . '</a>';
5778
+                                $modify_icons .= '&nbsp;<a href="'.api_get_self().'?'.api_get_cidreq().'&amp;curdirpath='.$curdirpath.'&action=delete_item&id='.$parent_id.'&deleteid='.$document_id.'&amp;'.$sort_params.'" onclick="return confirmation(\''.$titleToShow.'\');">'.
5779
+                                    Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL).'</a>';
5780 5780
                             } else {
5781
-                                $modify_icons .= '&nbsp;' . Display::return_icon('delete_na.png', get_lang('ThisFolderCannotBeDeleted'), array(), ICON_SIZE_SMALL);
5781
+                                $modify_icons .= '&nbsp;'.Display::return_icon('delete_na.png', get_lang('ThisFolderCannotBeDeleted'), array(), ICON_SIZE_SMALL);
5782 5782
                             }
5783 5783
                         } else {
5784
-                            $modify_icons .= '&nbsp;<a href="' . api_get_self() . '?' . api_get_cidreq() . '&amp;curdirpath=' . $curdirpath . '&action=delete_item&id='.$parent_id.'&deleteid='.$document_id . '&amp;' . $sort_params . '" onclick="return confirmation(\'' . $titleToShow. '\');">' .
5785
-                                Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL) . '</a>';
5784
+                            $modify_icons .= '&nbsp;<a href="'.api_get_self().'?'.api_get_cidreq().'&amp;curdirpath='.$curdirpath.'&action=delete_item&id='.$parent_id.'&deleteid='.$document_id.'&amp;'.$sort_params.'" onclick="return confirmation(\''.$titleToShow.'\');">'.
5785
+                                Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL).'</a>';
5786 5786
                         }
5787 5787
                     }
5788 5788
                 }
@@ -5794,15 +5794,15 @@  discard block
 block discarded – undo
5794 5794
                 // nothing to do
5795 5795
             } else {
5796 5796
                 if ($usePpt2lp && $formatType) {
5797
-                    $modify_icons .= '&nbsp;<a class="convertAction" href="#" ' .
5798
-                        'data-documentId = ' . $document_id .
5799
-                        ' data-formatType = ' . $formatType . '>' .
5797
+                    $modify_icons .= '&nbsp;<a class="convertAction" href="#" '.
5798
+                        'data-documentId = '.$document_id.
5799
+                        ' data-formatType = '.$formatType.'>'.
5800 5800
                         Display::return_icon(
5801 5801
                             'convert.png',
5802 5802
                             get_lang('Convert'),
5803 5803
                             array(),
5804 5804
                             ICON_SIZE_SMALL
5805
-                        ) . '</a>';
5805
+                        ).'</a>';
5806 5806
                 }
5807 5807
             }
5808 5808
         }
@@ -5810,8 +5810,8 @@  discard block
 block discarded – undo
5810 5810
         if ($type == 'file' && ($extension == 'html' || $extension == 'htm')) {
5811 5811
             if ($is_template == 0) {
5812 5812
                 if ((isset($_GET['curdirpath']) && $_GET['curdirpath'] != '/certificates') || !isset($_GET['curdirpath'])) {
5813
-                    $modify_icons .= '&nbsp;<a href="' . api_get_self() . '?' . api_get_cidreq() . '&amp;curdirpath=' . $curdirpath . '&amp;add_as_template=' . $id .  '&amp;' . $sort_params . '">' .
5814
-                        Display::return_icon('wizard.png', get_lang('AddAsTemplate'), array(), ICON_SIZE_SMALL) . '</a>';
5813
+                    $modify_icons .= '&nbsp;<a href="'.api_get_self().'?'.api_get_cidreq().'&amp;curdirpath='.$curdirpath.'&amp;add_as_template='.$id.'&amp;'.$sort_params.'">'.
5814
+                        Display::return_icon('wizard.png', get_lang('AddAsTemplate'), array(), ICON_SIZE_SMALL).'</a>';
5815 5815
                 }
5816 5816
                 if (isset($_GET['curdirpath']) && $_GET['curdirpath'] == '/certificates') {//allow attach certificate to course
5817 5817
                     $visibility_icon_certificate = 'nocertificate';
@@ -5825,21 +5825,21 @@  discard block
 block discarded – undo
5825 5825
                         $certificate = get_lang('NoDefaultCertificate');
5826 5826
                     }
5827 5827
                     if (isset($_GET['selectcat'])) {
5828
-                        $modify_icons .= '&nbsp;<a href="' . api_get_self() . '?' . api_get_cidreq() . '&amp;curdirpath=' . $curdirpath . '&amp;selectcat=' . intval($_GET['selectcat']) . '&amp;set_certificate=' . $id . '&amp;' . $sort_params . '">';
5828
+                        $modify_icons .= '&nbsp;<a href="'.api_get_self().'?'.api_get_cidreq().'&amp;curdirpath='.$curdirpath.'&amp;selectcat='.intval($_GET['selectcat']).'&amp;set_certificate='.$id.'&amp;'.$sort_params.'">';
5829 5829
                         $modify_icons .= Display::return_icon($visibility_icon_certificate.'.png', $certificate);
5830 5830
                         $modify_icons .= '</a>';
5831 5831
                         if ($is_preview) {
5832
-                            $modify_icons .= '&nbsp;<a target="_blank"  href="' . api_get_self() . '?' . api_get_cidreq() . '&amp;curdirpath=' . $curdirpath . '&amp;set_preview=' . $id . '&amp;' . $sort_params . '" >' .
5833
-                                Display::return_icon('preview_view.png', $preview, '', ICON_SIZE_SMALL) . '</a>';
5832
+                            $modify_icons .= '&nbsp;<a target="_blank"  href="'.api_get_self().'?'.api_get_cidreq().'&amp;curdirpath='.$curdirpath.'&amp;set_preview='.$id.'&amp;'.$sort_params.'" >'.
5833
+                                Display::return_icon('preview_view.png', $preview, '', ICON_SIZE_SMALL).'</a>';
5834 5834
                         }
5835 5835
                     }
5836 5836
                 }
5837 5837
             } else {
5838
-                $modify_icons .= '&nbsp;<a href="' . api_get_self() . '?' . api_get_cidreq() . '&curdirpath=' . $curdirpath . '&amp;remove_as_template=' . $id. '&amp;' . $sort_params . '">' .
5839
-                    Display::return_icon('wizard_na.png', get_lang('RemoveAsTemplate'), '', ICON_SIZE_SMALL) . '</a>';
5838
+                $modify_icons .= '&nbsp;<a href="'.api_get_self().'?'.api_get_cidreq().'&curdirpath='.$curdirpath.'&amp;remove_as_template='.$id.'&amp;'.$sort_params.'">'.
5839
+                    Display::return_icon('wizard_na.png', get_lang('RemoveAsTemplate'), '', ICON_SIZE_SMALL).'</a>';
5840 5840
             }
5841
-            $modify_icons .= '&nbsp;<a href="' . api_get_self() . '?' . api_get_cidreq() . '&action=export_to_pdf&id=' . $id . '">' .
5842
-                Display::return_icon('pdf.png', get_lang('Export2PDF'), array(), ICON_SIZE_SMALL) . '</a>';
5841
+            $modify_icons .= '&nbsp;<a href="'.api_get_self().'?'.api_get_cidreq().'&action=export_to_pdf&id='.$id.'">'.
5842
+                Display::return_icon('pdf.png', get_lang('Export2PDF'), array(), ICON_SIZE_SMALL).'</a>';
5843 5843
         }
5844 5844
 
5845 5845
         return $modify_icons;
@@ -5911,7 +5911,7 @@  discard block
 block discarded – undo
5911 5911
                     // 3. inside a subfolder of the folder you want to move
5912 5912
                     if (($curdirpath != $folder) &&
5913 5913
                         ($folder != $move_file) &&
5914
-                        (substr($folder, 0, strlen($move_file) + 1) != $move_file . '/')
5914
+                        (substr($folder, 0, strlen($move_file) + 1) != $move_file.'/')
5915 5915
                     ) {
5916 5916
                         $path_displayed = $folder;
5917 5917
                         // If document title is used, we have to display titles instead of real paths...
@@ -5928,7 +5928,7 @@  discard block
 block discarded – undo
5928 5928
             foreach ($folders as $folder) {
5929 5929
                 if (($curdirpath != $folder) &&
5930 5930
                     ($folder != $move_file) &&
5931
-                    (substr($folder, 0, strlen($move_file) + 1) != $move_file . '/')
5931
+                    (substr($folder, 0, strlen($move_file) + 1) != $move_file.'/')
5932 5932
                 ) {
5933 5933
                     // Cannot copy dir into his own subdir
5934 5934
                     $path_displayed = DocumentManager::get_titles_of_path($folder);
@@ -5971,10 +5971,10 @@  discard block
 block discarded – undo
5971 5971
                 // If this path has soon been stored here we don't need a new query
5972 5972
                 $path_displayed .= $tmp_folders_titles[$tmp_path];
5973 5973
             } else {
5974
-                $sql = 'SELECT title FROM ' . Database::get_course_table(TABLE_DOCUMENT) . '
5975
-                    WHERE c_id = ' . $course_id . ' AND path LIKE BINARY "' . $tmp_path . '"';
5974
+                $sql = 'SELECT title FROM '.Database::get_course_table(TABLE_DOCUMENT).'
5975
+                    WHERE c_id = ' . $course_id.' AND path LIKE BINARY "'.$tmp_path.'"';
5976 5976
                 $rs = Database::query($sql);
5977
-                $tmp_title = '/' . Database::result($rs, 0, 0);
5977
+                $tmp_title = '/'.Database::result($rs, 0, 0);
5978 5978
                 $path_displayed .= $tmp_title;
5979 5979
                 $tmp_folders_titles[$tmp_path] = $tmp_title;
5980 5980
             }
@@ -6011,7 +6011,7 @@  discard block
 block discarded – undo
6011 6011
         $clean_curdirpath = Security::remove_XSS($curdirpath);
6012 6012
         if ($clean_curdirpath == '/shared_folder') {
6013 6013
             return true;
6014
-        } elseif ($clean_curdirpath == '/shared_folder_session_' . $current_session_id) {
6014
+        } elseif ($clean_curdirpath == '/shared_folder_session_'.$current_session_id) {
6015 6015
             return true;
6016 6016
         } else {
6017 6017
             return false;
@@ -6027,7 +6027,7 @@  discard block
 block discarded – undo
6027 6027
         $clean_path = Security::remove_XSS($path);
6028 6028
         if (strpos($clean_path, 'shared_folder/sf_user_')) {
6029 6029
             return true;
6030
-        } elseif (strpos($clean_path, 'shared_folder_session_' . $current_session_id . '/sf_user_')) {
6030
+        } elseif (strpos($clean_path, 'shared_folder_session_'.$current_session_id.'/sf_user_')) {
6031 6031
             return true;
6032 6032
         } else {
6033 6033
             return false;
@@ -6040,11 +6040,11 @@  discard block
 block discarded – undo
6040 6040
      */
6041 6041
     public static function is_my_shared_folder($user_id, $path, $current_session_id)
6042 6042
     {
6043
-        $clean_path = Security::remove_XSS($path) . '/';
6043
+        $clean_path = Security::remove_XSS($path).'/';
6044 6044
         //for security does not remove the last slash
6045
-        $main_user_shared_folder = '/shared_folder\/sf_user_' . $user_id . '\//';
6045
+        $main_user_shared_folder = '/shared_folder\/sf_user_'.$user_id.'\//';
6046 6046
         //for security does not remove the last slash
6047
-        $main_user_shared_folder_session = '/shared_folder_session_' . $current_session_id . '\/sf_user_' . $user_id . '\//';
6047
+        $main_user_shared_folder_session = '/shared_folder_session_'.$current_session_id.'\/sf_user_'.$user_id.'\//';
6048 6048
 
6049 6049
         if (preg_match($main_user_shared_folder, $clean_path)) {
6050 6050
             return true;
@@ -6317,7 +6317,7 @@  discard block
 block discarded – undo
6317 6317
                 ON (i.c_id = d.c_id)
6318 6318
                 WHERE
6319 6319
                     d.id = i.ref AND
6320
-                    i.tool = '" . TOOL_DOCUMENT . "'
6320
+                    i.tool = '".TOOL_DOCUMENT."'
6321 6321
                     $conditionSession AND
6322 6322
                     i.c_id = $courseId AND
6323 6323
                     d.c_id = $courseId ";
@@ -6325,9 +6325,9 @@  discard block
 block discarded – undo
6325 6325
         $result = Database::query($sql);
6326 6326
         $documents = Database::store_result($result, 'ASSOC');
6327 6327
         if ($documents) {
6328
-            $course_dir = $courseInfo['directory'] . '/document';
6328
+            $course_dir = $courseInfo['directory'].'/document';
6329 6329
             $sys_course_path = api_get_path(SYS_COURSE_PATH);
6330
-            $base_work_dir = $sys_course_path . $course_dir;
6330
+            $base_work_dir = $sys_course_path.$course_dir;
6331 6331
 
6332 6332
             foreach ($documents as $document) {
6333 6333
                 $documentId = $document['id'];
Please login to merge, or discard this patch.
main/inc/lib/career.lib.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -84,7 +84,7 @@
 block discarded – undo
84 84
 
85 85
     /**
86 86
      * Available driver list.
87
-     * @return array
87
+     * @return string[]
88 88
      */
89 89
     private function getDefaultDriverList()
90 90
     {
Please login to merge, or discard this patch.
main/admin/access_urls.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -85,12 +85,12 @@
 block discarded – undo
85 85
     }
86 86
 }
87 87
 if(!empty($url_string)) {
88
-	Display :: display_warning_message(get_lang('AdminShouldBeRegisterInSite').'<br />'.$url_string,false);
88
+    Display :: display_warning_message(get_lang('AdminShouldBeRegisterInSite').'<br />'.$url_string,false);
89 89
 }
90 90
 
91 91
 // checking the current installation
92 92
 if ($current_access_url_id==-1) {
93
-	Display::display_warning_message(get_lang('URLNotConfiguredPleaseChangedTo').': '.api_get_path(WEB_PATH));
93
+    Display::display_warning_message(get_lang('URLNotConfiguredPleaseChangedTo').': '.api_get_path(WEB_PATH));
94 94
 } elseif(api_is_platform_admin()) {
95 95
     $quant= UrlManager::relation_url_user_exist(api_get_user_id(),$current_access_url_id);
96 96
     if ($quant==0) {
Please login to merge, or discard this 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/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/forum/editthread.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 }
46 46
 
47 47
 if (!empty($gradebook) && $gradebook == 'view') {
48
-    $interbreadcrumb[] = array (
48
+    $interbreadcrumb[] = array(
49 49
         'url' => '../gradebook/'.Security::remove_XSS($_SESSION['gradebook_dest']),
50 50
         'name' => get_lang('ToolGradebook')
51 51
     );
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
     $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'group/group.php?'.$cidreq, 'name' => get_lang('Groups'));
108 108
     $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'group/group_space.php?'.$cidreq, 'name' => get_lang('GroupSpace').' '.$groupProperties['name']);
109 109
     $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/viewforum.php?'.$cidreq.'&forum='.intval($_GET['forum']), 'name' => $currentForum['forum_title']);
110
-    $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/newthread.php?'.$cidreq.'&forum='.intval($_GET['forum']),'name' => get_lang('EditThread'));
110
+    $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/newthread.php?'.$cidreq.'&forum='.intval($_GET['forum']), 'name' => get_lang('EditThread'));
111 111
 } else {
112 112
     $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/index.php?'.$cidreq, 'name' => $nameTools);
113 113
     $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/viewforumcategory.php?'.$cidreq.'&forumcategory='.$currentForumCategory['cat_id'], 'name' => $currentForumCategory['cat_title']);
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
 echo '<div class="actions">';
157 157
 echo '<span style="float:right;">'.search_link().'</span>';
158 158
 echo '<a href="viewforum.php?forum='.intval($_GET['forum']).'&'.$cidreq.'">'.
159
-    Display::return_icon('back.png',get_lang('BackToForum'),'',ICON_SIZE_MEDIUM).'</a>';
159
+    Display::return_icon('back.png', get_lang('BackToForum'), '', ICON_SIZE_MEDIUM).'</a>';
160 160
 echo '</div>';
161 161
 
162 162
 $threadData = getThreadInfo($threadId, $cId);
Please login to merge, or discard this patch.
main/forum/forumsearch.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 // Are we in a lp ?
41 41
 $origin = '';
42 42
 if (isset($_GET['origin'])) {
43
-    $origin =  Security::remove_XSS($_GET['origin']);
43
+    $origin = Security::remove_XSS($_GET['origin']);
44 44
 }
45 45
 
46 46
 // Name of the tool
@@ -48,12 +48,12 @@  discard block
 block discarded – undo
48 48
 
49 49
 // Breadcrumbs
50 50
 
51
-if (isset($_SESSION['gradebook'])){
51
+if (isset($_SESSION['gradebook'])) {
52 52
     $gradebook = $_SESSION['gradebook'];
53 53
 }
54 54
 
55 55
 if (!empty($gradebook) && $gradebook == 'view') {
56
-    $interbreadcrumb[] = array (
56
+    $interbreadcrumb[] = array(
57 57
         'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
58 58
         'name' => get_lang('ToolGradebook')
59 59
     );
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
     $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'group/group.php?'.api_get_cidreq(), 'name' => get_lang('Groups'));
67 67
     $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'group/group_space.php?'.api_get_cidreq(), 'name' => get_lang('GroupSpace').' ('.$group_properties['name'].')');
68 68
     $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/viewforum.php?origin='.$origin.'&forum='.intval($_GET['forum']).'&'.api_get_cidreq(), 'name' => prepare4display($current_forum['forum_title']));
69
-    $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/forumsearch.php?'.api_get_cidreq(),'name' => get_lang('ForumSearch'));
69
+    $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/forumsearch.php?'.api_get_cidreq(), 'name' => get_lang('ForumSearch'));
70 70
 } else {
71 71
     $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/index.php?'.api_get_cidreq(), 'name' => $nameTools);
72 72
     $nameTools = get_lang('ForumSearch');
Please login to merge, or discard this patch.