@@ -29,12 +29,12 @@ discard block |
||
29 | 29 | |
30 | 30 | $isStudentView = (int) $_REQUEST['isStudentView']; |
31 | 31 | $learnpath_id = (int) $_REQUEST['lp_id']; |
32 | -$submit = $_POST['submit_button']; |
|
32 | +$submit = $_POST['submit_button']; |
|
33 | 33 | |
34 | 34 | /* MAIN CODE */ |
35 | 35 | |
36 | 36 | // Using the resource linker as a tool for adding resources to the learning path. |
37 | -if ($action=="add" and $type=="learnpathitem") { |
|
37 | +if ($action == "add" and $type == "learnpathitem") { |
|
38 | 38 | $htmlHeadXtra[] = "<script language='JavaScript' type='text/javascript'> window.location=\"../resourcelinker/resourcelinker.php?source_id=5&action=$action&learnpath_id=$learnpath_id&chapter_id=$chapter_id&originalresource=no\"; </script>"; |
39 | 39 | } |
40 | 40 | if ((!$is_allowed_to_edit) || ($isStudentView)) { |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | if ($learnpath_id == 0) { |
52 | 52 | $is_new = true; |
53 | 53 | |
54 | - $sql = "SELECT id FROM " . $tbl_lp . " WHERE c_id = $course_id ORDER BY id DESC LIMIT 0, 1"; |
|
54 | + $sql = "SELECT id FROM ".$tbl_lp." WHERE c_id = $course_id ORDER BY id DESC LIMIT 0, 1"; |
|
55 | 55 | $result = Database::query($sql); |
56 | 56 | $row = Database::fetch_array($result); |
57 | 57 | $learnpath_id = $row['id']; |
@@ -73,8 +73,8 @@ discard block |
||
73 | 73 | } |
74 | 74 | |
75 | 75 | if (!empty($gradebook) && $gradebook == 'view') { |
76 | - $interbreadcrumb[] = array ( |
|
77 | - 'url' => '../gradebook/' . $_SESSION['gradebook_dest'], |
|
76 | + $interbreadcrumb[] = array( |
|
77 | + 'url' => '../gradebook/'.$_SESSION['gradebook_dest'], |
|
78 | 78 | 'name' => get_lang('ToolGradebook') |
79 | 79 | ); |
80 | 80 | } |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | $interbreadcrumb[] = array('url' => '#', "name" => $therow['name']); |
83 | 83 | |
84 | 84 | // Theme calls. |
85 | -$lp_theme_css=$_SESSION['oLP']->get_theme(); |
|
85 | +$lp_theme_css = $_SESSION['oLP']->get_theme(); |
|
86 | 86 | $show_learn_path = true; |
87 | 87 | Display::display_header('', 'Path'); |
88 | 88 | $suredel = trim(get_lang('AreYouSureToDeleteJS')); |
@@ -132,11 +132,11 @@ discard block |
||
132 | 132 | |
133 | 133 | echo '<ul id="lp_overview" class="thumbnails">'; |
134 | 134 | |
135 | - echo show_block('lp_controller.php?'.api_get_cidreq().'&gradebook='.$gradebook.'&action=add_item&type=step&lp_id=' . $_SESSION['oLP']->lp_id, get_lang("NewStep"), get_lang('NewStepComment'), 'tools.png'); |
|
135 | + echo show_block('lp_controller.php?'.api_get_cidreq().'&gradebook='.$gradebook.'&action=add_item&type=step&lp_id='.$_SESSION['oLP']->lp_id, get_lang("NewStep"), get_lang('NewStepComment'), 'tools.png'); |
|
136 | 136 | |
137 | 137 | // echo show_block('lp_controller.php?'.api_get_cidreq().'&gradebook='.$gradebook.'&action=admin_view&updateaudio=true&lp_id=' . $_SESSION['oLP']->lp_id, get_lang("BasicOverview"), get_lang('BasicOverviewComment'), 'audio.png'); |
138 | 138 | |
139 | - echo show_block('lp_controller.php?'.api_get_cidreq().'&gradebook='.$gradebook.'&action=view&lp_id=' . $_SESSION['oLP']->lp_id, get_lang("Display"), get_lang('DisplayComment'), 'view.png'); |
|
139 | + echo show_block('lp_controller.php?'.api_get_cidreq().'&gradebook='.$gradebook.'&action=view&lp_id='.$_SESSION['oLP']->lp_id, get_lang("Display"), get_lang('DisplayComment'), 'view.png'); |
|
140 | 140 | |
141 | 141 | //echo show_block('lp_controller.php?'.api_get_cidreq().'&gradebook='.$gradebook.'&action=edit&lp_id=' . $_SESSION['oLP']->lp_id, get_lang("Settings"), null, 'reference.png'); |
142 | 142 | |
@@ -148,15 +148,15 @@ discard block |
||
148 | 148 | |
149 | 149 | function show_block($link, $title, $subtitle, $icon) { |
150 | 150 | $html = '<li class="col-md-4">'; |
151 | - $html .= '<div class="thumbnail">'; |
|
152 | - $html .= '<a href="'.$link.'" title="'.$title.'">'; |
|
153 | - $html .= Display::return_icon($icon, $title, array(), ICON_SIZE_BIG); |
|
154 | - $html .= '</a>'; |
|
155 | - $html .= '<div class="caption">'; |
|
156 | - $html .= '<strong>'.$title.'</strong></a> '.$subtitle; |
|
157 | - $html .= '</div>'; |
|
158 | - $html .= '</div>'; |
|
159 | - $html .= '</li>'; |
|
151 | + $html .= '<div class="thumbnail">'; |
|
152 | + $html .= '<a href="'.$link.'" title="'.$title.'">'; |
|
153 | + $html .= Display::return_icon($icon, $title, array(), ICON_SIZE_BIG); |
|
154 | + $html .= '</a>'; |
|
155 | + $html .= '<div class="caption">'; |
|
156 | + $html .= '<strong>'.$title.'</strong></a> '.$subtitle; |
|
157 | + $html .= '</div>'; |
|
158 | + $html .= '</div>'; |
|
159 | + $html .= '</li>'; |
|
160 | 160 | return $html; |
161 | 161 | } |
162 | 162 |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | //$_user = $_SESSION['_user']; |
56 | 56 | $file = $_SESSION['file']; |
57 | 57 | $oLP = unserialize($_SESSION['lpobject']); |
58 | -$oItem =& $oLP->items[$oLP->current]; |
|
58 | +$oItem = & $oLP->items[$oLP->current]; |
|
59 | 59 | if (!is_object($oItem)) { |
60 | 60 | error_log('New LP - aicc_hacp - Could not load oItem item', 0); |
61 | 61 | exit; |
@@ -69,8 +69,8 @@ discard block |
||
69 | 69 | 'evaluation' => array(), |
70 | 70 | 'student_data' => array(), |
71 | 71 | ); |
72 | -$convert_enc = array('%25','%0D','%0A','%09','%20','%2D','%2F','%3B','%3F','%7B','%7D','%7C','%5C','%5E','%7E','%5B','%5D','%60','%23','%3E','%3C','%22'); |
|
73 | -$convert_dec = array('%',"\r","\n","\t",' ','-','/',';','?','{','}','|','\\','^','~','[',']','`','#','>','<','"'); |
|
72 | +$convert_enc = array('%25', '%0D', '%0A', '%09', '%20', '%2D', '%2F', '%3B', '%3F', '%7B', '%7D', '%7C', '%5C', '%5E', '%7E', '%5B', '%5D', '%60', '%23', '%3E', '%3C', '%22'); |
|
73 | +$convert_dec = array('%', "\r", "\n", "\t", ' ', '-', '/', ';', '?', '{', '}', '|', '\\', '^', '~', '[', ']', '`', '#', '>', '<', '"'); |
|
74 | 74 | $crlf = "\r\n"; |
75 | 75 | //$tab = "\t"; |
76 | 76 | $tab = ""; |
@@ -117,7 +117,7 @@ |
||
117 | 117 | $abs_order++; |
118 | 118 | $i = 1; |
119 | 119 | foreach ($this->sub_items as $id => $dummy) { |
120 | - $oSubitem =& $this->sub_items[$id]; |
|
120 | + $oSubitem = & $this->sub_items[$id]; |
|
121 | 121 | $oSubitem->get_flat_list($list, $abs_order, $i, $level + 1); |
122 | 122 | $i++; |
123 | 123 | } |
@@ -163,7 +163,7 @@ |
||
163 | 163 | exit; |
164 | 164 | } else { |
165 | 165 | $headers = [get_lang('SubscribeUsersToLp'), get_lang('SubscribeGroupsToLp')]; |
166 | - $tabs = Display::tabs($headers, [$formUsers->toHtml(),$form->toHtml()]); |
|
166 | + $tabs = Display::tabs($headers, [$formUsers->toHtml(), $form->toHtml()]); |
|
167 | 167 | $tpl->assign('tabs', $tabs); |
168 | 168 | } |
169 | 169 |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | "; |
106 | 106 | $res = Database::query($sql); |
107 | 107 | $names = array(); |
108 | - while ($row = Database::fetch_array($res,'ASSOC')) { |
|
108 | + while ($row = Database::fetch_array($res, 'ASSOC')) { |
|
109 | 109 | // Use domesticate here instead of Database::escape_string because |
110 | 110 | // it prevents ' to be slashed and the input (done by learnpath.class.php::toggle_visibility()) |
111 | 111 | // is done using domesticate() |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | |
236 | 236 | $lessons = array(); |
237 | 237 | while ($row = Database::fetch_array($result)) { |
238 | - if (api_get_item_visibility($course, 'learnpath', $row['id'], $session_id)) { |
|
238 | + if (api_get_item_visibility($course, 'learnpath', $row['id'], $session_id)) { |
|
239 | 239 | $lessons[$row['id']] = $row; |
240 | 240 | } |
241 | 241 | } |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | $intro_content = api_substr($content, 0, api_strpos($content, $matches[0][0])); |
118 | 118 | $items_to_create[get_lang('Introduction')] = $intro_content; |
119 | 119 | |
120 | - for ($i = 0; $i<count($matches[0]); $i++) { |
|
120 | + for ($i = 0; $i < count($matches[0]); $i++) { |
|
121 | 121 | |
122 | 122 | if (empty($matches[1][$i])) |
123 | 123 | continue; |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | |
175 | 175 | $first_item = 0; |
176 | 176 | |
177 | - foreach($pages as $key => $page_content) { |
|
177 | + foreach ($pages as $key => $page_content) { |
|
178 | 178 | // For every pages, we create a new file. |
179 | 179 | |
180 | 180 | $key += 1; |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | foreach ($specific_fields as $specific_field) { |
214 | 214 | if (isset($_REQUEST[$specific_field['code']])) { |
215 | 215 | $sterms = trim($_REQUEST[$specific_field['code']]); |
216 | - $all_specific_terms .= ' '. $sterms; |
|
216 | + $all_specific_terms .= ' '.$sterms; |
|
217 | 217 | if (!empty($sterms)) { |
218 | 218 | $sterms = explode(',', $sterms); |
219 | 219 | foreach ($sterms as $sterm) { |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | } |
223 | 223 | } |
224 | 224 | } |
225 | - $page_content = $all_specific_terms .' '. $page_content; |
|
225 | + $page_content = $all_specific_terms.' '.$page_content; |
|
226 | 226 | $ic_slide->addValue('content', $page_content); |
227 | 227 | // Add a comment to say terms separated by commas. |
228 | 228 | $courseid = api_get_course_id(); |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | SE_COURSE_ID => $courseid, |
234 | 234 | SE_TOOL_ID => TOOL_LEARNPATH, |
235 | 235 | SE_DATA => array('lp_id' => $lp_id, 'lp_item' => $previous, 'document_id' => $document_id), |
236 | - SE_USER => (int)api_get_user_id(), |
|
236 | + SE_USER => (int) api_get_user_id(), |
|
237 | 237 | ); |
238 | 238 | $ic_slide->xapian_data = serialize($xapian_data); |
239 | 239 | $di->addChunk($ic_slide); |
@@ -276,7 +276,7 @@ discard block |
||
276 | 276 | $content = '<body><div style="width:'.$max_width.'">'.$content; |
277 | 277 | } |
278 | 278 | |
279 | - $content = preg_replace('|</body>|i','</div>\\0', $content, -1, $count); |
|
279 | + $content = preg_replace('|</body>|i', '</div>\\0', $content, -1, $count); |
|
280 | 280 | if ($count < 1) { |
281 | 281 | $content = $content.'</div></body>'; |
282 | 282 | } |
@@ -304,7 +304,7 @@ discard block |
||
304 | 304 | } |
305 | 305 | |
306 | 306 | } elseif ($img_width > $max_width - 10) { |
307 | - $picture_resized = str_ireplace('width='.$img_width, 'width="'.($max_width-10).'"', $images[0][$key]); |
|
307 | + $picture_resized = str_ireplace('width='.$img_width, 'width="'.($max_width - 10).'"', $images[0][$key]); |
|
308 | 308 | $content = str_replace($images[0][$key], $picture_resized, $content); |
309 | 309 | } |
310 | 310 | } |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | $this_section = SECTION_COURSES; |
21 | 21 | |
22 | 22 | if ($lp_controller_touched != 1) { |
23 | - header('location: lp_controller.php?action=view&item_id=' . intval($_REQUEST['item_id'])); |
|
23 | + header('location: lp_controller.php?action=view&item_id='.intval($_REQUEST['item_id'])); |
|
24 | 24 | exit; |
25 | 25 | } |
26 | 26 | |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | //Impress js |
101 | 101 | if ($_SESSION['oLP']->mode == 'impress') { |
102 | 102 | $lp_id = $_SESSION['oLP']->get_id(); |
103 | - $url = api_get_path(WEB_CODE_PATH) . "newscorm/lp_impress.php?lp_id=$lp_id&" . api_get_cidreq(); |
|
103 | + $url = api_get_path(WEB_CODE_PATH)."newscorm/lp_impress.php?lp_id=$lp_id&".api_get_cidreq(); |
|
104 | 104 | header("Location: $url"); |
105 | 105 | exit; |
106 | 106 | } |
@@ -118,15 +118,15 @@ discard block |
||
118 | 118 | |
119 | 119 | // additional APIs |
120 | 120 | $htmlHeadXtra[] = '<script> |
121 | -chamilo_courseCode = "' . $course_code . '"; |
|
121 | +chamilo_courseCode = "' . $course_code.'"; |
|
122 | 122 | </script>'; |
123 | 123 | // Document API |
124 | 124 | $htmlHeadXtra[] = '<script src="js/documentapi.js" type="text/javascript" language="javascript"></script>'; |
125 | 125 | // Storage API |
126 | 126 | $htmlHeadXtra[] = '<script> |
127 | -var sv_user = \'' . api_get_user_id() . '\'; |
|
127 | +var sv_user = \'' . api_get_user_id().'\'; |
|
128 | 128 | var sv_course = chamilo_courseCode; |
129 | -var sv_sco = \'' . $lp_id . '\'; |
|
129 | +var sv_sco = \'' . $lp_id.'\'; |
|
130 | 130 | </script>'; // FIXME fetch sco and userid from a more reliable source directly in sotrageapi.js |
131 | 131 | $htmlHeadXtra[] = '<script type="text/javascript" src="js/storageapi.js"></script>'; |
132 | 132 | |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | case 3: |
198 | 198 | // aicc |
199 | 199 | $_SESSION['oLP']->stop_previous_item(); // save status manually if asset |
200 | - $htmlHeadXtra[] = '<script src="' . $_SESSION['oLP']->get_js_lib().'" type="text/javascript" language="javascript"></script>'; |
|
200 | + $htmlHeadXtra[] = '<script src="'.$_SESSION['oLP']->get_js_lib().'" type="text/javascript" language="javascript"></script>'; |
|
201 | 201 | $preReqCheck = $_SESSION['oLP']->prerequisites_match($lp_item_id); |
202 | 202 | if ($preReqCheck === true) { |
203 | 203 | $src = $_SESSION['oLP']->get_link( |
@@ -219,10 +219,10 @@ discard block |
||
219 | 219 | // Update status, total_time from lp_item_view table when you finish the exercises in learning path. |
220 | 220 | |
221 | 221 | if ($debug) { |
222 | - error_log('$type_quiz: ' . $type_quiz); |
|
223 | - error_log('$_REQUEST[exeId]: ' . intval($_REQUEST['exeId'])); |
|
224 | - error_log('$lp_id: ' . $lp_id); |
|
225 | - error_log('$_GET[lp_item_id]: ' . intval($_GET['lp_item_id'])); |
|
222 | + error_log('$type_quiz: '.$type_quiz); |
|
223 | + error_log('$_REQUEST[exeId]: '.intval($_REQUEST['exeId'])); |
|
224 | + error_log('$lp_id: '.$lp_id); |
|
225 | + error_log('$_GET[lp_item_id]: '.intval($_GET['lp_item_id'])); |
|
226 | 226 | } |
227 | 227 | |
228 | 228 | if ( |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | $safe_item_id == strval(intval($safe_item_id)) |
246 | 246 | ) { |
247 | 247 | $sql = 'SELECT start_date, exe_date, exe_result, exe_weighting, exe_exo_id |
248 | - FROM ' . $TBL_TRACK_EXERCICES . ' |
|
248 | + FROM ' . $TBL_TRACK_EXERCICES.' |
|
249 | 249 | WHERE exe_id = ' . $safe_exe_id; |
250 | 250 | $res = Database::query($sql); |
251 | 251 | $row_dates = Database::fetch_array($res); |
@@ -259,14 +259,14 @@ discard block |
||
259 | 259 | |
260 | 260 | $sql = "UPDATE $TBL_LP_ITEM SET |
261 | 261 | max_score = '$max_score' |
262 | - WHERE c_id = $course_id AND id = '" . $safe_item_id . "'"; |
|
262 | + WHERE c_id = $course_id AND id = '".$safe_item_id."'"; |
|
263 | 263 | Database::query($sql); |
264 | 264 | |
265 | 265 | $sql = "SELECT id FROM $TBL_LP_ITEM_VIEW |
266 | 266 | WHERE |
267 | 267 | c_id = $course_id AND |
268 | 268 | lp_item_id = '$safe_item_id' AND |
269 | - lp_view_id = '" . $_SESSION['oLP']->lp_view_id . "' |
|
269 | + lp_view_id = '".$_SESSION['oLP']->lp_view_id."' |
|
270 | 270 | ORDER BY id DESC |
271 | 271 | LIMIT 1"; |
272 | 272 | $res_last_attempt = Database::query($sql); |
@@ -295,7 +295,7 @@ discard block |
||
295 | 295 | status = '$status', |
296 | 296 | score = $score, |
297 | 297 | total_time = $mytime |
298 | - WHERE id='" . $lp_item_view_id . "' AND c_id = $course_id "; |
|
298 | + WHERE id='".$lp_item_view_id."' AND c_id = $course_id "; |
|
299 | 299 | |
300 | 300 | if ($debug) { |
301 | 301 | error_log($sql); |
@@ -305,17 +305,17 @@ discard block |
||
305 | 305 | |
306 | 306 | $sql = "UPDATE $TBL_TRACK_EXERCICES SET |
307 | 307 | orig_lp_item_view_id = $lp_item_view_id |
308 | - WHERE exe_id = " . $safe_exe_id; |
|
308 | + WHERE exe_id = ".$safe_exe_id; |
|
309 | 309 | Database::query($sql); |
310 | 310 | } |
311 | 311 | } |
312 | 312 | if (intval($_GET['fb_type']) > 0) { |
313 | 313 | $src = 'blank.php?msg=exerciseFinished'; |
314 | 314 | } else { |
315 | - $src = api_get_path(WEB_CODE_PATH) . 'exercice/result.php?origin=learnpath&id=' . $safe_exe_id.'&'.api_get_cidreq(); |
|
315 | + $src = api_get_path(WEB_CODE_PATH).'exercice/result.php?origin=learnpath&id='.$safe_exe_id.'&'.api_get_cidreq(); |
|
316 | 316 | |
317 | 317 | if ($debug) { |
318 | - error_log('Calling URL: ' . $src); |
|
318 | + error_log('Calling URL: '.$src); |
|
319 | 319 | } |
320 | 320 | } |
321 | 321 | $autostart = 'false'; |
@@ -373,8 +373,8 @@ discard block |
||
373 | 373 | $tbl_lp_item = Database::get_course_table(TABLE_LP_ITEM); |
374 | 374 | $show_audioplayer = false; |
375 | 375 | // Getting all the information about the item. |
376 | -$sql = "SELECT audio FROM " . $tbl_lp_item . " |
|
377 | - WHERE c_id = $course_id AND lp_id = '" . $_SESSION['oLP']->lp_id . "'"; |
|
376 | +$sql = "SELECT audio FROM ".$tbl_lp_item." |
|
377 | + WHERE c_id = $course_id AND lp_id = '".$_SESSION['oLP']->lp_id."'"; |
|
378 | 378 | $res_media = Database::query($sql); |
379 | 379 | |
380 | 380 | if (Database::num_rows($res_media) > 0) { |
@@ -397,7 +397,7 @@ discard block |
||
397 | 397 | 'name' => get_lang('LearningPaths') |
398 | 398 | ); |
399 | 399 | $interbreadcrumb[] = array( |
400 | - 'url' => api_get_self() . "?action=add_item&type=step&lp_id={$_SESSION['oLP']->lp_id}&isStudentView=false", |
|
400 | + 'url' => api_get_self()."?action=add_item&type=step&lp_id={$_SESSION['oLP']->lp_id}&isStudentView=false", |
|
401 | 401 | 'name' => $_SESSION['oLP']->get_name() |
402 | 402 | ); |
403 | 403 | $interbreadcrumb[] = array( |
@@ -409,12 +409,12 @@ discard block |
||
409 | 409 | |
410 | 410 | // Return to course home. |
411 | 411 | if ($is_allowed_to_edit) { |
412 | - $buttonHomeUrl = 'lp_controller.php?' . api_get_cidreq() . '&' . http_build_query([ |
|
412 | + $buttonHomeUrl = 'lp_controller.php?'.api_get_cidreq().'&'.http_build_query([ |
|
413 | 413 | 'isStudentView' => 'false', |
414 | 414 | 'action' => 'return_to_course_homepage' |
415 | 415 | ]); |
416 | 416 | } else { |
417 | - $buttonHomeUrl = 'lp_controller.php?' . api_get_cidreq() . '&' . http_build_query([ |
|
417 | + $buttonHomeUrl = 'lp_controller.php?'.api_get_cidreq().'&'.http_build_query([ |
|
418 | 418 | 'action' => 'return_to_course_homepage' |
419 | 419 | ]); |
420 | 420 | } |
@@ -519,7 +519,7 @@ discard block |
||
519 | 519 | |
520 | 520 | $template->assign('lp_author', $_SESSION['oLP']->get_author()); |
521 | 521 | $template->assign('lp_mode', $_SESSION['oLP']->mode); |
522 | -$template->assign('lp_title_scorm',$_SESSION['oLP']->name); |
|
522 | +$template->assign('lp_title_scorm', $_SESSION['oLP']->name); |
|
523 | 523 | $template->assign( |
524 | 524 | 'lp_html_toc', |
525 | 525 | $_SESSION['oLP']->get_html_toc($get_toc_list) |
@@ -198,7 +198,7 @@ |
||
198 | 198 | //"lms_progress_bar_mode='".$myprogress_mode."';" . |
199 | 199 | "olms.lms_view_id=".$view_id.";". |
200 | 200 | "olms.lms_user_id=".$user_id.";". |
201 | - "olms.next_item=".$new_item_id.";". // This one is very important to replace possible literal strings. |
|
201 | + "olms.next_item=".$new_item_id.";".// This one is very important to replace possible literal strings. |
|
202 | 202 | "olms.lms_next_item=".$mynext.";". |
203 | 203 | "olms.lms_previous_item=".$myprevious.";". |
204 | 204 | "olms.lms_item_type = '".$myitemtype."';". |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | }*/ |
87 | 87 | |
88 | 88 | // Get max display_order so far in this parent chapter. |
89 | - $sql = "SELECT MAX(display_order) as maxi FROM $tbl_lp_item " . |
|
89 | + $sql = "SELECT MAX(display_order) as maxi FROM $tbl_lp_item ". |
|
90 | 90 | "WHERE c_id = $course_id AND lp_id = $learnpath_id ". |
91 | 91 | " AND parent_item_id = $chapter_id"; |
92 | 92 | $res = Database::query($sql); |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | $lastorder_item = 0; |
97 | 97 | $previous = 0; |
98 | 98 | } else { |
99 | - $sql = "SELECT id FROM $tbl_lp_item " . |
|
99 | + $sql = "SELECT id FROM $tbl_lp_item ". |
|
100 | 100 | "WHERE lp_id = $learnpath_id AND parent_item_id=$chapter_id AND display_order = $lastorder_item"; |
101 | 101 | $result = Database::query($sql); |
102 | 102 | $row = Database::fetch_array($result); |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | } |
105 | 105 | $order = $lastorder_item + 1; |
106 | 106 | |
107 | - $sql = "INSERT INTO $tbl_lp_item "."(c_id, lp_id,item_type,title,parent_item_id,previous_item_id, next_item_id, display_order) " . |
|
107 | + $sql = "INSERT INTO $tbl_lp_item "."(c_id, lp_id,item_type,title,parent_item_id,previous_item_id, next_item_id, display_order) ". |
|
108 | 108 | "VALUES "."($course_id, $learnpath_id,'dokeos_chapter','$title', $chapter_id, $previous, 0, $order )"; |
109 | 109 | //error_log('New LP - Inserting new resource: '.$sql, 0); |
110 | 110 | $res = Database::query($sql); |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | if ($from_learnpath == 'yes') { |
174 | 174 | $i = 0; |
175 | 175 | // Calculating the last order of the items of this chapter. |
176 | - $sql = "SELECT MAX(display_order) as maxi FROM $tbl_lp_item " . |
|
176 | + $sql = "SELECT MAX(display_order) as maxi FROM $tbl_lp_item ". |
|
177 | 177 | "WHERE c_id = $course_id AND lp_id = $learnpath_id AND parent_item_id=$chapter_id"; |
178 | 178 | $result = Database::query($sql); |
179 | 179 | $row = Database::fetch_array($result); |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | $lastorder_item = 0; |
183 | 183 | $previous = 0; |
184 | 184 | } else { |
185 | - $sql = "SELECT id FROM $tbl_lp_item " . |
|
185 | + $sql = "SELECT id FROM $tbl_lp_item ". |
|
186 | 186 | "WHERE lp_id = $learnpath_id AND parent_item_id=$chapter_id AND display_order = $lastorder_item"; |
187 | 187 | //error_log('New LP - resourcelinker.php - '.$sql, 0); |
188 | 188 | $result = Database::query($sql); |
@@ -193,8 +193,8 @@ discard block |
||
193 | 193 | foreach ($addedresource as $addedresource_item) { |
194 | 194 | // In the case we added a chapter, add this into the chapters list with the correct parent_id. |
195 | 195 | if ($addedresource_item == 'Chap') { |
196 | - $sql = "INSERT INTO $tbl_lp_item " . |
|
197 | - "(c_id, lp_id,item_type,title,parent_item_id,previous_item_id,next_item_id,display_order) " . |
|
196 | + $sql = "INSERT INTO $tbl_lp_item ". |
|
197 | + "(c_id, lp_id,item_type,title,parent_item_id,previous_item_id,next_item_id,display_order) ". |
|
198 | 198 | "VALUES ($course_id, ".$learnpath_id.",'dokeos_chapter','".$learnpath_chapter_name."',".$chapter_id.",$previous,0,".$lastorder.")"; |
199 | 199 | //error_log('New LP - Inserting new resource: '.$sql, 0); |
200 | 200 | $res = Database::query($sql); |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | //get title from tool-type table |
256 | 256 | $tooltable = Database::get_course_table(TABLE_DOCUMENT); |
257 | 257 | $result = Database::query("SELECT * FROM $tooltable WHERE id=".$addedresourceid[$i]); |
258 | - $myrow=Database::fetch_array($result); |
|
258 | + $myrow = Database::fetch_array($result); |
|
259 | 259 | $title = $myrow['title']; |
260 | 260 | break; |
261 | 261 | case 'Exercise': |
@@ -263,7 +263,7 @@ discard block |
||
263 | 263 | //get title from tool-type table |
264 | 264 | $tooltable = Database::get_course_table(TABLE_QUIZ_TEST); |
265 | 265 | $result = Database::query("SELECT * FROM $tooltable WHERE id=".$addedresourceid[$i]); |
266 | - $myrow=Database::fetch_array($result); |
|
266 | + $myrow = Database::fetch_array($result); |
|
267 | 267 | $title = $myrow['title']; |
268 | 268 | break; |
269 | 269 | case 'Forum': |
@@ -275,7 +275,7 @@ discard block |
||
275 | 275 | //get title from tool-type table |
276 | 276 | $tooltable = Database::get_course_table(TABLE_AGENDA); |
277 | 277 | $result = Database::query("SELECT * FROM $tooltable WHERE id=".$addedresourceid[$i]); |
278 | - $myrow=Database::fetch_array($result); |
|
278 | + $myrow = Database::fetch_array($result); |
|
279 | 279 | $title = $myrow['title']; |
280 | 280 | break; |
281 | 281 | case 'Ad_Valvas': |
@@ -283,12 +283,12 @@ discard block |
||
283 | 283 | //get title from tool-type table |
284 | 284 | $tooltable = Database::get_course_table(TABLE_ANNOUNCEMENT); |
285 | 285 | $result = Database::query("SELECT * FROM $tooltable WHERE id=".$addedresourceid[$i]); |
286 | - $myrow=Database::fetch_array($result); |
|
286 | + $myrow = Database::fetch_array($result); |
|
287 | 287 | $title = $myrow['title']; |
288 | 288 | break; |
289 | 289 | |
290 | 290 | } |
291 | - $sql = "INSERT INTO $tbl_lp_item (c_id, lp_id, title, parent_item_id, item_type, ref, previous_item_id, next_item_id, display_order) " . |
|
291 | + $sql = "INSERT INTO $tbl_lp_item (c_id, lp_id, title, parent_item_id, item_type, ref, previous_item_id, next_item_id, display_order) ". |
|
292 | 292 | "VALUES ($course_id, $learnpath_id, '$title','$chapter_id', '$addedresource_item','$addedresourceid[$i]',$previous,0,'".$lastorder."')"; |
293 | 293 | //error_log('New LP - Inserting new resource: '.$sql, 0); |
294 | 294 | $result = Database::query($sql); |
@@ -301,8 +301,8 @@ discard block |
||
301 | 301 | $addedresourceassigned[$i] = 1; |
302 | 302 | $resource_added = true; |
303 | 303 | } |
304 | - $i ++; |
|
305 | - $lastorder ++; |
|
304 | + $i++; |
|
305 | + $lastorder++; |
|
306 | 306 | } |
307 | 307 | //$_SESSION['addedresource']=null; |
308 | 308 | //$_SESSION['addedresourceid']=null; |
@@ -330,7 +330,7 @@ discard block |
||
330 | 330 | } |
331 | 331 | |
332 | 332 | if (!empty($gradebook) && $gradebook == 'view') { |
333 | - $interbreadcrumb[] = array ( |
|
333 | + $interbreadcrumb[] = array( |
|
334 | 334 | 'url' => '../gradebook/'.$_SESSION['gradebook_dest'], |
335 | 335 | 'name' => get_lang('ToolGradebook') |
336 | 336 | ); |
@@ -348,34 +348,34 @@ discard block |
||
348 | 348 | $url = "../calendar/agenda.php?action=add"; |
349 | 349 | } |
350 | 350 | $originaltoolname = get_lang('Agenda'); |
351 | - $breadcrumbelement = array ('url' => $url, 'name' => $originaltoolname); |
|
351 | + $breadcrumbelement = array('url' => $url, 'name' => $originaltoolname); |
|
352 | 352 | session_unregister('from_learnpath'); |
353 | 353 | unset ($from_learnpath); |
354 | 354 | break; |
355 | 355 | case '2': // coming from forum: new topic |
356 | 356 | $url = "../phpbb/newtopic.php?forum=$source_forum&md5=$md5"; |
357 | 357 | $originaltoolname = get_lang('ForumAddNewTopic'); |
358 | - $breadcrumbelement = array ('url' => $url, 'name' => $originaltoolname); |
|
358 | + $breadcrumbelement = array('url' => $url, 'name' => $originaltoolname); |
|
359 | 359 | session_unregister('from_learnpath'); |
360 | 360 | unset ($from_learnpath); |
361 | 361 | break; |
362 | 362 | case '3': // coming from forum: edit topic |
363 | 363 | $url = "../phpbb/editpost.php?post_id=$post_id&topic=$topic&forum=$forum&md5=$md5&originalresource=no"; |
364 | 364 | $originaltoolname = get_lang('ForumEditTopic'); |
365 | - $breadcrumbelement = array ('url' => $url, 'name' => $originaltoolname); |
|
365 | + $breadcrumbelement = array('url' => $url, 'name' => $originaltoolname); |
|
366 | 366 | session_unregister('from_learnpath'); |
367 | 367 | unset ($from_learnpath); |
368 | 368 | break; |
369 | 369 | case '4': // coming from exercises: edit topic |
370 | 370 | $url = "../exercice/admin.php?modifyAnswers=$modifyAnswers"; |
371 | 371 | $originaltoolname = get_lang('ExerciseAnswers'); |
372 | - $breadcrumbelement = array ('url' => $url, 'name' => $originaltoolname); |
|
372 | + $breadcrumbelement = array('url' => $url, 'name' => $originaltoolname); |
|
373 | 373 | session_unregister('from_learnpath'); |
374 | 374 | unset ($from_learnpath); |
375 | 375 | break; |
376 | 376 | case '5': // coming from learning path |
377 | 377 | $from_learnpath = 'yes'; |
378 | - Session::write('from_learnpath',$from_learnpath); |
|
378 | + Session::write('from_learnpath', $from_learnpath); |
|
379 | 379 | break; |
380 | 380 | |
381 | 381 | /* end add [email protected] */ |
@@ -396,7 +396,7 @@ discard block |
||
396 | 396 | // the information from the session. Else we use the information of the learningpath itself. |
397 | 397 | if ($from_learnpath != 'yes') { |
398 | 398 | $nameTools = get_lang('Attachment'); |
399 | - $interbreadcrumb[] = array ('url' => $_SESSION['origintoolurl'], 'name' => $_SESSION['origintoolname']); |
|
399 | + $interbreadcrumb[] = array('url' => $_SESSION['origintoolurl'], 'name' => $_SESSION['origintoolname']); |
|
400 | 400 | } else { |
401 | 401 | $learnpath_select_query = " SELECT * FROM $tbl_lp |
402 | 402 | WHERE id=$learnpath_id"; |
@@ -410,9 +410,9 @@ discard block |
||
410 | 410 | |
411 | 411 | $from_learnpath = 'yes'; |
412 | 412 | session_register('from_learnpath'); |
413 | - $interbreadcrumb[] = array ('url' => "../newscorm/lp_controller.php?action=list", 'name' => get_lang('LearningPath')); |
|
414 | - $interbreadcrumb[] = array ('url' => "../newscorm/lp_controller.php?action=admin_view&lp_id=$learnpath_id", 'name' => stripslashes("{$therow['name']}")); |
|
415 | - $interbreadcrumb[] = array ('url' => api_get_self()."?action=$action&lp_id=$learnpath_id&parent_item_id=$chapter_id&originalresource=no", 'name' => "{$therow2['title']}"); |
|
413 | + $interbreadcrumb[] = array('url' => "../newscorm/lp_controller.php?action=list", 'name' => get_lang('LearningPath')); |
|
414 | + $interbreadcrumb[] = array('url' => "../newscorm/lp_controller.php?action=admin_view&lp_id=$learnpath_id", 'name' => stripslashes("{$therow['name']}")); |
|
415 | + $interbreadcrumb[] = array('url' => api_get_self()."?action=$action&lp_id=$learnpath_id&parent_item_id=$chapter_id&originalresource=no", 'name' => "{$therow2['title']}"); |
|
416 | 416 | } |
417 | 417 | |
418 | 418 | $htmlHeadXtra[] = '<script type="text/javascript"> |
@@ -439,7 +439,7 @@ discard block |
||
439 | 439 | $tool_table = Database::get_course_table(TABLE_TOOL_LIST); |
440 | 440 | $sql_select_active = "SELECT * FROM $tool_table WHERE visibility='1'"; |
441 | 441 | $result_select_active = Database::query($sql_select_active); |
442 | -while ($row=Database::fetch_array($result_select_active)) { |
|
442 | +while ($row = Database::fetch_array($result_select_active)) { |
|
443 | 443 | $active_modules[] = $row['name']; |
444 | 444 | } |
445 | 445 | ?> |
@@ -500,7 +500,7 @@ discard block |
||
500 | 500 | <!--tr> |
501 | 501 | <td width="26%"><b><?php echo get_lang('ExportableCourseResources'); ?></b></td> |
502 | 502 | </tr--> |
503 | -<?php if ($multi_level_learnpath === true ) { ?> |
|
503 | +<?php if ($multi_level_learnpath === true) { ?> |
|
504 | 504 | <tr> |
505 | 505 | <td><?php echo "<a href=\"".api_get_self()."?content=chapter&action=$action&id=$id&lp_id=$learnpath_id&parent_item_id=$chapter_id&source_forum=$source_forum&originalresource=no\">".get_lang('Chapter')."</a>"; ?></td> |
506 | 506 | </tr> |
@@ -857,9 +857,9 @@ discard block |
||
857 | 857 | ?> |
858 | 858 | </tr> |
859 | 859 | <tr> |
860 | - <td><?php if ($is_allowedToEdit) {echo get_lang('AddToLinks');} ?></td> |
|
860 | + <td><?php if ($is_allowedToEdit) {echo get_lang('AddToLinks'); } ?></td> |
|
861 | 861 | <td> |
862 | - <?php if ($is_allowedToEdit){?> |
|
862 | + <?php if ($is_allowedToEdit) {?> |
|
863 | 863 | <select name="add_2_links" id="add_2_links"> |
864 | 864 | <option value="niet toevoegen" selected="selected">-<?php echo get_lang('DontAdd'); ?>-</option> |
865 | 865 | <option value="0"><?php echo get_lang('MainCategory'); ?></option> |