Completed
Push — 1.10.x ( fe0e5a...3a6f9c )
by Yannick
134:15 queued 86:39
created
main/coursecopy/classes/Survey.class.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -109,7 +109,7 @@
 block discarded – undo
109 109
         $invite_mail,
110 110
         $reminder_mail
111 111
     ) {
112
-		parent::__construct($id,RESOURCE_SURVEY);
112
+		parent::__construct($id, RESOURCE_SURVEY);
113 113
 		$this->code = $code;
114 114
 		$this->title = $title;
115 115
 		$this->subtitle = $subtitle;
Please login to merge, or discard this patch.
main/coursecopy/classes/CourseRecycler.class.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
     public function recycle_glossary()
161 161
     {
162 162
         if ($this->course->has_resources(RESOURCE_GLOSSARY)) {
163
-            $table_glossary	= Database::get_course_table(TABLE_GLOSSARY);
163
+            $table_glossary = Database::get_course_table(TABLE_GLOSSARY);
164 164
             $ids = implode(',', array_filter(array_keys($this->course->resources[RESOURCE_GLOSSARY])));
165 165
             if (!empty($ids)) {
166 166
                 $sql = "DELETE FROM ".$table_glossary."
@@ -556,7 +556,7 @@  discard block
 block discarded – undo
556 556
                     if (trim($learnpath->path) != '') {
557 557
                         // when $learnpath->path value is incorrect for some reason.
558 558
                         // The directory trat contains files of the SCORM package is to be deleted.
559
-                        $scorm_package_dir = realpath($this->course->path . 'scorm/' . $learnpath->path);
559
+                        $scorm_package_dir = realpath($this->course->path.'scorm/'.$learnpath->path);
560 560
                         rmdirr($scorm_package_dir);
561 561
                     }
562 562
                 }
@@ -632,7 +632,7 @@  discard block
 block discarded – undo
632 632
             foreach ($resources[RESOURCE_THEMATIC] as $last_id => $thematic) {
633 633
                 if (is_numeric($last_id)) {
634 634
 
635
-                    foreach($thematic->thematic_advance_list as $thematic_advance) {
635
+                    foreach ($thematic->thematic_advance_list as $thematic_advance) {
636 636
                         $cond = array(
637 637
                             'id = ? AND  c_id = ?' => array(
638 638
                                 $thematic_advance['id'],
@@ -649,7 +649,7 @@  discard block
 block discarded – undo
649 649
                         Database::delete($table_thematic_advance, $cond);
650 650
                     }
651 651
 
652
-                    foreach($thematic->thematic_plan_list as $thematic_plan) {
652
+                    foreach ($thematic->thematic_plan_list as $thematic_plan) {
653 653
                         $cond = array(
654 654
                             'id = ? AND  c_id = ?' => array(
655 655
                                 $thematic_plan['id'],
@@ -678,7 +678,7 @@  discard block
 block discarded – undo
678 678
                         'ThematicDeleted',
679 679
                         api_get_user_id()
680 680
                     );
681
-                    Database::delete($table_thematic,$cond);
681
+                    Database::delete($table_thematic, $cond);
682 682
                 }
683 683
             }
684 684
         }
@@ -696,7 +696,7 @@  discard block
 block discarded – undo
696 696
             $resources = $this->course->resources;
697 697
             foreach ($resources[RESOURCE_ATTENDANCE] as $last_id => $obj) {
698 698
                 if (is_numeric($last_id)) {
699
-                    foreach($obj->attendance_calendar as $attendance_calendar) {
699
+                    foreach ($obj->attendance_calendar as $attendance_calendar) {
700 700
                         $cond = array('id = ? AND c_id = ? '=>array($attendance_calendar['id'], $this->course_id));
701 701
                         Database::delete($table_attendance_calendar, $cond);
702 702
                     }
@@ -720,7 +720,7 @@  discard block
 block discarded – undo
720 720
     public function recycle_work($session_id = 0)
721 721
     {
722 722
         if ($this->course->has_resources(RESOURCE_WORK)) {
723
-            $table_work          = Database :: get_course_table(TABLE_STUDENT_PUBLICATION);
723
+            $table_work = Database :: get_course_table(TABLE_STUDENT_PUBLICATION);
724 724
             $table_work_assignment = Database :: get_course_table(TABLE_STUDENT_PUBLICATION_ASSIGNMENT);
725 725
 
726 726
             $resources = $this->course->resources;
Please login to merge, or discard this patch.
main/coursecopy/classes/Document.class.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -3,8 +3,8 @@  discard block
 block discarded – undo
3 3
 
4 4
 require_once 'Resource.class.php';
5 5
 
6
-define('DOCUMENT','file');
7
-define('FOLDER','folder');
6
+define('DOCUMENT', 'file');
7
+define('FOLDER', 'folder');
8 8
 
9 9
 /**
10 10
  * Class Document
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
     public function __construct($id, $path, $comment, $title, $file_type, $size)
32 32
     {
33 33
         parent::__construct($id, RESOURCE_DOCUMENT);
34
-        $this->path = 'document' . $path;
34
+        $this->path = 'document'.$path;
35 35
         $this->comment = $comment;
36 36
         $this->title = $title;
37 37
         $this->file_type = $file_type;
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
         echo preg_replace('@^document@', '', $this->path);
48 48
         if (!empty($this->title)) {
49 49
             if (strpos($this->path, $this->title) === false) {
50
-                echo " - " . $this->title;
50
+                echo " - ".$this->title;
51 51
             }
52 52
         }
53 53
     }
Please login to merge, or discard this patch.
main/coursecopy/classes/CourseSession.class.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
18 18
 	 * @param int $id
19 19
 	 * @param string $title
20 20
 	 */
21
-	public function __construct($id,$title)
21
+	public function __construct($id, $title)
22 22
 	{
23 23
 		parent::__construct($id, RESOURCE_SESSION_COURSE);
24 24
 		$this->title = $title;
Please login to merge, or discard this patch.
main/coursecopy/classes/ForumTopic.class.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -47,6 +47,6 @@
 block discarded – undo
47 47
             $user_info = api_get_user_info($this->obj->thread_poster_id);
48 48
             $extra = $user_info['complete_name'].', '.$extra;
49 49
         }
50
-        echo $this->obj->thread_title . ' (' . $extra . ')';
50
+        echo $this->obj->thread_title.' ('.$extra.')';
51 51
     }
52 52
 }
Please login to merge, or discard this patch.
main/coursecopy/classes/CourseRestorer.class.php 1 patch
Spacing   +82 added lines, -82 removed lines patch added patch discarded remove patch
@@ -520,7 +520,7 @@  discard block
 block discarded – undo
520 520
                                             $this->course->backup_path,
521 521
                                             $this->course->info['path']
522 522
                                         );
523
-                                        file_put_contents($path.$document->path,$content);
523
+                                        file_put_contents($path.$document->path, $content);
524 524
                                     }
525 525
 
526 526
                                     $params = [
@@ -564,14 +564,14 @@  discard block
 block discarded – undo
564 564
 								$new_file_name = $file_name_no_ext.'_'.$i.$ext;
565 565
 								$file_exists = file_exists($path.$new_file_name);
566 566
 								while ($file_exists) {
567
-									$i ++;
567
+									$i++;
568 568
 									$new_file_name = $file_name_no_ext.'_'.$i.$ext;
569 569
 									$file_exists = file_exists($path.$new_file_name);
570 570
 								}
571 571
 
572 572
 								if (!empty($session_id)) {
573 573
 
574
-									$document_path = explode('/',$document->path,3);
574
+									$document_path = explode('/', $document->path, 3);
575 575
 									$course_path = $path;
576 576
 									$orig_base_folder = $document_path[1];
577 577
 									$orig_base_path   = $course_path.$document_path[0].'/'.$document_path[1];
@@ -589,7 +589,7 @@  discard block
 block discarded – undo
589 589
 
590 590
 										$folder_exists = file_exists($new_base_path);
591 591
 										if ($folder_exists) {
592
-											$_SESSION['orig_base_foldername'] = $new_base_foldername; 		// e.g: carpeta1 in session
592
+											$_SESSION['orig_base_foldername'] = $new_base_foldername; // e.g: carpeta1 in session
593 593
 											$x = '';
594 594
 											while ($folder_exists) {
595 595
 												$x = $x + 1;
@@ -609,9 +609,9 @@  discard block
 block discarded – undo
609 609
 											$new_base_path = $_SESSION['new_base_path'];
610 610
 										}
611 611
 
612
-										$dest_document_path = $new_base_path.'/'.$document_path[2];		// e.g: "/var/www/wiener/courses/CURSO4/document/carpeta1_1/subcarpeta1/collaborative.png"
613
-										$basedir_dest_path 	= dirname($dest_document_path);				// e.g: "/var/www/wiener/courses/CURSO4/document/carpeta1_1/subcarpeta1"
614
-										$base_path_document = $course_path.$document_path[0];			// e.g: "/var/www/wiener/courses/CURSO4/document"
612
+										$dest_document_path = $new_base_path.'/'.$document_path[2]; // e.g: "/var/www/wiener/courses/CURSO4/document/carpeta1_1/subcarpeta1/collaborative.png"
613
+										$basedir_dest_path 	= dirname($dest_document_path); // e.g: "/var/www/wiener/courses/CURSO4/document/carpeta1_1/subcarpeta1"
614
+										$base_path_document = $course_path.$document_path[0]; // e.g: "/var/www/wiener/courses/CURSO4/document"
615 615
 
616 616
 										$path_title = '/'.$new_base_foldername.'/'.$document_path[2];
617 617
 
@@ -631,7 +631,7 @@  discard block
 block discarded – undo
631 631
                                         //Replace old course code with the new destination code see BT#1985
632 632
                                         if (file_exists($dest_document_path)) {
633 633
                                             $file_info = pathinfo($dest_document_path);
634
-                                            if (in_array($file_info['extension'], array('html','htm'))) {
634
+                                            if (in_array($file_info['extension'], array('html', 'htm'))) {
635 635
                                                 $content = file_get_contents($dest_document_path);
636 636
                                                 if (UTF8_CONVERT) {
637 637
                                                     $content = utf8_encode($content);
@@ -687,8 +687,8 @@  discard block
 block discarded – undo
687 687
                                         //Replace old course code with the new destination code see BT#1985
688 688
                                         if (file_exists($path.$new_file_name)) {
689 689
                                             $file_info = pathinfo($path.$new_file_name);
690
-                                            if (in_array($file_info['extension'], array('html','htm'))) {
691
-                                                $content    = file_get_contents($path.$new_file_name);
690
+                                            if (in_array($file_info['extension'], array('html', 'htm'))) {
691
+                                                $content = file_get_contents($path.$new_file_name);
692 692
                                                 if (UTF8_CONVERT) {
693 693
                                                     $content = utf8_encode($content);
694 694
                                                 }
@@ -741,8 +741,8 @@  discard block
 block discarded – undo
741 741
                                     //Replace old course code with the new destination code see BT#1985
742 742
                                     if (file_exists($path.$new_file_name)) {
743 743
                                         $file_info = pathinfo($path.$new_file_name);
744
-                                        if (in_array($file_info['extension'], array('html','htm'))) {
745
-                                            $content    = file_get_contents($path.$new_file_name);
744
+                                        if (in_array($file_info['extension'], array('html', 'htm'))) {
745
+                                            $content = file_get_contents($path.$new_file_name);
746 746
                                             if (UTF8_CONVERT) {
747 747
                                                 $content = utf8_encode($content);
748 748
                                             }
@@ -805,8 +805,8 @@  discard block
 block discarded – undo
805 805
                             //Replace old course code with the new destination code see BT#1985
806 806
                             if (file_exists($path.$document->path)) {
807 807
                                 $file_info = pathinfo($path.$document->path);
808
-                                if (in_array($file_info['extension'], array('html','htm'))) {
809
-                                    $content    = file_get_contents($path.$document->path);
808
+                                if (in_array($file_info['extension'], array('html', 'htm'))) {
809
+                                    $content = file_get_contents($path.$document->path);
810 810
                                     if (UTF8_CONVERT) {
811 811
                                         $content = utf8_encode($content);
812 812
                                     }
@@ -896,8 +896,8 @@  discard block
 block discarded – undo
896 896
 						case FILE_OVERWRITE:
897 897
 							rmdirr($path.$document->path);
898 898
                             copyDirTo(
899
-                                $this->course->backup_path . '/' . $document->path,
900
-                                $path . dirname($document->path),
899
+                                $this->course->backup_path.'/'.$document->path,
900
+                                $path.dirname($document->path),
901 901
                                 false
902 902
                             );
903 903
 							break;
@@ -919,23 +919,23 @@  discard block
 block discarded – undo
919 919
 							$file_exists = file_exists($path.$new_file_name);
920 920
 
921 921
 							while ($file_exists) {
922
-								$i ++;
922
+								$i++;
923 923
 								$new_file_name = $file_name_no_ext.'_'.$i.$ext;
924 924
 								$file_exists = file_exists($path.$new_file_name);
925 925
 							}
926 926
 
927 927
                             rename(
928
-                                $this->course->backup_path . '/' . $document->path,
929
-                                $this->course->backup_path . '/' . $new_file_name
928
+                                $this->course->backup_path.'/'.$document->path,
929
+                                $this->course->backup_path.'/'.$new_file_name
930 930
                             );
931 931
                             copyDirTo(
932
-                                $this->course->backup_path . '/' . $new_file_name,
933
-                                $path . dirname($new_file_name),
932
+                                $this->course->backup_path.'/'.$new_file_name,
933
+                                $path.dirname($new_file_name),
934 934
                                 false
935 935
                             );
936 936
                             rename(
937
-                                $this->course->backup_path . '/' . $new_file_name,
938
-                                $this->course->backup_path . '/' . $document->path
937
+                                $this->course->backup_path.'/'.$new_file_name,
938
+                                $this->course->backup_path.'/'.$document->path
939 939
                             );
940 940
 
941 941
 							break;
@@ -943,8 +943,8 @@  discard block
 block discarded – undo
943 943
 				} else {
944 944
                     // end if file exists
945 945
                     copyDirTo(
946
-                        $this->course->backup_path . '/' . $document->path,
947
-                        $path . dirname($document->path),
946
+                        $this->course->backup_path.'/'.$document->path,
947
+                        $path.dirname($document->path),
948 948
                         false
949 949
                     );
950 950
 				}
@@ -962,7 +962,7 @@  discard block
 block discarded – undo
962 962
 			$table_forum = Database::get_course_table(TABLE_FORUM);
963 963
 			$resources = $this->course->resources;
964 964
 			foreach ($resources[RESOURCE_FORUM] as $id => $forum) {
965
-                $params = (array)$forum->obj;
965
+                $params = (array) $forum->obj;
966 966
                 $cat_id = '';
967 967
                 if (isset($this->course->resources[RESOURCE_FORUMCATEGORY]) &&
968 968
                     isset($this->course->resources[RESOURCE_FORUMCATEGORY][$params['forum_category']])) {
@@ -1014,13 +1014,13 @@  discard block
 block discarded – undo
1014 1014
 					foreach ($this->course->resources[RESOURCE_FORUMTOPIC] as $topic_id => $topic) {
1015 1015
 						if ($topic->obj->forum_id == $id) {
1016 1016
 							$this->restore_topic($topic_id, $new_id, $sessionId);
1017
-							$forum_topics ++;
1017
+							$forum_topics++;
1018 1018
 						}
1019 1019
 					}
1020 1020
 				}
1021 1021
 				if ($forum_topics > 0) {
1022 1022
 					$sql = "UPDATE ".$table_forum." SET forum_threads = ".$forum_topics."
1023
-                            WHERE c_id = {$this->destination_course_id} AND forum_id = ".(int)$new_id;
1023
+                            WHERE c_id = {$this->destination_course_id} AND forum_id = ".(int) $new_id;
1024 1024
 					Database::query($sql);
1025 1025
 				}
1026 1026
 			}
@@ -1090,13 +1090,13 @@  discard block
 block discarded – undo
1090 1090
 		$table = Database :: get_course_table(TABLE_FORUM_THREAD);
1091 1091
 		$topic = $this->course->resources[RESOURCE_FORUMTOPIC][$thread_id];
1092 1092
 
1093
-        $params = (array)$topic->obj;
1093
+        $params = (array) $topic->obj;
1094 1094
         $params = self::DBUTF8_array($params);
1095 1095
         $params['c_id'] = $this->destination_course_id;
1096 1096
         $params['forum_id'] = $forum_id;
1097 1097
         $params['thread_poster_id'] = $this->first_teacher_id;
1098 1098
         $params['thread_date'] = api_get_utc_datetime();
1099
-        $params['thread_close_date']  = '0000-00-00 00:00:00';
1099
+        $params['thread_close_date'] = '0000-00-00 00:00:00';
1100 1100
         $params['thread_last_post'] = 0;
1101 1101
         $params['thread_replies'] = 0;
1102 1102
         $params['thread_views'] = 0;
@@ -1202,7 +1202,7 @@  discard block
 block discarded – undo
1202 1202
 				        FROM $link_table
1203 1203
 				        WHERE
1204 1204
 				            c_id = ".$this->destination_course_id." AND
1205
-				            category_id='" . intval($cat_id). "'";
1205
+				            category_id='" . intval($cat_id)."'";
1206 1206
 				$result = Database::query($sql);
1207 1207
     			list($max_order) = Database::fetch_array($result);
1208 1208
 
@@ -1217,7 +1217,7 @@  discard block
 block discarded – undo
1217 1217
                 $params['description'] = self::DBUTF8($link->description);
1218 1218
                 $params['category_id'] = $cat_id;
1219 1219
                 $params['on_homepage'] = $link->on_homepage;
1220
-                $params['display_order'] = $max_order+1;
1220
+                $params['display_order'] = $max_order + 1;
1221 1221
 
1222 1222
                 $id = Database::insert($link_table, $params);
1223 1223
 
@@ -1261,9 +1261,9 @@  discard block
 block discarded – undo
1261 1261
         if (is_object($link_cat) && !$link_cat->is_restored()) {
1262 1262
             $sql = "SELECT MAX(display_order) FROM  $link_cat_table
1263 1263
 			        WHERE c_id = ".$this->destination_course_id." ";
1264
-            $result=Database::query($sql);
1265
-            list($orderMax)=Database::fetch_array($result,'NUM');
1266
-            $display_order=$orderMax+1;
1264
+            $result = Database::query($sql);
1265
+            list($orderMax) = Database::fetch_array($result, 'NUM');
1266
+            $display_order = $orderMax + 1;
1267 1267
 
1268 1268
             $params['c_id'] = $this->destination_course_id;
1269 1269
             $params['category_title'] = self::DBUTF8($link_cat->title);
@@ -1639,9 +1639,9 @@  discard block
 block discarded – undo
1639 1639
                 if (!empty($quiz->sound)) {
1640 1640
                     if (isset($this->course->resources[RESOURCE_DOCUMENT][$quiz->sound]) &&
1641 1641
                         $this->course->resources[RESOURCE_DOCUMENT][$quiz->sound]->is_restored()) {
1642
-                        $sql = "SELECT path FROM " . $table_doc . "
1642
+                        $sql = "SELECT path FROM ".$table_doc."
1643 1643
                                 WHERE
1644
-                                    c_id = " . $this->destination_course_id . "  AND
1644
+                                    c_id = " . $this->destination_course_id."  AND
1645 1645
                                     id = " . $resources[RESOURCE_DOCUMENT][$quiz->sound]->destination_id;
1646 1646
 						$doc = Database::query($sql);
1647 1647
 						$doc = Database::fetch_object($doc);
@@ -1675,19 +1675,19 @@  discard block
 block discarded – undo
1675 1675
                         'random' => $quiz->random,
1676 1676
                         'active' => $quiz->active,
1677 1677
                         'sound' => self::DBUTF8($doc),
1678
-                        'max_attempt' => (int)$quiz->max_attempt,
1679
-                        'results_disabled' => (int)$quiz->results_disabled,
1678
+                        'max_attempt' => (int) $quiz->max_attempt,
1679
+                        'results_disabled' => (int) $quiz->results_disabled,
1680 1680
                         'access_condition' => $quiz->access_condition,
1681 1681
                         'start_time' => $quiz->start_time,
1682 1682
                         'pass_percentage' => $quiz->pass_percentage,
1683 1683
                         'end_time' => $quiz->end_time,
1684
-                        'feedback_type' => (int)$quiz->feedback_type,
1685
-                        'random_answers' => (int)$quiz->random_answers,
1684
+                        'feedback_type' => (int) $quiz->feedback_type,
1685
+                        'random_answers' => (int) $quiz->random_answers,
1686 1686
                         'random_by_category' => $quiz->random_by_category,
1687 1687
                         'review_answers' => $quiz->review_answers,
1688 1688
                         'propagate_neg' => $quiz->propagate_neg,
1689 1689
                         'text_when_finished' => $quiz->text_when_finished,
1690
-                        'expired_time' => (int)$quiz->expired_time,
1690
+                        'expired_time' => (int) $quiz->expired_time,
1691 1691
                     );
1692 1692
 
1693 1693
                     if ($respect_base_content) {
@@ -1723,9 +1723,9 @@  discard block
 block discarded – undo
1723 1723
                         $qid = $this->restore_quiz_question($question_id);
1724 1724
                         $question_order = $quiz->question_orders[$index] ? $quiz->question_orders[$index] : ++$order;
1725 1725
                         $sql = "INSERT IGNORE INTO $table_rel SET
1726
-                                c_id = " . $this->destination_course_id . ",
1727
-                                question_id = " . $qid . ",
1728
-                                exercice_id = " . $new_id . ",
1726
+                                c_id = ".$this->destination_course_id.",
1727
+                                question_id = " . $qid.",
1728
+                                exercice_id = " . $new_id.",
1729 1729
                                 question_order = " . $question_order;
1730 1730
                         Database::query($sql);
1731 1731
                     }
@@ -1800,7 +1800,7 @@  discard block
 block discarded – undo
1800 1800
                             $sql = "UPDATE $table_que SET
1801 1801
                                         picture = '$picture_name'
1802 1802
                                     WHERE
1803
-                                        c_id = " . $this->destination_course_id . " AND
1803
+                                        c_id = ".$this->destination_course_id." AND
1804 1804
                                         id = $new_id ";
1805 1805
                             Database::query($sql);
1806 1806
                         }
@@ -1955,7 +1955,7 @@  discard block
 block discarded – undo
1955 1955
                             }
1956 1956
                         }
1957 1957
 
1958
-                        foreach($correct_answers as $answer_id => $correct_answer) {
1958
+                        foreach ($correct_answers as $answer_id => $correct_answer) {
1959 1959
                             $params = array();
1960 1960
                             $params['correct'] = $new_options[$correct_answer];
1961 1961
                             Database::update(
@@ -1989,7 +1989,7 @@  discard block
 block discarded – undo
1989 1989
         $tab_test_category_id_old_new = array(); // used to build the quiz_question_rel_category table
1990 1990
         if ($this->course->has_resources(RESOURCE_TEST_CATEGORY)) {
1991 1991
             $resources = $this->course->resources;
1992
-            foreach ($resources[RESOURCE_TEST_CATEGORY] as $id => $CourseCopyTestcategory ) {
1992
+            foreach ($resources[RESOURCE_TEST_CATEGORY] as $id => $CourseCopyTestcategory) {
1993 1993
                 $tab_test_category_id_old_new[$CourseCopyTestcategory->source_id] = $id;
1994 1994
                 // check if this test_category already exist in the destination BDD
1995 1995
                 // do not Database::escape_string $title and $description, it will be done later
@@ -2135,7 +2135,7 @@  discard block
 block discarded – undo
2135 2135
 							break;
2136 2136
 						case FILE_RENAME:
2137 2137
 							$survey_code = $survey->code.'_';
2138
-							$i=1;
2138
+							$i = 1;
2139 2139
 							$temp_survey_code = $survey_code.$i;
2140 2140
 							while (!$this->is_survey_code_available($temp_survey_code)) {
2141 2141
 								$temp_survey_code = $survey_code.++$i;
@@ -2167,15 +2167,15 @@  discard block
 block discarded – undo
2167 2167
 							$sql = "SELECT * FROM $table_sur
2168 2168
 							        WHERE
2169 2169
 							            c_id = ".$this->destination_course_id." AND
2170
-							            survey_id='".self::DBUTF8escapestring(Database::result($result_check,0,0))."'";
2170
+							            survey_id='".self::DBUTF8escapestring(Database::result($result_check, 0, 0))."'";
2171 2171
 							$result = Database::query($sql);
2172
-							$survey_data = Database::fetch_array($result,'ASSOC');
2172
+							$survey_data = Database::fetch_array($result, 'ASSOC');
2173 2173
 
2174 2174
 							// if the survey is shared => also delete the shared content
2175 2175
 							if (isset($survey_data['survey_share']) && is_numeric($survey_data['survey_share'])) {
2176
-                                SurveyManager::delete_survey($survey_data['survey_share'], true,$this->destination_course_id);
2176
+                                SurveyManager::delete_survey($survey_data['survey_share'], true, $this->destination_course_id);
2177 2177
 							}
2178
-							SurveyManager :: delete_survey($survey_data['survey_id'],false,$this->destination_course_id);
2178
+							SurveyManager :: delete_survey($survey_data['survey_id'], false, $this->destination_course_id);
2179 2179
 
2180 2180
 							// Insert the new source survey
2181 2181
                             $new_id = Database::insert($table_sur, $params);
@@ -2251,7 +2251,7 @@  discard block
 block discarded – undo
2251 2251
 		$resources = $this->course->resources;
2252 2252
 		$question = $resources[RESOURCE_SURVEYQUESTION][$id];
2253 2253
 
2254
-		$new_id=0;
2254
+		$new_id = 0;
2255 2255
 
2256 2256
 		if (is_object($question)) {
2257 2257
 			if ($question->is_restored()) {
@@ -2356,14 +2356,14 @@  discard block
 block discarded – undo
2356 2356
 
2357 2357
 				// Adding the author's image
2358 2358
 				if (!empty($lp->preview_image)) {
2359
-					$new_filename = uniqid('').substr($lp->preview_image,strlen($lp->preview_image)-7, strlen($lp->preview_image));
2359
+					$new_filename = uniqid('').substr($lp->preview_image, strlen($lp->preview_image) - 7, strlen($lp->preview_image));
2360 2360
 					if (file_exists($origin_path.$lp->preview_image) && !is_dir($origin_path.$lp->preview_image)) {
2361 2361
 						$copy_result = copy($origin_path.$lp->preview_image, $destination_path.$new_filename);
2362 2362
 						//$copy_result = true;
2363 2363
 						if ($copy_result) {
2364 2364
 							$lp->preview_image = $new_filename;
2365 2365
 						} else {
2366
-							$lp->preview_image ='';
2366
+							$lp->preview_image = '';
2367 2367
 						}
2368 2368
 					}
2369 2369
 				}
@@ -2524,20 +2524,20 @@  discard block
 block discarded – undo
2524 2524
 					$next_item_ids[$new_item_id] = $item['next_item_id'];
2525 2525
 
2526 2526
 					if (!empty($item['prerequisite'])) {
2527
-						if ($lp->lp_type =='2') {
2527
+						if ($lp->lp_type == '2') {
2528 2528
 							// if is an sco
2529
-							$old_prerequisite[$new_item_id]= $item['prerequisite'];
2529
+							$old_prerequisite[$new_item_id] = $item['prerequisite'];
2530 2530
 						} else {
2531
-							$old_prerequisite[$new_item_id]= $new_item_ids[$item['prerequisite']];
2531
+							$old_prerequisite[$new_item_id] = $new_item_ids[$item['prerequisite']];
2532 2532
 						}
2533 2533
 					}
2534 2534
 
2535 2535
 					if (!empty($ref)) {
2536
-						if ($lp->lp_type =='2') {
2536
+						if ($lp->lp_type == '2') {
2537 2537
 							// if is an sco
2538
-							$old_refs[$new_item_id]= $ref;
2538
+							$old_refs[$new_item_id] = $ref;
2539 2539
 						} else {
2540
-                            $old_refs[$new_item_id]= $new_item_ids[$ref];
2540
+                            $old_refs[$new_item_id] = $new_item_ids[$ref];
2541 2541
 						}
2542 2542
 					}
2543 2543
 
@@ -2546,7 +2546,7 @@  discard block
 block discarded – undo
2546 2546
 
2547 2547
 				// Updating prerequisites
2548 2548
 				foreach ($old_prerequisite  as $key=>$my_old_prerequisite) {
2549
-					if($my_old_prerequisite != ''){
2549
+					if ($my_old_prerequisite != '') {
2550 2550
 						$sql = "UPDATE ".$table_item." SET prerequisite = '".$my_old_prerequisite."'
2551 2551
 						        WHERE c_id = ".$this->destination_course_id." AND id = '".$key."'  ";
2552 2552
 						Database::query($sql);
@@ -2564,7 +2564,7 @@  discard block
 block discarded – undo
2564 2564
 
2565 2565
 				foreach ($parent_item_ids as $new_item_id => $parent_item_old_id) {
2566 2566
 					$parent_new_id = 0;
2567
-					if($parent_item_old_id != 0){
2567
+					if ($parent_item_old_id != 0) {
2568 2568
 						$parent_new_id = $new_item_ids[$parent_item_old_id];
2569 2569
 					}
2570 2570
 					$sql = "UPDATE ".$table_item." SET parent_item_id = '".$parent_new_id."'
@@ -2573,7 +2573,7 @@  discard block
 block discarded – undo
2573 2573
 				}
2574 2574
 				foreach ($previous_item_ids as $new_item_id => $previous_item_old_id) {
2575 2575
 					$previous_new_id = 0;
2576
-					if($previous_item_old_id != 0){
2576
+					if ($previous_item_old_id != 0) {
2577 2577
 						$previous_new_id = $new_item_ids[$previous_item_old_id];
2578 2578
 					}
2579 2579
 					$sql = "UPDATE ".$table_item." SET previous_item_id = '".$previous_new_id."'
@@ -2583,7 +2583,7 @@  discard block
 block discarded – undo
2583 2583
 
2584 2584
 				foreach ($next_item_ids as $new_item_id => $next_item_old_id) {
2585 2585
 					$next_new_id = 0;
2586
-					if($next_item_old_id != 0){
2586
+					if ($next_item_old_id != 0) {
2587 2587
 						$next_new_id = $new_item_ids[$next_item_old_id];
2588 2588
 					}
2589 2589
 					$sql = "UPDATE ".$table_item." SET next_item_id = '".$next_new_id."'
@@ -2593,7 +2593,7 @@  discard block
 block discarded – undo
2593 2593
 
2594 2594
 				foreach ($prerequisite_ids as $new_item_id => $prerequisite_old_id) {
2595 2595
 					$prerequisite_new_id = 0;
2596
-					if($prerequisite_old_id != 0){
2596
+					if ($prerequisite_old_id != 0) {
2597 2597
 						$prerequisite_new_id = $new_item_ids[$prerequisite_old_id];
2598 2598
 					}
2599 2599
 					$sql = "UPDATE ".$table_item." SET prerequisite = '".$prerequisite_new_id."'
@@ -2613,9 +2613,9 @@  discard block
 block discarded – undo
2613 2613
 	public function restore_student_publication($sessionId = 0)
2614 2614
     {
2615 2615
         $sessionId = intval($sessionId);
2616
-		$work_assignment_table  = Database :: get_course_table(TABLE_STUDENT_PUBLICATION_ASSIGNMENT);
2616
+		$work_assignment_table = Database :: get_course_table(TABLE_STUDENT_PUBLICATION_ASSIGNMENT);
2617 2617
 		$work_table = Database :: get_course_table(TABLE_STUDENT_PUBLICATION);
2618
-		$item_property_table  	= Database :: get_course_table(TABLE_ITEM_PROPERTY);
2618
+		$item_property_table = Database :: get_course_table(TABLE_ITEM_PROPERTY);
2619 2619
 
2620 2620
 		// Query in student publication
2621 2621
 		$sql = 'SELECT * FROM '.$work_table.'
@@ -2693,7 +2693,7 @@  discard block
 block discarded – undo
2693 2693
 
2694 2694
 		$destination = '../../courses/'.$this->course->destination_path.'/work/';
2695 2695
 		$origin = '../../courses/'.$this->course->info['path'].'/work/';
2696
-		self::allow_create_all_directory($origin,$destination,false);
2696
+		self::allow_create_all_directory($origin, $destination, false);
2697 2697
 	}
2698 2698
 
2699 2699
     /**
@@ -2712,16 +2712,16 @@  discard block
 block discarded – undo
2712 2712
         if ($handle = opendir($source)) {        // if the folder exploration is sucsessful, continue
2713 2713
             while (false !== ($file = readdir($handle))) { // as long as storing the next file to $file is successful, continue
2714 2714
                 if ($file != '.' && $file != '..') {
2715
-                    $path = $source . '/' . $file;
2715
+                    $path = $source.'/'.$file;
2716 2716
                     if (is_file($path)) {
2717 2717
                        /* if (!is_file($dest . '/' . $file) || $overwrite)
2718 2718
                         if (!@copy($path, $dest . '/' . $file)) {
2719 2719
                             echo '<font color="red">File ('.$path.') '.get_lang('NotHavePermission').'</font>';
2720 2720
                         }*/
2721
-                    } elseif(is_dir($path)) {
2722
-                        if (!is_dir($dest . '/' . $file))
2723
-                        mkdir($dest . '/' . $file);
2724
-                       self:: allow_create_all_directory($path, $dest . '/' . $file, $overwrite);
2721
+                    } elseif (is_dir($path)) {
2722
+                        if (!is_dir($dest.'/'.$file))
2723
+                        mkdir($dest.'/'.$file);
2724
+                       self:: allow_create_all_directory($path, $dest.'/'.$file, $overwrite);
2725 2725
                     }
2726 2726
                 }
2727 2727
             }
@@ -2908,7 +2908,7 @@  discard block
 block discarded – undo
2908 2908
                     $this->course->backup_path,
2909 2909
                     $this->course->info['path']
2910 2910
                 );
2911
-				$thematic->params['c_id']  = $this->destination_course_id;
2911
+				$thematic->params['c_id'] = $this->destination_course_id;
2912 2912
 				unset($thematic->params['id']);
2913 2913
                 unset($thematic->params['iid']);
2914 2914
 
@@ -2932,7 +2932,7 @@  discard block
 block discarded – undo
2932 2932
                         unset($thematic_advance['iid']);
2933 2933
 						$thematic_advance['attendance_id'] = 0;
2934 2934
 						$thematic_advance['thematic_id'] = $last_id;
2935
-						$thematic_advance['c_id']  = $this->destination_course_id;
2935
+						$thematic_advance['c_id'] = $this->destination_course_id;
2936 2936
                         $my_id = Database::insert(
2937 2937
                             $table_thematic_advance,
2938 2938
                             $thematic_advance,
@@ -2954,7 +2954,7 @@  discard block
 block discarded – undo
2954 2954
 						}
2955 2955
 					}
2956 2956
 
2957
-					foreach($thematic->thematic_plan_list as $thematic_plan) {
2957
+					foreach ($thematic->thematic_plan_list as $thematic_plan) {
2958 2958
 						unset($thematic_plan['id']);
2959 2959
                         unset($thematic_plan['iid']);
2960 2960
 						$thematic_plan['thematic_id'] = $last_id;
@@ -3070,7 +3070,7 @@  discard block
 block discarded – undo
3070 3070
                 // re-create dir
3071 3071
                 // @todo check security against injection of dir in crafted course backup here!
3072 3072
                 $path = $obj->params['url'];
3073
-                $path = '/'.str_replace('/','',substr($path,1));
3073
+                $path = '/'.str_replace('/', '', substr($path, 1));
3074 3074
 
3075 3075
                 $workData = array();
3076 3076
                 switch ($this->file_option) {
@@ -3092,9 +3092,9 @@  discard block
 block discarded – undo
3092 3092
                         $obj->params['new_dir'] = $obj->params['title'];
3093 3093
 
3094 3094
                         if (!empty($this->course_origin_id)) {
3095
-                            $sql = 'SELECT * FROM ' . $table_work_assignment . '
3095
+                            $sql = 'SELECT * FROM '.$table_work_assignment.'
3096 3096
                                     WHERE
3097
-                                        c_id = ' . $this->course_origin_id . ' AND
3097
+                                        c_id = ' . $this->course_origin_id.' AND
3098 3098
                                         publication_id = ' . $id_work;
3099 3099
 
3100 3100
                             $result = Database::query($sql);
@@ -3206,7 +3206,7 @@  discard block
 block discarded – undo
3206 3206
     public function DBUTF8_array($array)
3207 3207
     {
3208 3208
         if (UTF8_CONVERT) {
3209
-            foreach ($array as &$item)  {
3209
+            foreach ($array as &$item) {
3210 3210
                 $item = utf8_encode($item);
3211 3211
             }
3212 3212
             return $array;
Please login to merge, or discard this patch.
main/coursecopy/copy_course_session.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 
12 12
 $cidReset = true;
13 13
 require_once '../inc/global.inc.php';
14
-$current_course_tool  = TOOL_COURSE_MAINTENANCE;
14
+$current_course_tool = TOOL_COURSE_MAINTENANCE;
15 15
 
16 16
 api_protect_global_admin_script();
17 17
 api_protect_limit_for_session_admin();
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 
83 83
 function display_form()
84 84
 {
85
-    $html  = '';
85
+    $html = '';
86 86
     $sessions = SessionManager::get_sessions_list(array(), array('name', 'ASC'));
87 87
 
88 88
     // Actions
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 
110 110
     //destination
111 111
     $html .= '<div class="form-group">';
112
-    $html .= '<label class="col-sm-2 control-label">' . get_lang('DestinationCoursesFromSession') . ': </label>';
112
+    $html .= '<label class="col-sm-2 control-label">'.get_lang('DestinationCoursesFromSession').': </label>';
113 113
     $html .= '<div class="col-sm-5" id="ajax_sessions_list_destination">';
114 114
     $html .= '<select class="form-control" name="sessions_list_destination" onchange="javascript: xajax_search_courses(this.value,\'destination\');">';
115 115
     $html .= '<option value = "0">'.get_lang('ThereIsNotStillASession').'</option></select ></div>';
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
     $html .= '<button class="btn btn-success" type="submit" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES))."'".')) return false;"><em class="fa fa-files-o"></em> '.get_lang('CopyCourse').'</button>';
132 132
 
133 133
     // Add Security token
134
-    $html .= '<input type="hidden" value="' . Security::get_token() . '" name="sec_token">';
134
+    $html .= '<input type="hidden" value="'.Security::get_token().'" name="sec_token">';
135 135
     $html .= '</div></div>';
136 136
 
137 137
     $html .= '</form>';
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
 
230 230
 /* HTML head extra */
231 231
 
232
-$htmlHeadXtra[] = $xajax->getJavascript( api_get_path(WEB_LIBRARY_PATH).'xajax/');
232
+$htmlHeadXtra[] = $xajax->getJavascript(api_get_path(WEB_LIBRARY_PATH).'xajax/');
233 233
 $htmlHeadXtra[] = '<script type="text/javascript">
234 234
 function checkSelected(id_select,id_radio,id_title,id_destination) {
235 235
    var num=0;
@@ -299,22 +299,22 @@  discard block
 block discarded – undo
299 299
         display_form();
300 300
     } else {
301 301
 
302
-        $arr_course_origin 		= array();
302
+        $arr_course_origin = array();
303 303
         $arr_course_destination = array();
304
-        $destination_session 	= '';
305
-        $origin_session 		= '';
304
+        $destination_session = '';
305
+        $origin_session = '';
306 306
 
307 307
         if (isset($_POST['SessionCoursesListOrigin'])) {
308
-            $arr_course_origin 		= $_POST['SessionCoursesListOrigin'];
308
+            $arr_course_origin = $_POST['SessionCoursesListOrigin'];
309 309
         }
310 310
         if (isset($_POST['SessionCoursesListDestination'])) {
311 311
             $arr_course_destination = $_POST['SessionCoursesListDestination'];
312 312
         }
313 313
         if (isset($_POST['sessions_list_destination'])) {
314
-            $destination_session 	= $_POST['sessions_list_destination'];
314
+            $destination_session = $_POST['sessions_list_destination'];
315 315
         }
316 316
         if (isset($_POST['sessions_list_origin'])) {
317
-            $origin_session 		= $_POST['sessions_list_origin'];
317
+            $origin_session = $_POST['sessions_list_origin'];
318 318
         }
319 319
 
320 320
         if ((is_array($arr_course_origin) && count($arr_course_origin) > 0) && !empty($destination_session)) {
@@ -354,22 +354,22 @@  discard block
 block discarded – undo
354 354
         Display::display_normal_message(get_lang('ToExportDocumentsWithGlossaryYouHaveToSelectGlossary'));
355 355
     }
356 356
 
357
-    $arr_course_origin 		= array();
357
+    $arr_course_origin = array();
358 358
     $arr_course_destination = array();
359
-    $destination_session 	= '';
360
-    $origin_session 		= '';
359
+    $destination_session = '';
360
+    $origin_session = '';
361 361
 
362 362
     if (isset($_POST['SessionCoursesListOrigin'])) {
363
-        $arr_course_origin 		= $_POST['SessionCoursesListOrigin'];
363
+        $arr_course_origin = $_POST['SessionCoursesListOrigin'];
364 364
     }
365 365
     if (isset($_POST['SessionCoursesListDestination'])) {
366 366
         $arr_course_destination = $_POST['SessionCoursesListDestination'];
367 367
     }
368 368
     if (isset($_POST['sessions_list_destination'])) {
369
-        $destination_session 	= $_POST['sessions_list_destination'];
369
+        $destination_session = $_POST['sessions_list_destination'];
370 370
     }
371 371
     if (isset($_POST['sessions_list_origin'])) {
372
-        $origin_session 		= $_POST['sessions_list_origin'];
372
+        $origin_session = $_POST['sessions_list_origin'];
373 373
     }
374 374
 
375 375
     if ((is_array($arr_course_origin) && count($arr_course_origin) > 0) && !empty($destination_session)) {
@@ -378,10 +378,10 @@  discard block
 block discarded – undo
378 378
         $cb = new CourseBuilder('', $course_origin);
379 379
         $course = $cb->build($origin_session, $arr_course_origin[0], $with_base_content);
380 380
         //$hiddenFields['same_file_name_option'] = $_POST['same_file_name_option'];
381
-        $hiddenFields['destination_course'] 	= $arr_course_destination[0];
382
-        $hiddenFields['origin_course'] 		= $arr_course_origin[0];
383
-        $hiddenFields['destination_session'] 	= $destination_session;
384
-        $hiddenFields['origin_session'] 		= $origin_session;
381
+        $hiddenFields['destination_course'] = $arr_course_destination[0];
382
+        $hiddenFields['origin_course'] = $arr_course_origin[0];
383
+        $hiddenFields['destination_session'] = $destination_session;
384
+        $hiddenFields['origin_session'] = $origin_session;
385 385
         // Add token to Course select form
386 386
         $hiddenFields['sec_token'] = Security::get_token();
387 387
 
Please login to merge, or discard this patch.
main/coursecopy/copy_course_session_selected.php 1 patch
Spacing   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 $nameTools = get_lang('CopyCourse');
49 49
 $returnLink = api_get_path(
50 50
         WEB_CODE_PATH
51
-    ) . 'course_info/maintenance_coach.php?' . api_get_cidreq();
51
+    ).'course_info/maintenance_coach.php?'.api_get_cidreq();
52 52
 $interbreadcrumb[] = array(
53 53
     'url' => $returnLink,
54 54
     'name' => get_lang('Maintenance')
@@ -71,29 +71,29 @@  discard block
 block discarded – undo
71 71
     $attrs = '';
72 72
     if (count($attr) > 0) {
73 73
         foreach ($attr as $key => $value) {
74
-            $attrs .= ' ' . $key . '="' . $value . '"';
74
+            $attrs .= ' '.$key.'="'.$value.'"';
75 75
         }
76 76
     }
77
-    $output = '<select name="' . $name . '" ' . $attrs . '>';
77
+    $output = '<select name="'.$name.'" '.$attrs.'>';
78 78
 
79 79
     if (count($sessions) == 0) {
80
-        $output .= '<option value = "0">' . get_lang(
80
+        $output .= '<option value = "0">'.get_lang(
81 81
                 'ThereIsNotStillASession'
82
-            ) . '</option>';
82
+            ).'</option>';
83 83
     } else {
84
-        $output .= '<option value = "0">' . get_lang(
84
+        $output .= '<option value = "0">'.get_lang(
85 85
                 'SelectASession'
86
-            ) . '</option>';
86
+            ).'</option>';
87 87
     }
88 88
 
89 89
     if (is_array($sessions)) {
90 90
         foreach ($sessions as $session) {
91 91
             $category_name = '';
92 92
             if (!empty($session['category_name'])) {
93
-                $category_name = ' (' . $session['category_name'] . ')';
93
+                $category_name = ' ('.$session['category_name'].')';
94 94
             }
95 95
 
96
-            $output .= '<option value="' . $session['id'] . '">' . $session['name'] . ' ' . $category_name . '</option>';
96
+            $output .= '<option value="'.$session['id'].'">'.$session['name'].' '.$category_name.'</option>';
97 97
         }
98 98
     }
99 99
     $output .= '</select>';
@@ -118,43 +118,43 @@  discard block
 block discarded – undo
118 118
     // Actions
119 119
     $html .= '<div class="actions">';
120 120
     // Link back to the documents overview
121
-    $html .= '<a href="' . $returnLink . '">' . Display::return_icon(
122
-            'back.png', get_lang('BackTo') . ' ' . get_lang('Maintenance'), '', ICON_SIZE_MEDIUM
123
-        ) . '</a>';
121
+    $html .= '<a href="'.$returnLink.'">'.Display::return_icon(
122
+            'back.png', get_lang('BackTo').' '.get_lang('Maintenance'), '', ICON_SIZE_MEDIUM
123
+        ).'</a>';
124 124
     $html .= '</div>';
125 125
 
126 126
     $html .= Display::return_message(
127 127
             get_lang('CopyCourseFromSessionToSessionExplanation')
128 128
     );
129 129
 
130
-    $html .= '<form name="formulaire" method="post" action="' . api_get_self(
131
-        ) . '?' . api_get_cidreq() . '" >';
130
+    $html .= '<form name="formulaire" method="post" action="'.api_get_self(
131
+        ).'?'.api_get_cidreq().'" >';
132 132
     $html .= '<table border="0" cellpadding="5" cellspacing="0" width="100%">';
133 133
 
134 134
     // Source
135
-    $html .= '<tr><td width="15%"><b>' . get_lang(
135
+    $html .= '<tr><td width="15%"><b>'.get_lang(
136 136
             'OriginCoursesFromSession'
137
-        ) . ':</b></td>';
138
-    $html .= '<td width="10%" align="left">' . api_get_session_name(
137
+        ).':</b></td>';
138
+    $html .= '<td width="10%" align="left">'.api_get_session_name(
139 139
             $sessionId
140
-        ) . '</td>';
140
+        ).'</td>';
141 141
     $html .= '<td width="50%">';
142
-    $html .= "{$courseInfo['title']} ({$courseInfo['code']})" . '</td></tr>';
142
+    $html .= "{$courseInfo['title']} ({$courseInfo['code']})".'</td></tr>';
143 143
 
144 144
     // Destination
145
-    $html .= '<tr><td width="15%"><b>' . get_lang(
145
+    $html .= '<tr><td width="15%"><b>'.get_lang(
146 146
             'DestinationCoursesFromSession'
147
-        ) . ':</b></td>';
147
+        ).':</b></td>';
148 148
     $html .= '<td width="10%" align="left"><div id="ajax_sessions_list_destination">';
149 149
     $html .= '<select name="sessions_list_destination" onchange="javascript: xajax_searchCourses(this.value,\'destination\');">';
150 150
     if (empty($sessions)) {
151
-        $html .= '<option value = "0">' . get_lang(
151
+        $html .= '<option value = "0">'.get_lang(
152 152
                 'ThereIsNotStillASession'
153
-            ) . '</option>';
153
+            ).'</option>';
154 154
     } else {
155
-        $html .= '<option value = "0">' . get_lang(
155
+        $html .= '<option value = "0">'.get_lang(
156 156
                 'SelectASession'
157
-            ) . '</option>';
157
+            ).'</option>';
158 158
         foreach ($sessions as $session) {
159 159
             if ($session['id'] == $sessionId) {
160 160
                 continue;
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
                 continue;
165 165
             }
166 166
 
167
-            $html .= '<option value="' . $session['id'] . '">' . $session['name'] . '</option>';
167
+            $html .= '<option value="'.$session['id'].'">'.$session['name'].'</option>';
168 168
         }
169 169
     }
170 170
 
@@ -176,17 +176,17 @@  discard block
 block discarded – undo
176 176
     $html .= '</tr></table>';
177 177
 
178 178
     $html .= "<fieldset>";
179
-    $html .= '<legend>' . get_lang('TypeOfCopy') . ' <small>(' . get_lang('CopyOnlySessionItems') . ')</small></legend>';
179
+    $html .= '<legend>'.get_lang('TypeOfCopy').' <small>('.get_lang('CopyOnlySessionItems').')</small></legend>';
180 180
     $html .= '<label class="radio"><input type="radio" id="copy_option_1" name="copy_option" value="full_copy" checked="checked"/>';
181
-    $html .= get_lang('FullCopy') . '</label>';
181
+    $html .= get_lang('FullCopy').'</label>';
182 182
     $html .= '<label class="radio"><input type="radio" id="copy_option_2" name="copy_option" value="select_items"/>';
183
-    $html .= ' ' . get_lang('LetMeSelectItems') . '</label><br/>';
183
+    $html .= ' '.get_lang('LetMeSelectItems').'</label><br/>';
184 184
 
185 185
     $html .= "</fieldset>";
186 186
 
187
-    $html .= '<button class="save" type="submit" onclick="javascript:if(!confirm(' . "'" . addslashes(
187
+    $html .= '<button class="save" type="submit" onclick="javascript:if(!confirm('."'".addslashes(
188 188
             api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES)
189
-        ) . "'" . ')) return false;">' . get_lang('CopyCourse') . '</button>';
189
+        )."'".')) return false;">'.get_lang('CopyCourse').'</button>';
190 190
     $html .= '</form>';
191 191
     echo $html;
192 192
 }
@@ -212,10 +212,10 @@  discard block
 block discarded – undo
212 212
 
213 213
             $courseTitle = str_replace("'", "\'", $course['title']);
214 214
 
215
-            $return .= '<option value="' . $course['code'] . '" title="' . @htmlspecialchars(
216
-                    $course['title'] . ' (' . $course['visual_code'] . ')', ENT_QUOTES, api_get_system_encoding()
217
-                ) . '">' .
218
-                $course['title'] . ' (' . $course['visual_code'] . ')</option>';
215
+            $return .= '<option value="'.$course['code'].'" title="'.@htmlspecialchars(
216
+                    $course['title'].' ('.$course['visual_code'].')', ENT_QUOTES, api_get_system_encoding()
217
+                ).'">'.
218
+                $course['title'].' ('.$course['visual_code'].')</option>';
219 219
         }
220 220
         $return .= '</select>';
221 221
         $_SESSION['course_list_destination'] = $course_list_destination;
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
 /* HTML head extra */
234 234
 
235 235
 $htmlHeadXtra[] = $xajax->getJavascript(
236
-    api_get_path(WEB_LIBRARY_PATH) . 'xajax/'
236
+    api_get_path(WEB_LIBRARY_PATH).'xajax/'
237 237
 );
238 238
 $htmlHeadXtra[] = '<script>
239 239
 	function checkSelected(id_select,id_radio,id_title,id_destination) {
@@ -378,13 +378,13 @@  discard block
 block discarded – undo
378 378
 
379 379
         CourseSelectForm :: display_form($course, $hiddenFields, true);
380 380
 
381
-        echo '<div style="float:right"><a href="javascript:window.history.go(-1);">' .
381
+        echo '<div style="float:right"><a href="javascript:window.history.go(-1);">'.
382 382
             Display::return_icon(
383
-                'back.png', get_lang('Back') . ' ' . get_lang('To') . ' ' . get_lang(
383
+                'back.png', get_lang('Back').' '.get_lang('To').' '.get_lang(
384 384
                     'PlatformAdmin'
385 385
                 ), array('style' => 'vertical-align:middle')
386
-            ) .
387
-            get_lang('Back') . '</a></div>';
386
+            ).
387
+            get_lang('Back').'</a></div>';
388 388
     } else {
389 389
         Display::display_error_message(
390 390
             get_lang('You must select a course from original session and select a destination session')
Please login to merge, or discard this patch.
main/coursecopy/import_backup.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -98,21 +98,21 @@  discard block
 block discarded – undo
98 98
         $cr->set_file_option($_POST['same_file_name_option']);
99 99
         $cr->restore();
100 100
         Display::display_normal_message(get_lang('ImportFinished'));
101
-        echo '<a class="btn btn-default" href="' . api_get_path(WEB_COURSE_PATH) . api_get_course_path() . '/index.php">' . get_lang('CourseHomepage') . '</a>';
101
+        echo '<a class="btn btn-default" href="'.api_get_path(WEB_COURSE_PATH).api_get_course_path().'/index.php">'.get_lang('CourseHomepage').'</a>';
102 102
     } else {
103 103
         if (!$error) {
104 104
             Display::display_warning_message(get_lang('NoResourcesInBackupFile'));
105
-            echo '<a class="btn btn-default" href="import_backup.php?' . api_get_cidreq() . '">' . get_lang('TryAgain') . '</a>';
105
+            echo '<a class="btn btn-default" href="import_backup.php?'.api_get_cidreq().'">'.get_lang('TryAgain').'</a>';
106 106
         } elseif ($filename === false) {
107 107
             Display::display_error_message(get_lang('ArchivesDirectoryNotWriteableContactAdmin'));
108
-            echo '<a class="btn btn-default" href="import_backup.php?' . api_get_cidreq() . '">' . get_lang('TryAgain') . '</a>';
108
+            echo '<a class="btn btn-default" href="import_backup.php?'.api_get_cidreq().'">'.get_lang('TryAgain').'</a>';
109 109
         } else {
110 110
             if ($filename == '') {
111 111
                 Display::display_error_message(get_lang('SelectBackupFile'));
112
-                echo '<a class="btn btn-default" href="import_backup.php?' . api_get_cidreq() . '">' . get_lang('TryAgain') . '</a>';
112
+                echo '<a class="btn btn-default" href="import_backup.php?'.api_get_cidreq().'">'.get_lang('TryAgain').'</a>';
113 113
             } else {
114 114
                 Display::display_error_message(get_lang('UploadError'));
115
-                echo '<a class="btn btn-default" href="import_backup.php?' . api_get_cidreq() . '">' . get_lang('TryAgain') . '</a>';
115
+                echo '<a class="btn btn-default" href="import_backup.php?'.api_get_cidreq().'">'.get_lang('TryAgain').'</a>';
116 116
             }
117 117
         }
118 118
     }
@@ -142,10 +142,10 @@  discard block
 block discarded – undo
142 142
         CourseSelectForm::display_form($course, $hiddenFields);
143 143
     } elseif ($filename === false) {
144 144
         Display::display_error_message(get_lang('ArchivesDirectoryNotWriteableContactAdmin'));
145
-        echo '<a class="btn btn-default" href="import_backup.php?' . api_get_cidreq() . '">' . get_lang('TryAgain') . '</a>';
145
+        echo '<a class="btn btn-default" href="import_backup.php?'.api_get_cidreq().'">'.get_lang('TryAgain').'</a>';
146 146
     } else {
147 147
         Display::display_warning_message(get_lang('NoResourcesInBackupFile'));
148
-        echo '<a class="btn btn-default" href="import_backup.php?' . api_get_cidreq() . '">' . get_lang('TryAgain') . '</a>';
148
+        echo '<a class="btn btn-default" href="import_backup.php?'.api_get_cidreq().'">'.get_lang('TryAgain').'</a>';
149 149
     }
150 150
 } else {
151 151
     $user = api_get_user_info();
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
     $form = new FormValidator(
158 158
         'import_backup_form',
159 159
         'post',
160
-        api_get_path(WEB_CODE_PATH) . 'coursecopy/import_backup.php?' . api_get_cidreq(),
160
+        api_get_path(WEB_CODE_PATH).'coursecopy/import_backup.php?'.api_get_cidreq(),
161 161
         '',
162 162
         array('enctype' => 'multipart/form-data')
163 163
     );
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
         );
190 190
         $options['null'] = '-';
191 191
         foreach ($backups as $index => $backup) {
192
-            $options[$backup['file']] = $backup['course_code'] . ' (' . $backup['date'] . ')';
192
+            $options[$backup['file']] = $backup['course_code'].' ('.$backup['date'].')';
193 193
         }
194 194
         $form->addElement(
195 195
             'select',
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
             'radio',
208 208
             '',
209 209
             '',
210
-            '<i>' . get_lang('NoBackupsAvailable') . '</i>',
210
+            '<i>'.get_lang('NoBackupsAvailable').'</i>',
211 211
             '',
212 212
             'disabled="true"'
213 213
         );
Please login to merge, or discard this patch.