Completed
Pull Request — 1.11.x (#1628)
by José
97:30 queued 69:06
created
main/document/create_audio.php 1 patch
Spacing   +50 added lines, -50 removed lines patch added patch discarded remove patch
@@ -63,35 +63,35 @@  discard block
 block discarded – undo
63 63
 }
64 64
 
65 65
 if ($dir[0] != '/') {
66
-    $dir = '/' . $dir;
66
+    $dir = '/'.$dir;
67 67
 }
68 68
 
69 69
 if ($dir[strlen($dir) - 1] != '/') {
70 70
     $dir .= '/';
71 71
 }
72 72
 
73
-$filepath = api_get_path(SYS_COURSE_PATH) . $_course['path'] . '/document' . $dir;
73
+$filepath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document'.$dir;
74 74
 
75 75
 if (!is_dir($filepath)) {
76
-    $filepath = api_get_path(SYS_COURSE_PATH) . $_course['path'] . '/document/';
76
+    $filepath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document/';
77 77
     $dir = '/';
78 78
 }
79 79
 
80 80
 //groups //TODO: clean
81 81
 if (!empty($groupId)) {
82 82
     $interbreadcrumb[] = array(
83
-        "url" => "../group/group_space.php?" . api_get_cidreq(),
83
+        "url" => "../group/group_space.php?".api_get_cidreq(),
84 84
         "name" => get_lang('GroupSpace')
85 85
     );
86 86
     $group = GroupManager:: get_group_properties($groupId);
87 87
     $path = explode('/', $dir);
88
-    if ('/' . $path[1] != $group['directory']) {
88
+    if ('/'.$path[1] != $group['directory']) {
89 89
         api_not_allowed(true);
90 90
     }
91 91
 }
92 92
 
93 93
 $interbreadcrumb[] = array(
94
-    "url" => "./document.php?curdirpath=" . urlencode($dir) . "&" . api_get_cidreq(),
94
+    "url" => "./document.php?curdirpath=".urlencode($dir)."&".api_get_cidreq(),
95 95
     "name" => get_lang('Documents')
96 96
 );
97 97
 
@@ -128,11 +128,11 @@  discard block
 block discarded – undo
128 128
 
129 129
 $dir_acum = '';
130 130
 for ($i = 0; $i < $array_len; $i++) {
131
-    $url_dir = 'document.php?&curdirpath=' . $dir_acum . $dir_array[$i];
131
+    $url_dir = 'document.php?&curdirpath='.$dir_acum.$dir_array[$i];
132 132
     //Max char 80
133 133
     $url_to_who = cut($dir_array[$i], 80);
134 134
     $interbreadcrumb[] = array('url' => $url_dir, 'name' => $url_to_who);
135
-    $dir_acum .= $dir_array[$i] . '/';
135
+    $dir_acum .= $dir_array[$i].'/';
136 136
 }
137 137
 
138 138
 $service = isset($_GET['service']) ? $_GET['service'] : 'pediaphon';
@@ -140,15 +140,15 @@  discard block
 block discarded – undo
140 140
 Display:: display_header($nameTools, 'Doc');
141 141
 
142 142
 echo '<div class="actions">';
143
-echo '<a href="document.php?id=' . $document_id . '">' .
144
-    Display::return_icon('back.png', get_lang('BackTo') . ' ' . get_lang('DocumentsOverview'), '',
145
-        ICON_SIZE_MEDIUM) . '</a>';
143
+echo '<a href="document.php?id='.$document_id.'">'.
144
+    Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('DocumentsOverview'), '',
145
+        ICON_SIZE_MEDIUM).'</a>';
146 146
 
147
-echo '<a href="create_audio.php?' . api_get_cidreq() . '&id=' . $document_id . '&service=pediaphon">' .
148
-    Display::return_icon('pediaphon.png', get_lang('Pediaphon'), '', ICON_SIZE_MEDIUM) . '</a>';
147
+echo '<a href="create_audio.php?'.api_get_cidreq().'&id='.$document_id.'&service=pediaphon">'.
148
+    Display::return_icon('pediaphon.png', get_lang('Pediaphon'), '', ICON_SIZE_MEDIUM).'</a>';
149 149
 
150
-echo '<a href="create_audio.php?' . api_get_cidreq() . '&id=' . $document_id . '&service=google">' .
151
-    Display::return_icon('google.png', get_lang('GoogleAudio'), '', ICON_SIZE_MEDIUM) . '</a>';
150
+echo '<a href="create_audio.php?'.api_get_cidreq().'&id='.$document_id.'&service=google">'.
151
+    Display::return_icon('google.png', get_lang('GoogleAudio'), '', ICON_SIZE_MEDIUM).'</a>';
152 152
 echo '</div>';
153 153
 ?>
154 154
     <!-- javascript and styles for textareaCounter-->
@@ -213,14 +213,14 @@  discard block
 block discarded – undo
213 213
 $selected_language = null;
214 214
 
215 215
 while ($row = Database::fetch_array($result_select)) {
216
-    $options[$row['isocode']] = $row['original_name'] . ' (' . $row['english_name'] . ')';
216
+    $options[$row['isocode']] = $row['original_name'].' ('.$row['english_name'].')';
217 217
     if (in_array($row['isocode'], array('de', 'en', 'es', 'fr'))) {
218
-        $options_pedia[$row['isocode']] = $row['original_name'] . ' (' . $row['english_name'] . ')';
218
+        $options_pedia[$row['isocode']] = $row['original_name'].' ('.$row['english_name'].')';
219 219
     }
220 220
 }
221 221
 
