@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | |
57 | 57 | protected function build_move() |
58 | 58 | { |
59 | - $renderer =& $this->defaultRenderer(); |
|
59 | + $renderer = & $this->defaultRenderer(); |
|
60 | 60 | $renderer->setCustomElementTemplate('<span>{element}</span> '); |
61 | 61 | $this->addElement( |
62 | 62 | 'static', |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | $link = LinkFactory::create($link); |
139 | 139 | if (!empty($courseCode)) { |
140 | 140 | $link->set_course_code($courseCode); |
141 | - } elseif(!empty($_GET['course_code'])) { |
|
141 | + } elseif (!empty($_GET['course_code'])) { |
|
142 | 142 | $link->set_course_code(Database::escape_string($_GET['course_code'], null, false)); |
143 | 143 | } |
144 | 144 |
@@ -50,9 +50,9 @@ discard block |
||
50 | 50 | |
51 | 51 | } |
52 | 52 | if (count($result) == 0) { |
53 | - $evals_filtered=$evals; |
|
53 | + $evals_filtered = $evals; |
|
54 | 54 | } else { |
55 | - $evals_filtered=$evals_filtered_copy; |
|
55 | + $evals_filtered = $evals_filtered_copy; |
|
56 | 56 | } |
57 | 57 | $this->items = array_merge($evals_filtered, $links); |
58 | 58 | |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | { |
86 | 86 | // do some checks on count, redefine if invalid value |
87 | 87 | if (!isset($count)) { |
88 | - $count = count ($this->items) - $start; |
|
88 | + $count = count($this->items) - $start; |
|
89 | 89 | } |
90 | 90 | if ($count < 0) { |
91 | 91 | $count = 0; |
@@ -104,20 +104,20 @@ discard block |
||
104 | 104 | } elseif ($sorting & self :: UDG_SORT_AVERAGE) { |
105 | 105 | // if user sorts on average scores, first calculate them and cache them |
106 | 106 | foreach ($allitems as $item) { |
107 | - $this->avgcache[$item->get_item_type() . $item->get_id()]= $item->calc_score(); |
|
107 | + $this->avgcache[$item->get_item_type().$item->get_id()] = $item->calc_score(); |
|
108 | 108 | } |
109 | 109 | usort($allitems, array('UserDataGenerator', 'sort_by_average')); |
110 | 110 | } elseif ($sorting & self :: UDG_SORT_SCORE) { |
111 | 111 | // if user sorts on student's scores, first calculate them and cache them |
112 | 112 | foreach ($allitems as $item) { |
113 | - $this->scorecache[$item->get_item_type() . $item->get_id()] |
|
113 | + $this->scorecache[$item->get_item_type().$item->get_id()] |
|
114 | 114 | = $item->calc_score($this->userid); |
115 | 115 | } |
116 | 116 | usort($allitems, array('UserDataGenerator', 'sort_by_score')); |
117 | 117 | } elseif ($sorting & self :: UDG_SORT_MASK) { |
118 | 118 | // if user sorts on student's masks, first calculate scores and cache them |
119 | 119 | foreach ($allitems as $item) { |
120 | - $this->scorecache[$item->get_item_type() . $item->get_id()] |
|
120 | + $this->scorecache[$item->get_item_type().$item->get_id()] |
|
121 | 121 | = $item->calc_score($this->userid); |
122 | 122 | } |
123 | 123 | usort($allitems, array('UserDataGenerator', 'sort_by_mask')); |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | // fill score cache if not done yet |
133 | 133 | if (!isset ($this->scorecache)) { |
134 | 134 | foreach ($visibleitems as $item) { |
135 | - $this->scorecache[$item->get_item_type() . $item->get_id()] |
|
135 | + $this->scorecache[$item->get_item_type().$item->get_id()] |
|
136 | 136 | = $item->calc_score($this->userid); |
137 | 137 | } |
138 | 138 | |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | $scoredisplay = ScoreDisplay :: instance(); |
142 | 142 | $data = array(); |
143 | 143 | foreach ($visibleitems as $item) { |
144 | - $row = array (); |
|
144 | + $row = array(); |
|
145 | 145 | $row[] = $item; |
146 | 146 | $row[] = $item->get_name(); |
147 | 147 | $row[] = $this->build_course_name($item); |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | function sort_by_type($item1, $item2) |
164 | 164 | { |
165 | 165 | if ($item1->get_item_type() == $item2->get_item_type()) { |
166 | - return $this->sort_by_name($item1,$item2); |
|
166 | + return $this->sort_by_name($item1, $item2); |
|
167 | 167 | } else { |
168 | 168 | return ($item1->get_item_type() < $item2->get_item_type() ? -1 : 1); |
169 | 169 | } |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | */ |
204 | 204 | function sort_by_name($item1, $item2) |
205 | 205 | { |
206 | - return api_strnatcmp($item1->get_name(),$item2->get_name()); |
|
206 | + return api_strnatcmp($item1->get_name(), $item2->get_name()); |
|
207 | 207 | } |
208 | 208 | |
209 | 209 | /** |
@@ -213,8 +213,8 @@ discard block |
||
213 | 213 | */ |
214 | 214 | function sort_by_average($item1, $item2) |
215 | 215 | { |
216 | - $score1 = $this->avgcache[$item1->get_item_type() . $item1->get_id()]; |
|
217 | - $score2 = $this->avgcache[$item2->get_item_type() . $item2->get_id()]; |
|
216 | + $score1 = $this->avgcache[$item1->get_item_type().$item1->get_id()]; |
|
217 | + $score2 = $this->avgcache[$item2->get_item_type().$item2->get_id()]; |
|
218 | 218 | |
219 | 219 | return $this->compare_scores($score1, $score2); |
220 | 220 | } |
@@ -226,8 +226,8 @@ discard block |
||
226 | 226 | */ |
227 | 227 | function sort_by_score($item1, $item2) |
228 | 228 | { |
229 | - $score1 = $this->scorecache[$item1->get_item_type() . $item1->get_id()]; |
|
230 | - $score2 = $this->scorecache[$item2->get_item_type() . $item2->get_id()]; |
|
229 | + $score1 = $this->scorecache[$item1->get_item_type().$item1->get_id()]; |
|
230 | + $score2 = $this->scorecache[$item2->get_item_type().$item2->get_id()]; |
|
231 | 231 | |
232 | 232 | return $this->compare_scores($score1, $score2); |
233 | 233 | } |
@@ -239,8 +239,8 @@ discard block |
||
239 | 239 | */ |
240 | 240 | function sort_by_mask($item1, $item2) |
241 | 241 | { |
242 | - $score1 = $this->scorecache[$item1->get_item_type() . $item1->get_id()]; |
|
243 | - $score2 = $this->scorecache[$item2->get_item_type() . $item2->get_id()]; |
|
242 | + $score1 = $this->scorecache[$item1->get_item_type().$item1->get_id()]; |
|
243 | + $score2 = $this->scorecache[$item2->get_item_type().$item2->get_id()]; |
|
244 | 244 | |
245 | 245 | return ScoreDisplay :: compare_scores_by_custom_display($score1, $score2); |
246 | 246 | } |
@@ -256,10 +256,10 @@ discard block |
||
256 | 256 | return (isset($score2) ? 1 : 0); |
257 | 257 | } elseif (!isset($score2)) { |
258 | 258 | return -1; |
259 | - } elseif (($score1[0]/$score1[1]) == ($score2[0]/$score2[1])) { |
|
259 | + } elseif (($score1[0] / $score1[1]) == ($score2[0] / $score2[1])) { |
|
260 | 260 | return 0; |
261 | 261 | } else { |
262 | - return (($score1[0]/$score1[1]) < ($score2[0]/$score2[1]) ? -1 : 1); |
|
262 | + return (($score1[0] / $score1[1]) < ($score2[0] / $score2[1]) ? -1 : 1); |
|
263 | 263 | } |
264 | 264 | } |
265 | 265 | |
@@ -291,7 +291,7 @@ discard block |
||
291 | 291 | private function build_average_column($item, $ignore_score_color) |
292 | 292 | { |
293 | 293 | if (isset($this->avgcache)) { |
294 | - $avgscore = $this->avgcache[$item->get_item_type() . $item->get_id()]; |
|
294 | + $avgscore = $this->avgcache[$item->get_item_type().$item->get_id()]; |
|
295 | 295 | } else { |
296 | 296 | $avgscore = $item->calc_score(); |
297 | 297 | } |
@@ -311,7 +311,7 @@ discard block |
||
311 | 311 | */ |
312 | 312 | private function build_result_column($item, $ignore_score_color) |
313 | 313 | { |
314 | - $studscore = $this->scorecache[$item->get_item_type() . $item->get_id()]; |
|
314 | + $studscore = $this->scorecache[$item->get_item_type().$item->get_id()]; |
|
315 | 315 | $scoredisplay = ScoreDisplay :: instance(); |
316 | 316 | $displaytype = SCORE_DIV_PERCENT; |
317 | 317 | if ($ignore_score_color) { |
@@ -328,7 +328,7 @@ discard block |
||
328 | 328 | */ |
329 | 329 | private function build_mask_column($item, $ignore_score_color) |
330 | 330 | { |
331 | - $studscore = $this->scorecache[$item->get_item_type() . $item->get_id()]; |
|
331 | + $studscore = $this->scorecache[$item->get_item_type().$item->get_id()]; |
|
332 | 332 | $scoredisplay = ScoreDisplay :: instance(); |
333 | 333 | $displaytype = SCORE_DIV_PERCENT; |
334 | 334 | if ($ignore_score_color) { |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | /** |
15 | 15 | * constructor of the class |
16 | 16 | */ |
17 | - public function __construct($get_questions=false,$get_answers=false) |
|
17 | + public function __construct($get_questions = false, $get_answers = false) |
|
18 | 18 | { |
19 | 19 | } |
20 | 20 | |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | |
38 | 38 | foreach ($dato[0] as $header_col) { |
39 | 39 | if (!empty($header_col)) { |
40 | - $data .= str_replace("\r\n",' ',api_html_entity_decode(strip_tags($header_col))).';'; |
|
40 | + $data .= str_replace("\r\n", ' ', api_html_entity_decode(strip_tags($header_col))).';'; |
|
41 | 41 | } |
42 | 42 | } |
43 | 43 | |
@@ -46,10 +46,10 @@ discard block |
||
46 | 46 | |
47 | 47 | for ($i = 0; $i < $cant_students; $i++) { |
48 | 48 | $column = 0; |
49 | - foreach($dato[1][$i] as $col_name) { |
|
50 | - $data .= str_replace("\r\n",' ',api_html_entity_decode(strip_tags($col_name))).';'; |
|
49 | + foreach ($dato[1][$i] as $col_name) { |
|
50 | + $data .= str_replace("\r\n", ' ', api_html_entity_decode(strip_tags($col_name))).';'; |
|
51 | 51 | } |
52 | - $data .="\r\n"; |
|
52 | + $data .= "\r\n"; |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | //output the results |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | */ |
125 | 125 | public function exportCompleteReportDOC($data) |
126 | 126 | { |
127 | - $filename = 'gradebook_results_'.api_get_local_time() . '.docx'; |
|
127 | + $filename = 'gradebook_results_'.api_get_local_time().'.docx'; |
|
128 | 128 | |
129 | 129 | $doc = new \PhpOffice\PhpWord\PhpWord(); |
130 | 130 | $section = $doc->addSection(['orientation' => 'landscape']); |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | } |
144 | 144 | } |
145 | 145 | |
146 | - $file = api_get_path(SYS_ARCHIVE_PATH) . api_replace_dangerous_char($filename); |
|
146 | + $file = api_get_path(SYS_ARCHIVE_PATH).api_replace_dangerous_char($filename); |
|
147 | 147 | $doc->save($file, 'Word2007'); |
148 | 148 | |
149 | 149 | DocumentManager::file_send_for_download($file, true, $filename); |
@@ -11,15 +11,15 @@ discard block |
||
11 | 11 | |
12 | 12 | $selectCat = isset($_GET['selectcat']) ? (int) $_GET['selectcat'] : 0; |
13 | 13 | |
14 | -$interbreadcrumb[] = array ( |
|
14 | +$interbreadcrumb[] = array( |
|
15 | 15 | 'url' => $_SESSION['gradebook_dest'].'?', |
16 | 16 | 'name' => get_lang('Gradebook' |
17 | 17 | )); |
18 | -$interbreadcrumb[] = array ( |
|
18 | +$interbreadcrumb[] = array( |
|
19 | 19 | 'url' => $_SESSION['gradebook_dest'].'?selectcat='.$selectCat, |
20 | 20 | 'name' => get_lang('Details' |
21 | 21 | )); |
22 | -$interbreadcrumb[] = array ( |
|
22 | +$interbreadcrumb[] = array( |
|
23 | 23 | 'url' => 'gradebook_showlog_eval.php?visiblelog='.Security::remove_XSS($_GET['visiblelog']).'&selectcat='.$selectCat, |
24 | 24 | 'name' => get_lang('GradebookQualifyLog') |
25 | 25 | ); |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | |
31 | 31 | $t_linkeval_log = Database :: get_main_table(TABLE_MAIN_GRADEBOOK_LINKEVAL_LOG); |
32 | 32 | $t_user = Database :: get_main_table(TABLE_MAIN_USER); |
33 | -$visible_log=Security::remove_XSS($_GET['visiblelog']); |
|
33 | +$visible_log = Security::remove_XSS($_GET['visiblelog']); |
|
34 | 34 | |
35 | 35 | $evaledit = Evaluation :: load($visible_log); |
36 | 36 | $sql = "SELECT le.name,le.description,le.weight,le.visible,le.type,le.created_at,us.username |
@@ -45,8 +45,8 @@ discard block |
||
45 | 45 | } |
46 | 46 | |
47 | 47 | foreach ($list_info as $key => $info_log) { |
48 | - $list_info[$key][5]=($info_log[5]) ? api_convert_and_format_date($info_log[5]) : 'N/A'; |
|
49 | - $list_info[$key][3]=($info_log[3]==1) ? get_lang('GradebookVisible') : get_lang('GradebookInvisible'); |
|
48 | + $list_info[$key][5] = ($info_log[5]) ? api_convert_and_format_date($info_log[5]) : 'N/A'; |
|
49 | + $list_info[$key][3] = ($info_log[3] == 1) ? get_lang('GradebookVisible') : get_lang('GradebookInvisible'); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | $parameters = array( |
@@ -9,21 +9,21 @@ discard block |
||
9 | 9 | |
10 | 10 | api_block_anonymous_users(); |
11 | 11 | |
12 | -$eval= Evaluation :: load($_GET['selecteval']); |
|
12 | +$eval = Evaluation :: load($_GET['selecteval']); |
|
13 | 13 | if ($eval[0]->get_category_id() < 0) { |
14 | 14 | // if category id is negative, then the evaluation's origin is a link |
15 | - $link= LinkFactory :: get_evaluation_link($eval[0]->get_id()); |
|
15 | + $link = LinkFactory :: get_evaluation_link($eval[0]->get_id()); |
|
16 | 16 | $currentcat = Category :: load($link->get_category_id()); |
17 | 17 | } else { |
18 | 18 | $currentcat = Category :: load($eval[0]->get_category_id()); |
19 | 19 | } |
20 | 20 | |
21 | -$interbreadcrumb[]= array ( |
|
22 | - 'url' => $_SESSION['gradebook_dest'].'?selectcat=' . $currentcat[0]->get_id(), 'name' => get_lang('ToolGradebook')); |
|
21 | +$interbreadcrumb[] = array( |
|
22 | + 'url' => $_SESSION['gradebook_dest'].'?selectcat='.$currentcat[0]->get_id(), 'name' => get_lang('ToolGradebook')); |
|
23 | 23 | |
24 | 24 | if (api_is_allowed_to_edit()) { |
25 | - $interbreadcrumb[]= array ( |
|
26 | - 'url' => 'gradebook_view_result.php?selecteval=' . Security::remove_XSS($_GET['selecteval']).'&'.api_get_cidreq(), |
|
25 | + $interbreadcrumb[] = array( |
|
26 | + 'url' => 'gradebook_view_result.php?selecteval='.Security::remove_XSS($_GET['selecteval']).'&'.api_get_cidreq(), |
|
27 | 27 | 'name' => get_lang('ViewResult') |
28 | 28 | ); |
29 | 29 | } |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | Display :: display_error_message(get_lang('PleaseEnableScoringSystem'), false); |
46 | 46 | } |
47 | 47 | } else { |
48 | - $allresults = Result::load(null,null,$eval[0]->get_id()); |
|
48 | + $allresults = Result::load(null, null, $eval[0]->get_id()); |
|
49 | 49 | $nr_items = array(); |
50 | 50 | foreach ($displays as $itemsdisplay) { |
51 | 51 | $nr_items[$itemsdisplay['display']] = 0; |
@@ -78,19 +78,19 @@ discard block |
||
78 | 78 | } |
79 | 79 | |
80 | 80 | // Generate table |
81 | - $stattable= '<table class="data_table" cellspacing="0" cellpadding="3">'; |
|
82 | - $stattable .= '<tr><th>' . get_lang('ScoringSystem') . '</th>'; |
|
83 | - $stattable .= '<th>' . get_lang('Percentage') . '</th>'; |
|
84 | - $stattable .= '<th>' . get_lang('CountUsers') . '</th>'; |
|
81 | + $stattable = '<table class="data_table" cellspacing="0" cellpadding="3">'; |
|
82 | + $stattable .= '<tr><th>'.get_lang('ScoringSystem').'</th>'; |
|
83 | + $stattable .= '<th>'.get_lang('Percentage').'</th>'; |
|
84 | + $stattable .= '<th>'.get_lang('CountUsers').'</th>'; |
|
85 | 85 | //$stattable .= '<th>' . get_lang('Statistics') . '</th></tr>'; |
86 | - $counter=0; |
|
86 | + $counter = 0; |
|
87 | 87 | foreach ($keys as $key) { |
88 | - $bar = ($highest_ratio > 0?($nr_items[$key] / $highest_ratio) * 100:0); |
|
89 | - $stattable .= '<tr class="row_' . ($counter % 2 == 0 ? 'odd' : 'even') . '">'; |
|
90 | - $stattable .= '<td width="150">' . $key . '</td>'; |
|
88 | + $bar = ($highest_ratio > 0 ? ($nr_items[$key] / $highest_ratio) * 100 : 0); |
|
89 | + $stattable .= '<tr class="row_'.($counter % 2 == 0 ? 'odd' : 'even').'">'; |
|
90 | + $stattable .= '<td width="150">'.$key.'</td>'; |
|
91 | 91 | |
92 | 92 | $stattable .= '<td width="550">'.Display::bar_progress($bar).'</td>'; |
93 | - $stattable .= '<td align="right">' . $nr_items[$key] . '</td>'; |
|
93 | + $stattable .= '<td align="right">'.$nr_items[$key].'</td>'; |
|
94 | 94 | $counter++; |
95 | 95 | } |
96 | 96 | $stattable .= '</tr></table>'; |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | } |
58 | 58 | |
59 | 59 | $c_id = $c_id ? intval($c_id) : api_get_course_int_id(); |
60 | - $table = Database::get_course_table(TABLE_TOOL_LIST); |
|
60 | + $table = Database::get_course_table(TABLE_TOOL_LIST); |
|
61 | 61 | $sql = "SELECT * from $table |
62 | 62 | WHERE c_id = $c_id and name='$name' |
63 | 63 | LIMIT 1"; |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | $selected_skills = self::get_skills_by_gradebook($gradebook_id); |
195 | 195 | $clean_selected_skills = array(); |
196 | 196 | if (!empty($selected_skills)) { |
197 | - foreach($selected_skills as $skill) { |
|
197 | + foreach ($selected_skills as $skill) { |
|
198 | 198 | $clean_selected_skills[] = $skill['id']; |
199 | 199 | } |
200 | 200 | } |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | foreach ($tab_parents_id as $parent_id) { |
85 | 85 | $Same_parent_LP_item_list = $LP_item_list->get_item_with_same_parent($parent_id); |
86 | 86 | $previous_item_id = 0; |
87 | - for ($i=0; $i < count($Same_parent_LP_item_list->list); $i++) { |
|
87 | + for ($i = 0; $i < count($Same_parent_LP_item_list->list); $i++) { |
|
88 | 88 | $item_id = $Same_parent_LP_item_list->list[$i]->id; |
89 | 89 | // display_order |
90 | 90 | $display_order = $i + 1; |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | // next_item_id |
96 | 96 | $next_item_id = 0; |
97 | 97 | if ($i < count($Same_parent_LP_item_list->list) - 1) { |
98 | - $next_item_id = $Same_parent_LP_item_list->list[$i+1]->id; |
|
98 | + $next_item_id = $Same_parent_LP_item_list->list[$i + 1]->id; |
|
99 | 99 | } |
100 | 100 | $LP_item_list->set_parameters_for_id($item_id, $next_item_id, "next_item_id"); |
101 | 101 | } |
@@ -217,23 +217,23 @@ discard block |
||
217 | 217 | |
218 | 218 | if (api_get_session_id() == 0) { |
219 | 219 | echo '<div class="actions">'; |
220 | - if ($view_dropbox_category_received != 0 && api_is_allowed_to_session_edit(false, true)) { |
|
221 | - echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category=0&view_sent_category='.$viewSentCategory.'&view='.$view.'">'.Display::return_icon('folder_up.png', get_lang('Up').' '.get_lang('Root'),'',ICON_SIZE_MEDIUM)."</a>"; |
|
220 | + if ($view_dropbox_category_received != 0 && api_is_allowed_to_session_edit(false, true)) { |
|
221 | + echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category=0&view_sent_category='.$viewSentCategory.'&view='.$view.'">'.Display::return_icon('folder_up.png', get_lang('Up').' '.get_lang('Root'), '', ICON_SIZE_MEDIUM)."</a>"; |
|
222 | 222 | echo get_lang('Category').': <strong>'.Security::remove_XSS($dropbox_categories[$view_dropbox_category_received]['cat_name']).'</strong> '; |
223 | 223 | $movelist[0] = 'Root'; // move_received selectbox content |
224 | 224 | } else { |
225 | - echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=addreceivedcategory&view='.$view.'">'.Display::return_icon('new_folder.png', get_lang('AddNewCategory'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
225 | + echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=addreceivedcategory&view='.$view.'">'.Display::return_icon('new_folder.png', get_lang('AddNewCategory'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
226 | 226 | } |
227 | 227 | echo '</div>'; |
228 | 228 | } else { |
229 | 229 | if (api_is_allowed_to_session_edit(false, true)) { |
230 | 230 | echo '<div class="actions">'; |
231 | 231 | if ($view_dropbox_category_received != 0 && api_is_allowed_to_session_edit(false, true)) { |
232 | - echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category=0&view_sent_category='.$viewSentCategory.'&view='.$view.'">'.Display::return_icon('folder_up.png', get_lang('Up').' '.get_lang('Root'),'',ICON_SIZE_MEDIUM)."</a>"; |
|
232 | + echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category=0&view_sent_category='.$viewSentCategory.'&view='.$view.'">'.Display::return_icon('folder_up.png', get_lang('Up').' '.get_lang('Root'), '', ICON_SIZE_MEDIUM)."</a>"; |
|
233 | 233 | echo get_lang('Category').': <strong>'.Security::remove_XSS($dropbox_categories[$view_dropbox_category_received]['cat_name']).'</strong> '; |
234 | 234 | $movelist[0] = 'Root'; // move_received selectbox content |
235 | 235 | } else { |
236 | - echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=addreceivedcategory&view='.$view.'">'.Display::return_icon('new_folder.png', get_lang('AddNewCategory'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
236 | + echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=addreceivedcategory&view='.$view.'">'.Display::return_icon('new_folder.png', get_lang('AddNewCategory'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
237 | 237 | } |
238 | 238 | echo '</div>'; |
239 | 239 | } |
@@ -253,13 +253,13 @@ discard block |
||
253 | 253 | if (api_get_session_id() == 0) { |
254 | 254 | echo '<div class="actions">'; |
255 | 255 | if ($view_dropbox_category_sent != 0) { |
256 | - echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category=0&view='.$view.'">'.Display::return_icon('folder_up.png', get_lang('Up').' '.get_lang('Root'),'',ICON_SIZE_MEDIUM)."</a>"; |
|
256 | + echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category=0&view='.$view.'">'.Display::return_icon('folder_up.png', get_lang('Up').' '.get_lang('Root'), '', ICON_SIZE_MEDIUM)."</a>"; |
|
257 | 257 | echo get_lang('Category').': <strong>'.Security::remove_XSS($dropbox_categories[$view_dropbox_category_sent]['cat_name']).'</strong> '; |
258 | 258 | } else { |
259 | - echo "<a href=\"".api_get_self()."?".api_get_cidreq()."&view=".$view."&action=addsentcategory\">".Display::return_icon('new_folder.png', get_lang('AddNewCategory'),'',ICON_SIZE_MEDIUM)."</a>\n"; |
|
259 | + echo "<a href=\"".api_get_self()."?".api_get_cidreq()."&view=".$view."&action=addsentcategory\">".Display::return_icon('new_folder.png', get_lang('AddNewCategory'), '', ICON_SIZE_MEDIUM)."</a>\n"; |
|
260 | 260 | } |
261 | 261 | if (empty($viewSentCategory)) { |
262 | - echo "<a href=\"".api_get_self()."?".api_get_cidreq()."&view=".$view."&action=add\">".Display::return_icon('upload_file.png', get_lang('UploadNewFile'),'',ICON_SIZE_MEDIUM)."</a>"; |
|
262 | + echo "<a href=\"".api_get_self()."?".api_get_cidreq()."&view=".$view."&action=add\">".Display::return_icon('upload_file.png', get_lang('UploadNewFile'), '', ICON_SIZE_MEDIUM)."</a>"; |
|
263 | 263 | } |
264 | 264 | echo '</div>'; |
265 | 265 | } else { |
@@ -267,12 +267,12 @@ discard block |
||
267 | 267 | echo '<div class="actions">'; |
268 | 268 | if ($view_dropbox_category_sent != 0) { |
269 | 269 | echo get_lang('CurrentlySeeing').': <strong>'.Security::remove_XSS($dropbox_categories[$view_dropbox_category_sent]['cat_name']).'</strong> '; |
270 | - echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category=0&view='.$view.'">'.Display::return_icon('folder_up.png', get_lang('Up').' '.get_lang('Root'),'',ICON_SIZE_MEDIUM)."</a>"; |
|
270 | + echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category=0&view='.$view.'">'.Display::return_icon('folder_up.png', get_lang('Up').' '.get_lang('Root'), '', ICON_SIZE_MEDIUM)."</a>"; |
|
271 | 271 | } else { |
272 | - echo "<a href=\"".api_get_self()."?".api_get_cidreq()."&view=".$view."&action=addsentcategory\">".Display::return_icon('new_folder.png', get_lang('AddNewCategory'),'',ICON_SIZE_MEDIUM)."</a>\n"; |
|
272 | + echo "<a href=\"".api_get_self()."?".api_get_cidreq()."&view=".$view."&action=addsentcategory\">".Display::return_icon('new_folder.png', get_lang('AddNewCategory'), '', ICON_SIZE_MEDIUM)."</a>\n"; |
|
273 | 273 | } |
274 | 274 | if (empty($viewSentCategory)) { |
275 | - echo "<a href=\"".api_get_self()."?".api_get_cidreq()."&view=".$view."&action=add\">".Display::return_icon('upload_file.png', get_lang('UploadNewFile'),'',ICON_SIZE_MEDIUM)."</a>"; |
|
275 | + echo "<a href=\"".api_get_self()."?".api_get_cidreq()."&view=".$view."&action=add\">".Display::return_icon('upload_file.png', get_lang('UploadNewFile'), '', ICON_SIZE_MEDIUM)."</a>"; |
|
276 | 276 | } |
277 | 277 | echo '</div>'; |
278 | 278 | } |
@@ -325,7 +325,7 @@ discard block |
||
325 | 325 | |
326 | 326 | if (api_get_session_id() == 0) { |
327 | 327 | $column_header[] = array(get_lang('Modify'), false, '', 'nowrap style="text-align: right"'); |
328 | - } elseif (api_is_allowed_to_session_edit(false,true)) { |
|
328 | + } elseif (api_is_allowed_to_session_edit(false, true)) { |
|
329 | 329 | $column_header[] = array(get_lang('Modify'), false, '', 'nowrap style="text-align: right"'); |
330 | 330 | } |
331 | 331 | |
@@ -386,7 +386,7 @@ discard block |
||
386 | 386 | $link_open = '<a href="'.api_get_path(WEB_CODE_PATH).'dropbox/dropbox_download.php?'.api_get_cidreq().'&id='.$dropbox_file->id.'">'; |
387 | 387 | $dropbox_file_data[] = $link_open.DocumentManager::build_document_icon_tag('file', $dropbox_file->title).'</a>'; |
388 | 388 | $dropbox_file_data[] = '<a href="'.api_get_path(WEB_CODE_PATH).'dropbox/dropbox_download.php?'.api_get_cidreq().'&id='.$dropbox_file->id.'&action=download">'. |
389 | - Display::return_icon('save.png', get_lang('Download'), array('style' => 'float:right;'),ICON_SIZE_SMALL).'</a>'.$link_open.$dropbox_file->title.'</a>'.$new_icon.'<br />'.$dropbox_file->description; |
|
389 | + Display::return_icon('save.png', get_lang('Download'), array('style' => 'float:right;'), ICON_SIZE_SMALL).'</a>'.$link_open.$dropbox_file->title.'</a>'.$new_icon.'<br />'.$dropbox_file->description; |
|
390 | 390 | $file_size = $dropbox_file->filesize; |
391 | 391 | $dropbox_file_data[] = format_file_size($file_size); |
392 | 392 | |
@@ -402,10 +402,10 @@ discard block |
||
402 | 402 | api_format_date($last_upload_date).'</span>'; |
403 | 403 | |
404 | 404 | $action_icons = check_number_feedback($dropbox_file->id, $number_feedback).' '.get_lang('Feedback').' |
405 | - <a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category='.$viewSentCategory.'&view='.$view.'&action=viewfeedback&id='.$dropbox_file->id.'&'.$sort_params.'">'.Display::return_icon('discuss.png', get_lang('Comment'),'',ICON_SIZE_SMALL).'</a> |
|
406 | - <a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category='.$viewSentCategory.'&view='.$view.'&action=movereceived&move_id='.$dropbox_file->id.'&'.$sort_params.'">'.Display::return_icon('move.png', get_lang('Move'),'',ICON_SIZE_SMALL).'</a> |
|
405 | + <a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category='.$viewSentCategory.'&view='.$view.'&action=viewfeedback&id='.$dropbox_file->id.'&'.$sort_params.'">'.Display::return_icon('discuss.png', get_lang('Comment'), '', ICON_SIZE_SMALL).'</a> |
|
406 | + <a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category='.$viewSentCategory.'&view='.$view.'&action=movereceived&move_id='.$dropbox_file->id.'&'.$sort_params.'">'.Display::return_icon('move.png', get_lang('Move'), '', ICON_SIZE_SMALL).'</a> |
|
407 | 407 | <a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category='.$viewSentCategory.'&view='.$view.'&action=deletereceivedfile&id='.$dropbox_file->id.'&'.$sort_params.'" onclick="javascript: return confirmation(\''.$dropbox_file->title.'\');">'. |
408 | - Display::return_icon('delete.png', get_lang('Delete'),'',ICON_SIZE_SMALL).'</a>'; |
|
408 | + Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'</a>'; |
|
409 | 409 | |
410 | 410 | // This is a hack to have an additional row in a sortable table |
411 | 411 | |
@@ -439,12 +439,12 @@ discard block |
||
439 | 439 | // The icon of the category |
440 | 440 | $link_open = '<a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$category['cat_id'].'&view_sent_category='.$viewSentCategory.'&view='.$view.'">'; |
441 | 441 | $dropbox_category_data[] = $link_open.DocumentManager::build_document_icon_tag('folder', $category['cat_name']).'</a>'; |
442 | - $dropbox_category_data[] = '<a href="'.api_get_path(WEB_CODE_PATH).'dropbox/dropbox_download.php?'.api_get_cidreq().'&cat_id='.$category['cat_id'].'&action=downloadcategory&sent_received=received">'.Display::return_icon('save_pack.png', get_lang('Save'), array('style' => 'float:right;'),ICON_SIZE_SMALL).'</a>'.$link_open.$category['cat_name'].'</a>'; |
|
442 | + $dropbox_category_data[] = '<a href="'.api_get_path(WEB_CODE_PATH).'dropbox/dropbox_download.php?'.api_get_cidreq().'&cat_id='.$category['cat_id'].'&action=downloadcategory&sent_received=received">'.Display::return_icon('save_pack.png', get_lang('Save'), array('style' => 'float:right;'), ICON_SIZE_SMALL).'</a>'.$link_open.$category['cat_name'].'</a>'; |
|
443 | 443 | $dropbox_category_data[] = ''; |
444 | 444 | $dropbox_category_data[] = ''; |
445 | 445 | $dropbox_category_data[] = ''; |
446 | - $dropbox_category_data[] = '<a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category='.$viewSentCategory.'&view='.$view.'&action=editcategory&id='.$category['cat_id'].'">'.Display::return_icon('edit.png',get_lang('Edit'),'',ICON_SIZE_SMALL).'</a> |
|
447 | - <a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category='.$viewSentCategory.'&view='.$view.'&action=deletereceivedcategory&id='.$category['cat_id'].'" onclick="javascript: return confirmation(\''.Security::remove_XSS($category['cat_name']).'\');">'.Display::return_icon('delete.png', get_lang('Delete'),'',ICON_SIZE_SMALL).'</a>'; |
|
446 | + $dropbox_category_data[] = '<a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category='.$viewSentCategory.'&view='.$view.'&action=editcategory&id='.$category['cat_id'].'">'.Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL).'</a> |
|
447 | + <a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category='.$viewSentCategory.'&view='.$view.'&action=deletereceivedcategory&id='.$category['cat_id'].'" onclick="javascript: return confirmation(\''.Security::remove_XSS($category['cat_name']).'\');">'.Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'</a>'; |
|
448 | 448 | } |
449 | 449 | if (is_array($dropbox_category_data) && count($dropbox_category_data) > 0) { |
450 | 450 | $dropbox_data_recieved[] = $dropbox_category_data; |
@@ -464,8 +464,8 @@ discard block |
||
464 | 464 | ); |
465 | 465 | |
466 | 466 | if (is_array($movelist)) { |
467 | - foreach ($movelist as $catid => $catname){ |
|
468 | - $selectlist['move_received_'.$catid] = get_lang('Move') . '->'. Security::remove_XSS($catname); |
|
467 | + foreach ($movelist as $catid => $catname) { |
|
468 | + $selectlist['move_received_'.$catid] = get_lang('Move').'->'.Security::remove_XSS($catname); |
|
469 | 469 | } |
470 | 470 | } |
471 | 471 | |
@@ -559,7 +559,7 @@ discard block |
||
559 | 559 | $link_open = '<a href="'.api_get_path(WEB_CODE_PATH).'dropbox/dropbox_download.php?'.api_get_cidreq().'&id='.$dropbox_file->id.'">'; |
560 | 560 | $dropbox_file_data[] = $link_open.DocumentManager::build_document_icon_tag('file', $dropbox_file->title).'</a>'; |
561 | 561 | $dropbox_file_data[] = '<a href="'.api_get_path(WEB_CODE_PATH).'dropbox/dropbox_download.php?'.api_get_cidreq().'&id='.$dropbox_file->id.'&action=download">'. |
562 | - Display::return_icon('save.png', get_lang('Save'), array('style' => 'float:right;'),ICON_SIZE_SMALL).'</a>'.$link_open.$dropbox_file->title.'</a><br />'.$dropbox_file->description; |
|
562 | + Display::return_icon('save.png', get_lang('Save'), array('style' => 'float:right;'), ICON_SIZE_SMALL).'</a>'.$link_open.$dropbox_file->title.'</a><br />'.$dropbox_file->description; |
|
563 | 563 | $file_size = $dropbox_file->filesize; |
564 | 564 | $dropbox_file_data[] = format_file_size($file_size); |
565 | 565 | $receivers_celldata = null; |
@@ -577,9 +577,9 @@ discard block |
||
577 | 577 | $receivers_celldata = ''; |
578 | 578 | |
579 | 579 | $action_icons = check_number_feedback($dropbox_file->id, $number_feedback).' '.get_lang('Feedback').' |
580 | - <a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category='.$viewSentCategory.'&view='.$view.'&action=viewfeedback&id='.$dropbox_file->id.'&'.$sort_params.'">'.Display::return_icon('discuss.png', get_lang('Comment'),'',ICON_SIZE_SMALL).'</a> |
|
581 | - <a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category='.$viewSentCategory.'&view='.$view.'&action=movesent&move_id='.$dropbox_file->id.'&'.$sort_params.'">'.Display::return_icon('move.png', get_lang('Move'),'',ICON_SIZE_SMALL).'</a> |
|
582 | - <a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category='.$viewSentCategory.'&view='.$view.'&action=deletesentfile&id='.$dropbox_file->id.'&'.$sort_params.'" onclick="javascript: return confirmation(\''.$dropbox_file->title.'\');">'.Display::return_icon('delete.png', get_lang('Delete'),'',ICON_SIZE_SMALL).'</a>'; |
|
580 | + <a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category='.$viewSentCategory.'&view='.$view.'&action=viewfeedback&id='.$dropbox_file->id.'&'.$sort_params.'">'.Display::return_icon('discuss.png', get_lang('Comment'), '', ICON_SIZE_SMALL).'</a> |
|
581 | + <a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category='.$viewSentCategory.'&view='.$view.'&action=movesent&move_id='.$dropbox_file->id.'&'.$sort_params.'">'.Display::return_icon('move.png', get_lang('Move'), '', ICON_SIZE_SMALL).'</a> |
|
582 | + <a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category='.$viewSentCategory.'&view='.$view.'&action=deletesentfile&id='.$dropbox_file->id.'&'.$sort_params.'" onclick="javascript: return confirmation(\''.$dropbox_file->title.'\');">'.Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'</a>'; |
|
583 | 583 | // This is a hack to have an additional row in a sortable table |
584 | 584 | if ($action == 'viewfeedback' && isset($_GET['id']) && is_numeric($_GET['id']) && $dropbox_file->id == $_GET['id']) { |
585 | 585 | $action_icons .= "</td></tr>\n"; // ending the normal row of the sortable table |
@@ -608,16 +608,16 @@ discard block |
||
608 | 608 | // This is where the checkbox icon for the files appear. |
609 | 609 | $link_open = '<a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category='.$category['cat_id'].'&view='.$view.'">'; |
610 | 610 | $dropbox_category_data[] = $link_open.DocumentManager::build_document_icon_tag('folder', Security::remove_XSS($category['cat_name'])).'</a>'; |
611 | - $dropbox_category_data[] = '<a href="'.api_get_path(WEB_CODE_PATH).'dropbox/dropbox_download.php?'.api_get_cidreq().'&cat_id='.$category['cat_id'].'&action=downloadcategory&sent_received=sent">'.Display::return_icon('save_pack.png', get_lang('Save'), array('style' => 'float:right;'),ICON_SIZE_SMALL).'</a>'.$link_open.Security::remove_XSS($category['cat_name']).'</a>'; |
|
611 | + $dropbox_category_data[] = '<a href="'.api_get_path(WEB_CODE_PATH).'dropbox/dropbox_download.php?'.api_get_cidreq().'&cat_id='.$category['cat_id'].'&action=downloadcategory&sent_received=sent">'.Display::return_icon('save_pack.png', get_lang('Save'), array('style' => 'float:right;'), ICON_SIZE_SMALL).'</a>'.$link_open.Security::remove_XSS($category['cat_name']).'</a>'; |
|
612 | 612 | //$dropbox_category_data[] = ''; |
613 | 613 | $dropbox_category_data[] = ''; |
614 | 614 | //$dropbox_category_data[] = ''; |
615 | 615 | $dropbox_category_data[] = ''; |
616 | 616 | $dropbox_category_data[] = ''; |
617 | 617 | $dropbox_category_data[] = '<a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category='.$viewSentCategory.'&view='.$view.'&action=editcategory&id='.$category['cat_id'].'">'. |
618 | - Display::return_icon('edit.png', get_lang('Edit'),'',ICON_SIZE_SMALL).'</a> |
|
618 | + Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL).'</a> |
|
619 | 619 | <a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category='.$viewSentCategory.'&view='.$view.'&action=deletesentcategory&id='.$category['cat_id'].'" onclick="javascript: return confirmation(\''.Security::remove_XSS($category['cat_name']).'\');">'. |
620 | - Display::return_icon('delete.png', get_lang('Delete'),'',ICON_SIZE_SMALL).'</a>'; |
|
620 | + Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'</a>'; |
|
621 | 621 | } |
622 | 622 | if (is_array($dropbox_category_data) && count($dropbox_category_data) > 0) { |
623 | 623 | $dropbox_data_sent[] = $dropbox_category_data; |
@@ -639,7 +639,7 @@ discard block |
||
639 | 639 | |
640 | 640 | if (!empty($moveList)) { |
641 | 641 | foreach ($moveList as $catid => $catname) { |
642 | - $selectlist['move_sent_'.$catid] = get_lang('Move') . '->'. Security::remove_XSS($catname); |
|
642 | + $selectlist['move_sent_'.$catid] = get_lang('Move').'->'.Security::remove_XSS($catname); |
|
643 | 643 | } |
644 | 644 | } |
645 | 645 |
@@ -46,8 +46,8 @@ discard block |
||
46 | 46 | $try_new_fsc_id = $try_new_fsc_db = $try_new_fsc_dir = 0; |
47 | 47 | |
48 | 48 | while (!$keys_are_unique) { |
49 | - $keys_course_id = $prefix_for_all . $unique_prefix . $wanted_code . $final_suffix['CourseId']; |
|
50 | - $keys_course_repository = $prefix_for_path . $unique_prefix . $wanted_code . $final_suffix['CourseDir']; |
|
49 | + $keys_course_id = $prefix_for_all.$unique_prefix.$wanted_code.$final_suffix['CourseId']; |
|
50 | + $keys_course_repository = $prefix_for_path.$unique_prefix.$wanted_code.$final_suffix['CourseDir']; |
|
51 | 51 | $keys_are_unique = true; |
52 | 52 | |
53 | 53 | // Check whether they are unique. |
@@ -58,12 +58,12 @@ discard block |
||
58 | 58 | |
59 | 59 | if (Database::num_rows($result)) { |
60 | 60 | $keys_are_unique = false; |
61 | - $try_new_fsc_id ++; |
|
61 | + $try_new_fsc_id++; |
|
62 | 62 | $final_suffix['CourseId'] = substr(md5(uniqid(rand())), 0, 4); |
63 | 63 | } |
64 | 64 | if (file_exists(api_get_path(SYS_COURSE_PATH).$keys_course_repository)) { |
65 | 65 | $keys_are_unique = false; |
66 | - $try_new_fsc_dir ++; |
|
66 | + $try_new_fsc_dir++; |
|
67 | 67 | $final_suffix['CourseDir'] = substr(md5(uniqid(rand())), 0, 4); |
68 | 68 | } |
69 | 69 | |
@@ -91,12 +91,12 @@ discard block |
||
91 | 91 | $perm = api_get_permissions_for_new_directories(); |
92 | 92 | $perm_file = api_get_permissions_for_new_files(); |
93 | 93 | $htmlpage = "<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <meta charset=\"utf-8\">\n <title>Not authorized</title>\n </head>\n <body>\n </body>\n</html>"; |
94 | - $cp = api_get_path(SYS_COURSE_PATH) . $course_repository; |
|
94 | + $cp = api_get_path(SYS_COURSE_PATH).$course_repository; |
|
95 | 95 | |
96 | 96 | //Creating document folder |
97 | 97 | mkdir($cp, $perm); |
98 | - mkdir($cp . '/document', $perm); |
|
99 | - $cpt = $cp . '/document/index.html'; |
|
98 | + mkdir($cp.'/document', $perm); |
|
99 | + $cpt = $cp.'/document/index.html'; |
|
100 | 100 | $fd = fopen($cpt, 'w'); |
101 | 101 | fwrite($fd, $htmlpage); |
102 | 102 | fclose($fd); |
@@ -118,49 +118,49 @@ discard block |
||
118 | 118 | @copy($cpt, $cp . '/document/video/index.html'); */ |
119 | 119 | |
120 | 120 | //Creatind dropbox folder |
121 | - mkdir($cp . '/dropbox', $perm); |
|
122 | - $cpt = $cp . '/dropbox/index.html'; |
|
121 | + mkdir($cp.'/dropbox', $perm); |
|
122 | + $cpt = $cp.'/dropbox/index.html'; |
|
123 | 123 | $fd = fopen($cpt, 'w'); |
124 | 124 | fwrite($fd, $htmlpage); |
125 | 125 | fclose($fd); |
126 | 126 | @chmod($cpt, $perm_file); |
127 | - mkdir($cp . '/group', $perm); |
|
128 | - @copy($cpt, $cp . '/group/index.html'); |
|
129 | - mkdir($cp . '/page', $perm); |
|
130 | - @copy($cpt, $cp . '/page/index.html'); |
|
131 | - mkdir($cp . '/scorm', $perm); |
|
132 | - @copy($cpt, $cp . '/scorm/index.html'); |
|
133 | - mkdir($cp . '/upload', $perm); |
|
134 | - @copy($cpt, $cp . '/upload/index.html'); |
|
135 | - mkdir($cp . '/upload/forum', $perm); |
|
136 | - @copy($cpt, $cp . '/upload/forum/index.html'); |
|
137 | - mkdir($cp . '/upload/forum/images', $perm); |
|
138 | - @copy($cpt, $cp . '/upload/forum/images/index.html'); |
|
139 | - mkdir($cp . '/upload/test', $perm); |
|
140 | - @copy($cpt, $cp . '/upload/test/index.html'); |
|
141 | - mkdir($cp . '/upload/blog', $perm); |
|
142 | - @copy($cpt, $cp . '/upload/blog/index.html'); |
|
143 | - mkdir($cp . '/upload/learning_path', $perm); |
|
144 | - @copy($cpt, $cp . '/upload/learning_path/index.html'); |
|
145 | - mkdir($cp . '/upload/learning_path/images', $perm); |
|
146 | - @copy($cpt, $cp . '/upload/learning_path/images/index.html'); |
|
147 | - mkdir($cp . '/upload/calendar', $perm); |
|
148 | - @copy($cpt, $cp . '/upload/calendar/index.html'); |
|
149 | - mkdir($cp . '/upload/calendar/images', $perm); |
|
150 | - @copy($cpt, $cp . '/upload/calendar/images/index.html'); |
|
151 | - mkdir($cp . '/work', $perm); |
|
152 | - @copy($cpt, $cp . '/work/index.html'); |
|
153 | - mkdir($cp . '/upload/announcements', $perm); |
|
154 | - @copy($cpt, $cp . '/upload/announcements/index.html'); |
|
155 | - mkdir($cp . '/upload/announcements/images', $perm); |
|
156 | - @copy($cpt, $cp . '/upload/announcements/images/index.html'); |
|
127 | + mkdir($cp.'/group', $perm); |
|
128 | + @copy($cpt, $cp.'/group/index.html'); |
|
129 | + mkdir($cp.'/page', $perm); |
|
130 | + @copy($cpt, $cp.'/page/index.html'); |
|
131 | + mkdir($cp.'/scorm', $perm); |
|
132 | + @copy($cpt, $cp.'/scorm/index.html'); |
|
133 | + mkdir($cp.'/upload', $perm); |
|
134 | + @copy($cpt, $cp.'/upload/index.html'); |
|
135 | + mkdir($cp.'/upload/forum', $perm); |
|
136 | + @copy($cpt, $cp.'/upload/forum/index.html'); |
|
137 | + mkdir($cp.'/upload/forum/images', $perm); |
|
138 | + @copy($cpt, $cp.'/upload/forum/images/index.html'); |
|
139 | + mkdir($cp.'/upload/test', $perm); |
|
140 | + @copy($cpt, $cp.'/upload/test/index.html'); |
|
141 | + mkdir($cp.'/upload/blog', $perm); |
|
142 | + @copy($cpt, $cp.'/upload/blog/index.html'); |
|
143 | + mkdir($cp.'/upload/learning_path', $perm); |
|
144 | + @copy($cpt, $cp.'/upload/learning_path/index.html'); |
|
145 | + mkdir($cp.'/upload/learning_path/images', $perm); |
|
146 | + @copy($cpt, $cp.'/upload/learning_path/images/index.html'); |
|
147 | + mkdir($cp.'/upload/calendar', $perm); |
|
148 | + @copy($cpt, $cp.'/upload/calendar/index.html'); |
|
149 | + mkdir($cp.'/upload/calendar/images', $perm); |
|
150 | + @copy($cpt, $cp.'/upload/calendar/images/index.html'); |
|
151 | + mkdir($cp.'/work', $perm); |
|
152 | + @copy($cpt, $cp.'/work/index.html'); |
|
153 | + mkdir($cp.'/upload/announcements', $perm); |
|
154 | + @copy($cpt, $cp.'/upload/announcements/index.html'); |
|
155 | + mkdir($cp.'/upload/announcements/images', $perm); |
|
156 | + @copy($cpt, $cp.'/upload/announcements/images/index.html'); |
|
157 | 157 | |
158 | 158 | //Oral expression question type |
159 | - mkdir($cp . '/exercises', $perm); |
|
160 | - @copy($cpt, $cp . '/exercises/index.html'); |
|
159 | + mkdir($cp.'/exercises', $perm); |
|
160 | + @copy($cpt, $cp.'/exercises/index.html'); |
|
161 | 161 | |
162 | 162 | // Create .htaccess in the dropbox directory. |
163 | - $fp = fopen($cp . '/dropbox/.htaccess', 'w'); |
|
163 | + $fp = fopen($cp.'/dropbox/.htaccess', 'w'); |
|
164 | 164 | fwrite( |
165 | 165 | $fp, |
166 | 166 | "AuthName AllowLocalAccess |
@@ -302,7 +302,7 @@ discard block |
||
302 | 302 | { |
303 | 303 | $list = self::get_course_tables(); |
304 | 304 | foreach ($list as $table) { |
305 | - $sql = "DROP TABLE IF EXISTS " . DB_COURSE_PREFIX . $table; |
|
305 | + $sql = "DROP TABLE IF EXISTS ".DB_COURSE_PREFIX.$table; |
|
306 | 306 | Database::query($sql); |
307 | 307 | } |
308 | 308 | } |
@@ -326,47 +326,47 @@ discard block |
||
326 | 326 | if ($media == 'images') { |
327 | 327 | $code_path = api_get_path( |
328 | 328 | SYS_CODE_PATH |
329 | - ) . 'default_course_document/images/'; |
|
329 | + ).'default_course_document/images/'; |
|
330 | 330 | } |
331 | 331 | if ($media == 'audio') { |
332 | 332 | $code_path = api_get_path( |
333 | 333 | SYS_CODE_PATH |
334 | - ) . 'default_course_document/audio/'; |
|
334 | + ).'default_course_document/audio/'; |
|
335 | 335 | } |
336 | 336 | if ($media == 'flash') { |
337 | 337 | $code_path = api_get_path( |
338 | 338 | SYS_CODE_PATH |
339 | - ) . 'default_course_document/flash/'; |
|
339 | + ).'default_course_document/flash/'; |
|
340 | 340 | } |
341 | 341 | if ($media == 'video') { |
342 | 342 | $code_path = api_get_path( |
343 | 343 | SYS_CODE_PATH |
344 | - ) . 'default_course_document/video/'; |
|
344 | + ).'default_course_document/video/'; |
|
345 | 345 | } |
346 | 346 | if ($media == 'certificates') { |
347 | 347 | $code_path = api_get_path( |
348 | 348 | SYS_CODE_PATH |
349 | - ) . 'default_course_document/certificates/'; |
|
349 | + ).'default_course_document/certificates/'; |
|
350 | 350 | } |
351 | 351 | if (is_dir($path)) { |
352 | 352 | $handle = opendir($path); |
353 | 353 | while (false !== ($file = readdir($handle))) { |
354 | - if (is_dir($path . $file) && strpos($file, '.') !== 0) { |
|
354 | + if (is_dir($path.$file) && strpos($file, '.') !== 0) { |
|
355 | 355 | $files[]['dir'] = str_replace( |
356 | 356 | $code_path, |
357 | 357 | '', |
358 | - $path . $file . '/' |
|
358 | + $path.$file.'/' |
|
359 | 359 | ); |
360 | 360 | $files = self::browse_folders( |
361 | - $path . $file . '/', |
|
361 | + $path.$file.'/', |
|
362 | 362 | $files, |
363 | 363 | $media |
364 | 364 | ); |
365 | - } elseif (is_file($path . $file) && strpos($file, '.') !== 0) { |
|
365 | + } elseif (is_file($path.$file) && strpos($file, '.') !== 0) { |
|
366 | 366 | $files[]['file'] = str_replace( |
367 | 367 | $code_path, |
368 | 368 | '', |
369 | - $path . $file |
|
369 | + $path.$file |
|
370 | 370 | ); |
371 | 371 | } |
372 | 372 | } |
@@ -444,117 +444,117 @@ discard block |
||
444 | 444 | |
445 | 445 | Database::query( |
446 | 446 | "INSERT INTO $tbl_course_homepage (c_id, id, name, link, image, visibility, admin, address, added_tool, target, category, session_id) |
447 | - VALUES ($course_id, 1, '" . TOOL_COURSE_DESCRIPTION . "','course_description/','info.gif','" . self::string2binary( |
|
447 | + VALUES ($course_id, 1, '".TOOL_COURSE_DESCRIPTION."','course_description/','info.gif','".self::string2binary( |
|
448 | 448 | api_get_setting( |
449 | 449 | 'course_create_active_tools', |
450 | 450 | 'course_description' |
451 | 451 | ) |
452 | - ) . "','0','squaregrey.gif', 0,'_self','authoring','0')" |
|
452 | + )."','0','squaregrey.gif', 0,'_self','authoring','0')" |
|
453 | 453 | ); |
454 | 454 | Database::query( |
455 | 455 | "INSERT INTO $tbl_course_homepage (c_id, id, name, link, image, visibility, admin, address, added_tool, target, category, session_id) |
456 | - VALUES ($course_id, 2, '" . TOOL_CALENDAR_EVENT . "','calendar/agenda.php','agenda.gif','" . self::string2binary( |
|
456 | + VALUES ($course_id, 2, '".TOOL_CALENDAR_EVENT."','calendar/agenda.php','agenda.gif','".self::string2binary( |
|
457 | 457 | api_get_setting('course_create_active_tools', 'agenda') |
458 | - ) . "','0','squaregrey.gif',0,'_self','interaction','0')" |
|
458 | + )."','0','squaregrey.gif',0,'_self','interaction','0')" |
|
459 | 459 | ); |
460 | 460 | Database::query( |
461 | 461 | "INSERT INTO $tbl_course_homepage (c_id, id, name, link, image, visibility, admin, address, added_tool, target, category, session_id) |
462 | - VALUES ($course_id, 3, '" . TOOL_DOCUMENT . "','document/document.php','folder_document.gif','" . self::string2binary( |
|
462 | + VALUES ($course_id, 3, '".TOOL_DOCUMENT."','document/document.php','folder_document.gif','".self::string2binary( |
|
463 | 463 | api_get_setting('course_create_active_tools', 'documents') |
464 | - ) . "','0','squaregrey.gif',0,'_self','authoring','0')" |
|
464 | + )."','0','squaregrey.gif',0,'_self','authoring','0')" |
|
465 | 465 | ); |
466 | 466 | Database::query( |
467 | 467 | "INSERT INTO $tbl_course_homepage (c_id, id, name, link, image, visibility, admin, address, added_tool, target, category, session_id) |
468 | - VALUES ($course_id, 4, '" . TOOL_LEARNPATH . "','lp/lp_controller.php','scorms.gif','" . self::string2binary( |
|
468 | + VALUES ($course_id, 4, '".TOOL_LEARNPATH."','lp/lp_controller.php','scorms.gif','".self::string2binary( |
|
469 | 469 | api_get_setting('course_create_active_tools', 'learning_path') |
470 | - ) . "','0','squaregrey.gif',0,'_self','authoring','0')" |
|
470 | + )."','0','squaregrey.gif',0,'_self','authoring','0')" |
|
471 | 471 | ); |
472 | 472 | Database::query( |
473 | 473 | "INSERT INTO $tbl_course_homepage (c_id, id, name, link, image, visibility, admin, address, added_tool, target, category, session_id) |
474 | - VALUES ($course_id, 5, '" . TOOL_LINK . "','link/link.php','links.gif','" . self::string2binary( |
|
474 | + VALUES ($course_id, 5, '".TOOL_LINK."','link/link.php','links.gif','".self::string2binary( |
|
475 | 475 | api_get_setting('course_create_active_tools', 'links') |
476 | - ) . "','0','squaregrey.gif',0,'_self','authoring','0')" |
|
476 | + )."','0','squaregrey.gif',0,'_self','authoring','0')" |
|
477 | 477 | ); |
478 | 478 | Database::query( |
479 | 479 | "INSERT INTO $tbl_course_homepage (c_id, id, name, link, image, visibility, admin, address, added_tool, target, category, session_id) |
480 | - VALUES ($course_id, 6, '" . TOOL_QUIZ . "','exercise/exercise.php','quiz.gif','" . self::string2binary( |
|
480 | + VALUES ($course_id, 6, '".TOOL_QUIZ."','exercise/exercise.php','quiz.gif','".self::string2binary( |
|
481 | 481 | api_get_setting('course_create_active_tools', 'quiz') |
482 | - ) . "','0','squaregrey.gif',0,'_self','authoring','0')" |
|
482 | + )."','0','squaregrey.gif',0,'_self','authoring','0')" |
|
483 | 483 | ); |
484 | 484 | Database::query( |
485 | 485 | "INSERT INTO $tbl_course_homepage (c_id, id, name, link, image, visibility, admin, address, added_tool, target, category, session_id) |
486 | - VALUES ($course_id, 7, '" . TOOL_ANNOUNCEMENT . "','announcements/announcements.php','valves.gif','" . self::string2binary( |
|
486 | + VALUES ($course_id, 7, '".TOOL_ANNOUNCEMENT."','announcements/announcements.php','valves.gif','".self::string2binary( |
|
487 | 487 | api_get_setting('course_create_active_tools', 'announcements') |
488 | - ) . "','0','squaregrey.gif', 0,'_self','authoring','0')" |
|
488 | + )."','0','squaregrey.gif', 0,'_self','authoring','0')" |
|
489 | 489 | ); |
490 | 490 | Database::query( |
491 | 491 | "INSERT INTO $tbl_course_homepage (c_id, id, name, link, image, visibility, admin, address, added_tool, target, category, session_id) |
492 | - VALUES ($course_id, 8, '" . TOOL_FORUM . "','forum/index.php','forum.gif','" . self::string2binary( |
|
492 | + VALUES ($course_id, 8, '".TOOL_FORUM."','forum/index.php','forum.gif','".self::string2binary( |
|
493 | 493 | api_get_setting('course_create_active_tools', 'forums') |
494 | - ) . "','0','squaregrey.gif',0,'_self','interaction','0')" |
|
494 | + )."','0','squaregrey.gif',0,'_self','interaction','0')" |
|
495 | 495 | ); |
496 | 496 | Database::query( |
497 | 497 | "INSERT INTO $tbl_course_homepage (c_id, id, name, link, image, visibility, admin, address, added_tool, target, category, session_id) |
498 | - VALUES ($course_id, 9, '" . TOOL_DROPBOX . "','dropbox/index.php','dropbox.gif','" . self::string2binary( |
|
498 | + VALUES ($course_id, 9, '".TOOL_DROPBOX."','dropbox/index.php','dropbox.gif','".self::string2binary( |
|
499 | 499 | api_get_setting('course_create_active_tools', 'dropbox') |
500 | - ) . "','0','squaregrey.gif',0,'_self','interaction','0')" |
|
500 | + )."','0','squaregrey.gif',0,'_self','interaction','0')" |
|
501 | 501 | ); |
502 | 502 | Database::query( |
503 | 503 | "INSERT INTO $tbl_course_homepage (c_id, id, name, link, image, visibility, admin, address, added_tool, target, category, session_id) |
504 | - VALUES ($course_id, 10, '" . TOOL_USER . "','user/user.php','members.gif','" . self::string2binary( |
|
504 | + VALUES ($course_id, 10, '".TOOL_USER."','user/user.php','members.gif','".self::string2binary( |
|
505 | 505 | api_get_setting('course_create_active_tools', 'users') |
506 | - ) . "','0','squaregrey.gif',0,'_self','interaction','0')" |
|
506 | + )."','0','squaregrey.gif',0,'_self','interaction','0')" |
|
507 | 507 | ); |
508 | 508 | Database::query( |
509 | 509 | "INSERT INTO $tbl_course_homepage (c_id, id, name, link, image, visibility, admin, address, added_tool, target, category, session_id) |
510 | - VALUES ($course_id, 11, '" . TOOL_GROUP . "','group/group.php','group.gif','" . self::string2binary( |
|
510 | + VALUES ($course_id, 11, '".TOOL_GROUP."','group/group.php','group.gif','".self::string2binary( |
|
511 | 511 | api_get_setting('course_create_active_tools', 'groups') |
512 | - ) . "','0','squaregrey.gif',0,'_self','interaction','0')" |
|
512 | + )."','0','squaregrey.gif',0,'_self','interaction','0')" |
|
513 | 513 | ); |
514 | 514 | Database::query( |
515 | 515 | "INSERT INTO $tbl_course_homepage (c_id, id, name, link, image, visibility, admin, address, added_tool, target, category, session_id) |
516 | - VALUES ($course_id, 12, '" . TOOL_CHAT . "','chat/chat.php','chat.gif','" . self::string2binary( |
|
516 | + VALUES ($course_id, 12, '".TOOL_CHAT."','chat/chat.php','chat.gif','".self::string2binary( |
|
517 | 517 | api_get_setting('course_create_active_tools', 'chat') |
518 | - ) . "','0','squaregrey.gif',0,'_self','interaction','0')" |
|
518 | + )."','0','squaregrey.gif',0,'_self','interaction','0')" |
|
519 | 519 | ); |
520 | 520 | Database::query( |
521 | 521 | "INSERT INTO $tbl_course_homepage (c_id, id, name, link, image, visibility, admin, address, added_tool, target, category, session_id) |
522 | - VALUES ($course_id, 13, '" . TOOL_STUDENTPUBLICATION . "','work/work.php','works.gif','" . self::string2binary( |
|
522 | + VALUES ($course_id, 13, '".TOOL_STUDENTPUBLICATION."','work/work.php','works.gif','".self::string2binary( |
|
523 | 523 | api_get_setting( |
524 | 524 | 'course_create_active_tools', |
525 | 525 | 'student_publications' |
526 | 526 | ) |
527 | - ) . "','0','squaregrey.gif',0,'_self','interaction','0')" |
|
527 | + )."','0','squaregrey.gif',0,'_self','interaction','0')" |
|
528 | 528 | ); |
529 | 529 | Database::query( |
530 | 530 | "INSERT INTO $tbl_course_homepage (c_id, id, name, link, image, visibility, admin, address, added_tool, target, category, session_id) |
531 | - VALUES ($course_id, 14, '" . TOOL_SURVEY . "','survey/survey_list.php','survey.gif','" . self::string2binary( |
|
531 | + VALUES ($course_id, 14, '".TOOL_SURVEY."','survey/survey_list.php','survey.gif','".self::string2binary( |
|
532 | 532 | api_get_setting('course_create_active_tools', 'survey') |
533 | - ) . "','0','squaregrey.gif',0,'_self','interaction','0')" |
|
533 | + )."','0','squaregrey.gif',0,'_self','interaction','0')" |
|
534 | 534 | ); |
535 | 535 | Database::query( |
536 | 536 | "INSERT INTO $tbl_course_homepage (c_id, id, name, link, image, visibility, admin, address, added_tool, target, category, session_id) |
537 | - VALUES ($course_id, 15, '" . TOOL_WIKI . "','wiki/index.php','wiki.gif','" . self::string2binary( |
|
537 | + VALUES ($course_id, 15, '".TOOL_WIKI."','wiki/index.php','wiki.gif','".self::string2binary( |
|
538 | 538 | api_get_setting('course_create_active_tools', 'wiki') |
539 | - ) . "','0','squaregrey.gif',0,'_self','interaction','0')" |
|
539 | + )."','0','squaregrey.gif',0,'_self','interaction','0')" |
|
540 | 540 | ); |
541 | 541 | Database::query( |
542 | 542 | "INSERT INTO $tbl_course_homepage (c_id, id, name, link, image, visibility, admin, address, added_tool, target, category, session_id) |
543 | - VALUES ($course_id, 16, '" . TOOL_GRADEBOOK . "','gradebook/index.php','gradebook.gif','" . self::string2binary( |
|
543 | + VALUES ($course_id, 16, '".TOOL_GRADEBOOK."','gradebook/index.php','gradebook.gif','".self::string2binary( |
|
544 | 544 | api_get_setting('course_create_active_tools', 'gradebook') |
545 | - ) . "','0','squaregrey.gif',0,'_self','authoring','0')" |
|
545 | + )."','0','squaregrey.gif',0,'_self','authoring','0')" |
|
546 | 546 | ); |
547 | 547 | Database::query( |
548 | 548 | "INSERT INTO $tbl_course_homepage (c_id, id, name, link, image, visibility, admin, address, added_tool, target, category, session_id) |
549 | - VALUES ($course_id, 17, '" . TOOL_GLOSSARY . "','glossary/index.php','glossary.gif','" . self::string2binary( |
|
549 | + VALUES ($course_id, 17, '".TOOL_GLOSSARY."','glossary/index.php','glossary.gif','".self::string2binary( |
|
550 | 550 | api_get_setting('course_create_active_tools', 'glossary') |
551 | - ) . "','0','squaregrey.gif',0,'_self','authoring','0')" |
|
551 | + )."','0','squaregrey.gif',0,'_self','authoring','0')" |
|
552 | 552 | ); |
553 | 553 | Database::query( |
554 | 554 | "INSERT INTO $tbl_course_homepage (c_id, id, name, link, image, visibility, admin, address, added_tool, target, category, session_id) |
555 | - VALUES ($course_id, 18, '" . TOOL_NOTEBOOK . "','notebook/index.php','notebook.gif','" . self::string2binary( |
|
555 | + VALUES ($course_id, 18, '".TOOL_NOTEBOOK."','notebook/index.php','notebook.gif','".self::string2binary( |
|
556 | 556 | api_get_setting('course_create_active_tools', 'notebook') |
557 | - ) . "','0','squaregrey.gif',0,'_self','interaction','0')" |
|
557 | + )."','0','squaregrey.gif',0,'_self','interaction','0')" |
|
558 | 558 | ); |
559 | 559 | |
560 | 560 | $setting = intval(self::string2binary( |
@@ -563,45 +563,45 @@ discard block |
||
563 | 563 | |
564 | 564 | Database::query( |
565 | 565 | "INSERT INTO $tbl_course_homepage (c_id, id, name, link, image, visibility, admin, address, added_tool, target, category, session_id) |
566 | - VALUES ($course_id, 19, '" . TOOL_ATTENDANCE . "','attendance/index.php','attendance.gif','" . $setting. "','0','squaregrey.gif',0,'_self','authoring','0')" |
|
566 | + VALUES ($course_id, 19, '".TOOL_ATTENDANCE."','attendance/index.php','attendance.gif','".$setting."','0','squaregrey.gif',0,'_self','authoring','0')" |
|
567 | 567 | ); |
568 | 568 | Database::query( |
569 | 569 | "INSERT INTO $tbl_course_homepage (c_id, id, name, link, image, visibility, admin, address, added_tool, target, category, session_id) |
570 | - VALUES ($course_id, 20, '" . TOOL_COURSE_PROGRESS . "','course_progress/index.php','course_progress.gif','" . self::string2binary( |
|
570 | + VALUES ($course_id, 20, '".TOOL_COURSE_PROGRESS."','course_progress/index.php','course_progress.gif','".self::string2binary( |
|
571 | 571 | intval(api_get_setting('course_create_active_tools', 'course_progress')) |
572 | - ) . "','0','squaregrey.gif',0,'_self','authoring','0')" |
|
572 | + )."','0','squaregrey.gif',0,'_self','authoring','0')" |
|
573 | 573 | ); |
574 | 574 | |
575 | 575 | if (api_get_setting('search_enabled') === 'true') { |
576 | 576 | Database::query( |
577 | 577 | "INSERT INTO $tbl_course_homepage (c_id, id, name, link, image, visibility, admin, address, added_tool, target, category, session_id) |
578 | - VALUES ($course_id, 23, '" . TOOL_SEARCH . "','search/','info.gif','" . self::string2binary( |
|
578 | + VALUES ($course_id, 23, '".TOOL_SEARCH."','search/','info.gif','".self::string2binary( |
|
579 | 579 | api_get_setting( |
580 | 580 | 'course_create_active_tools', |
581 | 581 | 'enable_search' |
582 | 582 | ) |
583 | - ) . "','0','search.gif',0,'_self','authoring','0')" |
|
583 | + )."','0','search.gif',0,'_self','authoring','0')" |
|
584 | 584 | ); |
585 | 585 | } |
586 | 586 | |
587 | 587 | $sql = "INSERT INTO $tbl_course_homepage (c_id, id, name, link, image, visibility, admin, address, added_tool, target, category, session_id) |
588 | - VALUES ($course_id, 24,'" . TOOL_BLOGS . "','blog/blog_admin.php','blog_admin.gif','" . intval(self::string2binary( |
|
588 | + VALUES ($course_id, 24,'".TOOL_BLOGS."','blog/blog_admin.php','blog_admin.gif','".intval(self::string2binary( |
|
589 | 589 | api_get_setting('course_create_active_tools', 'blogs')) |
590 | - ) . "','1','squaregrey.gif',0,'_self','admin','0')"; |
|
590 | + )."','1','squaregrey.gif',0,'_self','admin','0')"; |
|
591 | 591 | Database::query($sql); |
592 | 592 | |
593 | 593 | /* Course homepage tools for course admin only */ |
594 | 594 | Database::query( |
595 | 595 | "INSERT INTO $tbl_course_homepage (c_id, id, name, link, image, visibility, admin, address, added_tool, target, category, session_id) |
596 | - VALUES ($course_id, 25, '" . TOOL_TRACKING . "','tracking/courseLog.php','statistics.gif','$visible_for_course_admin','1','', 0,'_self','admin','0')" |
|
596 | + VALUES ($course_id, 25, '".TOOL_TRACKING."','tracking/courseLog.php','statistics.gif','$visible_for_course_admin','1','', 0,'_self','admin','0')" |
|
597 | 597 | ); |
598 | 598 | Database::query( |
599 | 599 | "INSERT INTO $tbl_course_homepage (c_id, id, name, link, image, visibility, admin, address, added_tool, target, category, session_id) |
600 | - VALUES ($course_id, 26, '" . TOOL_COURSE_SETTING . "','course_info/infocours.php','reference.gif','$visible_for_course_admin','1','', 0,'_self','admin','0')" |
|
600 | + VALUES ($course_id, 26, '".TOOL_COURSE_SETTING."','course_info/infocours.php','reference.gif','$visible_for_course_admin','1','', 0,'_self','admin','0')" |
|
601 | 601 | ); |
602 | 602 | Database::query( |
603 | 603 | "INSERT INTO $tbl_course_homepage (c_id, id, name, link, image, visibility, admin, address, added_tool, target, category, session_id) |
604 | - VALUES ($course_id, 27, '" . TOOL_COURSE_MAINTENANCE . "','course_info/maintenance.php','backup.gif','$visible_for_course_admin','1','',0,'_self', 'admin','0')" |
|
604 | + VALUES ($course_id, 27, '".TOOL_COURSE_MAINTENANCE."','course_info/maintenance.php','backup.gif','$visible_for_course_admin','1','',0,'_self', 'admin','0')" |
|
605 | 605 | ); |
606 | 606 | |
607 | 607 | $alert = api_get_setting('email_alert_manager_on_new_quiz'); |
@@ -688,7 +688,7 @@ discard block |
||
688 | 688 | $perm = api_get_permissions_for_new_directories(); |
689 | 689 | $perm_file = api_get_permissions_for_new_files(); |
690 | 690 | |
691 | - $chat_path = $sys_course_path . $course_repository . '/document/chat_files'; |
|
691 | + $chat_path = $sys_course_path.$course_repository.'/document/chat_files'; |
|
692 | 692 | |
693 | 693 | if (!is_dir($chat_path)) { |
694 | 694 | @mkdir($chat_path, api_get_permissions_for_new_directories()); |
@@ -720,11 +720,11 @@ discard block |
||
720 | 720 | 'certificates', |
721 | 721 | ); |
722 | 722 | |
723 | - $default_course_path = api_get_path(SYS_CODE_PATH) . 'default_course_document/'; |
|
723 | + $default_course_path = api_get_path(SYS_CODE_PATH).'default_course_document/'; |
|
724 | 724 | |
725 | 725 | $default_document_array = array(); |
726 | 726 | foreach ($folders_to_copy_from_default_course as $folder) { |
727 | - $default_course_folder_path = $default_course_path . $folder . '/'; |
|
727 | + $default_course_folder_path = $default_course_path.$folder.'/'; |
|
728 | 728 | $files = self::browse_folders( |
729 | 729 | $default_course_folder_path, |
730 | 730 | array(), |
@@ -753,30 +753,30 @@ discard block |
||
753 | 753 | //hack until feature #5242 is implemented |
754 | 754 | if ($media_type == 'images') { |
755 | 755 | $media_type = 'images/gallery'; |
756 | - $images_folder = $sys_course_path . $course_repository . "/document/images/"; |
|
756 | + $images_folder = $sys_course_path.$course_repository."/document/images/"; |
|
757 | 757 | |
758 | 758 | if (!is_dir($images_folder)) { |
759 | 759 | //Creating index.html |
760 | 760 | mkdir($images_folder, $perm); |
761 | - $fd = fopen($images_folder . 'index.html', 'w'); |
|
761 | + $fd = fopen($images_folder.'index.html', 'w'); |
|
762 | 762 | fwrite($fd, $htmlpage); |
763 | - @chmod($images_folder . 'index.html', $perm_file); |
|
763 | + @chmod($images_folder.'index.html', $perm_file); |
|
764 | 764 | } |
765 | 765 | } |
766 | 766 | |
767 | - $course_documents_folder = $sys_course_path . $course_repository . "/document/$media_type/"; |
|
768 | - $default_course_path = api_get_path(SYS_CODE_PATH) . 'default_course_document' . $path_documents; |
|
767 | + $course_documents_folder = $sys_course_path.$course_repository."/document/$media_type/"; |
|
768 | + $default_course_path = api_get_path(SYS_CODE_PATH).'default_course_document'.$path_documents; |
|
769 | 769 | |
770 | 770 | if (!is_dir($course_documents_folder)) { |
771 | 771 | // Creating index.html |
772 | 772 | mkdir($course_documents_folder, $perm); |
773 | 773 | $fd = fopen( |
774 | - $course_documents_folder . 'index.html', |
|
774 | + $course_documents_folder.'index.html', |
|
775 | 775 | 'w' |
776 | 776 | ); |
777 | 777 | fwrite($fd, $htmlpage); |
778 | 778 | @chmod( |
779 | - $course_documents_folder . 'index.html', |
|
779 | + $course_documents_folder.'index.html', |
|
780 | 780 | $perm_file |
781 | 781 | ); |
782 | 782 | } |
@@ -784,15 +784,15 @@ discard block |
||
784 | 784 | if (is_array($array_media) && count($array_media) > 0) { |
785 | 785 | foreach ($array_media as $key => $value) { |
786 | 786 | if (isset($value['dir']) && !empty($value['dir'])) { |
787 | - if (!is_dir($course_documents_folder . $value['dir'])) { |
|
787 | + if (!is_dir($course_documents_folder.$value['dir'])) { |
|
788 | 788 | //Creating folder |
789 | 789 | mkdir( |
790 | - $course_documents_folder . $value['dir'], |
|
790 | + $course_documents_folder.$value['dir'], |
|
791 | 791 | $perm |
792 | 792 | ); |
793 | 793 | |
794 | 794 | //Creating index.html (for light protection) |
795 | - $index_html = $course_documents_folder . $value['dir'] . '/index.html'; |
|
795 | + $index_html = $course_documents_folder.$value['dir'].'/index.html'; |
|
796 | 796 | $fd = fopen($index_html, 'w'); |
797 | 797 | fwrite($fd, $htmlpage); |
798 | 798 | @chmod($index_html, $perm_file); |
@@ -814,12 +814,12 @@ discard block |
||
814 | 814 | } |
815 | 815 | |
816 | 816 | if ($media_type == 'images/gallery') { |
817 | - $folder_path = 'gallery/' . $folder_path; |
|
817 | + $folder_path = 'gallery/'.$folder_path; |
|
818 | 818 | } |
819 | 819 | |
820 | 820 | Database::query( |
821 | 821 | "INSERT INTO $TABLETOOLDOCUMENT (c_id, path,title,filetype,size) |
822 | - VALUES ($course_id,'$path_documents" . $folder_path . "','" . $title . "','folder','0')" |
|
822 | + VALUES ($course_id,'$path_documents".$folder_path."','".$title."','folder','0')" |
|
823 | 823 | ); |
824 | 824 | $image_id = Database:: insert_id(); |
825 | 825 | |
@@ -844,33 +844,33 @@ discard block |
||
844 | 844 | |
845 | 845 | if (isset($value['file']) && !empty($value['file'])) { |
846 | 846 | if (!file_exists( |
847 | - $course_documents_folder . $value['file'] |
|
847 | + $course_documents_folder.$value['file'] |
|
848 | 848 | ) |
849 | 849 | ) { |
850 | 850 | //Copying file |
851 | 851 | copy( |
852 | - $default_course_path . $value['file'], |
|
853 | - $course_documents_folder . $value['file'] |
|
852 | + $default_course_path.$value['file'], |
|
853 | + $course_documents_folder.$value['file'] |
|
854 | 854 | ); |
855 | 855 | chmod( |
856 | - $course_documents_folder . $value['file'], |
|
856 | + $course_documents_folder.$value['file'], |
|
857 | 857 | $perm_file |
858 | 858 | ); |
859 | 859 | //echo $default_course_path.$value['file']; echo ' - '; echo $course_documents_folder.$value['file']; echo '<br />'; |
860 | 860 | $temp = explode('/', $value['file']); |
861 | 861 | $file_size = filesize( |
862 | - $course_documents_folder . $value['file'] |
|
862 | + $course_documents_folder.$value['file'] |
|
863 | 863 | ); |
864 | 864 | |
865 | 865 | //hack until feature #5242 is implemented |
866 | 866 | if ($media_type == 'images/gallery') { |
867 | - $value["file"] = 'gallery/' . $value["file"]; |
|
867 | + $value["file"] = 'gallery/'.$value["file"]; |
|
868 | 868 | } |
869 | 869 | |
870 | 870 | //Inserting file in the DB |
871 | 871 | Database::query( |
872 | 872 | "INSERT INTO $TABLETOOLDOCUMENT (c_id, path,title,filetype,size) |
873 | - VALUES ($course_id,'$path_documents" . $value["file"] . "','" . $temp[count($temp) - 1] . "','file','$file_size')" |
|
873 | + VALUES ($course_id,'$path_documents".$value["file"]."','".$temp[count($temp) - 1]."','file','$file_size')" |
|
874 | 874 | ); |
875 | 875 | $image_id = Database:: insert_id(); |
876 | 876 | if ($image_id) { |
@@ -878,7 +878,7 @@ discard block |
||
878 | 878 | $sql = "UPDATE $TABLETOOLDOCUMENT SET id = iid WHERE iid = $image_id"; |
879 | 879 | Database::query($sql); |
880 | 880 | |
881 | - if ($path_documents . $value['file'] == '/certificates/default.html') { |
|
881 | + if ($path_documents.$value['file'] == '/certificates/default.html') { |
|
882 | 882 | $example_cert_id = $image_id; |
883 | 883 | } |
884 | 884 | $docId = Database::insert( |
@@ -929,7 +929,7 @@ discard block |
||
929 | 929 | 'c_id' => $course_id, |
930 | 930 | 'url' => 'http://www.google.com', |
931 | 931 | 'title' => 'Google', |
932 | - 'description' => get_lang('Google') , |
|
932 | + 'description' => get_lang('Google'), |
|
933 | 933 | 'category_id' => 0, |
934 | 934 | 'on_homepage' => 0, |
935 | 935 | 'target' => '_self', |
@@ -939,7 +939,7 @@ discard block |
||
939 | 939 | 'c_id' => $course_id, |
940 | 940 | 'url' => 'http://www.wikipedia.org', |
941 | 941 | 'title' => 'Wikipedia', |
942 | - 'description' => get_lang('Wikipedia') , |
|
942 | + 'description' => get_lang('Wikipedia'), |
|
943 | 943 | 'category_id' => 0, |
944 | 944 | 'on_homepage' => 0, |
945 | 945 | 'target' => '_self', |
@@ -947,7 +947,7 @@ discard block |
||
947 | 947 | ] |
948 | 948 | ]; |
949 | 949 | |
950 | - foreach($links as $params) { |
|
950 | + foreach ($links as $params) { |
|
951 | 951 | $link->save($params); |
952 | 952 | } |
953 | 953 | |
@@ -965,8 +965,8 @@ discard block |
||
965 | 965 | |
966 | 966 | /* Introduction text */ |
967 | 967 | $intro_text = '<p style="text-align: center;"> |
968 | - <img src="' . api_get_path(REL_CODE_PATH) . 'img/mascot.png" alt="Mr. Chamilo" title="Mr. Chamilo" /> |
|
969 | - <h2>' . get_lang('IntroductionText') . '</h2> |
|
968 | + <img src="' . api_get_path(REL_CODE_PATH).'img/mascot.png" alt="Mr. Chamilo" title="Mr. Chamilo" /> |
|
969 | + <h2>' . get_lang('IntroductionText').'</h2> |
|
970 | 970 | </p>'; |
971 | 971 | |
972 | 972 | $toolIntro = new Chamilo\CourseBundle\Entity\CToolIntro(); |
@@ -1002,9 +1002,9 @@ discard block |
||
1002 | 1002 | $html = '<table width="100%" border="0" cellpadding="0" cellspacing="0"> |
1003 | 1003 | <tr> |
1004 | 1004 | <td width="220" valign="top" align="left"> |
1005 | - <img src="' . api_get_path(WEB_CODE_PATH) . 'default_course_document/images/mr_chamilo/doubts.png"> |
|
1005 | + <img src="' . api_get_path(WEB_CODE_PATH).'default_course_document/images/mr_chamilo/doubts.png"> |
|
1006 | 1006 | </td> |
1007 | - <td valign="top" align="left">' . get_lang('Antique') . '</td></tr> |
|
1007 | + <td valign="top" align="left">' . get_lang('Antique').'</td></tr> |
|
1008 | 1008 | </table>'; |
1009 | 1009 | $exercise->type = 1; |
1010 | 1010 | $exercise->setRandom(0); |
@@ -1257,7 +1257,7 @@ discard block |
||
1257 | 1257 | 'https://' |
1258 | 1258 | ) === false |
1259 | 1259 | ) { |
1260 | - $department_url = 'http://' . $department_url; |
|
1260 | + $department_url = 'http://'.$department_url; |
|
1261 | 1261 | } |
1262 | 1262 | //just in case |
1263 | 1263 | if ($department_url == 'http://') { |
@@ -1303,12 +1303,12 @@ discard block |
||
1303 | 1303 | $code |
1304 | 1304 | ); |
1305 | 1305 | if (!empty($user_id)) { |
1306 | - $sql = "INSERT INTO " . $TABLECOURSUSER . " SET |
|
1307 | - c_id = '" . $course_id . "', |
|
1308 | - user_id = '" . intval($user_id) . "', |
|
1306 | + $sql = "INSERT INTO ".$TABLECOURSUSER." SET |
|
1307 | + c_id = '" . $course_id."', |
|
1308 | + user_id = '" . intval($user_id)."', |
|
1309 | 1309 | status = '1', |
1310 | 1310 | is_tutor = '0', |
1311 | - sort = '" . ($i_course_sort) . "', |
|
1311 | + sort = '" . ($i_course_sort)."', |
|
1312 | 1312 | relation_type = 0, |
1313 | 1313 | user_course_cat = '0'"; |
1314 | 1314 | Database::query($sql); |
@@ -1327,12 +1327,12 @@ discard block |
||
1327 | 1327 | if (empty($key)) { |
1328 | 1328 | continue; |
1329 | 1329 | } |
1330 | - $sql = "INSERT INTO " . $TABLECOURSUSER . " SET |
|
1331 | - c_id = '" . Database::escape_string($course_id) . "', |
|
1332 | - user_id = '" . Database::escape_string($key) . "', |
|
1330 | + $sql = "INSERT INTO ".$TABLECOURSUSER." SET |
|
1331 | + c_id = '" . Database::escape_string($course_id)."', |
|
1332 | + user_id = '" . Database::escape_string($key)."', |
|
1333 | 1333 | status = '1', |
1334 | 1334 | is_tutor = '0', |
1335 | - sort = '" . ($sort + 1) . "', |
|
1335 | + sort = '" . ($sort + 1)."', |
|
1336 | 1336 | relation_type = 0, |
1337 | 1337 | user_course_cat = '0'"; |
1338 | 1338 | Database::query($sql); |
@@ -1376,18 +1376,18 @@ discard block |
||
1376 | 1376 | $iname = api_get_setting('Institution'); |
1377 | 1377 | $subject = get_lang( |
1378 | 1378 | 'NewCourseCreatedIn' |
1379 | - ) . ' ' . $siteName . ' - ' . $iname; |
|
1379 | + ).' '.$siteName.' - '.$iname; |
|
1380 | 1380 | $message = get_lang( |
1381 | 1381 | 'Dear' |
1382 | - ) . ' ' . $recipient_name . ",\n\n" . get_lang( |
|
1382 | + ).' '.$recipient_name.",\n\n".get_lang( |
|
1383 | 1383 | 'MessageOfNewCourseToAdmin' |
1384 | - ) . ' ' . $siteName . ' - ' . $iname . "\n"; |
|
1385 | - $message .= get_lang('CourseName') . ' ' . $title . "\n"; |
|
1384 | + ).' '.$siteName.' - '.$iname."\n"; |
|
1385 | + $message .= get_lang('CourseName').' '.$title."\n"; |
|
1386 | 1386 | $message .= get_lang( |
1387 | 1387 | 'Category' |
1388 | - ) . ' ' . $category_code . "\n"; |
|
1389 | - $message .= get_lang('Tutor') . ' ' . $tutor_name . "\n"; |
|
1390 | - $message .= get_lang('Language') . ' ' . $course_language; |
|
1388 | + ).' '.$category_code."\n"; |
|
1389 | + $message .= get_lang('Tutor').' '.$tutor_name."\n"; |
|
1390 | + $message .= get_lang('Language').' '.$course_language; |
|
1391 | 1391 | |
1392 | 1392 | $userInfo = api_get_user_info($user_id); |
1393 | 1393 |