@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | |
18 | 18 | $isStudentView = isset($_REQUEST['isStudentView']) ? (int) $_REQUEST['isStudentView'] : null; |
19 | 19 | $learnpath_id = (int) $_REQUEST['lp_id']; |
20 | -$submit = isset($_POST['submit_button']) ? $_POST['submit_button'] : null; |
|
20 | +$submit = isset($_POST['submit_button']) ? $_POST['submit_button'] : null; |
|
21 | 21 | |
22 | 22 | $type = isset($_GET['type']) ? $_GET['type'] : null; |
23 | 23 | $action = isset($_GET['action']) ? $_GET['action'] : null; |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | } |
41 | 41 | |
42 | 42 | if (!empty($gradebook) && $gradebook == 'view') { |
43 | - $interbreadcrumb[] = array ( |
|
43 | + $interbreadcrumb[] = array( |
|
44 | 44 | 'url' => '../gradebook/'.$_SESSION['gradebook_dest'], |
45 | 45 | 'name' => get_lang('ToolGradebook') |
46 | 46 | ); |
@@ -51,19 +51,19 @@ discard block |
||
51 | 51 | |
52 | 52 | switch ($type) { |
53 | 53 | case 'chapter': |
54 | - $interbreadcrumb[]= array('url' => 'lp_controller.php?action=add_item&type=step&lp_id='.$_SESSION['oLP']->get_id(), 'name' => get_lang('NewStep')); |
|
55 | - $interbreadcrumb[]= array('url' => '#', 'name' => get_lang('NewChapter')); |
|
54 | + $interbreadcrumb[] = array('url' => 'lp_controller.php?action=add_item&type=step&lp_id='.$_SESSION['oLP']->get_id(), 'name' => get_lang('NewStep')); |
|
55 | + $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('NewChapter')); |
|
56 | 56 | break; |
57 | 57 | case 'document': |
58 | - $interbreadcrumb[]= array('url' => 'lp_controller.php?action=add_item&type=step&lp_id='.$_SESSION['oLP']->get_id(), 'name' => get_lang('NewStep')); |
|
58 | + $interbreadcrumb[] = array('url' => 'lp_controller.php?action=add_item&type=step&lp_id='.$_SESSION['oLP']->get_id(), 'name' => get_lang('NewStep')); |
|
59 | 59 | break; |
60 | 60 | default: |
61 | - $interbreadcrumb[]= array('url' => '#', 'name' => get_lang('NewStep')); |
|
61 | + $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('NewStep')); |
|
62 | 62 | break; |
63 | 63 | } |
64 | 64 | |
65 | 65 | if ($action == 'add_item' && $type == 'document') { |
66 | - $interbreadcrumb[]= array ('url' => '#', 'name' => get_lang('NewDocumentCreated')); |
|
66 | + $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('NewDocumentCreated')); |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | // Theme calls. |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | $form = new FormValidator( |
80 | 80 | 'add_audio', |
81 | 81 | 'post', |
82 | - api_get_self() . '?action=add_audio&id=' . $lp_item_id . '&' . api_get_cidreq().'&lp_id='.$learnpath_id, |
|
82 | + api_get_self().'?action=add_audio&id='.$lp_item_id.'&'.api_get_cidreq().'&lp_id='.$learnpath_id, |
|
83 | 83 | null, |
84 | 84 | array('enctype' => 'multipart/form-data') |
85 | 85 | ); |
@@ -24,7 +24,7 @@ |
||
24 | 24 | |
25 | 25 | // Using the resource linker as a tool for adding resources to the learning path. |
26 | 26 | if ($action == 'add' && $type == 'learnpathitem') { |
27 | - $htmlHeadXtra[] = "<script> |
|
27 | + $htmlHeadXtra[] = "<script> |
|
28 | 28 | window.location=\"../resourcelinker/resourcelinker.php?source_id=5&action=$action&learnpath_id=$learnpath_id&chapter_id=$chapter_id&originalresource=no\"; |
29 | 29 | </script>"; |
30 | 30 | } |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | ); |
86 | 86 | |
87 | 87 | // Generating the thumbnail. |
88 | - $image = $this->base_work_dir.$this->created_dir .'/'. $file_name; |
|
88 | + $image = $this->base_work_dir.$this->created_dir.'/'.$file_name; |
|
89 | 89 | |
90 | 90 | $pattern = '/(\w+)\.png$/'; |
91 | 91 | $replacement = '${1}_thumb.png'; |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | |
102 | 102 | $my_new_image = new Image($image); |
103 | 103 | $my_new_image->resize($thumb_width, $thumb_height); |
104 | - $my_new_image->send_image($this->base_work_dir.$this->created_dir .'/'. $thumb_name, -1, 'png'); |
|
104 | + $my_new_image->send_image($this->base_work_dir.$this->created_dir.'/'.$thumb_name, -1, 'png'); |
|
105 | 105 | |
106 | 106 | // Adding the thumbnail to documents. |
107 | 107 | $document_id_thumb = add_document( |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | <body> |
128 | 128 | <img src="'.$slide_src.'" /> |
129 | 129 | </body> |
130 | -</html>'); // This indentation is to make the generated html files to look well. |
|
130 | +</html>'); // This indentation is to make the generated html files to look well. |
|
131 | 131 | |
132 | 132 | fclose($fp); |
133 | 133 | $document_id = add_document( |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | foreach ($specific_fields as $specific_field) { |
163 | 163 | if (isset($_REQUEST[$specific_field['code']])) { |
164 | 164 | $sterms = trim($_REQUEST[$specific_field['code']]); |
165 | - $all_specific_terms .= ' '. $sterms; |
|
165 | + $all_specific_terms .= ' '.$sterms; |
|
166 | 166 | if (!empty($sterms)) { |
167 | 167 | $sterms = explode(',', $sterms); |
168 | 168 | foreach ($sterms as $sterm) { |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | } |
172 | 172 | } |
173 | 173 | } |
174 | - $slide_body = $all_specific_terms .' '. $slide_body; |
|
174 | + $slide_body = $all_specific_terms.' '.$slide_body; |
|
175 | 175 | $ic_slide->addValue('content', $slide_body); |
176 | 176 | /* FIXME: cidReq:lp_id:doc_id al indexar */ |
177 | 177 | // Add a comment to say terms separated by commas. |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | SE_COURSE_ID => $courseid, |
184 | 184 | SE_TOOL_ID => TOOL_LEARNPATH, |
185 | 185 | SE_DATA => array('lp_id' => $lp_id, 'lp_item' => $previous, 'document_id' => $document_id), |
186 | - SE_USER => (int)api_get_user_id(), |
|
186 | + SE_USER => (int) api_get_user_id(), |
|
187 | 187 | ); |
188 | 188 | $ic_slide->xapian_data = serialize($xapian_data); |
189 | 189 | $di->addChunk($ic_slide); |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | $_course = api_get_course_info(); |
222 | 222 | foreach ($files as $file) { |
223 | 223 | // '||' is used as separator between slide name (with accents) and file name (without accents). |
224 | - list($slide_name,$file_name) = explode('||',$file); |
|
224 | + list($slide_name, $file_name) = explode('||', $file); |
|
225 | 225 | $slide_name = api_htmlentities($slide_name, ENT_COMPAT, $this->original_charset); |
226 | 226 | $slide_name = str_replace('’', '\'', $slide_name); |
227 | 227 | $slide_name = api_convert_encoding($slide_name, api_get_system_encoding(), $this->original_charset); |
@@ -16,7 +16,7 @@ |
||
16 | 16 | Display::display_reduced_header(); |
17 | 17 | |
18 | 18 | if (isset($_GET['error'])) { |
19 | - switch ($_GET['error']){ |
|
19 | + switch ($_GET['error']) { |
|
20 | 20 | case 'document_deleted': |
21 | 21 | echo '<br /><br />'; |
22 | 22 | Display::display_error_message(get_lang('DocumentHasBeenDeleted')); |
@@ -36,7 +36,7 @@ |
||
36 | 36 | api_get_group_id() |
37 | 37 | ); |
38 | 38 | if (!api_is_allowed_to_edit(null, true) && intval($visibility) == 0 ) { |
39 | - api_not_allowed(); |
|
39 | + api_not_allowed(); |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | if (empty($_SESSION['oLP'])) { |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | null, |
36 | 36 | api_get_group_id() |
37 | 37 | ); |
38 | -if (!api_is_allowed_to_edit(null, true) && intval($visibility) == 0 ) { |
|
38 | +if (!api_is_allowed_to_edit(null, true) && intval($visibility) == 0) { |
|
39 | 39 | api_not_allowed(); |
40 | 40 | } |
41 | 41 | |
@@ -73,22 +73,22 @@ discard block |
||
73 | 73 | $html = ''; |
74 | 74 | $step = 1; |
75 | 75 | foreach ($list as $toc) { |
76 | - $x = 1000*$step; |
|
76 | + $x = 1000 * $step; |
|
77 | 77 | $html .= '<div id="step-'.$step.'" class="step slide" data-x="'.$x.'" data-y="-1500" >'; |
78 | 78 | $html .= '<div class="impress-content">'; |
79 | 79 | $src = $_SESSION['oLP']->get_link('http', $toc['id']); |
80 | 80 | if ($toc['type'] !== 'dokeos_chapter') { |
81 | 81 | //just showing the src in a iframe ... |
82 | 82 | $html .= '<h2>'.$toc['title'].'</h2>'; |
83 | - $html .= '<iframe border="0" frameborder="0" style="width:100%;height:600px" src="' . $src . '"></iframe>'; |
|
84 | - }else{ |
|
83 | + $html .= '<iframe border="0" frameborder="0" style="width:100%;height:600px" src="'.$src.'"></iframe>'; |
|
84 | + } else { |
|
85 | 85 | $html .= "<div class='impress-title'>"; |
86 | 86 | $html .= '<h1>'.$toc['title'].'</h1>'; |
87 | 87 | $html .= "</div>"; |
88 | 88 | } |
89 | 89 | $html .= "</div>"; |
90 | 90 | $html .= "</div>"; |
91 | - $step ++; |
|
91 | + $step++; |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | //Setting the template |
@@ -81,7 +81,7 @@ |
||
81 | 81 | //just showing the src in a iframe ... |
82 | 82 | $html .= '<h2>'.$toc['title'].'</h2>'; |
83 | 83 | $html .= '<iframe border="0" frameborder="0" style="width:100%;height:600px" src="' . $src . '"></iframe>'; |
84 | - }else{ |
|
84 | + } else{ |
|
85 | 85 | $html .= "<div class='impress-title'>"; |
86 | 86 | $html .= '<h1>'.$toc['title'].'</h1>'; |
87 | 87 | $html .= "</div>"; |
@@ -38,14 +38,14 @@ discard block |
||
38 | 38 | //if ($first_item->type == XML_ELEMENT_NODE) this is already check prior to the call to this function. |
39 | 39 | $children = $element->childNodes; |
40 | 40 | foreach ($children as $child) { |
41 | - switch ($child->nodeType) { |
|
41 | + switch ($child->nodeType) { |
|
42 | 42 | case XML_ELEMENT_NODE: |
43 | 43 | switch ($child->tagName) { |
44 | 44 | case 'item': |
45 | 45 | $oItem = new scormItem('manifest', $child); |
46 | - if ($oItem->identifier != '') { |
|
46 | + if ($oItem->identifier != '') { |
|
47 | 47 | $this->items[$oItem->identifier] = $oItem; |
48 | - } |
|
48 | + } |
|
49 | 49 | break; |
50 | 50 | case 'metadata': |
51 | 51 | $this->metadata = new scormMetadata('manifest', $child); |
@@ -58,24 +58,24 @@ discard block |
||
58 | 58 | break; |
59 | 59 | } |
60 | 60 | break; |
61 | - case XML_TEXT_NODE: |
|
61 | + case XML_TEXT_NODE: |
|
62 | 62 | break; |
63 | - } |
|
63 | + } |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | if ($element->hasAttributes()) { |
67 | - $attributes = $element->attributes; |
|
68 | - //$keep_href = ''; |
|
69 | - foreach ($attributes as $attrib) { |
|
70 | - switch ($attrib->name) { |
|
71 | - case 'identifier': |
|
67 | + $attributes = $element->attributes; |
|
68 | + //$keep_href = ''; |
|
69 | + foreach ($attributes as $attrib) { |
|
70 | + switch ($attrib->name) { |
|
71 | + case 'identifier': |
|
72 | 72 | $this->identifier = $attrib->value; |
73 | - break; |
|
74 | - case 'structure': |
|
73 | + break; |
|
74 | + case 'structure': |
|
75 | 75 | $this->structure = $attrib->value; |
76 | - break; |
|
77 | - } |
|
78 | - } |
|
76 | + break; |
|
77 | + } |
|
78 | + } |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | return true; |
@@ -98,7 +98,7 @@ |
||
98 | 98 | foreach ($this->items as $id => $dummy) { |
99 | 99 | $abs_order = 0; |
100 | 100 | // Passes the array as a pointer so it is modified in $list directly. |
101 | - $this->items[$id]->get_flat_list($list,$abs_order, $i, 0); |
|
101 | + $this->items[$id]->get_flat_list($list, $abs_order, $i, 0); |
|
102 | 102 | $i++; |
103 | 103 | } |
104 | 104 |
@@ -15,52 +15,52 @@ |
||
15 | 15 | } |
16 | 16 | |
17 | 17 | switch ($_REQUEST['action']) { |
18 | - case "get": |
|
19 | - print storage_get($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey']); |
|
20 | - break; |
|
21 | - case "set": |
|
22 | - if (storage_can_set($_REQUEST['svuser'])) { |
|
23 | - print storage_set($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey'], $_REQUEST['svvalue']); |
|
24 | - } |
|
25 | - break; |
|
26 | - case "getall": |
|
27 | - print storage_getall($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco']); |
|
28 | - break; |
|
29 | - case "stackpush": |
|
30 | - if (storage_can_set($_REQUEST['svuser'])) { |
|
31 | - print storage_stack_push($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey'], $_REQUEST['svvalue']); |
|
32 | - } |
|
33 | - break; |
|
34 | - case "stackpop": |
|
35 | - if (storage_can_set($_REQUEST['svuser'])) { |
|
36 | - print storage_stack_pop($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey']); |
|
37 | - } |
|
38 | - break; |
|
39 | - case "stacklength": |
|
40 | - print storage_stack_length($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey']); |
|
41 | - break; |
|
42 | - case "stackclear": |
|
43 | - if (storage_can_set($_REQUEST['svuser'])) { |
|
44 | - print storage_stack_clear($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey']); |
|
45 | - } |
|
46 | - break; |
|
47 | - case "stackgetall": |
|
48 | - if (storage_can_set($_REQUEST['svuser'])) |
|
49 | - print storage_stack_getall($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey']); |
|
50 | - break; |
|
51 | - case "getposition": |
|
52 | - print storage_get_position($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey'], $_REQUEST['svasc']); |
|
53 | - break; |
|
54 | - case "getleaders": |
|
55 | - print storage_get_leaders($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey'], $_REQUEST['svasc'], $_REQUEST['svlength']); |
|
56 | - break; |
|
57 | - case "usersgetall": |
|
58 | -// security issue |
|
59 | - print "NOT allowed, security issue, see sources"; |
|
60 | -// print storage_get_all_users(); |
|
61 | - break; |
|
62 | - default: |
|
63 | - // Do nothing |
|
18 | + case "get": |
|
19 | + print storage_get($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey']); |
|
20 | + break; |
|
21 | + case "set": |
|
22 | + if (storage_can_set($_REQUEST['svuser'])) { |
|
23 | + print storage_set($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey'], $_REQUEST['svvalue']); |
|
24 | + } |
|
25 | + break; |
|
26 | + case "getall": |
|
27 | + print storage_getall($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco']); |
|
28 | + break; |
|
29 | + case "stackpush": |
|
30 | + if (storage_can_set($_REQUEST['svuser'])) { |
|
31 | + print storage_stack_push($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey'], $_REQUEST['svvalue']); |
|
32 | + } |
|
33 | + break; |
|
34 | + case "stackpop": |
|
35 | + if (storage_can_set($_REQUEST['svuser'])) { |
|
36 | + print storage_stack_pop($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey']); |
|
37 | + } |
|
38 | + break; |
|
39 | + case "stacklength": |
|
40 | + print storage_stack_length($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey']); |
|
41 | + break; |
|
42 | + case "stackclear": |
|
43 | + if (storage_can_set($_REQUEST['svuser'])) { |
|
44 | + print storage_stack_clear($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey']); |
|
45 | + } |
|
46 | + break; |
|
47 | + case "stackgetall": |
|
48 | + if (storage_can_set($_REQUEST['svuser'])) |
|
49 | + print storage_stack_getall($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey']); |
|
50 | + break; |
|
51 | + case "getposition": |
|
52 | + print storage_get_position($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey'], $_REQUEST['svasc']); |
|
53 | + break; |
|
54 | + case "getleaders": |
|
55 | + print storage_get_leaders($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey'], $_REQUEST['svasc'], $_REQUEST['svlength']); |
|
56 | + break; |
|
57 | + case "usersgetall": |
|
58 | + // security issue |
|
59 | + print "NOT allowed, security issue, see sources"; |
|
60 | + // print storage_get_all_users(); |
|
61 | + break; |
|
62 | + default: |
|
63 | + // Do nothing |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | function storage_can_set($sv_user) { |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | and sco_id = '$sv_sco' |
104 | 104 | and course_id = '$sv_course' |
105 | 105 | and sv_key = '$sv_key' |
106 | - order by sv_value ".($sv_asc ? "ASC": "DESC")." limit $sv_length"; |
|
106 | + order by sv_value ".($sv_asc ? "ASC" : "DESC")." limit $sv_length"; |
|
107 | 107 | // $sql_data = "select sv.user_id as user_id, sv_key as variable, sv_value as value |
108 | 108 | // from ".Database::get_main_table(TABLE_TRACK_STORED_VALUES)." sv |
109 | 109 | // where sv.user_id in (select u2.user_id from ($sql_leaders) u2) |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | and search.sco_id = '$sv_sco' |
136 | 136 | and search.course_id = '$sv_course' |
137 | 137 | and search.sv_key = '$sv_key' |
138 | - and list.sv_value ".($sv_asc ? "<=": ">=")." search.sv_value |
|
138 | + and list.sv_value ".($sv_asc ? "<=" : ">=")." search.sv_value |
|
139 | 139 | and list.sco_id = search.sco_id |
140 | 140 | and list.course_id = search.course_id |
141 | 141 | and list.sv_key = search.sv_key |
@@ -45,8 +45,9 @@ discard block |
||
45 | 45 | } |
46 | 46 | break; |
47 | 47 | case "stackgetall": |
48 | - if (storage_can_set($_REQUEST['svuser'])) |
|
49 | - print storage_stack_getall($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey']); |
|
48 | + if (storage_can_set($_REQUEST['svuser'])) { |
|
49 | + print storage_stack_getall($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey']); |
|
50 | + } |
|
50 | 51 | break; |
51 | 52 | case "getposition": |
52 | 53 | print storage_get_position($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey'], $_REQUEST['svasc']); |
@@ -87,8 +88,7 @@ discard block |
||
87 | 88 | } else { |
88 | 89 | return $row['sv_value']; |
89 | 90 | } |
90 | - } |
|
91 | - else { |
|
91 | + } else { |
|
92 | 92 | return null; |
93 | 93 | } |
94 | 94 | } |
@@ -144,8 +144,7 @@ discard block |
||
144 | 144 | if (Database::num_rows($res) > 0) { |
145 | 145 | $row = Database::fetch_assoc($res); |
146 | 146 | return $row['position']; |
147 | - } |
|
148 | - else { |
|
147 | + } else { |
|
149 | 148 | return null; |
150 | 149 | } |
151 | 150 | } |
@@ -198,8 +197,7 @@ discard block |
||
198 | 197 | if ($resorder && $resinsert) { |
199 | 198 | Database::query("commit"); |
200 | 199 | return 1; |
201 | - } |
|
202 | - else { |
|
200 | + } else { |
|
203 | 201 | Database::query("rollback"); |
204 | 202 | return 0; |
205 | 203 | } |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | |
65 | 65 | // Using the resource linker as a tool for adding resources to the learning path. |
66 | 66 | if ($action == 'add' && $type == 'learnpathitem') { |
67 | - $htmlHeadXtra[] = "<script> window.location=\"../resourcelinker/resourcelinker.php?source_id=5&action=$action&learnpath_id=$learnpath_id&chapter_id=$chapter_id&originalresource=no\"; </script>"; |
|
67 | + $htmlHeadXtra[] = "<script> window.location=\"../resourcelinker/resourcelinker.php?source_id=5&action=$action&learnpath_id=$learnpath_id&chapter_id=$chapter_id&originalresource=no\"; </script>"; |
|
68 | 68 | } |
69 | 69 | if ((!$is_allowed_to_edit) || ($isStudentView)) { |
70 | 70 | error_log('New LP - User not authorized in lp_view_item.php'); |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | // Theme calls |
99 | 99 | $show_learn_path = true; |
100 | 100 | if (isset($_SESSION['oLP']) && is_object($_SESSION['oLP'])) { |
101 | - $lp_theme_css = $_SESSION['oLP']->get_theme(); |
|
101 | + $lp_theme_css = $_SESSION['oLP']->get_theme(); |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | if ($mode == 'fullpage') { |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | if (isset($_GET['lp_item_id'])) { |
20 | 20 | |
21 | 21 | // Get parameter only came from lp_view.php. |
22 | - $lp_item_id = intval($_GET['lp_item_id']); |
|
22 | + $lp_item_id = intval($_GET['lp_item_id']); |
|
23 | 23 | if (isset($_SESSION['lpobject'])) { |
24 | 24 | $oLP = unserialize($_SESSION['lpobject']); |
25 | 25 | } |
@@ -56,8 +56,8 @@ discard block |
||
56 | 56 | $tbl_lp_item = Database::get_course_table(TABLE_LP_ITEM); |
57 | 57 | $tbl_lp_view = Database::get_course_table(TABLE_LP_VIEW); |
58 | 58 | |
59 | -$isStudentView = (empty($_REQUEST['isStudentView']) ? 0 : (int)$_REQUEST['isStudentView']); |
|
60 | -$learnpath_id = (int)$_REQUEST['lp_id']; |
|
59 | +$isStudentView = (empty($_REQUEST['isStudentView']) ? 0 : (int) $_REQUEST['isStudentView']); |
|
60 | +$learnpath_id = (int) $_REQUEST['lp_id']; |
|
61 | 61 | |
62 | 62 | // Using the resource linker as a tool for adding resources to the learning path. |
63 | 63 | if ($action == 'add' && $type == 'learnpathitem') { |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | /* SHOWING THE ADMIN TOOLS */ |
79 | 79 | |
80 | 80 | if (api_is_in_gradebook()) { |
81 | - $interbreadcrumb[] = array ( |
|
81 | + $interbreadcrumb[] = array( |
|
82 | 82 | 'url' => api_get_path(WEB_CODE_PATH).'gradebook/index.php?'.api_get_cidreq(), |
83 | 83 | 'name' => get_lang('ToolGradebook') |
84 | 84 | ); |
@@ -39,60 +39,60 @@ |
||
39 | 39 | case 'manifest': // Do the same as the default. |
40 | 40 | $children = $element->childNodes; |
41 | 41 | foreach ($children as $child) { |
42 | - switch ($child->nodeType) { |
|
43 | - case XML_ELEMENT_NODE: |
|
42 | + switch ($child->nodeType) { |
|
43 | + case XML_ELEMENT_NODE: |
|
44 | 44 | // Could be 'lom', 'schema', 'schemaversion' or 'location'. |
45 | 45 | switch ($child->tagName) { |
46 | - case 'lom': |
|
46 | + case 'lom': |
|
47 | 47 | $childchildren = $child->childNodes; |
48 | - foreach ($childchildren as $childchild) { |
|
49 | - $this->lom = $childchild->nodeValue; |
|
50 | - } |
|
51 | - break; |
|
52 | - case 'schema': |
|
48 | + foreach ($childchildren as $childchild) { |
|
49 | + $this->lom = $childchild->nodeValue; |
|
50 | + } |
|
51 | + break; |
|
52 | + case 'schema': |
|
53 | 53 | $childchildren = $child->childNodes; |
54 | - foreach ($childchildren as $childchild) { |
|
55 | - // There is generally only one child here. |
|
56 | - $this->schema = $childchild->nodeValue; |
|
57 | - } |
|
58 | - break; |
|
59 | - case 'schemaversion': |
|
54 | + foreach ($childchildren as $childchild) { |
|
55 | + // There is generally only one child here. |
|
56 | + $this->schema = $childchild->nodeValue; |
|
57 | + } |
|
58 | + break; |
|
59 | + case 'schemaversion': |
|
60 | 60 | $childchildren = $child->childNodes; |
61 | - foreach ($childchildren as $childchild) { |
|
62 | - // There is generally only one child here. |
|
63 | - $this->schemaversion = $childchild->nodeValue; |
|
64 | - } |
|
65 | - break; |
|
66 | - case 'location': |
|
61 | + foreach ($childchildren as $childchild) { |
|
62 | + // There is generally only one child here. |
|
63 | + $this->schemaversion = $childchild->nodeValue; |
|
64 | + } |
|
65 | + break; |
|
66 | + case 'location': |
|
67 | 67 | $childchildren = $child->childNodes; |
68 | - foreach ($childchildren as $childchild) { |
|
69 | - // There is generally only one child here. |
|
70 | - $this->location = $childchild->nodeValue; |
|
71 | - } |
|
72 | - break; |
|
73 | - } |
|
74 | - break; |
|
75 | - case XML_TEXT_NODE: |
|
68 | + foreach ($childchildren as $childchild) { |
|
69 | + // There is generally only one child here. |
|
70 | + $this->location = $childchild->nodeValue; |
|
71 | + } |
|
72 | + break; |
|
73 | + } |
|
74 | + break; |
|
75 | + case XML_TEXT_NODE: |
|
76 | 76 | if (trim($child->textContent) != '') { |
77 | - if (count($children == 1)) { |
|
78 | - // If this is the only child at this level and it is a content... save differently. |
|
79 | - $this->text = $child->textContent; |
|
80 | - } else { |
|
81 | - $this->text[$element->tagName] = $child->textContent; |
|
82 | - } |
|
83 | - } |
|
84 | - break; |
|
85 | - } |
|
86 | - } |
|
87 | - $attributes = $element->attributes; |
|
88 | - //$keep_href = ''; |
|
89 | - if (is_array($attributes)) { |
|
90 | - foreach ($attributes as $attrib) { |
|
91 | - if (trim($attrib->value) != ''){ |
|
92 | - $this->attribs[$attrib->name] = $attrib->value; |
|
93 | - } |
|
94 | - } |
|
95 | - } |
|
77 | + if (count($children == 1)) { |
|
78 | + // If this is the only child at this level and it is a content... save differently. |
|
79 | + $this->text = $child->textContent; |
|
80 | + } else { |
|
81 | + $this->text[$element->tagName] = $child->textContent; |
|
82 | + } |
|
83 | + } |
|
84 | + break; |
|
85 | + } |
|
86 | + } |
|
87 | + $attributes = $element->attributes; |
|
88 | + //$keep_href = ''; |
|
89 | + if (is_array($attributes)) { |
|
90 | + foreach ($attributes as $attrib) { |
|
91 | + if (trim($attrib->value) != ''){ |
|
92 | + $this->attribs[$attrib->name] = $attrib->value; |
|
93 | + } |
|
94 | + } |
|
95 | + } |
|
96 | 96 | return true; |
97 | 97 | //break; |
98 | 98 | } |
@@ -88,7 +88,7 @@ |
||
88 | 88 | //$keep_href = ''; |
89 | 89 | if (is_array($attributes)) { |
90 | 90 | foreach ($attributes as $attrib) { |
91 | - if (trim($attrib->value) != ''){ |
|
91 | + if (trim($attrib->value) != '') { |
|
92 | 92 | $this->attribs[$attrib->name] = $attrib->value; |
93 | 93 | } |
94 | 94 | } |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | } |
101 | 101 | break; |
102 | 102 | case 'item': |
103 | - $oItem = new scormItem('manifest',$child); |
|
103 | + $oItem = new scormItem('manifest', $child); |
|
104 | 104 | if ($oItem->identifier != '') { |
105 | 105 | $this->sub_items[$oItem->identifier] = $oItem; |
106 | 106 | } |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | $attributes = $element->attributes; |
120 | 120 | //$keep_href = ''; |
121 | 121 | foreach ($attributes as $attrib) { |
122 | - switch($attrib->name){ |
|
122 | + switch ($attrib->name) { |
|
123 | 123 | case 'identifier': |
124 | 124 | $this->identifier = $attrib->value; |
125 | 125 | break; |
@@ -172,8 +172,8 @@ discard block |
||
172 | 172 | ); |
173 | 173 | $abs_order++; |
174 | 174 | $i = 1; |
175 | - foreach($this->sub_items as $id => $dummy) { |
|
176 | - $oSubitem =& $this->sub_items[$id]; |
|
175 | + foreach ($this->sub_items as $id => $dummy) { |
|
176 | + $oSubitem = & $this->sub_items[$id]; |
|
177 | 177 | $oSubitem->get_flat_list($list, $abs_order, $i, $level + 1); |
178 | 178 | $i++; |
179 | 179 | } |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | parent::save($from_outside, $prereqs_complete); |
189 | 189 | // Under certain conditions, the scorm_contact should not be set, because no scorm signal was sent. |
190 | 190 | $this->scorm_contact = true; |
191 | - if (!$this->scorm_contact){ |
|
191 | + if (!$this->scorm_contact) { |
|
192 | 192 | //error_log('New LP - was expecting SCORM message but none received', 0); |
193 | 193 | } |
194 | 194 | } |