Completed
Push — 1.11.x ( 78f130...f6f5c2 )
by José
50:40 queued 24:26
created
main/work/edit.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@  discard block
 block discarded – undo
4 4
 use ChamiloSession as Session;
5 5
 
6 6
 require_once '../inc/global.inc.php';
7
-$current_course_tool  = TOOL_STUDENTPUBLICATION;
7
+$current_course_tool = TOOL_STUDENTPUBLICATION;
8 8
 
9 9
 api_protect_course_script(true);
10 10
 
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 $token = Security::get_token();
51 51
 
52 52
 $student_can_edit_in_session = api_is_allowed_to_session_edit(false, true);
53
-$has_ended   = false;
53
+$has_ended = false;
54 54
 $is_author = false;
55 55
 $work_item = get_work_data_by_id($item_id);
56 56
 
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
 $form->setDefaults($defaults);
221 221
 $error_message = null;
222 222
 $_course = api_get_course_info();
223
-$currentCourseRepositorySys = api_get_path(SYS_COURSE_PATH).$_course['path'] . '/';
223
+$currentCourseRepositorySys = api_get_path(SYS_COURSE_PATH).$_course['path'].'/';
224 224
 
225 225
 $succeed = false;
226 226
 if ($form->validate()) {
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
             $description = isset($_POST['description']) ? $_POST['description'] : $work_data['description'];
242 242
 
243 243
             $add_to_update = null;
244
-            if ($is_allowed_to_edit && ($_POST['qualification'] !='' )) {
244
+            if ($is_allowed_to_edit && ($_POST['qualification'] != '')) {
245 245
                 $add_to_update = ', qualificator_id ='."'".api_get_user_id()."', ";
246 246
                 $add_to_update .= ' qualification = '."'".Database::escape_string($_POST['qualification'])."',";
247 247
                 $add_to_update .= ' date_of_qualification = '."'".api_get_utc_datetime()."'";
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
                     'error'
268 268
                 );
269 269
             } else {
270
-                $sql = "UPDATE  " . $work_table . "
270
+                $sql = "UPDATE  ".$work_table."
271 271
                         SET	title = '".Database::escape_string($title)."',
272 272
                             description = '".Database::escape_string($description)."'
273 273
                             ".$add_to_update."
Please login to merge, or discard this patch.
main/dropbox/recover_dropbox_files.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@
 block discarded – undo
33 33
 $result = Database::query($sql);
34 34
 
35 35
 if (Database::num_rows($result)) {
36
-    $files  = Database::store_result($result);
36
+    $files = Database::store_result($result);
37 37
     $rows = array();
38 38
     foreach ($files as $file) {
39 39
         //Check if I have this file:
Please login to merge, or discard this patch.
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
 
@@ -614,8 +614,8 @@  discard block
 block discarded – undo
614 614
                     last.c_id = {$_course['real_id']}
615 615
                 )
616 616
                 WHERE
617
-                    docs.path LIKE '" . Database::escape_string($path . $added_slash.'%'). "' AND
618
-                    docs.path NOT LIKE '" . Database::escape_string($path . $added_slash.'%/%')."' AND
617
+                    docs.path LIKE '".Database::escape_string($path.$added_slash.'%')."' AND
618
+                    docs.path NOT LIKE '" . Database::escape_string($path.$added_slash.'%/%')."' AND
619 619
                     docs.path NOT LIKE '%_DELETED_%' AND
620 620
                     $userGroupFilter AND
621 621
                     last.visibility $visibility_bit
@@ -656,7 +656,7 @@  discard block
 block discarded – undo
656 656
                     $table_template = Database::get_main_table(TABLE_MAIN_TEMPLATES);
657 657
                     $sql = "SELECT id FROM $table_template
658 658
                             WHERE
659
-                                course_code = '" . $_course['code'] . "' AND
659
+                                course_code = '".$_course['code']."' AND
660 660
                                 user_id = '".api_get_user_id()."' AND
661 661
                                 ref_doc = '".$row['id']."'";
662 662
                     $template_result = Database::query($sql);
@@ -766,7 +766,7 @@  discard block
 block discarded – undo
766 766
         if (!empty($students)) {
767 767
             $conditionList = array();
768 768
             foreach ($students as $studentId => $studentInfo) {
769
-                $conditionList[] = '/shared_folder/sf_user_' . $studentInfo['user_id'];
769
+                $conditionList[] = '/shared_folder/sf_user_'.$studentInfo['user_id'];
770 770
             }
771 771
         }
772 772
 
@@ -791,7 +791,7 @@  discard block
 block discarded – undo
791 791
                        INNER JOIN $TABLE_DOCUMENT  AS docs
792 792
                        ON (
793 793
                             docs.id = last.ref AND
794
-                            last.tool = '" . TOOL_DOCUMENT . "' AND
794
+                            last.tool = '".TOOL_DOCUMENT."' AND
795 795
                             last.c_id = {$_course['real_id']} AND
796 796
                             docs.c_id = {$_course['real_id']}
797 797
                        )
@@ -808,7 +808,7 @@  discard block
 block discarded – undo
808 808
                         INNER JOIN $TABLE_DOCUMENT  AS docs
809 809
                         ON (
810 810
                             docs.id = last.ref AND
811
-                            last.tool = '" . TOOL_DOCUMENT . "' AND
811
+                            last.tool = '".TOOL_DOCUMENT."' AND
812 812
                             last.c_id = {$_course['real_id']} AND
813 813
                             docs.c_id = {$_course['real_id']}
814 814
                         )
@@ -866,7 +866,7 @@  discard block
 block discarded – undo
866 866
                         ON (docs.id = last.ref AND last.c_id = docs.c_id)
867 867
                     WHERE
868 868
                         $fileType
869
-                        last.tool = '" . TOOL_DOCUMENT . "' AND
869
+                        last.tool = '".TOOL_DOCUMENT."' AND
870 870
                         $groupCondition AND
871 871
                         $visibilityCondition
872 872
                         $show_users_condition
@@ -894,7 +894,7 @@  discard block
 block discarded – undo
894 894
                     WHERE
895 895
                         docs.id = last.ref AND
896 896
                         docs.filetype = 'folder' AND
897
-                        last.tool = '" . TOOL_DOCUMENT . "' AND
897
+                        last.tool = '".TOOL_DOCUMENT."' AND
898 898
                         $groupCondition AND
899 899
                         last.visibility = 0 $condition_session AND
900 900
                         last.c_id = {$_course['real_id']} AND
@@ -910,9 +910,9 @@  discard block
 block discarded – undo
910 910
                         FROM $TABLE_ITEMPROPERTY AS last, $TABLE_DOCUMENT AS docs
911 911
                         WHERE
912 912
                             docs.id = last.ref AND
913
-                            docs.path LIKE '" . Database::escape_string($row['path'].'/%') . "' AND
913
+                            docs.path LIKE '".Database::escape_string($row['path'].'/%')."' AND
914 914
                             docs.filetype = 'folder' AND
915
-                            last.tool = '" . TOOL_DOCUMENT . "' AND
915
+                            last.tool = '" . TOOL_DOCUMENT."' AND
916 916
                             $groupCondition AND
917 917
                             last.visibility = 1 $condition_session AND
918 918
                             last.c_id = {$_course['real_id']} AND
@@ -989,7 +989,7 @@  discard block
 block discarded – undo
989 989
                                 tp.c_id = $course_id AND
990 990
                                 td.session_id = $sessionId AND
991 991
                                 tp.ref= td.id AND
992
-                                (path='" . $path . "' OR path LIKE BINARY '" . $path . "/%' ) ";
992
+                                (path='".$path."' OR path LIKE BINARY '".$path."/%' ) ";
993 993
                     // Get all id's of documents that are deleted
994 994
                     $what_to_check_result = Database::query($sql);
995 995
 
@@ -1332,7 +1332,7 @@  discard block
 block discarded – undo
1332 1332
             $res = Database::query($sql);
1333 1333
             if (Database::num_rows($res) > 0) {
1334 1334
                 $row2 = Database::fetch_array($res);
1335
-                require_once api_get_path(LIBRARY_PATH) . 'search/ChamiloIndexer.class.php';
1335
+                require_once api_get_path(LIBRARY_PATH).'search/ChamiloIndexer.class.php';
1336 1336
                 $di = new ChamiloIndexer();
1337 1337
                 $di->remove_document((int) $row2['search_did']);
1338 1338
             }
@@ -1341,7 +1341,7 @@  discard block
 block discarded – undo
1341 1341
             Database::query($sql);
1342 1342
 
1343 1343
             // remove terms from db
1344
-            require_once api_get_path(LIBRARY_PATH) . 'specific_fields_manager.lib.php';
1344
+            require_once api_get_path(LIBRARY_PATH).'specific_fields_manager.lib.php';
1345 1345
             delete_all_values_for_item($course_id, TOOL_DOCUMENT, $document_id);
1346 1346
         }
1347 1347
     }
@@ -1429,12 +1429,12 @@  discard block
 block discarded – undo
1429 1429
             $path = str_replace('%2F', '/', $url_path);
1430 1430
             $pathinfo = pathinfo($row['path']);
1431 1431
 
1432
-            $row['url'] = api_get_path(WEB_CODE_PATH) . 'document/showinframes.php?cidReq=' . $course_code . '&id=' . $id;
1433
-            $row['document_url'] = api_get_path(WEB_CODE_PATH) . 'document/document.php?cidReq=' . $course_code . '&id=' . $id;
1434
-            $row['absolute_path'] = api_get_path(SYS_COURSE_PATH) . $course_info['path'] . '/document' . $row['path'];
1435
-            $row['absolute_path_from_document'] = '/document' . $row['path'];
1436
-            $row['absolute_parent_path'] = api_get_path(SYS_COURSE_PATH).$course_info['path'].'/document'.$pathinfo['dirname'] . '/';
1437
-            $row['direct_url'] = $www . $path;
1432
+            $row['url'] = api_get_path(WEB_CODE_PATH).'document/showinframes.php?cidReq='.$course_code.'&id='.$id;
1433
+            $row['document_url'] = api_get_path(WEB_CODE_PATH).'document/document.php?cidReq='.$course_code.'&id='.$id;
1434
+            $row['absolute_path'] = api_get_path(SYS_COURSE_PATH).$course_info['path'].'/document'.$row['path'];
1435
+            $row['absolute_path_from_document'] = '/document'.$row['path'];
1436
+            $row['absolute_parent_path'] = api_get_path(SYS_COURSE_PATH).$course_info['path'].'/document'.$pathinfo['dirname'].'/';
1437
+            $row['direct_url'] = $www.$path;
1438 1438
 
1439 1439
             if (dirname($row['path']) == '.') {
1440 1440
                 $row['parent_id'] = '0';
@@ -1453,7 +1453,7 @@  discard block
 block discarded – undo
1453 1453
                 $real_dir = '';
1454 1454
 
1455 1455
                 for ($i = 1; $i < $array_len; $i++) {
1456
-                    $real_dir .= '/' . (isset($dir_array[$i]) ? $dir_array[$i] : '');
1456
+                    $real_dir .= '/'.(isset($dir_array[$i]) ? $dir_array[$i] : '');
1457 1457
                     $parent_id = self::get_document_id($course_info, $real_dir);
1458 1458
                     if ($session_id != 0 && empty($parent_id)) {
1459 1459
                         $parent_id = self::get_document_id($course_info, $real_dir, 0);
@@ -1527,21 +1527,21 @@  discard block
 block discarded – undo
1527 1527
         $user_id = intval($user_id);
1528 1528
         $document_id = intval($document_id);
1529 1529
 
1530
-        $sql = 'SELECT id FROM ' . $table_template . '
1530
+        $sql = 'SELECT id FROM '.$table_template.'
1531 1531
                 WHERE
1532
-                    course_code="' . $course_code . '" AND
1533
-                    user_id="' . $user_id . '" AND
1534
-                    ref_doc="' . $document_id . '"';
1532
+                    course_code="' . $course_code.'" AND
1533
+                    user_id="' . $user_id.'" AND
1534
+                    ref_doc="' . $document_id.'"';
1535 1535
         $result = Database::query($sql);
1536 1536
         $template_id = Database::result($result, 0, 0);
1537 1537
 
1538
-        my_delete(api_get_path(SYS_CODE_PATH) . 'upload/template_thumbnails/' . $template_id . '.jpg');
1538
+        my_delete(api_get_path(SYS_CODE_PATH).'upload/template_thumbnails/'.$template_id.'.jpg');
1539 1539
 
1540
-        $sql = 'DELETE FROM ' . $table_template . '
1540
+        $sql = 'DELETE FROM '.$table_template.'
1541 1541
                 WHERE
1542
-                    course_code="' . $course_code . '" AND
1543
-                    user_id="' . $user_id . '" AND
1544
-                    ref_doc="' . $document_id . '"';
1542
+                    course_code="' . $course_code.'" AND
1543
+                    user_id="' . $user_id.'" AND
1544
+                    ref_doc="' . $document_id.'"';
1545 1545
 
1546 1546
         Database::query($sql);
1547 1547
     }
@@ -1602,7 +1602,7 @@  discard block
 block discarded – undo
1602 1602
                 INNER JOIN $propTable ip
1603 1603
                 ON (d.id = ip.ref AND d.c_id  = $course_id AND ip.c_id = $course_id)
1604 1604
         		WHERE
1605
-        		    ip.tool = '" . TOOL_DOCUMENT . "' $condition AND
1605
+        		    ip.tool = '".TOOL_DOCUMENT."' $condition AND
1606 1606
         			filetype = '$file_type' AND
1607 1607
         			locate(concat(path,'/'), '$doc_path')=1
1608 1608
                 ";
@@ -1766,12 +1766,12 @@  discard block
 block discarded – undo
1766 1766
         if (empty($session_id)) {
1767 1767
             $sql_session = 'AND (session_id = 0 OR isnull(session_id)) ';
1768 1768
         } elseif ($session_id > 0) {
1769
-            $sql_session = 'AND session_id=' . intval($session_id);
1769
+            $sql_session = 'AND session_id='.intval($session_id);
1770 1770
         } else {
1771 1771
             $sql_session = '';
1772 1772
         }
1773
-        $sql = 'UPDATE ' . $tbl_category . ' SET document_id="' . intval($document_id) . '"
1774
-                WHERE course_code="' . Database::escape_string($course_id) . '" ' . $sql_session;
1773
+        $sql = 'UPDATE '.$tbl_category.' SET document_id="'.intval($document_id).'"
1774
+                WHERE course_code="' . Database::escape_string($course_id).'" '.$sql_session;
1775 1775
         Database::query($sql);
1776 1776
     }
1777 1777
 
@@ -1793,12 +1793,12 @@  discard block
 block discarded – undo
1793 1793
         if (empty($session_id)) {
1794 1794
             $sql_session = 'AND (session_id = 0 OR isnull(session_id)) ';
1795 1795
         } elseif ($session_id > 0) {
1796
-            $sql_session = 'AND session_id=' . intval($session_id);
1796
+            $sql_session = 'AND session_id='.intval($session_id);
1797 1797
         } else {
1798 1798
             $sql_session = '';
1799 1799
         }
1800
-        $sql = 'SELECT document_id FROM ' . $tbl_category . '
1801
-                WHERE course_code="' . Database::escape_string($course_id) . '" ' . $sql_session;
1800
+        $sql = 'SELECT document_id FROM '.$tbl_category.'
1801
+                WHERE course_code="' . Database::escape_string($course_id).'" '.$sql_session;
1802 1802
 
1803 1803
         $rs = Database::query($sql);
1804 1804
         $num = Database::num_rows($rs);
@@ -1839,7 +1839,7 @@  discard block
 block discarded – undo
1839 1839
             $all_user_info = array();
1840 1840
             if (Database::num_rows($rs)) {
1841 1841
                 $row = Database::fetch_array($rs);
1842
-                $filepath = api_get_path(SYS_COURSE_PATH) . $course_info['path'] . '/document' . $row['path'];
1842
+                $filepath = api_get_path(SYS_COURSE_PATH).$course_info['path'].'/document'.$row['path'];
1843 1843
                 if (is_file($filepath)) {
1844 1844
                     $my_content_html = file_get_contents($filepath);
1845 1845
                 }
@@ -1922,9 +1922,9 @@  discard block
 block discarded – undo
1922 1922
             $date_no_time = api_convert_and_format_date(api_get_utc_datetime(), DATE_FORMAT_LONG_NO_DAY);
1923 1923
         }
1924 1924
 
1925
-        $url = api_get_path(WEB_PATH) . 'certificates/index.php?id=' . $info_grade_certificate['id'];
1925
+        $url = api_get_path(WEB_PATH).'certificates/index.php?id='.$info_grade_certificate['id'];
1926 1926
 
1927
-        $externalStyleFile = api_get_path(SYS_CSS_PATH) . 'themes/' . api_get_visual_theme() . '/certificate.css';
1927
+        $externalStyleFile = api_get_path(SYS_CSS_PATH).'themes/'.api_get_visual_theme().'/certificate.css';
1928 1928
         $externalStyle = '';
1929 1929
 
1930 1930
         if (is_file($externalStyleFile)) {
@@ -1946,7 +1946,7 @@  discard block
 block discarded – undo
1946 1946
             $course_info['name'],
1947 1947
             $info_grade_certificate['grade'],
1948 1948
             $url,
1949
-            '<a href="' . $url . '" target="_blank">' . get_lang('CertificateOnlineLink') . '</a>',
1949
+            '<a href="'.$url.'" target="_blank">'.get_lang('CertificateOnlineLink').'</a>',
1950 1950
             '((certificate_barcode))',
1951 1951
             $externalStyle
1952 1952
         );
@@ -1972,7 +1972,7 @@  discard block
 block discarded – undo
1972 1972
         if (!empty($extraFields)) {
1973 1973
             foreach ($extraFields as $extraField) {
1974 1974
                 $valueExtra = isset($extra_user_info_data[$extraField['variable']]) ? $extra_user_info_data[$extraField['variable']] : '';
1975
-                $info_to_be_replaced_in_content_html[] = '((' . strtolower($extraField['variable']) . '))';
1975
+                $info_to_be_replaced_in_content_html[] = '(('.strtolower($extraField['variable']).'))';
1976 1976
                 $info_to_replace_in_content_html[] = $valueExtra;
1977 1977
             }
1978 1978
         }
@@ -2000,17 +2000,17 @@  discard block
 block discarded – undo
2000 2000
             $tbl_category = Database :: get_main_table(TABLE_MAIN_GRADEBOOK_CATEGORY);
2001 2001
             $session_id = api_get_session_id();
2002 2002
             if ($session_id == 0 || is_null($session_id)) {
2003
-                $sql_session = 'AND (session_id=' . intval($session_id) . ' OR isnull(session_id)) ';
2003
+                $sql_session = 'AND (session_id='.intval($session_id).' OR isnull(session_id)) ';
2004 2004
             } elseif ($session_id > 0) {
2005
-                $sql_session = 'AND session_id=' . intval($session_id);
2005
+                $sql_session = 'AND session_id='.intval($session_id);
2006 2006
             } else {
2007 2007
                 $sql_session = '';
2008 2008
             }
2009 2009
 
2010
-            $sql = 'UPDATE ' . $tbl_category . ' SET document_id=null
2010
+            $sql = 'UPDATE '.$tbl_category.' SET document_id=null
2011 2011
                     WHERE
2012
-                        course_code = "' . Database::escape_string($course_id) . '" AND
2013
-                        document_id="' . $default_certificate_id . '" ' . $sql_session;
2012
+                        course_code = "' . Database::escape_string($course_id).'" AND
2013
+                        document_id="' . $default_certificate_id.'" '.$sql_session;
2014 2014
             Database::query($sql);
2015 2015
         }
2016 2016
     }
