@@ -10,86 +10,86 @@ discard block |
||
10 | 10 | */ |
11 | 11 | class Survey extends Coursecopy\Resource |
12 | 12 | { |
13 | - /** |
|
14 | - * The survey code |
|
15 | - */ |
|
13 | + /** |
|
14 | + * The survey code |
|
15 | + */ |
|
16 | 16 | public $code; |
17 | - /** |
|
18 | - * The title and subtitle |
|
19 | - */ |
|
17 | + /** |
|
18 | + * The title and subtitle |
|
19 | + */ |
|
20 | 20 | public $title; |
21 | 21 | public $subtitle; |
22 | - /** |
|
23 | - * The author's name |
|
24 | - */ |
|
22 | + /** |
|
23 | + * The author's name |
|
24 | + */ |
|
25 | 25 | public $author; |
26 | - /** |
|
27 | - * The survey's language |
|
28 | - */ |
|
26 | + /** |
|
27 | + * The survey's language |
|
28 | + */ |
|
29 | 29 | public $lang; |
30 | - /** |
|
31 | - * The availability period |
|
32 | - */ |
|
30 | + /** |
|
31 | + * The availability period |
|
32 | + */ |
|
33 | 33 | public $avail_from; |
34 | 34 | public $avail_till; |
35 | - /** |
|
36 | - * Flag for shared status |
|
37 | - */ |
|
35 | + /** |
|
36 | + * Flag for shared status |
|
37 | + */ |
|
38 | 38 | public $is_shared; |
39 | - /** |
|
40 | - * Template used |
|
41 | - */ |
|
39 | + /** |
|
40 | + * Template used |
|
41 | + */ |
|
42 | 42 | public $template; |
43 | - /** |
|
44 | - * Introduction text |
|
45 | - */ |
|
43 | + /** |
|
44 | + * Introduction text |
|
45 | + */ |
|
46 | 46 | public $intro; |
47 | - /** |
|
48 | - * Thanks text |
|
49 | - */ |
|
47 | + /** |
|
48 | + * Thanks text |
|
49 | + */ |
|
50 | 50 | public $surveythanks; |
51 | - /** |
|
52 | - * Creation date |
|
53 | - */ |
|
51 | + /** |
|
52 | + * Creation date |
|
53 | + */ |
|
54 | 54 | public $creation_date; |
55 | - /** |
|
56 | - * Invitation status |
|
57 | - */ |
|
55 | + /** |
|
56 | + * Invitation status |
|
57 | + */ |
|
58 | 58 | public $invited; |
59 | - /** |
|
60 | - * Answer status |
|
61 | - */ |
|
59 | + /** |
|
60 | + * Answer status |
|
61 | + */ |
|
62 | 62 | public $answered; |
63 | - /** |
|
64 | - * Invitation and reminder mail contents |
|
65 | - */ |
|
63 | + /** |
|
64 | + * Invitation and reminder mail contents |
|
65 | + */ |
|
66 | 66 | public $invite_mail; |
67 | 67 | public $reminder_mail; |
68 | - /** |
|
69 | - * Questions and invitations lists |
|
70 | - */ |
|
68 | + /** |
|
69 | + * Questions and invitations lists |
|
70 | + */ |
|
71 | 71 | public $question_ids; |
72 | 72 | public $invitation_ids; |
73 | 73 | |
74 | - /** |
|
75 | - * Create a new Survey |
|
76 | - * @param string $code |
|
77 | - * @param string $title |
|
78 | - * @param string $subtitle |
|
79 | - * @param string $author |
|
80 | - * @param string $lang |
|
81 | - * @param string $avail_from |
|
82 | - * @param string $avail_till |
|
83 | - * @param char $is_shared |
|
84 | - * @param string $template |
|
85 | - * @param string $intro |
|
86 | - * @param string $surveythanks |
|
87 | - * @param string $creation_date |
|
88 | - * @param int $invited |
|
89 | - * @param int $answered |
|
90 | - * @param string $invite_mail |
|
91 | - * @param string $reminder_mail |
|
92 | - */ |
|
74 | + /** |
|
75 | + * Create a new Survey |
|
76 | + * @param string $code |
|
77 | + * @param string $title |
|
78 | + * @param string $subtitle |
|
79 | + * @param string $author |
|
80 | + * @param string $lang |
|
81 | + * @param string $avail_from |
|
82 | + * @param string $avail_till |
|
83 | + * @param char $is_shared |
|
84 | + * @param string $template |
|
85 | + * @param string $intro |
|
86 | + * @param string $surveythanks |
|
87 | + * @param string $creation_date |
|
88 | + * @param int $invited |
|
89 | + * @param int $answered |
|
90 | + * @param string $invite_mail |
|
91 | + * @param string $reminder_mail |
|
92 | + */ |
|
93 | 93 | public function __construct( |
94 | 94 | $id, |
95 | 95 | $code, |
@@ -109,49 +109,49 @@ discard block |
||
109 | 109 | $invite_mail, |
110 | 110 | $reminder_mail |
111 | 111 | ) { |
112 | - parent::__construct($id,RESOURCE_SURVEY); |
|
113 | - $this->code = $code; |
|
114 | - $this->title = $title; |
|
115 | - $this->subtitle = $subtitle; |
|
116 | - $this->author = $author; |
|
117 | - $this->lang = $lang; |
|
118 | - $this->avail_from = $avail_from; |
|
119 | - $this->avail_till = $avail_till; |
|
120 | - $this->is_shared = $is_shared; |
|
121 | - $this->template = $template; |
|
122 | - $this->intro = $intro; |
|
123 | - $this->surveythanks = $surveythanks; |
|
124 | - $this->creation_date = $creation_date; |
|
125 | - $this->invited = $invited; |
|
126 | - $this->answered = $answered; |
|
127 | - $this->invite_mail = $invite_mail; |
|
128 | - $this->reminder_mail = $reminder_mail; |
|
129 | - $this->question_ids = array(); |
|
130 | - $this->invitation_ids = array(); |
|
131 | - } |
|
112 | + parent::__construct($id,RESOURCE_SURVEY); |
|
113 | + $this->code = $code; |
|
114 | + $this->title = $title; |
|
115 | + $this->subtitle = $subtitle; |
|
116 | + $this->author = $author; |
|
117 | + $this->lang = $lang; |
|
118 | + $this->avail_from = $avail_from; |
|
119 | + $this->avail_till = $avail_till; |
|
120 | + $this->is_shared = $is_shared; |
|
121 | + $this->template = $template; |
|
122 | + $this->intro = $intro; |
|
123 | + $this->surveythanks = $surveythanks; |
|
124 | + $this->creation_date = $creation_date; |
|
125 | + $this->invited = $invited; |
|
126 | + $this->answered = $answered; |
|
127 | + $this->invite_mail = $invite_mail; |
|
128 | + $this->reminder_mail = $reminder_mail; |
|
129 | + $this->question_ids = array(); |
|
130 | + $this->invitation_ids = array(); |
|
131 | + } |
|
132 | 132 | |
133 | - /** |
|
134 | - * Add a question to this survey |
|
135 | - */ |
|
136 | - function add_question($id) |
|
137 | - { |
|
138 | - $this->question_ids[] = $id; |
|
139 | - } |
|
133 | + /** |
|
134 | + * Add a question to this survey |
|
135 | + */ |
|
136 | + function add_question($id) |
|
137 | + { |
|
138 | + $this->question_ids[] = $id; |
|
139 | + } |
|
140 | 140 | |
141 | - /** |
|
142 | - * Add an invitation to this survey |
|
143 | - */ |
|
144 | - function add_invitation($id) |
|
145 | - { |
|
146 | - $this->invitation_ids[] = $id; |
|
147 | - } |
|
141 | + /** |
|
142 | + * Add an invitation to this survey |
|
143 | + */ |
|
144 | + function add_invitation($id) |
|
145 | + { |
|
146 | + $this->invitation_ids[] = $id; |
|
147 | + } |
|
148 | 148 | |
149 | - /** |
|
150 | - * Show this survey |
|
151 | - */ |
|
152 | - function show() |
|
153 | - { |
|
154 | - parent::show(); |
|
155 | - echo $this->code.' - '.$this->title; |
|
156 | - } |
|
149 | + /** |
|
150 | + * Show this survey |
|
151 | + */ |
|
152 | + function show() |
|
153 | + { |
|
154 | + parent::show(); |
|
155 | + echo $this->code.' - '.$this->title; |
|
156 | + } |
|
157 | 157 | } |
@@ -109,7 +109,7 @@ |
||
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; |
@@ -11,13 +11,13 @@ |
||
11 | 11 | { |
12 | 12 | public $params = array(); |
13 | 13 | public $thematic_advance_list = array(); |
14 | - public $thematic_plan_list = array(); |
|
14 | + public $thematic_plan_list = array(); |
|
15 | 15 | |
16 | 16 | /** |
17 | - * Create a new Thematic |
|
18 | - * |
|
19 | - * @param array parameters |
|
20 | - */ |
|
17 | + * Create a new Thematic |
|
18 | + * |
|
19 | + * @param array parameters |
|
20 | + */ |
|
21 | 21 | public function __construct($params) |
22 | 22 | { |
23 | 23 | parent::__construct($params['id'], RESOURCE_THEMATIC); |
@@ -619,8 +619,8 @@ discard block |
||
619 | 619 | } |
620 | 620 | |
621 | 621 | /** |
622 | - * Recycle Thematics |
|
623 | - */ |
|
622 | + * Recycle Thematics |
|
623 | + */ |
|
624 | 624 | public function recycle_thematic($session_id = 0) |
625 | 625 | { |
626 | 626 | if ($this->course->has_resources(RESOURCE_THEMATIC)) { |
@@ -685,8 +685,8 @@ discard block |
||
685 | 685 | } |
686 | 686 | |
687 | 687 | /** |
688 | - * Recycle Attendances |
|
689 | - */ |
|
688 | + * Recycle Attendances |
|
689 | + */ |
|
690 | 690 | public function recycle_attendance($session_id = 0) |
691 | 691 | { |
692 | 692 | if ($this->course->has_resources(RESOURCE_ATTENDANCE)) { |
@@ -160,7 +160,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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; |
@@ -38,7 +38,7 @@ |
||
38 | 38 | } |
39 | 39 | |
40 | 40 | /** |
41 | - * @return bool |
|
41 | + * @return false|null |
|
42 | 42 | */ |
43 | 43 | public function create_user_folder() |
44 | 44 | { |
@@ -10,82 +10,82 @@ |
||
10 | 10 | */ |
11 | 11 | class ToolIntro extends Coursecopy\Resource |
12 | 12 | { |
13 | - public $id; |
|
13 | + public $id; |
|
14 | 14 | |
15 | - /** |
|
16 | - * intro text |
|
17 | - */ |
|
18 | - public $intro_text; |
|
15 | + /** |
|
16 | + * intro text |
|
17 | + */ |
|
18 | + public $intro_text; |
|
19 | 19 | |
20 | - /** |
|
21 | - * Create a new text introduction |
|
22 | - * @param int $id The id of this tool introduction in the Chamilo-course |
|
23 | - * @param string $intro_text |
|
24 | - */ |
|
25 | - public function __construct($id, $intro_text) |
|
26 | - { |
|
27 | - parent::__construct($id, RESOURCE_TOOL_INTRO); |
|
28 | - $this->id = $id; |
|
29 | - $this->intro_text = $intro_text; |
|
30 | - } |
|
20 | + /** |
|
21 | + * Create a new text introduction |
|
22 | + * @param int $id The id of this tool introduction in the Chamilo-course |
|
23 | + * @param string $intro_text |
|
24 | + */ |
|
25 | + public function __construct($id, $intro_text) |
|
26 | + { |
|
27 | + parent::__construct($id, RESOURCE_TOOL_INTRO); |
|
28 | + $this->id = $id; |
|
29 | + $this->intro_text = $intro_text; |
|
30 | + } |
|
31 | 31 | |
32 | - /** |
|
33 | - * Show this resource |
|
34 | - */ |
|
35 | - function show() |
|
36 | - { |
|
37 | - parent::show(); |
|
38 | - switch ($this->id) |
|
39 | - { |
|
40 | - case TOOL_DOCUMENT: |
|
41 | - $lang_id = 'Documents'; |
|
42 | - break; |
|
43 | - case TOOL_CALENDAR_EVENT: |
|
44 | - $lang_id = 'Agenda'; |
|
45 | - break; |
|
46 | - case TOOL_LINK: |
|
47 | - $lang_id = 'Links'; |
|
48 | - break; |
|
49 | - case TOOL_LEARNPATH: |
|
50 | - $lang_id = 'LearningPath'; |
|
51 | - break; |
|
52 | - case TOOL_ANNOUNCEMENT: |
|
53 | - $lang_id = 'Announcements'; |
|
54 | - break; |
|
55 | - case TOOL_FORUM: |
|
56 | - $lang_id = 'Forums'; |
|
57 | - break; |
|
58 | - case TOOL_DROPBOX: |
|
59 | - $lang_id = 'Dropbox'; |
|
60 | - break; |
|
61 | - case TOOL_QUIZ: |
|
62 | - $lang_id = 'Exercises'; |
|
63 | - break; |
|
64 | - case TOOL_USER: |
|
65 | - $lang_id = 'Users'; |
|
66 | - break; |
|
67 | - case TOOL_GROUP: |
|
68 | - $lang_id = 'Group'; |
|
69 | - break; |
|
70 | - case TOOL_WIKI: |
|
71 | - $lang_id = 'Wiki'; |
|
72 | - break; |
|
73 | - case TOOL_STUDENTPUBLICATION: |
|
74 | - $lang_id = 'StudentPublications'; |
|
75 | - break; |
|
76 | - case TOOL_COURSE_HOMEPAGE: |
|
77 | - $lang_id = 'CourseHomepageLink'; |
|
78 | - break; |
|
79 | - case TOOL_GLOSSARY: |
|
80 | - $lang_id = 'Glossary'; |
|
81 | - break; |
|
82 | - case TOOL_NOTEBOOK: |
|
83 | - $lang_id = 'Notebook'; |
|
84 | - break; |
|
85 | - default: |
|
86 | - $lang_id = ucfirst($this->id); // This is a wild guess. |
|
87 | - } |
|
88 | - echo '<strong>'.get_lang($lang_id, '').':</strong><br />'; |
|
89 | - echo $this->intro_text; |
|
90 | - } |
|
32 | + /** |
|
33 | + * Show this resource |
|
34 | + */ |
|
35 | + function show() |
|
36 | + { |
|
37 | + parent::show(); |
|
38 | + switch ($this->id) |
|
39 | + { |
|
40 | + case TOOL_DOCUMENT: |
|
41 | + $lang_id = 'Documents'; |
|
42 | + break; |
|
43 | + case TOOL_CALENDAR_EVENT: |
|
44 | + $lang_id = 'Agenda'; |
|
45 | + break; |
|
46 | + case TOOL_LINK: |
|
47 | + $lang_id = 'Links'; |
|
48 | + break; |
|
49 | + case TOOL_LEARNPATH: |
|
50 | + $lang_id = 'LearningPath'; |
|
51 | + break; |
|
52 | + case TOOL_ANNOUNCEMENT: |
|
53 | + $lang_id = 'Announcements'; |
|
54 | + break; |
|
55 | + case TOOL_FORUM: |
|
56 | + $lang_id = 'Forums'; |
|
57 | + break; |
|
58 | + case TOOL_DROPBOX: |
|
59 | + $lang_id = 'Dropbox'; |
|
60 | + break; |
|
61 | + case TOOL_QUIZ: |
|
62 | + $lang_id = 'Exercises'; |
|
63 | + break; |
|
64 | + case TOOL_USER: |
|
65 | + $lang_id = 'Users'; |
|
66 | + break; |
|
67 | + case TOOL_GROUP: |
|
68 | + $lang_id = 'Group'; |
|
69 | + break; |
|
70 | + case TOOL_WIKI: |
|
71 | + $lang_id = 'Wiki'; |
|
72 | + break; |
|
73 | + case TOOL_STUDENTPUBLICATION: |
|
74 | + $lang_id = 'StudentPublications'; |
|
75 | + break; |
|
76 | + case TOOL_COURSE_HOMEPAGE: |
|
77 | + $lang_id = 'CourseHomepageLink'; |
|
78 | + break; |
|
79 | + case TOOL_GLOSSARY: |
|
80 | + $lang_id = 'Glossary'; |
|
81 | + break; |
|
82 | + case TOOL_NOTEBOOK: |
|
83 | + $lang_id = 'Notebook'; |
|
84 | + break; |
|
85 | + default: |
|
86 | + $lang_id = ucfirst($this->id); // This is a wild guess. |
|
87 | + } |
|
88 | + echo '<strong>'.get_lang($lang_id, '').':</strong><br />'; |
|
89 | + echo $this->intro_text; |
|
90 | + } |
|
91 | 91 | } |
@@ -3,8 +3,8 @@ discard block |
||
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 |
||
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 |
||
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 | } |
@@ -11,24 +11,24 @@ |
||
11 | 11 | class CourseSession extends Coursecopy\Resource |
12 | 12 | { |
13 | 13 | // The title session |
14 | - public $title; |
|
14 | + public $title; |
|
15 | 15 | |
16 | - /** |
|
17 | - * Create a new Session |
|
18 | - * @param int $id |
|
19 | - * @param string $title |
|
20 | - */ |
|
21 | - public function __construct($id,$title) |
|
22 | - { |
|
23 | - parent::__construct($id, RESOURCE_SESSION_COURSE); |
|
24 | - $this->title = $title; |
|
25 | - } |
|
16 | + /** |
|
17 | + * Create a new Session |
|
18 | + * @param int $id |
|
19 | + * @param string $title |
|
20 | + */ |
|
21 | + public function __construct($id,$title) |
|
22 | + { |
|
23 | + parent::__construct($id, RESOURCE_SESSION_COURSE); |
|
24 | + $this->title = $title; |
|
25 | + } |
|
26 | 26 | |
27 | - /** |
|
28 | - * Show this Event |
|
29 | - */ |
|
30 | - function show() { |
|
31 | - parent::show(); |
|
32 | - echo $this->title; |
|
33 | - } |
|
27 | + /** |
|
28 | + * Show this Event |
|
29 | + */ |
|
30 | + function show() { |
|
31 | + parent::show(); |
|
32 | + echo $this->title; |
|
33 | + } |
|
34 | 34 | } |
@@ -18,7 +18,7 @@ |
||
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; |
@@ -47,6 +47,6 @@ |
||
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 | } |
@@ -11,7 +11,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
@@ -65,6 +65,9 @@ |
||
65 | 65 | |
66 | 66 | /* FUNCTIONS */ |
67 | 67 | |
68 | +/** |
|
69 | + * @param string $name |
|
70 | + */ |
|
68 | 71 | function make_select_session_list($name, $sessions, $attr = array()) |
69 | 72 | { |
70 | 73 |
@@ -98,21 +98,21 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 | ); |