222 222
 if ($service == 'google') {
223
-    $selected_language = api_get_language_isocode();//lang default is the course language
223
+    $selected_language = api_get_language_isocode(); //lang default is the course language
224 224
 
225 225
     $form = new FormValidator('form1', 'post', api_get_self().'?'.api_get_cidreq(), '', array('id' => 'form1'));
226 226
     $form->addHeader(get_lang('HelpText2Audio'));
@@ -272,16 +272,16 @@  discard block
 block discarded – undo
272 272
         var voices = new Array()
273 273
 
274 274
         <!--German -->
275
-        voices['de'] = ["<?php echo get_lang('Female') . ' (de1)'; ?>|de1", "<?php echo get_lang('Male') . ' (de2)'; ?>|de2", "<?php echo get_lang('Female') . ' (de3)'; ?>|de3", "<?php echo get_lang('Male') . ' (de4)'; ?>|de4", "<?php echo get_lang('Female') . ' (de5)'; ?>|de5", "<?php echo get_lang('Male') . ' (de6)'; ?>|de6", "<?php echo get_lang('Female') . ' (de7)'; ?>|de7", "<?php echo get_lang('Female') . ' (de8 HQ)'; ?>|de8"]
275
+        voices['de'] = ["<?php echo get_lang('Female').' (de1)'; ?>|de1", "<?php echo get_lang('Male').' (de2)'; ?>|de2", "<?php echo get_lang('Female').' (de3)'; ?>|de3", "<?php echo get_lang('Male').' (de4)'; ?>|de4", "<?php echo get_lang('Female').' (de5)'; ?>|de5", "<?php echo get_lang('Male').' (de6)'; ?>|de6", "<?php echo get_lang('Female').' (de7)'; ?>|de7", "<?php echo get_lang('Female').' (de8 HQ)'; ?>|de8"]
276 276
 
277 277
         <!--English -->
278
-        voices['en'] = ["<?php echo get_lang('Male') . ' (en1)'; ?>|en1", "<?php echo get_lang('Male') . ' (en2 HQ)'; ?>|en2", "<?php echo get_lang('Female') . ' (us1)'; ?>|us1", "<?php echo get_lang('Male') . ' (us2)'; ?>|us2", "<?php echo get_lang('Male') . ' (us3)'; ?>|us3", "<?php echo get_lang('Female') . '(us4 HQ)'; ?>|us4"]
278
+        voices['en'] = ["<?php echo get_lang('Male').' (en1)'; ?>|en1", "<?php echo get_lang('Male').' (en2 HQ)'; ?>|en2", "<?php echo get_lang('Female').' (us1)'; ?>|us1", "<?php echo get_lang('Male').' (us2)'; ?>|us2", "<?php echo get_lang('Male').' (us3)'; ?>|us3", "<?php echo get_lang('Female').'(us4 HQ)'; ?>|us4"]
279 279
 
280 280
         <!--Spanish -->
281
-        voices['es'] = ["<?php echo get_lang('Male') . ' (es5 HQ)'; ?>|es5"]
281
+        voices['es'] = ["<?php echo get_lang('Male').' (es5 HQ)'; ?>|es5"]
282 282
 
283 283
         <!--French -->
284
-        voices['fr'] = ["<?php echo get_lang('Female') . ' (fr8 HQ)'; ?>|fr8"]
284
+        voices['fr'] = ["<?php echo get_lang('Female').' (fr8 HQ)'; ?>|fr8"]
285 285
 
286 286
         $(document).ready(function () {
287 287
             $('.lang').on('change', function () {
@@ -312,11 +312,11 @@  discard block
 block discarded – undo
312 312
  */
313 313
 function downloadMP3_google($filepath, $dir)
314 314
 {
315
-    $location = 'create_audio.php?' . api_get_cidreq() . '&id=' . intval($_POST['id']) . '&service=google';
315
+    $location = 'create_audio.php?'.api_get_cidreq().'&id='.intval($_POST['id']).'&service=google';
316 316
 
317 317
     //security
318 318
     if (!isset($_POST['lang']) && !isset($_POST['text']) && !isset($_POST['title']) && !isset($filepath) && !isset($dir)) {
319
-        echo '<script>window.location.href="' . $location . '"</script>';
319
+        echo '<script>window.location.href="'.$location.'"</script>';
320 320
         return;
321 321
     }
322 322
 
@@ -326,33 +326,33 @@  discard block
 block discarded – undo
326 326
     $clean_title = trim($_POST['title']);
327 327
     $clean_text = trim($_POST['text']);
328 328
     if (empty($clean_title) || empty($clean_text)) {
329
-        echo '<script>window.location.href="' . $location . '"</script>';
329
+        echo '<script>window.location.href="'.$location.'"</script>';
330 330
         
331 331
         return;
332 332
     }
333 333
     $clean_title = Security::remove_XSS($clean_title);
334 334
     $clean_title = Database::escape_string($clean_title);
335
-    $clean_title = str_replace(' ', '_', $clean_title);//compound file names
335
+    $clean_title = str_replace(' ', '_', $clean_title); //compound file names
336 336
 
337 337
     $clean_text = Security::remove_XSS($clean_text);
338 338
     $clean_lang = Security::remove_XSS($_POST['lang']);
339 339
 
340 340
     $extension = 'mp3';
341
-    $audio_filename = $clean_title . '.' . $extension;
341
+    $audio_filename = $clean_title.'.'.$extension;
342 342
     $audio_title = str_replace('_', ' ', $clean_title);
343 343
 
344 344
     //prevent duplicates
345
-    if (file_exists($filepath . '/' . $clean_title . '.' . $extension)) {
345
+    if (file_exists($filepath.'/'.$clean_title.'.'.$extension)) {
346 346
         $i = 1;
347
-        while (file_exists($filepath . '/' . $clean_title . '_' . $i . '.' . $extension)) {
347
+        while (file_exists($filepath.'/'.$clean_title.'_'.$i.'.'.$extension)) {
348 348
             $i++;
349 349
         }
350
-        $audio_filename = $clean_title . '_' . $i . '.' . $extension;
351
-        $audio_title = $clean_title . '_' . $i . '.' . $extension;
350
+        $audio_filename = $clean_title.'_'.$i.'.'.$extension;
351
+        $audio_title = $clean_title.'_'.$i.'.'.$extension;
352 352
         $audio_title = str_replace('_', ' ', $audio_title);
353 353
     }
354 354
 
355
-    $documentPath = $filepath . '/' . $audio_filename;
355
+    $documentPath = $filepath.'/'.$audio_filename;
356 356
 
357 357
     $clean_text = api_replace_dangerous_char($clean_text);
358 358
 
@@ -361,7 +361,7 @@  discard block
 block discarded – undo
361 361
 
362 362
     $proxySettings = api_get_configuration_value('proxy_settings');
363 363
     $key = api_get_configuration_value('translate_app_google_key');
364
-    $url = "https://www.googleapis.com/language/translate/v2?key=$key&" . $clean_lang . "&target=$clean_lang&q=" . urlencode($clean_text) . "";
364
+    $url = "https://www.googleapis.com/language/translate/v2?key=$key&".$clean_lang."&target=$clean_lang&q=".urlencode($clean_text)."";
365 365
 
366 366
     if (empty($proxySettings)) {
367 367
         $content = file_get_contents($url);
@@ -381,7 +381,7 @@  discard block
 block discarded – undo
381 381
     $relativeUrlPath = $dir;
382 382
     $doc_id = add_document(
383 383
         $_course,
384
-        $relativeUrlPath . $audio_filename,
384
+        $relativeUrlPath.$audio_filename,
385 385
         'file',
386 386
         filesize($documentPath),
387 387
         $audio_title
@@ -400,7 +400,7 @@  discard block
 block discarded – undo
400 400
     );
401 401
     Display::display_confirmation_message(get_lang('DocumentCreated'));
402 402
     //return to location
403
-    echo '<script>window.location.href="' . $location . '"</script>';
403
+    echo '<script>window.location.href="'.$location.'"</script>';
404 404
 }
405 405
 
406 406
 /**
@@ -413,10 +413,10 @@  discard block
 block discarded – undo
413 413
  */
414 414
 function downloadMP3_pediaphon($filepath, $dir)
415 415
 {
416
-    $location = 'create_audio.php?' . api_get_cidreq() . '&id=' . intval($_POST['id']) . '&service=pediaphon';
416
+    $location = 'create_audio.php?'.api_get_cidreq().'&id='.intval($_POST['id']).'&service=pediaphon';
417 417
     //security
418 418
     if (!isset($_POST['lang']) && !isset($_POST['text']) && !isset($_POST['title']) && !isset($filepath) && !isset($dir)) {
419
-        echo '<script>window.location.href="' . $location . '"</script>';
419
+        echo '<script>window.location.href="'.$location.'"</script>';
420 420
         return;
421 421
     }
422 422
     $_course = api_get_course_info();
@@ -426,33 +426,33 @@  discard block
 block discarded – undo
426 426
     $clean_text = trim($_POST['text']);
427 427
     $clean_voices = Security::remove_XSS($_POST['voices']);
428 428
     if (empty($clean_title) || empty($clean_text) || empty($clean_voices)) {
429
-        echo '<script>window.location.href="' . $location . '"</script>';
429
+        echo '<script>window.location.href="'.$location.'"</script>';
430 430
 
431 431
         return;
432 432
     }
433 433
     $clean_title = Security::remove_XSS($clean_title);
434 434
     $clean_title = Database::escape_string($clean_title);
435
-    $clean_title = str_replace(' ', '_', $clean_title);//compound file names
435
+    $clean_title = str_replace(' ', '_', $clean_title); //compound file names
436 436
     $clean_text = Security::remove_XSS($clean_text);
437 437
     $clean_lang = Security::remove_XSS($_POST['lang']);
438 438
     $clean_speed = Security::remove_XSS($_POST['speed']);
439 439
 
440 440
     $extension = 'mp3';
441
-    $audio_filename = $clean_title . '.' . $extension;
441
+    $audio_filename = $clean_title.'.'.$extension;
442 442
     $audio_title = str_replace('_', ' ', $clean_title);
443 443
 
444 444
     //prevent duplicates
445
-    if (file_exists($filepath . '/' . $clean_title . '.' . $extension)) {
445
+    if (file_exists($filepath.'/'.$clean_title.'.'.$extension)) {
446 446
         $i = 1;
447
-        while (file_exists($filepath . '/' . $clean_title . '_' . $i . '.' . $extension)) {
447
+        while (file_exists($filepath.'/'.$clean_title.'_'.$i.'.'.$extension)) {
448 448
             $i++;
449 449
         }
450
-        $audio_filename = $clean_title . '_' . $i . '.' . $extension;
451
-        $audio_title = $clean_title . '_' . $i . '.' . $extension;
450
+        $audio_filename = $clean_title.'_'.$i.'.'.$extension;
451
+        $audio_title = $clean_title.'_'.$i.'.'.$extension;
452 452
         $audio_title = str_replace('_', ' ', $audio_title);
453 453
     }
454 454
 
455
-    $documentPath = $filepath . '/' . $audio_filename;
455
+    $documentPath = $filepath.'/'.$audio_filename;
456 456
     $clean_text = api_replace_dangerous_char($clean_text);
457 457
 
458 458
     //adding the file
@@ -461,17 +461,17 @@  discard block
 block discarded – undo
461 461
         $url_pediaphon = 'http://www.pediaphon.org/~bischoff/radiopedia/sprich_multivoice.cgi';
462 462
         $find_t2v = '/http\:\/\/www\.pediaphon\.org\/\~bischoff\/radiopedia\/mp3\/(.*)\.mp3\"/';
463 463
     } else {
464
-        $url_pediaphon = 'http://www.pediaphon.org/~bischoff/radiopedia/sprich_multivoice_' . $clean_lang . '.cgi';//en, es, fr
465
-        $find_t2v = '/http\:\/\/www\.pediaphon\.org\/\~bischoff\/radiopedia\/mp3\/' . $clean_lang . '\/(.*)\.mp3\"/';
464
+        $url_pediaphon = 'http://www.pediaphon.org/~bischoff/radiopedia/sprich_multivoice_'.$clean_lang.'.cgi'; //en, es, fr
465
+        $find_t2v = '/http\:\/\/www\.pediaphon\.org\/\~bischoff\/radiopedia\/mp3\/'.$clean_lang.'\/(.*)\.mp3\"/';
466 466
     }
467 467
 
468
-    $data = "stimme=" . $clean_voices . "&inputtext=" . $clean_text . "&speed=" . $clean_speed . "&go=speak";
468
+    $data = "stimme=".$clean_voices."&inputtext=".$clean_text."&speed=".$clean_speed."&go=speak";
469 469
     $opts = array(
470 470
         'http' =>
471 471
             array(
472 472
                 'method' => 'POST',
473 473
                 'header' => "Content-Type: application/x-www-form-urlencoded\r\n",
474
-                "Content-Length: " . strlen($data) . "\r\n",
474
+                "Content-Length: ".strlen($data)."\r\n",
475 475
                 'content' => $data
476 476
             )
477 477
     );
@@ -515,5 +515,5 @@  discard block
 block discarded – undo
515 515
     );
516 516
     Display::display_confirmation_message(get_lang('DocumentCreated'));
517 517
     //return to location
518
-    echo '<script>window.location.href="' . $location . '"</script>';
518
+    echo '<script>window.location.href="'.$location.'"</script>';
519 519
 }
Please login to merge, or discard this patch.
main/badge/issued_all.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 $skillId = isset($_GET['skill']) ? intval($_GET['skill']) : 0;
14 14
 
15 15
 if (!$userId || !$skillId) {
16
-    header('Location: ' . api_get_path(WEB_PATH));
16
+    header('Location: '.api_get_path(WEB_PATH));
17 17
     exit;
18 18
 }
19 19
 
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
         Display::return_message(get_lang('NoResults'), 'error')
32 32
     );
33 33
 
34
-    header('Location: ' . api_get_path(WEB_PATH));
34
+    header('Location: '.api_get_path(WEB_PATH));
35 35
     exit;
36 36
 }
37 37
 
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
         $entityManager->persist($skillIssue);
168 168
         $entityManager->flush();
169 169
 
170
-        header("Location: " . $skillIssue->getIssueUrlAll());
170
+        header("Location: ".$skillIssue->getIssueUrlAll());
171 171
         exit;
172 172
     }
173 173
 
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
         $entityManager->persist($skillUserComment);
199 199
         $entityManager->flush();
200 200
 
201
-        header("Location: " . $skillIssue->getIssueUrlAll());
201
+        header("Location: ".$skillIssue->getIssueUrlAll());
202 202
         exit;
203 203
     }
204 204
 
@@ -214,11 +214,11 @@  discard block
 block discarded – undo
214 214
             $backpack = $configBackpack;
215 215
         }
216 216
 
217
-        $htmlHeadXtra[] = '<script src="' . $backpack . 'issuer.js"></script>';
217
+        $htmlHeadXtra[] = '<script src="'.$backpack.'issuer.js"></script>';
218 218
         $objSkill = new Skill();
219 219
         $assertionUrl = $skillIssueInfo['badge_assertion'];
220 220
         $skills = $objSkill->get($skillId);
221
-        $unbakedBadge = api_get_path(SYS_UPLOAD_PATH) . "badges/".$skills['icon'];
221
+        $unbakedBadge = api_get_path(SYS_UPLOAD_PATH)."badges/".$skills['icon'];
222 222
         if (!is_file($unbakedBadge)) {
223 223
             $unbakedBadge = api_get_path(WEB_CODE_PATH).'img/icons/128/badges-default.png';
224 224
         }
@@ -236,12 +236,12 @@  discard block
 block discarded – undo
236 236
                 mkdir($bakedBadge, api_get_permissions_for_new_directories(), true);
237 237
             }
238 238
             $skillRelUserId = $skillIssueInfo['id'];
239
-            if (!file_exists($bakedBadge . "/badge_" . $skillRelUserId)) {
240
-                file_put_contents($bakedBadge . "/badge_" . $skillRelUserId . ".png", $bakedInfo);
239
+            if (!file_exists($bakedBadge."/badge_".$skillRelUserId)) {
240
+                file_put_contents($bakedBadge."/badge_".$skillRelUserId.".png", $bakedInfo);
241 241
             }
242 242
 
243 243
             //Process to validate a baked badge
244
-            $badgeContent = file_get_contents($bakedBadge . "/badge_" . $skillRelUserId . ".png");
244
+            $badgeContent = file_get_contents($bakedBadge."/badge_".$skillRelUserId.".png");
245 245
             $verifyBakedBadge = $png->extractBadgeInfo($badgeContent);
246 246
             if (!is_array($verifyBakedBadge)) {
247 247
                 $badgeInfoError = true;
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
 
250 250
             if (!$badgeInfoError) {
251 251
                 $personalBadge = UserManager::getUserPathById($userId, "web");
252
-                $personalBadge = $personalBadge."badges/badge_" . $skillRelUserId . ".png";
252
+                $personalBadge = $personalBadge."badges/badge_".$skillRelUserId.".png";
253 253
             }
254 254
         }
255 255
     }
Please login to merge, or discard this patch.
src/Chamilo/CoreBundle/Entity/SkillRelUser.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -455,7 +455,7 @@  discard block
 block discarded – undo
455 455
      */
456 456
     public function getIssueUrl()
457 457
     {
458
-        return api_get_path(WEB_PATH) . "badge/{$this->id}";
458
+        return api_get_path(WEB_PATH)."badge/{$this->id}";
459 459
     }
460 460
 
461 461
     /**
@@ -464,7 +464,7 @@  discard block
 block discarded – undo
464 464
      */
465 465
     public function getIssueUrlAll()
466 466
     {
467
-        return api_get_path(WEB_PATH) . "skill/{$this->skill->getId()}/user/{$this->user->getId()}";
467
+        return api_get_path(WEB_PATH)."skill/{$this->skill->getId()}/user/{$this->user->getId()}";
468 468
     }
469 469
 
470 470
     /**
@@ -473,7 +473,7 @@  discard block
 block discarded – undo
473 473
      */
474 474
     public function getAssertionUrl()
475 475
     {
476
-        $url = api_get_path(WEB_CODE_PATH) . "badge/assertion.php?";
476
+        $url = api_get_path(WEB_CODE_PATH)."badge/assertion.php?";
477 477
 
478 478
         $url .= http_build_query(array(
479 479
             'user' => $this->user->getId(),
Please login to merge, or discard this patch.
main/document/edit_draw.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 $dir = str_replace('\\', '/', $dir);
38 38
 
39 39
 /* Constants & Variables */
40
-$current_session_id=api_get_session_id();
40
+$current_session_id = api_get_session_id();
41 41
 $group_id = api_get_group_id();
42 42
 
43 43
 //path for svg-edit save
@@ -50,8 +50,8 @@  discard block
 block discarded – undo
50 50
 $file = basename($get_file);
51 51
 $temp_file = explode(".", $file);
52 52
 $filename = $temp_file[0];
53
-$nameTools = get_lang('EditDocument') . ': ' . $filename;
54
-$courseDir = $_course['path'] . '/document';
53
+$nameTools = get_lang('EditDocument').': '.$filename;
54
+$courseDir = $_course['path'].'/document';
55 55
 $is_allowed_to_edit = api_is_allowed_to_edit(null, true);
56 56
 
57 57
 /*	Other initialization code */
@@ -125,15 +125,15 @@  discard block
 block discarded – undo
125 125
 Display :: display_header($nameTools, 'Doc');
126 126
 echo '<div class="actions">';
127 127
 echo '<a href="document.php?id='.$parent_id.'">'.
128
-    Display::return_icon('back.png',get_lang('BackTo').' '.get_lang('DocumentsOverview'),'',ICON_SIZE_MEDIUM).'</a>';
128
+    Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('DocumentsOverview'), '', ICON_SIZE_MEDIUM).'</a>';
129 129
 echo '<a href="edit_document.php?'.api_get_cidreq().'&id='.$document_id.'&origin=editdraw">'.
130
-    Display::return_icon('edit.png',get_lang('Rename').'/'.get_lang('Comments'),'',ICON_SIZE_MEDIUM).'</a>';
130
+    Display::return_icon('edit.png', get_lang('Rename').'/'.get_lang('Comments'), '', ICON_SIZE_MEDIUM).'</a>';
131 131
 echo '</div>';
132 132
 
133 133
 if (api_browser_support('svg')) {
134 134
 	//automatic loading the course language
135 135
 	$svgedit_code_translation_table = array('' => 'en', 'pt' => 'pt-Pt', 'sr' => 'sr_latn');
136
-	$langsvgedit  = api_get_language_isocode();
136
+	$langsvgedit = api_get_language_isocode();
137 137
 	$langsvgedit = isset($svgedit_code_translation_table[$langsvgedit]) ? $svgedit_code_translation_table[$langsvgedit] : $langsvgedit;
138 138
 	$langsvgedit = file_exists(api_get_path(LIBRARY_PATH).'javascript/svgedit/locale/lang.'.$langsvgedit.'.js') ? $langsvgedit : 'en';
139 139
 	$svg_url = api_get_path(WEB_LIBRARY_PATH).'javascript/svgedit/svg-editor.php?url=../../../../../courses/'.$courseDir.$dir.$file.'&lang='.$langsvgedit;
Please login to merge, or discard this patch.
main/inc/lib/diagnoser.lib.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 {
16 16
     const STATUS_OK = 1;
17 17
     const STATUS_WARNING = 2;
18
-    const STATUS_ERROR 	= 3;
18
+    const STATUS_ERROR = 3;
19 19
     const STATUS_INFORMATION = 4;
20 20
 
21 21
     /**
@@ -42,12 +42,12 @@  discard block
 block discarded – undo
42 42
                 $html .= '<li>';
43 43
             }
44 44
             $params['section'] = $section;
45
-            $html .='<a href="system_status.php?section='.$section.'">'.get_lang($section).'</a></li>';
45
+            $html .= '<a href="system_status.php?section='.$section.'">'.get_lang($section).'</a></li>';
46 46
         }
47 47
 
48 48
         $html .= '</ul><div class="tab-pane">';
49 49
 
50
-        $data = call_user_func(array($this, 'get_' . $currentSection . '_data'));
50
+        $data = call_user_func(array($this, 'get_'.$currentSection.'_data'));
51 51
         echo $html;
52 52
 
53 53
         if ($currentSection != 'paths') {
@@ -114,11 +114,11 @@  discard block
 block discarded – undo
114 114
     {
115 115
         $array = array();
116 116
         $writable_folders = array(
117
-            api_get_path(SYS_APP_PATH) .'cache',
117
+            api_get_path(SYS_APP_PATH).'cache',
118 118
             api_get_path(SYS_COURSE_PATH),
119
-            api_get_path(SYS_APP_PATH) .'home',
120
-            api_get_path(SYS_APP_PATH) .'upload/users/',
121
-            api_get_path(SYS_PATH) .'main/default_course_document/images/',
119
+            api_get_path(SYS_APP_PATH).'home',
120
+            api_get_path(SYS_APP_PATH).'upload/users/',
121
+            api_get_path(SYS_PATH).'main/default_course_document/images/',
122 122
         );
123 123
         foreach ($writable_folders as $index => $folder) {
124 124
             $writable = is_writable($folder);
@@ -137,10 +137,10 @@  discard block
 block discarded – undo
137 137
 
138 138
         $exists = file_exists(api_get_path(SYS_CODE_PATH).'install');
139 139
         $status = $exists ? self :: STATUS_WARNING : self :: STATUS_OK;
140
-        $array[] = $this->build_setting($status, '[FILES]', get_lang('DirectoryExists') . ': /install', 'http://be2.php.net/file_exists', $exists, 0, 'yes_no', get_lang('DirectoryShouldBeRemoved'));
140
+        $array[] = $this->build_setting($status, '[FILES]', get_lang('DirectoryExists').': /install', 'http://be2.php.net/file_exists', $exists, 0, 'yes_no', get_lang('DirectoryShouldBeRemoved'));
141 141
 
142 142
         $app_version = api_get_setting('chamilo_database_version');
143
-        $array[] = $this->build_setting(self :: STATUS_INFORMATION, '[DB]', 'chamilo_database_version', '#', $app_version, 0, null,  'Chamilo DB version');
143
+        $array[] = $this->build_setting(self :: STATUS_INFORMATION, '[DB]', 'chamilo_database_version', '#', $app_version, 0, null, 'Chamilo DB version');
144 144
 
145 145
         $access_url_id = api_get_current_access_url_id();
146 146
 
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
                     $message2 .= get_lang('SpaceUsedOnSystemCannotBeMeasuredOnWindows');
153 153
                 } else {
154 154
                     $dir = api_get_path(SYS_PATH);
155
-                    $du = exec('du -sh ' . $dir, $err);
155
+                    $du = exec('du -sh '.$dir, $err);
156 156
                     list($size, $none) = explode("\t", $du);
157 157
                     $limit = $_configuration[$access_url_id]['hosting_limit_disk_space'];
158 158
                     $message2 .= sprintf(get_lang('TotalSpaceUsedByPortalXLimitIsYMB'), $size, $limit);
@@ -236,33 +236,33 @@  discard block
 block discarded – undo
236 236
         $array[] = $this->build_setting($status, '[INI]', 'default_charset', 'http://www.php.net/manual/en/ini.core.php#ini.default-charset', $setting, $req_setting, null, get_lang('DefaultCharsetInfo'));
237 237
 
238 238
         $setting = ini_get('max_execution_time');
239
-        $req_setting = '300 (' . get_lang('Minimum') . ')';
239
+        $req_setting = '300 ('.get_lang('Minimum').')';
240 240
         $status = $setting >= 300 ? self :: STATUS_OK : self :: STATUS_WARNING;
241 241
         $array[] = $this->build_setting($status, '[INI]', 'max_execution_time', 'http://www.php.net/manual/en/ini.core.php#ini.max-execution-time', $setting, $req_setting, null, get_lang('MaxExecutionTimeInfo'));
242 242
 
243 243
         $setting = ini_get('max_input_time');
244
-        $req_setting = '300 (' . get_lang('Minimum') . ')';
244
+        $req_setting = '300 ('.get_lang('Minimum').')';
245 245
         $status = $setting >= 300 ? self :: STATUS_OK : self :: STATUS_WARNING;
246 246
         $array[] = $this->build_setting($status, '[INI]', 'max_input_time', 'http://www.php.net/manual/en/ini.core.php#ini.max-input-time', $setting, $req_setting, null, get_lang('MaxInputTimeInfo'));
247 247
 
248 248
         $setting = ini_get('memory_limit');
249 249
         $req_setting = '>= '.REQUIRED_MIN_MEMORY_LIMIT.'M';
250 250
         $status = self :: STATUS_ERROR;
251
-        if ((float)$setting >= REQUIRED_MIN_MEMORY_LIMIT)
251
+        if ((float) $setting >= REQUIRED_MIN_MEMORY_LIMIT)
252 252
             $status = self :: STATUS_OK;
253 253
         $array[] = $this->build_setting($status, '[INI]', 'memory_limit', 'http://www.php.net/manual/en/ini.core.php#ini.memory-limit', $setting, $req_setting, null, get_lang('MemoryLimitInfo'));
254 254
 
255 255
         $setting = ini_get('post_max_size');
256 256
         $req_setting = '>= '.REQUIRED_MIN_POST_MAX_SIZE.'M';
257 257
         $status = self :: STATUS_ERROR;
258
-        if ((float)$setting >= REQUIRED_MIN_POST_MAX_SIZE)
258
+        if ((float) $setting >= REQUIRED_MIN_POST_MAX_SIZE)
259 259
             $status = self :: STATUS_OK;
260 260
         $array[] = $this->build_setting($status, '[INI]', 'post_max_size', 'http://www.php.net/manual/en/ini.core.php#ini.post-max-size', $setting, $req_setting, null, get_lang('PostMaxSizeInfo'));
261 261
 
262 262
         $setting = ini_get('upload_max_filesize');
263 263
         $req_setting = '>= '.REQUIRED_MIN_UPLOAD_MAX_FILESIZE.'M';
264 264
         $status = self :: STATUS_ERROR;
265
-        if ((float)$setting >= REQUIRED_MIN_UPLOAD_MAX_FILESIZE)
265
+        if ((float) $setting >= REQUIRED_MIN_UPLOAD_MAX_FILESIZE)
266 266
             $status = self :: STATUS_OK;
267 267
         $array[] = $this->build_setting($status, '[INI]', 'upload_max_filesize', 'http://www.php.net/manual/en/ini.core.php#ini.upload_max_filesize', $setting, $req_setting, null, get_lang('UploadMaxFilesizeInfo'));
268 268
 
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
         $status = $setting == $req_setting ? self :: STATUS_OK : self :: STATUS_WARNING;
277 277
         $array[] = $this->build_setting($status, '[SESSION]', 'session.gc_maxlifetime', 'http://www.php.net/manual/en/ini.core.php#session.gc-maxlifetime', $setting, $req_setting, null, get_lang('SessionGCMaxLifetimeInfo'));
278 278
 
279
-        if (api_check_browscap()){$setting = true;}else{$setting=false;}
279
+        if (api_check_browscap()) {$setting = true; } else {$setting = false; }
280 280
         $req_setting = true;
281 281
         $status = $setting == $req_setting ? self :: STATUS_OK : self :: STATUS_WARNING;
282 282
         $array[] = $this->build_setting($status, '[INI]', 'browscap', 'http://www.php.net/manual/en/misc.configuration.php#ini.browscap', $setting, $req_setting, 'on_off', get_lang('BrowscapInfo'));
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
 
333 333
             $loaded = extension_loaded($extension);
334 334
             $status = $loaded ? self :: STATUS_OK : self :: STATUS_ERROR;
335
-            $array[] = $this->build_setting($status, '[EXTENSION]', get_lang('LoadedExtension') . ': ' . $extension, $url, $loaded, $expected_value, 'yes_no_optional', $comment);
335
+            $array[] = $this->build_setting($status, '[EXTENSION]', get_lang('LoadedExtension').': '.$extension, $url, $loaded, $expected_value, 'yes_no_optional', $comment);
336 336
         }
337 337
 
338 338
         return $array;
@@ -455,9 +455,9 @@  discard block
 block discarded – undo
455 455
         $formatted_expected_value = $expected_value;
456 456
 
457 457
         if ($formatter) {
458
-            if (method_exists($this, 'format_' . $formatter)) {
459
-                $formatted_current_value = call_user_func(array($this, 'format_' . $formatter), $current_value);
460
-                $formatted_expected_value = call_user_func(array($this, 'format_' . $formatter), $expected_value);
458
+            if (method_exists($this, 'format_'.$formatter)) {
459
+                $formatted_current_value = call_user_func(array($this, 'format_'.$formatter), $current_value);
460
+                $formatted_expected_value = call_user_func(array($this, 'format_'.$formatter), $expected_value);
461 461
             }
462 462
         }
463 463
 
@@ -472,13 +472,13 @@  discard block
 block discarded – undo
472 472
      */
473 473
     public function get_link($title, $url)
474 474
     {
475
-        return '<a href="' . $url . '" target="about:bank">' . $title . '</a>';
475
+        return '<a href="'.$url.'" target="about:bank">'.$title.'</a>';
476 476
     }
477 477
 
478 478
     public function format_yes_no_optional($value)
479 479
     {
480 480
     	$return = '';
481
-    	switch($value) {
481
+    	switch ($value) {
482 482
      		case 0:
483 483
      			$return = get_lang('No');
484 484
      			break;
Please login to merge, or discard this patch.
main/inc/lib/exercise_show_functions.lib.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
                 </td>
55 55
 
56 56
                 <?php
57
-                if (!api_is_allowed_to_edit(null,true) && $feedbackType != EXERCISE_FEEDBACK_TYPE_EXAM) { ?>
57
+                if (!api_is_allowed_to_edit(null, true) && $feedbackType != EXERCISE_FEEDBACK_TYPE_EXAM) { ?>
58 58
                     <td>
59 59
                         <?php
60 60
                         $comm = Event::get_comments($id, $questionId);
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
         $showTotalScoreAndUserChoices
83 83
     ) {
84 84
         if (empty($id)) {
85
-            echo '<tr><td>'. Security::remove_XSS($answer).'</td></tr>';
85
+            echo '<tr><td>'.Security::remove_XSS($answer).'</td></tr>';
86 86
         } else {
87 87
         ?>
88 88
             <tr>
@@ -93,10 +93,10 @@  discard block
 block discarded – undo
93 93
                 </td>
94 94
 
95 95
             <?php
96
-            if (!api_is_allowed_to_edit(null,true) && $feedback_type != EXERCISE_FEEDBACK_TYPE_EXAM) { ?>
96
+            if (!api_is_allowed_to_edit(null, true) && $feedback_type != EXERCISE_FEEDBACK_TYPE_EXAM) { ?>
97 97
                 <td>
98 98
                     <?php
99
-                    $comm = Event::get_comments($id,$questionId);
99
+                    $comm = Event::get_comments($id, $questionId);
100 100
                     ?>
101 101
                 </td>
102 102
             <?php } ?>
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
         if (isset($fileUrl)) {
152 152
             echo '
153 153
                 <tr>
154
-                    <td><audio src="' . $fileUrl . '" controls></audio></td>
154
+                    <td><audio src="' . $fileUrl.'" controls></audio></td>
155 155
                 </tr>
156 156
             ';
157 157
         }
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
             echo '</tr>';
163 163
             if ($feedback_type != EXERCISE_FEEDBACK_TYPE_EXAM) {
164 164
                 echo '<tr>';
165
-                echo Display::tag('td',get_lang('notCorrectedYet'), array('width'=>'45%'));
165
+                echo Display::tag('td', get_lang('notCorrectedYet'), array('width'=>'45%'));
166 166
                 echo '</tr>';
167 167
             } else {
168 168
                 echo '<tr><td>&nbsp;</td></tr>';
@@ -175,9 +175,9 @@  discard block
 block discarded – undo
175 175
             }
176 176
             echo '</td>';
177 177
 
178
-            if (!api_is_allowed_to_edit(null,true) && $feedback_type != EXERCISE_FEEDBACK_TYPE_EXAM) {
178
+            if (!api_is_allowed_to_edit(null, true) && $feedback_type != EXERCISE_FEEDBACK_TYPE_EXAM) {
179 179
                 echo '<td>';
180
-                $comm = Event::get_comments($id,$questionId);
180
+                $comm = Event::get_comments($id, $questionId);
181 181
                 echo '</td>';
182 182
             }
183 183
             echo '</tr>';
@@ -306,12 +306,12 @@  discard block
 block discarded – undo
306 306
             }
307 307
         }
308 308
 
309
-        $icon = in_array($answerType, array(UNIQUE_ANSWER, UNIQUE_ANSWER_NO_OPTION)) ? 'radio':'checkbox';
310
-		$icon .= $studentChoice?'_on':'_off';
309
+        $icon = in_array($answerType, array(UNIQUE_ANSWER, UNIQUE_ANSWER_NO_OPTION)) ? 'radio' : 'checkbox';
310
+		$icon .= $studentChoice ? '_on' : '_off';
311 311
 		$icon .= '.gif';
312 312
 
313
-		$iconAnswer = in_array($answerType, array(UNIQUE_ANSWER, UNIQUE_ANSWER_NO_OPTION)) ? 'radio':'checkbox';
314
-		$iconAnswer .= $answerCorrect?'_on':'_off';
313
+		$iconAnswer = in_array($answerType, array(UNIQUE_ANSWER, UNIQUE_ANSWER_NO_OPTION)) ? 'radio' : 'checkbox';
314
+		$iconAnswer .= $answerCorrect ? '_on' : '_off';
315 315
 		$iconAnswer .= '.gif';
316 316
 
317 317
 		?>
@@ -351,8 +351,8 @@  discard block
 block discarded – undo
351 351
 			?>
352 352
 		</td>
353 353
 			<?php
354
-		    if ($ans==1) {
355
-		        $comm = Event::get_comments($id,$questionId);
354
+		    if ($ans == 1) {
355
+		        $comm = Event::get_comments($id, $questionId);
356 356
 			}
357 357
 		    ?>
358 358
 		 <?php } else { ?>
@@ -455,7 +455,7 @@  discard block
 block discarded – undo
455 455
             ?>
456 456
         </td>
457 457
             <?php
458
-            if ($ans==1) {
458
+            if ($ans == 1) {
459 459
                 $comm = Event::get_comments($id, $questionId);
460 460
             }
461 461
             ?>
@@ -558,8 +558,8 @@  discard block
 block discarded – undo
558 558
             ?>
559 559
         </td>
560 560
             <?php
561
-            if ($ans==1) {
562
-                $comm = Event::get_comments($id,$questionId);
561
+            if ($ans == 1) {
562
+                $comm = Event::get_comments($id, $questionId);
563 563
             }
564 564
             ?>
565 565
          <?php } else { ?>
Please login to merge, or discard this patch.
plugin/courseblock/install.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
1 1
 <?php
2 2
 /* For license terms, see /license.txt */
3 3
 
4
-require_once dirname(__FILE__) . '/config.php';
4
+require_once dirname(__FILE__).'/config.php';
5 5
 
6 6
 if (!api_is_platform_admin()) {
7 7
     die ('You must have admin permissions to install plugins');
Please login to merge, or discard this patch.
main/inc/lib/surveymanager.lib.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -47,20 +47,20 @@  discard block
 block discarded – undo
47 47
         $res = Database::query($sql);
48 48
         $refs = array();
49 49
         $list = array();
50
-        $plain_array=array();
50
+        $plain_array = array();
51 51
 
52 52
         while ($survey = Database::fetch_array($res, 'ASSOC')) {
53
-            $plain_array[$survey['survey_id']]=$survey;
54
-            $surveys_parents[]=$survey['survey_version'];
55
-            $thisref = &$refs[ $survey['survey_id'] ];
53
+            $plain_array[$survey['survey_id']] = $survey;
54
+            $surveys_parents[] = $survey['survey_version'];
55
+            $thisref = &$refs[$survey['survey_id']];
56 56
             $thisref['parent_id'] = $survey['parent_id'];
57 57
             $thisref['name'] = $survey['name'];
58 58
             $thisref['id'] = $survey['survey_id'];
59 59
             $thisref['survey_version'] = $survey['survey_version'];
60 60
             if ($survey['parent_id'] == 0) {
61
-                $list[ $survey['survey_id'] ] = &$thisref;
61
+                $list[$survey['survey_id']] = &$thisref;
62 62
             } else {
63
-                $refs[ $survey['parent_id'] ]['children'][ $survey['survey_id'] ] = &$thisref;
63
+                $refs[$survey['parent_id']]['children'][$survey['survey_id']] = &$thisref;
64 64
             }
65 65
         }
66 66
         $this->surveylist = $list;
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
     public function getParentId($id)
80 80
     {
81 81
         $node = $this->plainsurveylist[$id];
82
-        if (is_array($node)&& !empty($node['parent_id'])) {
82
+        if (is_array($node) && !empty($node['parent_id'])) {
83 83
             return $node['parent_id'];
84 84
         } else {
85 85
             return -1;
@@ -99,12 +99,12 @@  discard block
 block discarded – undo
99 99
         if (is_array($list)) {
100 100
             foreach ($list as $key => $node) {
101 101
                 if (isset($node['children']) && is_array($node['children'])) {
102
-                    $result[$key]= $node['name'];
102
+                    $result[$key] = $node['name'];
103 103
                     $re = self::createList($node['children']);
104 104
                     if (!empty($re)) {
105 105
                         if (is_array($re)) {
106 106
                             foreach ($re as $key => $r) {
107
-                                $result[$key] = '' . $r;
107
+                                $result[$key] = ''.$r;
108 108
                             }
109 109
                         } else {
110 110
                             $result[] = $re;
Please login to merge, or discard this patch.
main/survey/preview.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
 						survey_question_option.c_id = $course_id
155 155
 					WHERE
156 156
 					    survey_question.survey_id = '".intval($survey_id)."' AND
157
-						survey_question.question_id IN (".Database::escape_string(implode(',',$paged_questions[$_GET['show']]), null, false).") AND
157
+						survey_question.question_id IN (".Database::escape_string(implode(',', $paged_questions[$_GET['show']]), null, false).") AND
158 158
 						survey_question.c_id =  $course_id
159 159
 					ORDER BY survey_question.sort, survey_question_option.sort ASC";
160 160
 
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
 
192 192
 	// Displaying the form with the questions
193 193
 	if (isset($_GET['show'])) {
194
-		$show = (int)$_GET['show'] + 1;
194
+		$show = (int) $_GET['show'] + 1;
195 195
 	} else {
196 196
 		$show = 0;
197 197
 	}
Please login to merge, or discard this patch.