@@ -2026,10 +2026,10 @@  discard block
 block discarded – undo
2026 2026
         if (!empty($courseInfo)) {
2027 2027
             $to_group_id = 0;
2028 2028
             $to_user_id = null;
2029
-            $course_dir = $courseInfo['path'] . "/document/";
2029
+            $course_dir = $courseInfo['path']."/document/";
2030 2030
             $sys_course_path = api_get_path(SYS_COURSE_PATH);
2031
-            $base_work_dir = $sys_course_path . $course_dir;
2032
-            $base_work_dir_test = $base_work_dir . 'certificates';
2031
+            $base_work_dir = $sys_course_path.$course_dir;
2032
+            $base_work_dir_test = $base_work_dir.'certificates';
2033 2033
             $dir_name = '/certificates';
2034 2034
             $post_dir_name = get_lang('CertificatesFiles');
2035 2035
             $visibility_command = 'invisible';
@@ -2256,9 +2256,9 @@  discard block
 block discarded – undo
2256 2256
                                             //$new_abs_path = realpath($dir.'/'.$second_part);
2257 2257
                                             $dir = '';
2258 2258
                                             if (!empty($abs_path)) {
2259
-                                                $dir = dirname($abs_path) . '/';
2259
+                                                $dir = dirname($abs_path).'/';
2260 2260
                                             }
2261
-                                            $new_abs_path = realpath($dir . $second_part);
2261
+                                            $new_abs_path = realpath($dir.$second_part);
2262 2262
                                             $in_files_list[] = self::get_resources_from_source_html($new_abs_path, true, TOOL_DOCUMENT, $recursivity + 1);
2263 2263
                                             if (count($in_files_list) > 0) {
2264 2264
                                                 $files_list = array_merge($files_list, $in_files_list);
@@ -2271,9 +2271,9 @@  discard block
 block discarded – undo
2271 2271
                                             $files_list[] = array($second_part, 'local', 'rel');
2272 2272
                                             $dir = '';
2273 2273
                                             if (!empty($abs_path)) {
2274
-                                                $dir = dirname($abs_path) . '/';
2274
+                                                $dir = dirname($abs_path).'/';
2275 2275
                                             }
2276
-                                            $new_abs_path = realpath($dir . $second_part);
2276
+                                            $new_abs_path = realpath($dir.$second_part);
2277 2277
                                             $in_files_list[] = self::get_resources_from_source_html($new_abs_path, true, TOOL_DOCUMENT, $recursivity + 1);
2278 2278
                                             if (count($in_files_list) > 0) {
2279 2279
                                                 $files_list = array_merge($files_list, $in_files_list);
@@ -2307,9 +2307,9 @@  discard block
 block discarded – undo
2307 2307
                                             $files_list[] = array($source, 'local', 'rel');
2308 2308
                                             $dir = '';
2309 2309
                                             if (!empty($abs_path)) {
2310
-                                                $dir = dirname($abs_path) . '/';
2310
+                                                $dir = dirname($abs_path).'/';
2311 2311
                                             }
2312
-                                            $new_abs_path = realpath($dir . $source);
2312
+                                            $new_abs_path = realpath($dir.$source);
2313 2313
                                             $in_files_list[] = self::get_resources_from_source_html($new_abs_path, true, TOOL_DOCUMENT, $recursivity + 1);
2314 2314
                                             if (count($in_files_list) > 0) {
2315 2315
                                                 $files_list = array_merge($files_list, $in_files_list);
@@ -2322,9 +2322,9 @@  discard block
 block discarded – undo
2322 2322
                                             $files_list[] = array($source, 'local', 'rel');
2323 2323
                                             $dir = '';
2324 2324
                                             if (!empty($abs_path)) {
2325
-                                                $dir = dirname($abs_path) . '/';
2325
+                                                $dir = dirname($abs_path).'/';
2326 2326
                                             }
2327
-                                            $new_abs_path = realpath($dir . $source);
2327
+                                            $new_abs_path = realpath($dir.$source);
2328 2328
                                             $in_files_list[] = self::get_resources_from_source_html($new_abs_path, true, TOOL_DOCUMENT, $recursivity + 1);
2329 2329
                                             if (count($in_files_list) > 0) {
2330 2330
                                                 $files_list = array_merge($files_list, $in_files_list);
@@ -2358,9 +2358,9 @@  discard block
 block discarded – undo
2358 2358
                                     $files_list[] = array($source, 'local', 'rel');
2359 2359
                                     $dir = '';
2360 2360
                                     if (!empty($abs_path)) {
2361
-                                        $dir = dirname($abs_path) . '/';
2361
+                                        $dir = dirname($abs_path).'/';
2362 2362
                                     }
2363
-                                    $new_abs_path = realpath($dir . $source);
2363
+                                    $new_abs_path = realpath($dir.$source);
2364 2364
                                     $in_files_list[] = self::get_resources_from_source_html($new_abs_path, true, TOOL_DOCUMENT, $recursivity + 1);
2365 2365
                                     if (count($in_files_list) > 0) {
2366 2366
                                         $files_list = array_merge($files_list, $in_files_list);
@@ -2373,9 +2373,9 @@  discard block
 block discarded – undo
2373 2373
                                     $files_list[] = array($source, 'local', 'rel');
2374 2374
                                     $dir = '';
2375 2375
                                     if (!empty($abs_path)) {
2376
-                                        $dir = dirname($abs_path) . '/';
2376
+                                        $dir = dirname($abs_path).'/';
2377 2377
                                     }
2378
-                                    $new_abs_path = realpath($dir . $source);
2378
+                                    $new_abs_path = realpath($dir.$source);
2379 2379
                                     $in_files_list[] = self::get_resources_from_source_html($new_abs_path, true, TOOL_DOCUMENT, $recursivity + 1);
2380 2380
                                     if (count($in_files_list) > 0) {
2381 2381
                                         $files_list = array_merge($files_list, $in_files_list);
@@ -2434,24 +2434,24 @@  discard block
 block discarded – undo
2434 2434
             // then possible closing brackets if we were in the opening bracket case
2435 2435
             // OR something like @import()
2436 2436
             $res = preg_match_all(
2437
-                '/(((([A-Za-z_:])([A-Za-z0-9_:\.-]*))' .
2437
+                '/(((([A-Za-z_:])([A-Za-z0-9_:\.-]*))'.
2438 2438
                 // '/(((([A-Za-z_:])([A-Za-z0-9_:\.-]|[^\x00-\x7F])*)' . -> seems to be taking too much
2439 2439
                 // '/(((([A-Za-z_:])([^\x00-\x7F])*)' . -> takes only last letter of parameter name
2440
-                '([ \n\t\r]+)?(' .
2440
+                '([ \n\t\r]+)?('.
2441 2441
                 // '(=([ \n\t\r]+)?("[^"]+"|\'[^\']+\'|[^ \n\t\r]+))' . -> doesn't restrict close enough to the url itself
2442
-                '(=([ \n\t\r]+)?("[^"\)]+"|\'[^\'\)]+\'|[^ \n\t\r\)]+))' .
2443
-                '|' .
2442
+                '(=([ \n\t\r]+)?("[^"\)]+"|\'[^\'\)]+\'|[^ \n\t\r\)]+))'.
2443
+                '|'.
2444 2444
                 // '(\(([ \n\t\r]+)?("[^"]+"|\'[^\']+\'|[^ \n\t\r]+)\))' . -> doesn't restrict close enough to the url itself
2445
-                '(\(([ \n\t\r]+)?("[^"\)]+"|\'[^\'\)]+\'|[^ \n\t\r\)]+)\))' .
2446
-                '))' .
2447
-                '|' .
2445
+                '(\(([ \n\t\r]+)?("[^"\)]+"|\'[^\'\)]+\'|[^ \n\t\r\)]+)\))'.
2446
+                '))'.
2447
+                '|'.
2448 2448
                 // '(@import([ \n\t\r]+)?("[^"]+"|\'[^\']+\'|[^ \n\t\r]+)))?/', -> takes a lot (like 100's of thousands of empty possibilities)
2449 2449
                 '(@import([ \n\t\r]+)?("[^"]+"|\'[^\']+\'|[^ \n\t\r]+)))/',
2450 2450
                 $attrString,
2451 2451
                 $regs
2452 2452
             );
2453 2453
         } catch (Exception $e) {
2454
-            error_log('Caught exception: ' . $e->getMessage(), 0);
2454
+            error_log('Caught exception: '.$e->getMessage(), 0);
2455 2455
         }
2456 2456
         if ($res) {
2457 2457
             for ($i = 0; $i < count($regs[1]); $i++) {
@@ -2529,14 +2529,14 @@  discard block
 block discarded – undo
2529 2529
                 $orig_course_info_path = $origin_course_info_path;
2530 2530
             }
2531 2531
         } else {
2532
-            $orig_course_path = api_get_path(SYS_COURSE_PATH).$orig_course_info['path'] . '/';
2532
+            $orig_course_path = api_get_path(SYS_COURSE_PATH).$orig_course_info['path'].'/';
2533 2533
             $orig_course_info_path = $orig_course_info['path'];
2534 2534
         }
2535 2535
 
2536 2536
         $destination_course_code = CourseManager::get_course_id_from_path($destination_course_directory);
2537 2537
         $destination_course_info = api_get_course_info($destination_course_code);
2538
-        $dest_course_path = api_get_path(SYS_COURSE_PATH) . $destination_course_directory . '/';
2539
-        $dest_course_path_rel = api_get_path(REL_COURSE_PATH) . $destination_course_directory . '/';
2538
+        $dest_course_path = api_get_path(SYS_COURSE_PATH).$destination_course_directory.'/';
2539
+        $dest_course_path_rel = api_get_path(REL_COURSE_PATH).$destination_course_directory.'/';
2540 2540
 
2541 2541
         $user_id = api_get_user_id();
2542 2542
 
@@ -2545,7 +2545,7 @@  discard block
 block discarded – undo
2545 2545
 
2546 2546
                 // Get information about source url
2547 2547
                 $real_orig_url = $source[0]; // url
2548
-                $scope_url = $source[1];   // scope (local, remote)
2548
+                $scope_url = $source[1]; // scope (local, remote)
2549 2549
                 $type_url = $source[2]; // type (rel, abs, url)
2550 2550
 
2551 2551
                 // Get path and query from origin url
@@ -2557,7 +2557,7 @@  discard block
 block discarded – undo
2557 2557
                 $dest_url_query = '';
2558 2558
 
2559 2559
                 if (!empty($real_orig_query)) {
2560
-                    $dest_url_query = '?' . $real_orig_query;
2560
+                    $dest_url_query = '?'.$real_orig_query;
2561 2561
                     if (strpos($dest_url_query, $origin_course_code) !== false) {
2562 2562
                         $dest_url_query = str_replace($origin_course_code, $destination_course_code, $dest_url_query);
2563 2563
                     }
@@ -2638,7 +2638,7 @@  discard block
 block discarded – undo
2638 2638
 
2639 2639
                                 //$destination_url = $url_course_path . $destination_course_directory . '/' . $document_file . $dest_url_query;
2640 2640
                                 // See BT#7780
2641
-                                $destination_url = $dest_course_path_rel . $document_file . $dest_url_query;
2641
+                                $destination_url = $dest_course_path_rel.$document_file.$dest_url_query;
2642 2642
 
2643 2643
                                 // If the course code doesn't exist in the path? what we do? Nothing! see BT#1985
2644 2644
                                 if (strpos($real_orig_path, $origin_course_code) === false) {
@@ -2673,14 +2673,14 @@  discard block
 block discarded – undo
2673 2673
     public function replace_urls_inside_content_html_when_moving_file($file_name, $original_path, $destiny_path)
2674 2674
     {
2675 2675
         if (substr($original_path, strlen($original_path) - 1, strlen($original_path)) == '/') {
2676
-            $original = $original_path . $file_name;
2676
+            $original = $original_path.$file_name;
2677 2677
         } else {
2678
-            $original = $original_path . '/' . $file_name;
2678
+            $original = $original_path.'/'.$file_name;
2679 2679
         }
2680 2680
         if (substr($destiny_path, strlen($destiny_path) - 1, strlen($destiny_path)) == '/') {
2681
-            $destination = $destiny_path . $file_name;
2681
+            $destination = $destiny_path.$file_name;
2682 2682
         } else {
2683
-            $destination = $destiny_path . '/' . $file_name;
2683
+            $destination = $destiny_path.'/'.$file_name;
2684 2684
         }
2685 2685
         $original_count = count(explode('/', $original));
2686 2686
         $destination_count = count(explode('/', $destination));
@@ -2694,8 +2694,8 @@  discard block
 block discarded – undo
2694 2694
             $mode = 'inside';
2695 2695
         }
2696 2696
         //We do not select the $original_path becayse the file was already moved
2697
-        $content_html = file_get_contents($destiny_path . '/' . $file_name);
2698
-        $destination_file = $destiny_path . '/' . $file_name;
2697
+        $content_html = file_get_contents($destiny_path.'/'.$file_name);
2698
+        $destination_file = $destiny_path.'/'.$file_name;
2699 2699
 
2700 2700
         $pre_original = strstr($original_path, 'document');
2701 2701
         $pre_destin = strstr($destiny_path, 'document');
@@ -2717,11 +2717,11 @@  discard block
 block discarded – undo
2717 2717
         }
2718 2718
 
2719 2719
         if ($pre_original != '') {
2720
-            $pre_original = '..' . $pre_original . '/';
2720
+            $pre_original = '..'.$pre_original.'/';
2721 2721
         }
2722 2722
 
2723 2723
         if ($pre_destin != '') {
2724
-            $pre_destin = '..' . $pre_destin . '/';
2724
+            $pre_destin = '..'.$pre_destin.'/';
2725 2725
         }
2726 2726
 
2727 2727
         $levels = explode('/', $pre_original);
@@ -2739,7 +2739,7 @@  discard block
 block discarded – undo
2739 2739
         //echo '$count_pre_destination_levels '. $count_pre_destination_levels;
2740 2740
         $pre_remove = '';
2741 2741
         for ($i = 1; $i <= $count_pre_destination_levels; $i++) {
2742
-            $pre_remove .='..\/';
2742
+            $pre_remove .= '..\/';
2743 2743
         }
2744 2744
 
2745 2745
         $orig_source_html = DocumentManager::get_resources_from_source_html($content_html);
@@ -2747,9 +2747,9 @@  discard block
 block discarded – undo
2747 2747
         foreach ($orig_source_html as $source) {
2748 2748
 
2749 2749
             // get information about source url
2750
-            $real_orig_url = $source[0];   // url
2751
-            $scope_url = $source[1];   // scope (local, remote)
2752
-            $type_url = $source[2];   // tyle (rel, abs, url)
2750
+            $real_orig_url = $source[0]; // url
2751
+            $scope_url = $source[1]; // scope (local, remote)
2752
+            $type_url = $source[2]; // tyle (rel, abs, url)
2753 2753
             // Get path and query from origin url
2754 2754
             $orig_parse_url = parse_url($real_orig_url);
2755 2755
             $real_orig_path = $orig_parse_url['path'];
@@ -2776,11 +2776,11 @@  discard block
 block discarded – undo
2776 2776
                         $real_orig_url_temp = '';
2777 2777
                         if ($mode == 'inside') {
2778 2778
                             $real_orig_url_temp = str_replace('../', '', $real_orig_url);
2779
-                            $destination_url = $link_to_add . $real_orig_url_temp;
2779
+                            $destination_url = $link_to_add.$real_orig_url_temp;
2780 2780
                         } else {
2781 2781
                             $real_orig_url_temp = $real_orig_url;
2782 2782
 
2783
-                            $destination_url = preg_replace("/" . $pre_remove . "/", '', $real_orig_url, 1);
2783
+                            $destination_url = preg_replace("/".$pre_remove."/", '', $real_orig_url, 1);
2784 2784
                         }
2785 2785
                         if ($real_orig_url == $destination_url) {
2786 2786
                             //echo 'continue2';
@@ -2806,7 +2806,7 @@  discard block
 block discarded – undo
2806 2806
     {
2807 2807
         $course_data = api_get_course_info($course_code);
2808 2808
         $document_data = self::get_document_data_by_id($document_id, $course_code);
2809
-        $file_path = api_get_path(SYS_COURSE_PATH) . $course_data['path'] . '/document' . $document_data['path'];
2809
+        $file_path = api_get_path(SYS_COURSE_PATH).$course_data['path'].'/document'.$document_data['path'];
2810 2810
         $pdf = new PDF('A4-L', 'L');
2811 2811
         $pdf->html_to_pdf($file_path, $document_data['title'], $course_code);
2812 2812
     }
@@ -2841,9 +2841,9 @@  discard block
 block discarded – undo
2841 2841
     ) {
2842 2842
         $course_info = api_get_course_info();
2843 2843
         $sessionId = api_get_session_id();
2844
-        $course_dir = $course_info['path'] . '/document';
2844
+        $course_dir = $course_info['path'].'/document';
2845 2845
         $sys_course_path = api_get_path(SYS_COURSE_PATH);
2846
-        $base_work_dir = $sys_course_path . $course_dir;
2846
+        $base_work_dir = $sys_course_path.$course_dir;
2847 2847
 
2848 2848
         $group_properties = GroupManager::get_group_properties(api_get_group_id());
2849 2849
         $groupIid = isset($group_properties['iid']) ? $group_properties['iid'] : 0;
@@ -3031,7 +3031,7 @@  discard block
 block discarded – undo
3031 3031
         }
3032 3032
         if (isset($output)) {
3033 3033
             foreach ($output as & $line) {
3034
-                $content .= $line . "\n";
3034
+                $content .= $line."\n";
3035 3035
             }
3036 3036
             return $content;
3037 3037
         } else {
@@ -3063,13 +3063,13 @@  discard block
 block discarded – undo
3063 3063
         $group_condition = null;
3064 3064
         if (isset($group_id)) {
3065 3065
             $group_id = intval($group_id);
3066
-            $group_condition = " AND props.to_group_id='" . $group_id . "' ";
3066
+            $group_condition = " AND props.to_group_id='".$group_id."' ";
3067 3067
         }
3068 3068
 
3069 3069
         $session_condition = null;
3070 3070
         if (isset($session_id)) {
3071 3071
             $session_id = intval($session_id);
3072
-            $session_condition = " AND props.session_id='" . $session_id . "' ";
3072
+            $session_condition = " AND props.session_id='".$session_id."' ";
3073 3073
         }
3074 3074
 
3075 3075
         $sql = "SELECT SUM(size)
@@ -3079,7 +3079,7 @@  discard block
 block discarded – undo
3079 3079
                 WHERE
3080 3080
                     props.c_id 	= $course_id AND
3081 3081
                     docs.c_id 	= $course_id AND
3082
-                    props.tool 	= '" . TOOL_DOCUMENT . "' AND
3082
+                    props.tool 	= '".TOOL_DOCUMENT."' AND
3083 3083
                     props.visibility <> 2
3084 3084
                     $group_condition
3085 3085
                     $session_condition
@@ -3102,8 +3102,8 @@  discard block
 block discarded – undo
3102 3102
         $course_quota_m = round($course_quota / 1048576);
3103 3103
         $already_consumed_space_m = round($already_consumed_space / 1048576);
3104 3104
 
3105
-        $message = get_lang('MaximumAllowedQuota') . ' <strong>' . $course_quota_m . ' megabyte</strong>.<br />';
3106
-        $message .= get_lang('CourseCurrentlyUses') . ' <strong>' . $already_consumed_space_m . ' megabyte</strong>.<br />';
3105
+        $message = get_lang('MaximumAllowedQuota').' <strong>'.$course_quota_m.' megabyte</strong>.<br />';
3106
+        $message .= get_lang('CourseCurrentlyUses').' <strong>'.$already_consumed_space_m.' megabyte</strong>.<br />';
3107 3107
 
3108 3108
         $percentage = round(($already_consumed_space / $course_quota * 100), 1);
3109 3109
 
@@ -3111,33 +3111,33 @@  discard block
 block discarded – undo
3111 3111
 
3112 3112
         // Decide where to place percentage in graph
3113 3113
         if ($percentage >= 50) {
3114
-            $text_in_filled = '&nbsp;' . $other_percentage . '%';
3114
+            $text_in_filled = '&nbsp;'.$other_percentage.'%';
3115 3115
             $text_in_unfilled = '';
3116 3116
         } else {
3117
-            $text_in_unfilled = '&nbsp;' . $other_percentage . '%';
3117
+            $text_in_unfilled = '&nbsp;'.$other_percentage.'%';
3118 3118
             $text_in_filled = '';
3119 3119
         }
3120 3120
 
3121 3121
         // Decide the background colour of the graph
3122 3122
         if ($percentage < 65) {
3123
-            $colour = '#00BB00';        // Safe - green
3123
+            $colour = '#00BB00'; // Safe - green
3124 3124
         } elseif ($percentage < 90) {
3125
-            $colour = '#ffd400';        // Filling up - yelloworange
3125
+            $colour = '#ffd400'; // Filling up - yelloworange
3126 3126
         } else {
3127
-            $colour = '#DD0000';        // Full - red
3127
+            $colour = '#DD0000'; // Full - red
3128 3128
         }
3129 3129
 
3130 3130
         // This is used for the table width: a table of only 100 pixels looks too small
3131 3131
         $visual_percentage = 4 * $percentage;
3132 3132
         $visual_other_percentage = 4 * $other_percentage;
3133 3133
 
3134
-        $message .= get_lang('PercentageQuotaInUse') . ': <strong>' . $percentage . '%</strong>.<br />' .
3135
-            get_lang('PercentageQuotaFree') . ': <strong>' . $other_percentage . '%</strong>.<br />';
3134
+        $message .= get_lang('PercentageQuotaInUse').': <strong>'.$percentage.'%</strong>.<br />'.
3135
+            get_lang('PercentageQuotaFree').': <strong>'.$other_percentage.'%</strong>.<br />';
3136 3136
 
3137
-        $show_percentage = '&nbsp;' . $percentage . '%';
3138
-        $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">' .
3139
-            '<div style="width:' . $percentage . '%; background-color: #bbb; border-right:3px groove #bbb; -moz-border-radius:5px;">&nbsp;</div>' .
3140
-            '<span style="margin-top: -15px; margin-left:-15px; position: absolute;font-weight:bold;">' . $show_percentage . '</span></div>';
3137
+        $show_percentage = '&nbsp;'.$percentage.'%';
3138
+        $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">'.
3139
+            '<div style="width:'.$percentage.'%; background-color: #bbb; border-right:3px groove #bbb; -moz-border-radius:5px;">&nbsp;</div>'.
3140
+            '<span style="margin-top: -15px; margin-left:-15px; position: absolute;font-weight:bold;">'.$show_percentage.'</span></div>';
3141 3141
         echo $message;
3142 3142
     }
3143 3143
 
@@ -3153,7 +3153,7 @@  discard block
 block discarded – undo
3153 3153
         $percentage = $already_consumed_space / $course_quota * 100;
3154 3154
         $percentage = round($percentage, 1);
3155 3155
         $message = get_lang('YouAreCurrentlyUsingXOfYourX');
3156
-        $message = sprintf($message, $already_consumed_space_m, $percentage . '%', $course_quota_m . ' ');
3156
+        $message = sprintf($message, $already_consumed_space_m, $percentage.'%', $course_quota_m.' ');
3157 3157
         echo Display::div($message, array('id' => 'document_quota'));
3158 3158
     }
3159 3159
 
@@ -3185,13 +3185,13 @@  discard block
 block discarded – undo
3185 3185
      */
3186 3186
     public static function generate_jplayer_jquery($params = array())
3187 3187
     {
3188
-        $js_path = api_get_path(WEB_LIBRARY_PATH) . 'javascript/';
3188
+        $js_path = api_get_path(WEB_LIBRARY_PATH).'javascript/';
3189 3189
 
3190 3190
         $js = '
3191
-            $("#jquery_jplayer_' . $params['count'] . '").jPlayer({
3191
+            $("#jquery_jplayer_' . $params['count'].'").jPlayer({
3192 3192
                 ready: function() {
3193 3193
                     $(this).jPlayer("setMedia", {
3194
-                        ' . $params['extension'] . ' : "' . $params['url'] . '"
3194
+                        ' . $params['extension'].' : "'.$params['url'].'"
3195 3195
                     });
3196 3196
                 },
3197 3197
                 play: function() { // To avoid both jPlayers playing together.
@@ -3199,12 +3199,12 @@  discard block
 block discarded – undo
3199 3199
                 },
3200 3200
                 //errorAlerts: true,
3201 3201
                 //warningAlerts: true,
3202
-                swfPath: "' . $js_path . 'jquery-jplayer/jplayer/",
3202
+                swfPath: "' . $js_path.'jquery-jplayer/jplayer/",
3203 3203
                 //supplied: "m4a, oga, mp3, ogg, wav",
3204
-                supplied: "' . $params['extension'] . '",
3204
+                supplied: "' . $params['extension'].'",
3205 3205
                 wmode: "window",
3206 3206
                 solution: "flash, html",  // Do not change this setting
3207
-                cssSelectorAncestor: "#jp_container_' . $params['count'] . '",
3207
+                cssSelectorAncestor: "#jp_container_' . $params['count'].'",
3208 3208
             });  	 ' . "\n\n";
3209 3209
 
3210 3210
         return $js;
@@ -3234,16 +3234,16 @@  discard block
 block discarded – undo
3234 3234
         }
3235 3235
 
3236 3236
         //Shows only the play button
3237
-        $html = '<div id="jquery_jplayer_' . $i . '" class="jp-jplayer"></div>
3238
-                <div id="jp_container_' . $i . '" class="jp-audio">
3237
+        $html = '<div id="jquery_jplayer_'.$i.'" class="jp-jplayer"></div>
3238
+                <div id="jp_container_' . $i.'" class="jp-audio">
3239 3239
                     <div class="jp-type-single">
3240 3240
                         <div class="jp-gui jp-interface">
3241 3241
                             <ul class="jp-controls">
3242 3242
                                 <li><a href="javascript:;" class="jp-play" tabindex="1">play</a></li>
3243 3243
                                 <li><a href="javascript:;" class="jp-pause" tabindex="1">pause</a></li>
3244
-                                ' . $extra_controls . '
3244
+                                ' . $extra_controls.'
3245 3245
                             </ul>
3246
-                            ' . $progress . '
3246
+                            ' . $progress.'
3247 3247
                         </div>
3248 3248
                     </div>
3249 3249
                 </div>';
@@ -3296,8 +3296,8 @@  discard block
 block discarded – undo
3296 3296
                     </div>
3297 3297
                 </div>
3298 3298
                 <div class="jp-no-solution">
3299
-                    <span>' . get_lang('UpdateRequire') . '</span>
3300
-                    ' . get_lang("ToPlayTheMediaYouWillNeedToUpdateYourBrowserToARecentVersionYouCanAlsoDownloadTheFile") . '
3299
+                    <span>' . get_lang('UpdateRequire').'</span>
3300
+                    ' . get_lang("ToPlayTheMediaYouWillNeedToUpdateYourBrowserToARecentVersionYouCanAlsoDownloadTheFile").'
3301 3301
                 </div>
3302 3302
             </div>
3303 3303
         </div>';
@@ -3378,7 +3378,7 @@  discard block
 block discarded – undo
3378 3378
 
3379 3379
         $add_folder_filter = null;
3380 3380
         if (!empty($filter_by_folder)) {
3381
-            $add_folder_filter = " AND docs.path LIKE '" . Database::escape_string($filter_by_folder) . "%'";
3381
+            $add_folder_filter = " AND docs.path LIKE '".Database::escape_string($filter_by_folder)."%'";
3382 3382
         }
3383 3383
 
3384 3384
         // If we are in LP display hidden folder https://support.chamilo.org/issues/6679
@@ -3413,7 +3413,7 @@  discard block
 block discarded – undo
3413 3413
 
3414 3414
                 $notLikeCondition = null;
3415 3415
                 for ($i = 1; $i <= $num; $i++) {
3416
-                    $repeat = str_repeat('/%', $i+1);
3416
+                    $repeat = str_repeat('/%', $i + 1);
3417 3417
                     $notLikeCondition .= " AND docs.path NOT LIKE '".Database::escape_string($cleanedPath.$repeat)."' ";
3418 3418
                 }
3419 3419
 
@@ -3438,7 +3438,7 @@  discard block
 block discarded – undo
3438 3438
                 ON (docs.id = last.ref AND docs.c_id = last.c_id)
3439 3439
                 WHERE
3440 3440
                     docs.path NOT LIKE '%_DELETED_%' AND
3441
-                    last.tool = '" . TOOL_DOCUMENT . "' $condition_session AND
3441
+                    last.tool = '".TOOL_DOCUMENT."' $condition_session AND
3442 3442
                     (last.visibility = '1' $lp_visibility_condition) AND
3443 3443
                     last.visibility <> 2 AND
3444 3444
                     docs.c_id = {$course_info['real_id']} AND
@@ -3468,7 +3468,7 @@  discard block
 block discarded – undo
3468 3468
                 Display::url(
3469 3469
                     Display::return_icon('close.png', get_lang('Close'), array(), ICON_SIZE_SMALL),
3470 3470
                     ' javascript:void(0);',
3471
-                    array('id' => 'close_div_' . $course_info['real_id'] . '_' . $session_id, 'class' => 'close_div')
3471
+                    array('id' => 'close_div_'.$course_info['real_id'].'_'.$session_id, 'class' => 'close_div')
3472 3472
                 ),
3473 3473
                 array('style' => 'position:absolute;right:10px')
3474 3474
             );
@@ -3572,7 +3572,7 @@  discard block
 block discarded – undo
3572 3572
                     $('#'+tempId).hide();
3573 3573
                 } else {
3574 3574
                     image.addClass('open');
3575
-                    image.attr('src', '" . Display::returnIconPath('nolines_minus.gif') . "');
3575
+                    image.attr('src', '" . Display::returnIconPath('nolines_minus.gif')."');
3576 3576
                     $('#'+id).hide();
3577 3577
                     $('#'+tempId).show();
3578 3578
 
@@ -3619,7 +3619,7 @@  discard block
 block discarded – undo
3619 3619
         $target,
3620 3620
         $overwrite_url
3621 3621
     ) {
3622
-        $img_sys_path = api_get_path(SYS_CODE_PATH) . 'img/';
3622
+        $img_sys_path = api_get_path(SYS_CODE_PATH).'img/';
3623 3623
         $web_code_path = api_get_path(WEB_CODE_PATH);
3624 3624
 
3625 3625
         $documentId = $resource['id'];
@@ -3634,7 +3634,7 @@  discard block
 block discarded – undo
3634 3634
         // It's a file.
3635 3635
         $icon = choose_image($path);
3636 3636
         $position = strrpos($icon, '.');
3637
-        $icon = substr($icon, 0, $position) . '_small.gif';
3637
+        $icon = substr($icon, 0, $position).'_small.gif';
3638 3638
         $my_file_title = $resource['title'];
3639 3639
         $visibility = $resource['visibility'];
3640 3640
 
@@ -3646,29 +3646,29 @@  discard block
 block discarded – undo
3646 3646
         // Show the "image name" not the filename of the image.
3647 3647
         if ($lp_id) {
3648 3648
             // LP URL
3649
-            $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;
3649
+            $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;
3650 3650
             if (!empty($overwrite_url)) {
3651
-                $url = $overwrite_url . '&cidReq=' . $course_info['code'] . '&id_session=' . $session_id . '&document_id=' . $documentId.'';
3651
+                $url = $overwrite_url.'&cidReq='.$course_info['code'].'&id_session='.$session_id.'&document_id='.$documentId.'';
3652 3652
             }
3653 3653
         } else {
3654 3654
             // Direct document URL
3655
-            $url = $web_code_path . 'document/document.php?cidReq=' . $course_info['code'] . '&id_session=' . $session_id . '&id=' . $documentId;
3655
+            $url = $web_code_path.'document/document.php?cidReq='.$course_info['code'].'&id_session='.$session_id.'&id='.$documentId;
3656 3656
             if (!empty($overwrite_url)) {
3657
-                $url = $overwrite_url . '&cidReq=' . $course_info['code'] . '&id_session=' . $session_id . '&document_id=' . $documentId;
3657
+                $url = $overwrite_url.'&cidReq='.$course_info['code'].'&id_session='.$session_id.'&document_id='.$documentId;
3658 3658
             }
3659 3659
         }
3660 3660
 
3661 3661
         $img = Display::returnIconPath($icon);
3662
-        if (!file_exists($img_sys_path . $icon)) {
3662
+        if (!file_exists($img_sys_path.$icon)) {
3663 3663
             $img = Display::returnIconPath('default_small.gif');
3664 3664
         }
3665 3665
 
3666 3666
         $link = Display::url(
3667
-            '<img alt="" src="' . $img . '" title="" />&nbsp;' . $my_file_title, $url,
3667
+            '<img alt="" src="'.$img.'" title="" />&nbsp;'.$my_file_title, $url,
3668 3668
             array('target' => $target, 'class' => 'moved')
3669 3669
         );
3670 3670
 
3671
-        $directUrl = $web_code_path . 'document/document.php?cidReq=' . $course_info['code'] . '&id_session=' . $session_id . '&id=' . $documentId;
3671
+        $directUrl = $web_code_path.'document/document.php?cidReq='.$course_info['code'].'&id_session='.$session_id.'&id='.$documentId;
3672 3672
 
3673 3673
         $link .= Display::url(
3674 3674
             Display::return_icon('preview_view.png', get_lang('Preview')),
@@ -3683,12 +3683,12 @@  discard block
 block discarded – undo
3683 3683
         $return = null;
3684 3684
 
3685 3685
         if ($lp_id == false) {
3686
-            $return .= '<li class="doc_resource '.$visibilityClass.' " data_id="' . $documentId . '" data_type="document" title="' . $my_file_title . '" >';
3686
+            $return .= '<li class="doc_resource '.$visibilityClass.' " data_id="'.$documentId.'" data_type="document" title="'.$my_file_title.'" >';
3687 3687
         } else {
3688
-            $return .= '<li class="doc_resource lp_resource_element '.$visibilityClass.' " data_id="' . $documentId . '" data_type="document" title="' . $my_file_title . '" >';
3688
+            $return .= '<li class="doc_resource lp_resource_element '.$visibilityClass.' " data_id="'.$documentId.'" data_type="document" title="'.$my_file_title.'" >';
3689 3689
         }
3690 3690
 
3691
-        $return .= '<div class="item_data" style="margin-left:' . ($num  * 5 ) . 'px;margin-right:5px;">';
3691
+        $return .= '<div class="item_data" style="margin-left:'.($num * 5).'px;margin-right:5px;">';
3692 3692
 
3693 3693
         if ($add_move_button) {
3694 3694
             $return .= '<a class="moved" href="#">';
@@ -3753,7 +3753,7 @@  discard block
 block discarded – undo
3753 3753
             if (isset($resource['visible']) && $resource['visible'] == 0) {
3754 3754
                 $folder_class_hidden = "doc_folder_hidden"; // in base.css
3755 3755
             }
3756
-            $onclick = 'onclick="javascript: testResources(\'res_' . $resource['id'] . '\',\'img_' . $resource['id'] . '\')"';
3756
+            $onclick = 'onclick="javascript: testResources(\'res_'.$resource['id'].'\',\'img_'.$resource['id'].'\')"';
3757 3757
         }
3758 3758
         $return = null;
3759 3759
 
@@ -3761,22 +3761,22 @@  discard block
 block discarded – undo
3761 3761
             $return = '<ul class="lp_resource">';
3762 3762
         }
3763 3763
 
3764
-        $return .= '<li class="doc_folder '.$folder_class_hidden.'" id="doc_id_' . $resource['id'] . '"  style="margin-left:' . ($num * 18) . 'px; ">';
3764
+        $return .= '<li class="doc_folder '.$folder_class_hidden.'" id="doc_id_'.$resource['id'].'"  style="margin-left:'.($num * 18).'px; ">';
3765 3765
 
3766 3766
         $image = Display::returnIconPath('nolines_plus.gif');
3767 3767
         if (empty($path)) {
3768 3768
             $image = Display::returnIconPath('nolines_minus.gif');
3769 3769
         }
3770
-        $return .= '<img style="cursor: pointer;" src="'.$image.'" align="absmiddle" id="img_'.$resource['id'] . '" '.$onclick.'>';
3770
+        $return .= '<img style="cursor: pointer;" src="'.$image.'" align="absmiddle" id="img_'.$resource['id'].'" '.$onclick.'>';
3771 3771
         $return .= Display::return_icon('lp_folder.gif').'&nbsp;';
3772 3772
         $return .= '<span '.$onclick.' style="cursor: pointer;" >'.$title.'</span>';
3773 3773
         $return .= '</li>';
3774 3774
 
3775 3775
         if (empty($path)) {
3776 3776
             if ($folderId == false) {
3777
-                $return .= '<div id="res_' . $resource['id'] . '" >';
3777
+                $return .= '<div id="res_'.$resource['id'].'" >';
3778 3778
             } else {
3779
-                $return .= '<div id="res_' . $resource['id'] . '" style="display: none;" >';
3779
+                $return .= '<div id="res_'.$resource['id'].'" style="display: none;" >';
3780 3780
             }
3781 3781
         }
3782 3782
 
@@ -3938,9 +3938,9 @@  discard block
 block discarded – undo
3938 3938
             $session_id = api_get_session_id();
3939 3939
         }
3940 3940
         $course_info = api_get_course_info($course_code);
3941
-        $course_dir = $course_info['path'] . '/document';
3941
+        $course_dir = $course_info['path'].'/document';
3942 3942
         $sys_course_path = api_get_path(SYS_COURSE_PATH);
3943
-        $base_work_dir = $sys_course_path . $course_dir;
3943
+        $base_work_dir = $sys_course_path.$course_dir;
3944 3944
 
3945 3945
         $course_id = $course_info['real_id'];
3946 3946
         $table_document = Database::get_course_table(TABLE_DOCUMENT);
@@ -3949,7 +3949,7 @@  discard block
 block discarded – undo
3949 3949
         $result = Database::query($qry);
3950 3950
         if (Database::num_rows($result) == 1) {
3951 3951
             $row = Database::fetch_array($result);
3952
-            $doc_path = api_get_path(SYS_COURSE_PATH) . $course_dir . $row['path'];
3952
+            $doc_path = api_get_path(SYS_COURSE_PATH).$course_dir.$row['path'];
3953 3953
             //TODO: mime_content_type is deprecated, fileinfo php extension is enabled by default as of PHP 5.3.0
3954 3954
             // now versions of PHP on Debian testing(5.2.6-5) and Ubuntu(5.2.6-2ubuntu) are lower, so wait for a while
3955 3955
             $doc_mime = mime_content_type($doc_path);
@@ -3980,8 +3980,8 @@  discard block
 block discarded – undo
3980 3980
                 $file_content = self::get_text_content($doc_path, $doc_mime);
3981 3981
                 $course_code = Database::escape_string($course_code);
3982 3982
 
3983
-                require_once api_get_path(LIBRARY_PATH) . 'search/ChamiloIndexer.class.php';
3984
-                require_once api_get_path(LIBRARY_PATH) . 'search/IndexableChunk.class.php';
3983
+                require_once api_get_path(LIBRARY_PATH).'search/ChamiloIndexer.class.php';
3984
+                require_once api_get_path(LIBRARY_PATH).'search/IndexableChunk.class.php';
3985 3985
 
3986 3986
                 $ic_slide = new IndexableChunk();
3987 3987
                 $ic_slide->addValue('title', $file_title);
@@ -3998,7 +3998,7 @@  discard block
 block discarded – undo
3998 3998
                 $di = new ChamiloIndexer();
3999 3999
                 $return = $di->connectDb(null, null, $lang);
4000 4000
 
4001
-                require_once api_get_path(LIBRARY_PATH) . 'specific_fields_manager.lib.php';
4001
+                require_once api_get_path(LIBRARY_PATH).'specific_fields_manager.lib.php';
4002 4002
                 $specific_fields = get_specific_field_list();
4003 4003
 
4004 4004
                 // process different depending on what to do if file exists
@@ -4035,7 +4035,7 @@  discard block
 block discarded – undo
4035 4035
                             } else { //if the specific field is not defined, force an empty one
4036 4036
                                 $sterms = '';
4037 4037
                             }
4038
-                            $all_specific_terms .= ' ' . $sterms;
4038
+                            $all_specific_terms .= ' '.$sterms;
4039 4039
                             $sterms = explode(',', $sterms);
4040 4040
                             foreach ($sterms as $sterm) {
4041 4041
                                 $sterm = trim($sterm);
@@ -4049,7 +4049,7 @@  discard block
 block discarded – undo
4049 4049
                             }
4050 4050
                         }
4051 4051
                         // Add terms also to content to make terms findable by probabilistic search
4052
-                        $file_content = $all_specific_terms . ' ' . $file_content;
4052
+                        $file_content = $all_specific_terms.' '.$file_content;
4053 4053
 
4054 4054
                         if (!$simulation) {
4055 4055
                             $ic_slide->addValue('content', $file_content);
@@ -4075,7 +4075,7 @@  discard block
 block discarded – undo
4075 4075
                         } else { //if the specific field is not defined, force an empty one
4076 4076
                             $sterms = '';
4077 4077
                         }
4078
-                        $all_specific_terms .= ' ' . $sterms;
4078
+                        $all_specific_terms .= ' '.$sterms;
4079 4079
                         if (!empty($sterms)) {
4080 4080
                             $sterms = explode(',', $sterms);
4081 4081
                             foreach ($sterms as $sterm) {
@@ -4087,7 +4087,7 @@  discard block
 block discarded – undo
4087 4087
                         }
4088 4088
                     }
4089 4089
                     // Add terms also to content to make terms findable by probabilistic search
4090
-                    $file_content = $all_specific_terms . ' ' . $file_content;
4090
+                    $file_content = $all_specific_terms.' '.$file_content;
4091 4091
                     if (!$simulation) {
4092 4092
                         $ic_slide->addValue('content', $file_content);
4093 4093
                         $di->addChunk($ic_slide);
@@ -4370,7 +4370,7 @@  discard block
 block discarded – undo
4370 4370
         $defaultVisibility = 'visible';
4371 4371
 
4372 4372
         if (isset($settings['documents'])) {
4373
-            $portalDefaultVisibility =  'invisible';
4373
+            $portalDefaultVisibility = 'invisible';
4374 4374
             if ($settings['documents'] == 'true') {
4375 4375
                 $portalDefaultVisibility = 'visible';
4376 4376
             }
@@ -4610,7 +4610,7 @@  discard block
 block discarded – undo
4610 4610
         //make htaccess with allow from all, and file index.html into temp/audio
4611 4611
         $htaccess = api_get_path(SYS_ARCHIVE_PATH).'temp/audio/.htaccess';
4612 4612
         if (!file_exists($htaccess)) {
4613
-            $htaccess_content="order deny,allow\r\nallow from all\r\nOptions -Indexes";
4613
+            $htaccess_content = "order deny,allow\r\nallow from all\r\nOptions -Indexes";
4614 4614
             $fp = @ fopen(api_get_path(SYS_ARCHIVE_PATH).'temp/audio/.htaccess', 'w');
4615 4615
             if ($fp) {
4616 4616
                 fwrite($fp, $htaccess_content);
@@ -4619,9 +4619,9 @@  discard block
 block discarded – undo
4619 4619
         }
4620 4620
 
4621 4621
         //encript temp name file
4622
-        $name_crip = sha1(uniqid());//encript
4623
-        $findext= explode(".", $file);
4624
-        $extension = $findext[count($findext)-1];
4622
+        $name_crip = sha1(uniqid()); //encript
4623
+        $findext = explode(".", $file);
4624
+        $extension = $findext[count($findext) - 1];
4625 4625
         $file_crip = $name_crip.'.'.$extension;
4626 4626
 
4627 4627
         //copy file to temp/audio directory
@@ -4725,7 +4725,7 @@  discard block
 block discarded – undo
4725 4725
         $comment = null;
4726 4726
 
4727 4727
         $fileName = api_replace_dangerous_char($title);
4728
-        $filePath = api_get_path(SYS_COURSE_PATH) . "{$courseData['path']}/document{$dir}";
4728
+        $filePath = api_get_path(SYS_COURSE_PATH)."{$courseData['path']}/document{$dir}";
4729 4729
         $fileFullPath = "{$filePath}/{$fileName}.html";
4730 4730
         $fileSize = 0;
4731 4731
         $fileType = 'file';
@@ -4777,7 +4777,7 @@  discard block
 block discarded – undo
4777 4777
             $fileSize,
4778 4778
             $title,
4779 4779
             $comment,
4780
-            0,//$readonly = 0,
4780
+            0, //$readonly = 0,
4781 4781
             true, //$save_visibility = true,
4782 4782
             null, //$group_id = null,
4783 4783
             $sessionId
@@ -5063,8 +5063,8 @@  discard block
 block discarded – undo
5063 5063
             $sessionId,
5064 5064
             $groupId
5065 5065
         )) {
5066
-            $uniqueName = self::addSuffixToFileName($name, '_' . $counter);
5067
-            $filePath = $path . $uniqueName;
5066
+            $uniqueName = self::addSuffixToFileName($name, '_'.$counter);
5067
+            $filePath = $path.$uniqueName;
5068 5068
             $counter++;
5069 5069
         }
5070 5070
 
@@ -5105,7 +5105,7 @@  discard block
 block discarded – undo
5105 5105
                     WHERE 
5106 5106
                         filetype = 'folder' AND 
5107 5107
                         c_id = $course_id AND 
5108
-                        path IN ('" . $folder_sql . "')";
5108
+                        path IN ('".$folder_sql."')";
5109 5109
             $res = Database::query($sql);
5110 5110
             $folder_titles = array();
5111 5111
             while ($obj = Database::fetch_object($res)) {
@@ -5142,9 +5142,9 @@  discard block
 block discarded – undo
5142 5142
                     $folder_titles[$folder] = cut($folder_titles[$folder], 80);
5143 5143
                     $counter = count($path_parts) - 2;
5144 5144
                     if ($counter > 0) {
5145
-                        $label = str_repeat('&nbsp;&nbsp;&nbsp;', $counter) . ' &mdash; ' . $folder_titles[$folder];
5145
+                        $label = str_repeat('&nbsp;&nbsp;&nbsp;', $counter).' &mdash; '.$folder_titles[$folder];
5146 5146
                     } else {
5147
-                        $label = ' &mdash; ' . $folder_titles[$folder];
5147
+                        $label = ' &mdash; '.$folder_titles[$folder];
5148 5148
                     }
5149 5149
                     $parent_select->addOption($label, $folder_id);
5150 5150
                     if ($selected != '') {
@@ -5162,7 +5162,7 @@  discard block
 block discarded – undo
5162 5162
                     } else {
5163 5163
                         $path_parts = explode('/', str_replace($group_dir, '', $folder));
5164 5164
                         $label = cut($label, 80);
5165
-                        $label = str_repeat('&nbsp;&nbsp;&nbsp;', count($path_parts) - 2) . ' &mdash; ' . $label;
5165
+                        $label = str_repeat('&nbsp;&nbsp;&nbsp;', count($path_parts) - 2).' &mdash; '.$label;
5166 5166
                     }
5167 5167
                     $parent_select->addOption($label, $folder_id);
5168 5168
                     if ($selected != '') {
@@ -5195,7 +5195,7 @@  discard block
 block discarded – undo
5195 5195
     ) {
5196 5196
         global $dbl_click_id;
5197 5197
         $course_info = api_get_course_info();
5198
-        $www = api_get_path(WEB_COURSE_PATH) . $course_info['path'] . '/document';
5198
+        $www = api_get_path(WEB_COURSE_PATH).$course_info['path'].'/document';
5199 5199
         $webOdflist = DocumentManager::get_web_odf_extension_list();
5200 5200
 
5201 5201
         // Get the title or the basename depending on what we're using
@@ -5219,11 +5219,11 @@  discard block
 block discarded – undo
5219 5219
 
5220 5220
         if (!$show_as_icon) {
5221 5221
             // Build download link (icon)
5222
-            $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'];
5222
+            $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'];
5223 5223
             // Folder download or file download?
5224 5224
             $forcedownload_icon = ($filetype == 'folder') ? 'save_pack.png' : 'save.png';
5225 5225
             // Prevent multiple clicks on zipped folder download
5226
-            $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; }\"" : '';
5226
+            $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; }\"" : '';
5227 5227
         }
5228 5228
 
5229 5229
         $target = '_self';
@@ -5239,17 +5239,17 @@  discard block
 block discarded – undo
5239 5239
 
5240 5240
             if ($is_browser_viewable_file) {
5241 5241
                 if ($ext == 'pdf' || in_array($ext, $webOdflist)) {
5242
-                    $url = api_get_self() . '?' . api_get_cidreq() . '&amp;action=download&amp;id=' . $document_data['id'];
5242
+                    $url = api_get_self().'?'.api_get_cidreq().'&amp;action=download&amp;id='.$document_data['id'];
5243 5243
                 } else {
5244
-                    $url = 'showinframes.php?' . api_get_cidreq() . '&id=' . $document_data['id'];
5244
+                    $url = 'showinframes.php?'.api_get_cidreq().'&id='.$document_data['id'];
5245 5245
                 }
5246 5246
             } else {
5247 5247
                 // url-encode for problematic characters (we may not call them dangerous characters...)
5248
-                $path = str_replace('%2F', '/', $url_path) . '?' . api_get_cidreq();
5249
-                $url = $www . $path;
5248
+                $path = str_replace('%2F', '/', $url_path).'?'.api_get_cidreq();
5249
+                $url = $www.$path;
5250 5250
             }
5251 5251
         } else {
5252
-            $url = api_get_self() . '?' . api_get_cidreq() . '&id=' . $document_data['id'];
5252
+            $url = api_get_self().'?'.api_get_cidreq().'&id='.$document_data['id'];
5253 5253
         }
5254 5254
 
5255 5255
         // The little download icon
@@ -5259,10 +5259,10 @@  discard block
 block discarded – undo
5259 5259
         if ($path == '/shared_folder') {
5260 5260
             $tooltip_title_alt = get_lang('UserFolders');
5261 5261
         } elseif (strstr($path, 'shared_folder_session_')) {
5262
-            $tooltip_title_alt = get_lang('UserFolders') . ' (' . api_get_session_name(api_get_session_id()) . ')';
5262
+            $tooltip_title_alt = get_lang('UserFolders').' ('.api_get_session_name(api_get_session_id()).')';
5263 5263
         } elseif (strstr($tooltip_title, 'sf_user_')) {
5264 5264
             $userinfo = api_get_user_info(substr($tooltip_title, 8));
5265
-            $tooltip_title_alt = get_lang('UserFolder') . ' ' . $userinfo['complete_name'];
5265
+            $tooltip_title_alt = get_lang('UserFolder').' '.$userinfo['complete_name'];
5266 5266
         } elseif ($path == '/chat_files') {
5267 5267
             $tooltip_title_alt = get_lang('ChatFiles');
5268 5268
         } elseif ($path == '/learning_path') {
@@ -5294,24 +5294,24 @@  discard block
 block discarded – undo
5294 5294
                 ) {
5295 5295
                     //filter when I am into shared folder, I can show for donwload only my shared folder
5296 5296
                     if (DocumentManager::is_shared_folder($curdirpath, $current_session_id)) {
5297
-                        if (preg_match('/shared_folder\/sf_user_' . api_get_user_id() . '$/', urldecode($forcedownload_link)) ||
5298
-                            preg_match('/shared_folder_session_' . $current_session_id . '\/sf_user_' . api_get_user_id() . '$/', urldecode($forcedownload_link)) ||
5297
+                        if (preg_match('/shared_folder\/sf_user_'.api_get_user_id().'$/', urldecode($forcedownload_link)) ||
5298
+                            preg_match('/shared_folder_session_'.$current_session_id.'\/sf_user_'.api_get_user_id().'$/', urldecode($forcedownload_link)) ||
5299 5299
                             api_is_allowed_to_edit() || api_is_platform_admin()
5300 5300
                         ) {
5301
-                            $force_download_html = ($size == 0) ? '' : '<a href="' . $forcedownload_link . '" style="float:right"' . $prevent_multiple_click . '>' .
5302
-                                Display::return_icon($forcedownload_icon, get_lang('Download'), array(), ICON_SIZE_SMALL) . '</a>';
5301
+                            $force_download_html = ($size == 0) ? '' : '<a href="'.$forcedownload_link.'" style="float:right"'.$prevent_multiple_click.'>'.
5302
+                                Display::return_icon($forcedownload_icon, get_lang('Download'), array(), ICON_SIZE_SMALL).'</a>';
5303 5303
                         }
5304 5304
                     } elseif (!preg_match('/shared_folder/', urldecode($forcedownload_link)) ||
5305 5305
                         api_is_allowed_to_edit() ||
5306 5306
                         api_is_platform_admin()
5307 5307
                     ) {
5308
-                        $force_download_html = ($size == 0) ? '' : '<a href="' . $forcedownload_link . '" style="float:right"' . $prevent_multiple_click . '>' .
5309
-                            Display::return_icon($forcedownload_icon, get_lang('Download'), array(), ICON_SIZE_SMALL) . '</a>';
5308
+                        $force_download_html = ($size == 0) ? '' : '<a href="'.$forcedownload_link.'" style="float:right"'.$prevent_multiple_click.'>'.
5309
+                            Display::return_icon($forcedownload_icon, get_lang('Download'), array(), ICON_SIZE_SMALL).'</a>';
5310 5310
                     }
5311 5311
                 }
5312 5312
             } else {
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
 
5317 5317
             // Copy files to users myfiles
@@ -5319,12 +5319,12 @@  discard block
 block discarded – undo
5319 5319
                 api_get_setting('users_copy_files') === 'true' &&
5320 5320
                 !api_is_anonymous()
5321 5321
             ) {
5322
-                $copy_myfiles_link = ($filetype == 'file') ? api_get_self() . '?' . api_get_cidreq() . '&action=copytomyfiles&id=' . $document_data['id'] : api_get_self() . '?' . api_get_cidreq();
5322
+                $copy_myfiles_link = ($filetype == 'file') ? api_get_self().'?'.api_get_cidreq().'&action=copytomyfiles&id='.$document_data['id'] : api_get_self().'?'.api_get_cidreq();
5323 5323
 
5324 5324
                 if ($filetype == 'file') {
5325 5325
 
5326
-                    $copy_to_myfiles = '<a href="' . $copy_myfiles_link . '" style="float:right"' . $prevent_multiple_click . '>' .
5327
-                        Display::return_icon('briefcase.png', get_lang('CopyToMyFiles'), array(), ICON_SIZE_SMALL) . '&nbsp;&nbsp;</a>';
5326
+                    $copy_to_myfiles = '<a href="'.$copy_myfiles_link.'" style="float:right"'.$prevent_multiple_click.'>'.
5327
+                        Display::return_icon('briefcase.png', get_lang('CopyToMyFiles'), array(), ICON_SIZE_SMALL).'&nbsp;&nbsp;</a>';
5328 5328
 
5329 5329
                     if (api_get_setting('allow_my_files') === 'false') {
5330 5330
                         $copy_to_myfiles = '';
@@ -5343,13 +5343,13 @@  discard block
 block discarded – undo
5343 5343
                 $filetype == 'file' &&
5344 5344
                 in_array($extension, array('html', 'htm'))
5345 5345
             ) {
5346
-                $pdf_icon = ' <a style="float:right".' . $prevent_multiple_click . ' href="' . api_get_self() . '?' . api_get_cidreq() . '&action=export_to_pdf&id=' . $document_data['id'] . '">' .
5347
-                    Display::return_icon('pdf.png', get_lang('Export2PDF'), array(), ICON_SIZE_SMALL) . '</a> ';
5346
+                $pdf_icon = ' <a style="float:right".'.$prevent_multiple_click.' href="'.api_get_self().'?'.api_get_cidreq().'&action=export_to_pdf&id='.$document_data['id'].'">'.
5347
+                    Display::return_icon('pdf.png', get_lang('Export2PDF'), array(), ICON_SIZE_SMALL).'</a> ';
5348 5348
             }
5349 5349
 
5350 5350
             if ($is_browser_viewable_file) {
5351
-                $open_in_new_window_link = '<a href="' . $www . str_replace('%2F', '/', $url_path) . '?' . api_get_cidreq() . '" style="float:right"' . $prevent_multiple_click . ' target="_blank">' .
5352
-                    Display::return_icon('open_in_new_window.png', get_lang('OpenInANewWindow'), array(), ICON_SIZE_SMALL) . '&nbsp;&nbsp;</a>';
5351
+                $open_in_new_window_link = '<a href="'.$www.str_replace('%2F', '/', $url_path).'?'.api_get_cidreq().'" style="float:right"'.$prevent_multiple_click.' target="_blank">'.
5352
+                    Display::return_icon('open_in_new_window.png', get_lang('OpenInANewWindow'), array(), ICON_SIZE_SMALL).'&nbsp;&nbsp;</a>';
5353 5353
             }
5354 5354
 
5355 5355
             if ($filetype == 'file') {
@@ -5358,9 +5358,9 @@  discard block
 block discarded – undo
5358 5358
                     (preg_match('/wav$/i', urldecode($checkExtension))) ||
5359 5359
                     preg_match('/ogg$/i', urldecode($checkExtension))
5360 5360
                 ) {
5361
-                    return '<span style="float:left" ' . $visibility_class . '>' .
5362
-                    $title .
5363
-                    '</span>' . $force_download_html . $send_to . $copy_to_myfiles . $open_in_new_window_link . $pdf_icon;
5361
+                    return '<span style="float:left" '.$visibility_class.'>'.
5362
+                    $title.
5363
+                    '</span>'.$force_download_html.$send_to.$copy_to_myfiles.$open_in_new_window_link.$pdf_icon;
5364 5364
                 } elseif (
5365 5365
 
5366 5366
                     // Show preview
@@ -5373,7 +5373,7 @@  discard block
 block discarded – undo
5373 5373
                     preg_match('/svg$/i', urldecode($checkExtension))
5374 5374
                 ) {
5375 5375
                     // Simpler version of showinframesmin.php with no headers
5376
-                    $url = 'show_content.php?' . api_get_cidreq() . '&id=' . $document_data['id'];
5376
+                    $url = 'show_content.php?'.api_get_cidreq().'&id='.$document_data['id'];
5377 5377
                     $class = 'ajax';
5378 5378
                     if ($visibility == false) {
5379 5379
                         $class = "ajax invisible";
@@ -5388,34 +5388,34 @@  discard block
 block discarded – undo
5388 5388
                             'style' => 'float: left;'
5389 5389
                         ]
5390 5390
                     )
5391
-                    . $force_download_html . $send_to . $copy_to_myfiles
5392
-                    . $open_in_new_window_link . $pdf_icon;
5391
+                    . $force_download_html.$send_to.$copy_to_myfiles
5392
+                    . $open_in_new_window_link.$pdf_icon;
5393 5393
                 } else {
5394 5394
                     // For PDF Download the file.
5395 5395
                     $pdfPreview = null;
5396 5396
                     if ($ext != 'pdf' && !in_array($ext, $webOdflist)) {
5397
-                        $url = 'showinframes.php?' . api_get_cidreq() . '&id=' . $document_data['id'];
5397
+                        $url = 'showinframes.php?'.api_get_cidreq().'&id='.$document_data['id'];
5398 5398
                     } else {
5399 5399
                         $pdfPreview = Display::url(
5400 5400
                             Display::return_icon('preview.gif', get_lang('Preview')),
5401
-                            api_get_path(WEB_CODE_PATH).'document/showinframes.php?' . api_get_cidreq() . '&id=' . $document_data['id'],
5401
+                            api_get_path(WEB_CODE_PATH).'document/showinframes.php?'.api_get_cidreq().'&id='.$document_data['id'],
5402 5402
                             array('style' => 'float:right')
5403 5403
                         );
5404 5404
                     }
5405 5405
                     // No plugin just the old and good showinframes.php page
5406
-                    return '<a href="' . $url . '" title="' . $tooltip_title_alt . '" style="float:left" ' . $visibility_class . ' >' . $title . '</a>' .
5407
-                    $pdfPreview.$force_download_html . $send_to . $copy_to_myfiles . $open_in_new_window_link . $pdf_icon;
5406
+                    return '<a href="'.$url.'" title="'.$tooltip_title_alt.'" style="float:left" '.$visibility_class.' >'.$title.'</a>'.
5407
+                    $pdfPreview.$force_download_html.$send_to.$copy_to_myfiles.$open_in_new_window_link.$pdf_icon;
5408 5408
                 }
5409 5409
             } else {
5410
-                return '<a href="' . $url . '" title="' . $tooltip_title_alt . '" ' . $visibility_class . ' style="float:left">' . $title . '</a>' .
5411
-                $force_download_html . $send_to . $copy_to_myfiles . $open_in_new_window_link . $pdf_icon;
5410
+                return '<a href="'.$url.'" title="'.$tooltip_title_alt.'" '.$visibility_class.' style="float:left">'.$title.'</a>'.
5411
+                $force_download_html.$send_to.$copy_to_myfiles.$open_in_new_window_link.$pdf_icon;
5412 5412
             }
5413 5413
             // end copy files to users myfiles
5414 5414
         } else {
5415 5415
             // Icon column
5416 5416
             if (preg_match('/shared_folder/', urldecode($checkExtension)) &&
5417 5417
                 preg_match('/shared_folder$/', urldecode($checkExtension)) == false &&
5418
-                preg_match('/shared_folder_session_' . $current_session_id . '$/', urldecode($url)) == false
5418
+                preg_match('/shared_folder_session_'.$current_session_id.'$/', urldecode($url)) == false
5419 5419
             ) {
5420 5420
                 if ($filetype == 'file') {
5421 5421
                     //Sound preview with jplayer
@@ -5435,19 +5435,19 @@  discard block
 block discarded – undo
5435 5435
                         preg_match('/bmp$/i', urldecode($checkExtension)) ||
5436 5436
                         preg_match('/svg$/i', urldecode($checkExtension))
5437 5437
                     ) {
5438
-                        $url = 'showinframes.php?' . api_get_cidreq() . '&id=' . $document_data['id'];
5439
-                        return '<a href="' . $url . '" title="' . $tooltip_title_alt . '" ' . $visibility_class . ' style="float:left">' .
5440
-                        DocumentManager::build_document_icon_tag($filetype, $path) .
5441
-                        Display::return_icon('shared.png', get_lang('ResourceShared'), array()) . '</a>';
5438
+                        $url = 'showinframes.php?'.api_get_cidreq().'&id='.$document_data['id'];
5439
+                        return '<a href="'.$url.'" title="'.$tooltip_title_alt.'" '.$visibility_class.' style="float:left">'.
5440
+                        DocumentManager::build_document_icon_tag($filetype, $path).
5441
+                        Display::return_icon('shared.png', get_lang('ResourceShared'), array()).'</a>';
5442 5442
                     } else {
5443
-                        return '<a href="' . $url . '" title="' . $tooltip_title_alt . '" ' . $visibility_class . ' style="float:left">' .
5444
-                        DocumentManager::build_document_icon_tag($filetype, $path) .
5445
-                        Display::return_icon('shared.png', get_lang('ResourceShared'), array()) . '</a>';
5443
+                        return '<a href="'.$url.'" title="'.$tooltip_title_alt.'" '.$visibility_class.' style="float:left">'.
5444
+                        DocumentManager::build_document_icon_tag($filetype, $path).
5445
+                        Display::return_icon('shared.png', get_lang('ResourceShared'), array()).'</a>';
5446 5446
                     }
5447 5447
                 } else {
5448
-                    return '<a href="' . $url . '" title="' . $tooltip_title_alt . '" target="' . $target . '"' . $visibility_class . ' style="float:left">' .
5449
-                    DocumentManager::build_document_icon_tag($filetype, $path) .
5450
-                    Display::return_icon('shared.png', get_lang('ResourceShared'), array()) . '</a>';
5448
+                    return '<a href="'.$url.'" title="'.$tooltip_title_alt.'" target="'.$target.'"'.$visibility_class.' style="float:left">'.
5449
+                    DocumentManager::build_document_icon_tag($filetype, $path).
5450
+                    Display::return_icon('shared.png', get_lang('ResourceShared'), array()).'</a>';
5451 5451
                 }
5452 5452
             } else {
5453 5453
                 if ($filetype == 'file') {
@@ -5470,16 +5470,16 @@  discard block
 block discarded – undo
5470 5470
                         preg_match('/bmp$/i', urldecode($checkExtension)) ||
5471 5471
                         preg_match('/svg$/i', urldecode($checkExtension))
5472 5472
                     ) {
5473
-                        $url = 'showinframes.php?' . api_get_cidreq() . '&id=' . $document_data['id']; //without preview
5474
-                        return '<a href="' . $url . '" title="' . $tooltip_title_alt . '" ' . $visibility_class . ' style="float:left">' .
5475
-                        DocumentManager::build_document_icon_tag($filetype, $path) . '</a>';
5473
+                        $url = 'showinframes.php?'.api_get_cidreq().'&id='.$document_data['id']; //without preview
5474
+                        return '<a href="'.$url.'" title="'.$tooltip_title_alt.'" '.$visibility_class.' style="float:left">'.
5475
+                        DocumentManager::build_document_icon_tag($filetype, $path).'</a>';
5476 5476
                     } else {
5477
-                        return '<a href="' . $url . '" title="' . $tooltip_title_alt . '" ' . $visibility_class . ' style="float:left">' .
5478
-                        DocumentManager::build_document_icon_tag($filetype, $path) . '</a>';
5477
+                        return '<a href="'.$url.'" title="'.$tooltip_title_alt.'" '.$visibility_class.' style="float:left">'.
5478
+                        DocumentManager::build_document_icon_tag($filetype, $path).'</a>';
5479 5479
                     }
5480 5480
                 } else {
5481
-                    return '<a href="' . $url . '" title="' . $tooltip_title_alt . '" target="' . $target . '"' . $visibility_class . ' style="float:left">' .
5482
-                    DocumentManager::build_document_icon_tag($filetype, $path) . '</a>';
5481
+                    return '<a href="'.$url.'" title="'.$tooltip_title_alt.'" target="'.$target.'"'.$visibility_class.' style="float:left">'.
5482
+                    DocumentManager::build_document_icon_tag($filetype, $path).'</a>';
5483 5483
                 }
5484 5484
             }
5485 5485
         }
@@ -5514,13 +5514,13 @@  discard block
 block discarded – undo
5514 5514
                 $userinfo = api_get_user_info(substr($basename, 8));
5515 5515
                 $icon = $userinfo['avatar_small'];
5516 5516
 
5517
-                $basename = get_lang('UserFolder') . ' ' . $userinfo['complete_name'];
5517
+                $basename = get_lang('UserFolder').' '.$userinfo['complete_name'];
5518 5518
                 $user_image = true;
5519 5519
             } elseif (strstr($path, 'shared_folder_session_')) {
5520 5520
                 if ($is_allowed_to_edit) {
5521
-                    $basename = '***(' . api_get_session_name($current_session_id) . ')*** ' . get_lang('HelpUsersFolder');
5521
+                    $basename = '***('.api_get_session_name($current_session_id).')*** '.get_lang('HelpUsersFolder');
5522 5522
                 } else {
5523
-                    $basename = get_lang('UserFolders') . ' (' . api_get_session_name($current_session_id) . ')';
5523
+                    $basename = get_lang('UserFolders').' ('.api_get_session_name($current_session_id).')';
5524 5524
                 }
5525 5525
                 $icon = 'folder_users.png';
5526 5526
             } else {
@@ -5629,16 +5629,16 @@  discard block
 block discarded – undo
5629 5629
         // Build URL-parameters for table-sorting
5630 5630
         $sort_params = array();
5631 5631
         if (isset($_GET['column'])) {
5632
-            $sort_params[] = 'column=' . Security::remove_XSS($_GET['column']);
5632
+            $sort_params[] = 'column='.Security::remove_XSS($_GET['column']);
5633 5633
         }
5634 5634
         if (isset($_GET['page_nr'])) {
5635
-            $sort_params[] = 'page_nr=' . Security::remove_XSS($_GET['page_nr']);
5635
+            $sort_params[] = 'page_nr='.Security::remove_XSS($_GET['page_nr']);
5636 5636
         }
5637 5637
         if (isset($_GET['per_page'])) {
5638
-            $sort_params[] = 'per_page=' . Security::remove_XSS($_GET['per_page']);
5638
+            $sort_params[] = 'per_page='.Security::remove_XSS($_GET['per_page']);
5639 5639
         }
5640 5640
         if (isset($_GET['direction'])) {
5641
-            $sort_params[] = 'direction=' . Security::remove_XSS($_GET['direction']);
5641
+            $sort_params[] = 'direction='.Security::remove_XSS($_GET['direction']);
5642 5642
         }
5643 5643
         $sort_params = implode('&amp;', $sort_params);
5644 5644
         $visibility_icon = ($visibility == 0) ? 'invisible' : 'visible';
@@ -5651,89 +5651,89 @@  discard block
 block discarded – undo
5651 5651
         if ($is_read_only /* or ($session_id!=api_get_session_id()) */) {
5652 5652
             if (api_is_course_admin() || api_is_platform_admin()) {
5653 5653
                 if ($extension == 'svg' && api_browser_support('svg') && api_get_setting('enabled_support_svg') == 'true') {
5654
-                    $modify_icons = '<a href="edit_draw.php?' . api_get_cidreq() . '&id=' . $document_id . '">' .
5655
-                        Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
5656
-                } elseif (in_array($extension, $web_odf_extension_list)  && api_get_setting('enabled_support_odf') === true) {
5657
-                    $modify_icons = '<a href="edit_odf.php?' . api_get_cidreq() . '&id=' . $document_id . '">' .
5658
-                        Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
5654
+                    $modify_icons = '<a href="edit_draw.php?'.api_get_cidreq().'&id='.$document_id.'">'.
5655
+                        Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>';
5656
+                } elseif (in_array($extension, $web_odf_extension_list) && api_get_setting('enabled_support_odf') === true) {
5657
+                    $modify_icons = '<a href="edit_odf.php?'.api_get_cidreq().'&id='.$document_id.'">'.
5658
+                        Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>';
5659 5659
                 } elseif ($extension == 'png' || $extension == 'jpg' || $extension == 'jpeg' || $extension == 'bmp' || $extension == 'gif' || $extension == 'pxd' && api_get_setting('enabled_support_pixlr') == 'true') {
5660
-                    $modify_icons = '<a href="edit_paint.php?' . api_get_cidreq() . '&id=' . $document_id . '">' .
5661
-                        Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
5660
+                    $modify_icons = '<a href="edit_paint.php?'.api_get_cidreq().'&id='.$document_id.'">'.
5661
+                        Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>';
5662 5662
                 } else {
5663
-                    $modify_icons = '<a href="edit_document.php?' . api_get_cidreq() . '&id=' . $document_id. '">' .
5664
-                        Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
5663
+                    $modify_icons = '<a href="edit_document.php?'.api_get_cidreq().'&id='.$document_id.'">'.
5664
+                        Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>';
5665 5665
                 }
5666 5666
             } else {
5667 5667
                 $modify_icons = Display::return_icon('edit_na.png', get_lang('Modify'), '', ICON_SIZE_SMALL);
5668 5668
             }
5669
-            $modify_icons .= '&nbsp;' . Display::return_icon('move_na.png', get_lang('Move'), array(), ICON_SIZE_SMALL);
5669
+            $modify_icons .= '&nbsp;'.Display::return_icon('move_na.png', get_lang('Move'), array(), ICON_SIZE_SMALL);
5670 5670
             if (api_is_allowed_to_edit() || api_is_platform_admin()) {
5671
-                $modify_icons .= '&nbsp;' . Display::return_icon($visibility_icon . '.png', get_lang('VisibilityCannotBeChanged'), '', ICON_SIZE_SMALL);
5671
+                $modify_icons .= '&nbsp;'.Display::return_icon($visibility_icon.'.png', get_lang('VisibilityCannotBeChanged'), '', ICON_SIZE_SMALL);
5672 5672
             }
5673
-            $modify_icons .= '&nbsp;' . Display::return_icon('delete_na.png', get_lang('Delete'), array(), ICON_SIZE_SMALL);
5673
+            $modify_icons .= '&nbsp;'.Display::return_icon('delete_na.png', get_lang('Delete'), array(), ICON_SIZE_SMALL);
5674 5674
         } else {
5675 5675
             //Edit button
5676 5676
             if (in_array($path, DocumentManager::get_system_folders())) {
5677 5677
                 $modify_icons = Display::return_icon('edit_na.png', get_lang('Modify'), '', ICON_SIZE_SMALL);
5678
-            } elseif ($is_certificate_mode ) {
5678
+            } elseif ($is_certificate_mode) {
5679 5679
                 // gradebook category doesn't seem to be taken into account
5680
-                $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>';
5680
+                $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>';
5681 5681
             } else {
5682 5682
                 if (api_get_session_id()) {
5683 5683
                     if ($document_data['session_id'] == api_get_session_id()) {
5684 5684
                         if ($extension == 'svg' && api_browser_support('svg') && api_get_setting('enabled_support_svg') == 'true') {
5685
-                            $modify_icons = '<a href="edit_draw.php?' . api_get_cidreq() . '&amp;id=' . $document_id  . '">' .
5686
-                                Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
5687
-                        } elseif (in_array($extension, $web_odf_extension_list)  && api_get_setting('enabled_support_odf') === true) {
5688
-                            $modify_icons = '<a href="edit_odf.php?' . api_get_cidreq() . '&id=' . $document_id  . '">' .
5689
-                                Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
5685
+                            $modify_icons = '<a href="edit_draw.php?'.api_get_cidreq().'&amp;id='.$document_id.'">'.
5686
+                                Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>';
5687
+                        } elseif (in_array($extension, $web_odf_extension_list) && api_get_setting('enabled_support_odf') === true) {
5688
+                            $modify_icons = '<a href="edit_odf.php?'.api_get_cidreq().'&id='.$document_id.'">'.
5689
+                                Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>';
5690 5690
                         } elseif ($extension == 'png' || $extension == 'jpg' || $extension == 'jpeg' || $extension == 'bmp' || $extension == 'gif' || $extension == 'pxd' && api_get_setting('enabled_support_pixlr') == 'true') {
5691
-                            $modify_icons = '<a href="edit_paint.php?' . api_get_cidreq() . '&id=' . $document_id  . '">' .
5692
-                                Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
5691
+                            $modify_icons = '<a href="edit_paint.php?'.api_get_cidreq().'&id='.$document_id.'">'.
5692
+                                Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>';
5693 5693
                         } else {
5694
-                            $modify_icons = '<a href="edit_document.php?' . api_get_cidreq() . '&amp;id=' . $document_id  . '">' .
5695
-                                Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
5694
+                            $modify_icons = '<a href="edit_document.php?'.api_get_cidreq().'&amp;id='.$document_id.'">'.
5695
+                                Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>';
5696 5696
                         }
5697 5697
                     } else {
5698
-                        $modify_icons .= '&nbsp;' . Display::return_icon('edit_na.png', get_lang('Edit'), array(), ICON_SIZE_SMALL) . '</a>';
5698
+                        $modify_icons .= '&nbsp;'.Display::return_icon('edit_na.png', get_lang('Edit'), array(), ICON_SIZE_SMALL).'</a>';
5699 5699
                     }
5700 5700
                 } else {
5701 5701
                     if ($extension == 'svg' && api_browser_support('svg') && api_get_setting('enabled_support_svg') == 'true') {
5702
-                        $modify_icons = '<a href="edit_draw.php?' . api_get_cidreq() . '&amp;id=' . $document_id  . '">' .
5703
-                            Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
5704
-                    } elseif (in_array($extension, $web_odf_extension_list)  && api_get_setting('enabled_support_odf') === true) {
5705
-                        $modify_icons = '<a href="edit_odf.php?' . api_get_cidreq() . '&id=' . $document_id  . '">' .
5706
-                            Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
5702
+                        $modify_icons = '<a href="edit_draw.php?'.api_get_cidreq().'&amp;id='.$document_id.'">'.
5703
+                            Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>';
5704
+                    } elseif (in_array($extension, $web_odf_extension_list) && api_get_setting('enabled_support_odf') === true) {
5705
+                        $modify_icons = '<a href="edit_odf.php?'.api_get_cidreq().'&id='.$document_id.'">'.
5706
+                            Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>';
5707 5707
                     } elseif ($extension == 'png' || $extension == 'jpg' || $extension == 'jpeg' || $extension == 'bmp' || $extension == 'gif' || $extension == 'pxd' && api_get_setting('enabled_support_pixlr') == 'true') {
5708
-                        $modify_icons = '<a href="edit_paint.php?' . api_get_cidreq() . '&amp;id=' . $document_id . '">' .
5709
-                            Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
5708
+                        $modify_icons = '<a href="edit_paint.php?'.api_get_cidreq().'&amp;id='.$document_id.'">'.
5709
+                            Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>';
5710 5710
                     } else {
5711
-                        $modify_icons = '<a href="edit_document.php?' . api_get_cidreq() . '&amp;id=' . $document_id  . '">' .
5712
-                            Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
5711
+                        $modify_icons = '<a href="edit_document.php?'.api_get_cidreq().'&amp;id='.$document_id.'">'.
5712
+                            Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>';
5713 5713
                     }
5714 5714
                 }
5715 5715
             }
5716 5716
 
5717 5717
             // Move button.
5718 5718
             if ($is_certificate_mode || in_array($path, DocumentManager::get_system_folders())) {
5719
-                $modify_icons .= '&nbsp;' . Display::return_icon('move_na.png', get_lang('Move'), array(), ICON_SIZE_SMALL) . '</a>';
5719
+                $modify_icons .= '&nbsp;'.Display::return_icon('move_na.png', get_lang('Move'), array(), ICON_SIZE_SMALL).'</a>';
5720 5720
             } else {
5721 5721
                 if (api_get_session_id()) {
5722 5722
                     if ($document_data['session_id'] == api_get_session_id()) {
5723
-                        $modify_icons .= '&nbsp;<a href="' . api_get_self() . '?' . api_get_cidreq() . '&amp;id=' . $parent_id . '&amp;move=' . $document_id .  '">' .
5724
-                            Display::return_icon('move.png', get_lang('Move'), array(), ICON_SIZE_SMALL) . '</a>';
5723
+                        $modify_icons .= '&nbsp;<a href="'.api_get_self().'?'.api_get_cidreq().'&amp;id='.$parent_id.'&amp;move='.$document_id.'">'.
5724
+                            Display::return_icon('move.png', get_lang('Move'), array(), ICON_SIZE_SMALL).'</a>';
5725 5725
                     } else {
5726
-                        $modify_icons .= '&nbsp;' . Display::return_icon('move_na.png', get_lang('Move'), array(), ICON_SIZE_SMALL) . '</a>';
5726
+                        $modify_icons .= '&nbsp;'.Display::return_icon('move_na.png', get_lang('Move'), array(), ICON_SIZE_SMALL).'</a>';
5727 5727
                     }
5728 5728
                 } else {
5729
-                    $modify_icons .= '&nbsp;<a href="' . api_get_self() . '?' . api_get_cidreq() . '&amp;id=' . $parent_id . '&amp;move=' . $document_id .  '">' .
5730
-                        Display::return_icon('move.png', get_lang('Move'), array(), ICON_SIZE_SMALL) . '</a>';
5729
+                    $modify_icons .= '&nbsp;<a href="'.api_get_self().'?'.api_get_cidreq().'&amp;id='.$parent_id.'&amp;move='.$document_id.'">'.
5730
+                        Display::return_icon('move.png', get_lang('Move'), array(), ICON_SIZE_SMALL).'</a>';
5731 5731
                 }
5732 5732
             }
5733 5733
 
5734 5734
             //Visibility button
5735 5735
             if ($is_certificate_mode) {
5736
-                $modify_icons .= '&nbsp;' . Display::return_icon($visibility_icon . '.png', get_lang('VisibilityCannotBeChanged'), array(), ICON_SIZE_SMALL) . '</a>';
5736
+                $modify_icons .= '&nbsp;'.Display::return_icon($visibility_icon.'.png', get_lang('VisibilityCannotBeChanged'), array(), ICON_SIZE_SMALL).'</a>';
5737 5737
             } else {
5738 5738
                 if (api_is_allowed_to_edit() || api_is_platform_admin()) {
5739 5739
                     if ($visibility_icon == 'invisible') {
@@ -5741,14 +5741,14 @@  discard block
 block discarded – undo
5741 5741
                     } else {
5742 5742
                         $tip_visibility = get_lang('Hide');
5743 5743
                     }
5744
-                    $modify_icons .= '&nbsp;<a href="' . api_get_self() . '?' . api_get_cidreq() . '&amp;id=' . $parent_id . '&amp;' . $visibility_command . '=' . $id . '&amp;' . $sort_params . '">' .
5745
-                        Display::return_icon($visibility_icon . '.png', $tip_visibility, '', ICON_SIZE_SMALL) . '</a>';
5744
+                    $modify_icons .= '&nbsp;<a href="'.api_get_self().'?'.api_get_cidreq().'&amp;id='.$parent_id.'&amp;'.$visibility_command.'='.$id.'&amp;'.$sort_params.'">'.
5745
+                        Display::return_icon($visibility_icon.'.png', $tip_visibility, '', ICON_SIZE_SMALL).'</a>';
5746 5746
                 }
5747 5747
             }
5748 5748
 
5749 5749
             // Delete button
5750 5750
             if (in_array($path, DocumentManager::get_system_folders())) {
5751
-                $modify_icons .= '&nbsp;' . Display::return_icon('delete_na.png', get_lang('ThisFolderCannotBeDeleted'), array(), ICON_SIZE_SMALL);
5751
+                $modify_icons .= '&nbsp;'.Display::return_icon('delete_na.png', get_lang('ThisFolderCannotBeDeleted'), array(), ICON_SIZE_SMALL);
5752 5752
             } else {
5753 5753
                 $titleToShow = addslashes(basename($document_data['title']));
5754 5754
 
@@ -5756,23 +5756,23 @@  discard block
 block discarded – undo
5756 5756
                     $_GET['curdirpath'] == '/certificates' &&
5757 5757
                     DocumentManager::get_default_certificate_id(api_get_course_id()) == $id
5758 5758
                 ) {
5759
-                    $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 . '\');">' .
5760
-                        Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL) . '</a>';
5759
+                    $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.'\');">'.
5760
+                        Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL).'</a>';
5761 5761
                 } else {
5762 5762
                     if ($is_certificate_mode) {
5763
-                        $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 . '\');">' .
5764
-                            Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL) . '</a>';
5763
+                        $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.'\');">'.
5764
+                            Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL).'</a>';
5765 5765
                     } else {
5766 5766
                         if (api_get_session_id()) {
5767 5767
                             if ($document_data['session_id'] == api_get_session_id()) {
5768
-                                $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 . '\');">'.
5769
-                                    Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL) . '</a>';
5768
+                                $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.'\');">'.
5769
+                                    Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL).'</a>';
5770 5770
                             } else {
5771
-                                $modify_icons .= '&nbsp;' . Display::return_icon('delete_na.png', get_lang('ThisFolderCannotBeDeleted'), array(), ICON_SIZE_SMALL);
5771
+                                $modify_icons .= '&nbsp;'.Display::return_icon('delete_na.png', get_lang('ThisFolderCannotBeDeleted'), array(), ICON_SIZE_SMALL);
5772 5772
                             }
5773 5773
                         } else {
5774
-                            $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. '\');">' .
5775
-                                Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL) . '</a>';
5774
+                            $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.'\');">'.
5775
+                                Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL).'</a>';
5776 5776
                         }
5777 5777
                     }
5778 5778
                 }
@@ -5784,15 +5784,15 @@  discard block
 block discarded – undo
5784 5784
                 // nothing to do
5785 5785
             } else {
5786 5786
                 if ($usePpt2lp && $formatType) {
5787
-                    $modify_icons .= '&nbsp;<a class="convertAction" href="#" ' .
5788
-                        'data-documentId = ' . $document_id .
5789
-                        ' data-formatType = ' . $formatType . '>' .
5787
+                    $modify_icons .= '&nbsp;<a class="convertAction" href="#" '.
5788
+                        'data-documentId = '.$document_id.
5789
+                        ' data-formatType = '.$formatType.'>'.
5790 5790
                         Display::return_icon(
5791 5791
                             'convert.png',
5792 5792
                             get_lang('Convert'),
5793 5793
                             array(),
5794 5794
                             ICON_SIZE_SMALL
5795
-                        ) . '</a>';
5795
+                        ).'</a>';
5796 5796
                 }
5797 5797
             }
5798 5798
         }
@@ -5800,8 +5800,8 @@  discard block
 block discarded – undo
5800 5800
         if ($type == 'file' && ($extension == 'html' || $extension == 'htm')) {
5801 5801
             if ($is_template == 0) {
5802 5802
                 if ((isset($_GET['curdirpath']) && $_GET['curdirpath'] != '/certificates') || !isset($_GET['curdirpath'])) {
5803
-                    $modify_icons .= '&nbsp;<a href="' . api_get_self() . '?' . api_get_cidreq() . '&amp;curdirpath=' . $curdirpath . '&amp;add_as_template=' . $id .  '&amp;' . $sort_params . '">' .
5804
-                        Display::return_icon('wizard.png', get_lang('AddAsTemplate'), array(), ICON_SIZE_SMALL) . '</a>';
5803
+                    $modify_icons .= '&nbsp;<a href="'.api_get_self().'?'.api_get_cidreq().'&amp;curdirpath='.$curdirpath.'&amp;add_as_template='.$id.'&amp;'.$sort_params.'">'.
5804
+                        Display::return_icon('wizard.png', get_lang('AddAsTemplate'), array(), ICON_SIZE_SMALL).'</a>';
5805 5805
                 }
5806 5806
                 if (isset($_GET['curdirpath']) && $_GET['curdirpath'] == '/certificates') {//allow attach certificate to course
5807 5807
                     $visibility_icon_certificate = 'nocertificate';
@@ -5815,21 +5815,21 @@  discard block
 block discarded – undo
5815 5815
                         $certificate = get_lang('NoDefaultCertificate');
5816 5816
                     }
5817 5817
                     if (isset($_GET['selectcat'])) {
5818
-                        $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 . '">';
5818
+                        $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.'">';
5819 5819
                         $modify_icons .= Display::return_icon($visibility_icon_certificate.'.png', $certificate);
5820 5820
                         $modify_icons .= '</a>';
5821 5821
                         if ($is_preview) {
5822
-                            $modify_icons .= '&nbsp;<a target="_blank"  href="' . api_get_self() . '?' . api_get_cidreq() . '&amp;curdirpath=' . $curdirpath . '&amp;set_preview=' . $id . '&amp;' . $sort_params . '" >' .
5823
-                                Display::return_icon('preview_view.png', $preview, '', ICON_SIZE_SMALL) . '</a>';
5822
+                            $modify_icons .= '&nbsp;<a target="_blank"  href="'.api_get_self().'?'.api_get_cidreq().'&amp;curdirpath='.$curdirpath.'&amp;set_preview='.$id.'&amp;'.$sort_params.'" >'.
5823
+                                Display::return_icon('preview_view.png', $preview, '', ICON_SIZE_SMALL).'</a>';
5824 5824
                         }
5825 5825
                     }
5826 5826
                 }
5827 5827
             } else {
5828
-                $modify_icons .= '&nbsp;<a href="' . api_get_self() . '?' . api_get_cidreq() . '&curdirpath=' . $curdirpath . '&amp;remove_as_template=' . $id. '&amp;' . $sort_params . '">' .
5829
-                    Display::return_icon('wizard_na.png', get_lang('RemoveAsTemplate'), '', ICON_SIZE_SMALL) . '</a>';
5828
+                $modify_icons .= '&nbsp;<a href="'.api_get_self().'?'.api_get_cidreq().'&curdirpath='.$curdirpath.'&amp;remove_as_template='.$id.'&amp;'.$sort_params.'">'.
5829
+                    Display::return_icon('wizard_na.png', get_lang('RemoveAsTemplate'), '', ICON_SIZE_SMALL).'</a>';
5830 5830
             }
5831
-            $modify_icons .= '&nbsp;<a href="' . api_get_self() . '?' . api_get_cidreq() . '&action=export_to_pdf&id=' . $id . '">' .
5832
-                Display::return_icon('pdf.png', get_lang('Export2PDF'), array(), ICON_SIZE_SMALL) . '</a>';
5831
+            $modify_icons .= '&nbsp;<a href="'.api_get_self().'?'.api_get_cidreq().'&action=export_to_pdf&id='.$id.'">'.
5832
+                Display::return_icon('pdf.png', get_lang('Export2PDF'), array(), ICON_SIZE_SMALL).'</a>';
5833 5833
         }
5834 5834
 
5835 5835
         return $modify_icons;
@@ -5901,7 +5901,7 @@  discard block
 block discarded – undo
5901 5901
                     // 3. inside a subfolder of the folder you want to move
5902 5902
                     if (($curdirpath != $folder) &&
5903 5903
                         ($folder != $move_file) &&
5904
-                        (substr($folder, 0, strlen($move_file) + 1) != $move_file . '/')
5904
+                        (substr($folder, 0, strlen($move_file) + 1) != $move_file.'/')
5905 5905
                     ) {
5906 5906
                         $path_displayed = $folder;
5907 5907
                         // If document title is used, we have to display titles instead of real paths...
@@ -5918,7 +5918,7 @@  discard block
 block discarded – undo
5918 5918
             foreach ($folders as $folder) {
5919 5919
                 if (($curdirpath != $folder) &&
5920 5920
                     ($folder != $move_file) &&
5921
-                    (substr($folder, 0, strlen($move_file) + 1) != $move_file . '/')
5921
+                    (substr($folder, 0, strlen($move_file) + 1) != $move_file.'/')
5922 5922
                 ) {
5923 5923
                     // Cannot copy dir into his own subdir
5924 5924
                     $path_displayed = DocumentManager::get_titles_of_path($folder);
@@ -5961,10 +5961,10 @@  discard block
 block discarded – undo
5961 5961
                 // If this path has soon been stored here we don't need a new query
5962 5962
                 $path_displayed .= $tmp_folders_titles[$tmp_path];
5963 5963
             } else {
5964
-                $sql = 'SELECT title FROM ' . Database::get_course_table(TABLE_DOCUMENT) . '
5965
-                    WHERE c_id = ' . $course_id . ' AND path LIKE BINARY "' . $tmp_path . '"';
5964
+                $sql = 'SELECT title FROM '.Database::get_course_table(TABLE_DOCUMENT).'
5965
+                    WHERE c_id = ' . $course_id.' AND path LIKE BINARY "'.$tmp_path.'"';
5966 5966
                 $rs = Database::query($sql);
5967
-                $tmp_title = '/' . Database::result($rs, 0, 0);
5967
+                $tmp_title = '/'.Database::result($rs, 0, 0);
5968 5968
                 $path_displayed .= $tmp_title;
5969 5969
                 $tmp_folders_titles[$tmp_path] = $tmp_title;
5970 5970
             }
@@ -6001,7 +6001,7 @@  discard block
 block discarded – undo
6001 6001
         $clean_curdirpath = Security::remove_XSS($curdirpath);
6002 6002
         if ($clean_curdirpath == '/shared_folder') {
6003 6003
             return true;
6004
-        } elseif ($clean_curdirpath == '/shared_folder_session_' . $current_session_id) {
6004
+        } elseif ($clean_curdirpath == '/shared_folder_session_'.$current_session_id) {
6005 6005
             return true;
6006 6006
         } else {
6007 6007
             return false;
@@ -6017,7 +6017,7 @@  discard block
 block discarded – undo
6017 6017
         $clean_path = Security::remove_XSS($path);
6018 6018
         if (strpos($clean_path, 'shared_folder/sf_user_')) {
6019 6019
             return true;
6020
-        } elseif (strpos($clean_path, 'shared_folder_session_' . $current_session_id . '/sf_user_')) {
6020
+        } elseif (strpos($clean_path, 'shared_folder_session_'.$current_session_id.'/sf_user_')) {
6021 6021
             return true;
6022 6022
         } else {
6023 6023
             return false;
@@ -6030,11 +6030,11 @@  discard block
 block discarded – undo
6030 6030
      */
6031 6031
     public static function is_my_shared_folder($user_id, $path, $current_session_id)
6032 6032
     {
6033
-        $clean_path = Security::remove_XSS($path) . '/';
6033
+        $clean_path = Security::remove_XSS($path).'/';
6034 6034
         //for security does not remove the last slash
6035
-        $main_user_shared_folder = '/shared_folder\/sf_user_' . $user_id . '\//';
6035
+        $main_user_shared_folder = '/shared_folder\/sf_user_'.$user_id.'\//';
6036 6036
         //for security does not remove the last slash
6037
-        $main_user_shared_folder_session = '/shared_folder_session_' . $current_session_id . '\/sf_user_' . $user_id . '\//';
6037
+        $main_user_shared_folder_session = '/shared_folder_session_'.$current_session_id.'\/sf_user_'.$user_id.'\//';
6038 6038
 
6039 6039
         if (preg_match($main_user_shared_folder, $clean_path)) {
6040 6040
             return true;
@@ -6307,7 +6307,7 @@  discard block
 block discarded – undo
6307 6307
                 ON (i.c_id = d.c_id)
6308 6308
                 WHERE
6309 6309
                     d.id = i.ref AND
6310
-                    i.tool = '" . TOOL_DOCUMENT . "'
6310
+                    i.tool = '".TOOL_DOCUMENT."'
6311 6311
                     $conditionSession AND
6312 6312
                     i.c_id = $courseId AND
6313 6313
                     d.c_id = $courseId ";
@@ -6315,9 +6315,9 @@  discard block
 block discarded – undo
6315 6315
         $result = Database::query($sql);
6316 6316
         $documents = Database::store_result($result, 'ASSOC');
6317 6317
         if ($documents) {
6318
-            $course_dir = $courseInfo['directory'] . '/document';
6318
+            $course_dir = $courseInfo['directory'].'/document';
6319 6319
             $sys_course_path = api_get_path(SYS_COURSE_PATH);
6320
-            $base_work_dir = $sys_course_path . $course_dir;
6320
+            $base_work_dir = $sys_course_path.$course_dir;
6321 6321
 
6322 6322
             foreach ($documents as $document) {
6323 6323
                 $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.