@@ -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')); |
@@ -21,26 +21,26 @@ discard block |
||
21 | 21 | |
22 | 22 | /* Header and action code */ |
23 | 23 | $htmlHeadXtra[] = '<script type="text/javascript">'. |
24 | -$_SESSION['oLP']->get_js_dropdown_array() . |
|
25 | -'function load_cbo(id){' ."\n" . |
|
24 | +$_SESSION['oLP']->get_js_dropdown_array(). |
|
25 | +'function load_cbo(id){'."\n". |
|
26 | 26 | 'if (!id) {return false;}'. |
27 | - 'var cbo = document.getElementById(\'previous\');' . |
|
28 | - 'for(var i = cbo.length - 1; i > 0; i--) {' . |
|
29 | - 'cbo.options[i] = null;' . |
|
30 | - '}' ."\n" . |
|
31 | - 'var k=0;' . |
|
32 | - 'for(var i = 1; i <= child_name[id].length; i++){' ."\n" . |
|
33 | - ' cbo.options[i] = new Option(child_name[id][i-1], child_value[id][i-1]);' ."\n" . |
|
34 | - ' k=i;' ."\n" . |
|
35 | - '}' ."\n" . |
|
36 | - 'cbo.options[k].selected = true;'."\n" . |
|
37 | -'}'."\n" . |
|
38 | -'$().ready(function() {'."\n" . |
|
39 | - 'if ($(\'#previous\')) {'."\n" . |
|
27 | + 'var cbo = document.getElementById(\'previous\');'. |
|
28 | + 'for(var i = cbo.length - 1; i > 0; i--) {'. |
|
29 | + 'cbo.options[i] = null;'. |
|
30 | + '}'."\n". |
|
31 | + 'var k=0;'. |
|
32 | + 'for(var i = 1; i <= child_name[id].length; i++){'."\n". |
|
33 | + ' cbo.options[i] = new Option(child_name[id][i-1], child_value[id][i-1]);'."\n". |
|
34 | + ' k=i;'."\n". |
|
35 | + '}'."\n". |
|
36 | + 'cbo.options[k].selected = true;'."\n". |
|
37 | +'}'."\n". |
|
38 | +'$().ready(function() {'."\n". |
|
39 | + 'if ($(\'#previous\')) {'."\n". |
|
40 | 40 | 'if(\'parent is\'+$(\'#idParent\').val()) {'. |
41 | - 'load_cbo($(\'#idParent\').val());'."\n" . |
|
42 | - '}}'."\n" . |
|
43 | -'});</script>'."\n" ; |
|
41 | + 'load_cbo($(\'#idParent\').val());'."\n". |
|
42 | + '}}'."\n". |
|
43 | +'});</script>'."\n"; |
|
44 | 44 | |
45 | 45 | /* Constants and variables */ |
46 | 46 | |
@@ -79,11 +79,11 @@ discard block |
||
79 | 79 | /* SHOWING THE ADMIN TOOLS */ |
80 | 80 | |
81 | 81 | if (isset($_SESSION['gradebook'])) { |
82 | - $gradebook= $_SESSION['gradebook']; |
|
82 | + $gradebook = $_SESSION['gradebook']; |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | if (!empty($gradebook) && $gradebook == 'view') { |
86 | - $interbreadcrumb[] = array ( |
|
86 | + $interbreadcrumb[] = array( |
|
87 | 87 | 'url' => '../gradebook/'.$_SESSION['gradebook_dest'], |
88 | 88 | 'name' => get_lang('ToolGradebook') |
89 | 89 | ); |
@@ -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 |
@@ -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 |
@@ -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 |
@@ -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 | } |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | |
26 | 26 | // Including the global initialization file. |
27 | 27 | require_once '../inc/global.inc.php'; |
28 | -$current_course_tool = TOOL_LEARNPATH; |
|
28 | +$current_course_tool = TOOL_LEARNPATH; |
|
29 | 29 | $_course = api_get_course_info(); |
30 | 30 | |
31 | 31 | $glossaryExtraTools = api_get_setting('show_glossary_in_extra_tools'); |
@@ -37,11 +37,11 @@ discard block |
||
37 | 37 | ) { |
38 | 38 | $htmlHeadXtra[] = '<script> |
39 | 39 | <!-- |
40 | - var jQueryFrameReadyConfigPath = \'' . api_get_jquery_web_path() . '\'; |
|
40 | + var jQueryFrameReadyConfigPath = \'' . api_get_jquery_web_path().'\'; |
|
41 | 41 | --> |
42 | 42 | </script>'; |
43 | - $htmlHeadXtra[] = '<script src="' . api_get_path(WEB_LIBRARY_PATH) . 'javascript/jquery.frameready.js" type="text/javascript" language="javascript"></script>'; |
|
44 | - $htmlHeadXtra[] = '<script src="' . api_get_path(WEB_LIBRARY_PATH) . 'javascript/jquery.highlight.js" type="text/javascript" language="javascript"></script>'; |
|
43 | + $htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.frameready.js" type="text/javascript" language="javascript"></script>'; |
|
44 | + $htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.highlight.js" type="text/javascript" language="javascript"></script>'; |
|
45 | 45 | } |
46 | 46 | } |
47 | 47 | |
@@ -268,7 +268,7 @@ discard block |
||
268 | 268 | |
269 | 269 | $course_id = api_get_course_int_id(); |
270 | 270 | |
271 | -if ($debug>0) error_log('New LP - Passed data remains check', 0); |
|
271 | +if ($debug > 0) error_log('New LP - Passed data remains check', 0); |
|
272 | 272 | |
273 | 273 | if (!$lp_found || (!empty($_REQUEST['lp_id']) && $_SESSION['oLP']->get_id() != $_REQUEST['lp_id'])) { |
274 | 274 | if ($debug > 0) error_log('New LP - oLP is not object, has changed or refresh been asked, getting new', 0); |
@@ -292,7 +292,7 @@ discard block |
||
292 | 292 | if (Database::num_rows($res)) { |
293 | 293 | $row = Database::fetch_array($res); |
294 | 294 | $type = $row['lp_type']; |
295 | - if ($debug > 0) error_log('New LP - found row - type '.$type. ' - Calling constructor with '.api_get_course_id().' - '.$lp_id.' - '.api_get_user_id(), 0); |
|
295 | + if ($debug > 0) error_log('New LP - found row - type '.$type.' - Calling constructor with '.api_get_course_id().' - '.$lp_id.' - '.api_get_user_id(), 0); |
|
296 | 296 | switch ($type) { |
297 | 297 | case 1: |
298 | 298 | if ($debug > 0) error_log('New LP - found row - type dokeos - Calling constructor with '.api_get_course_id().' - '.$lp_id.' - '.api_get_user_id(), 0); |
@@ -687,8 +687,8 @@ discard block |
||
687 | 687 | $editPrerequisite = $_SESSION['oLP']->edit_item_prereq( |
688 | 688 | $_GET['id'], |
689 | 689 | $_POST['prerequisites'], |
690 | - $_POST['min_' . $_POST['prerequisites']], |
|
691 | - $_POST['max_' . $_POST['prerequisites']] |
|
690 | + $_POST['min_'.$_POST['prerequisites']], |
|
691 | + $_POST['max_'.$_POST['prerequisites']] |
|
692 | 692 | ); |
693 | 693 | |
694 | 694 | if ($editPrerequisite) { |
@@ -937,7 +937,7 @@ discard block |
||
937 | 937 | $_SESSION['oLP']->setSubscribeUsers($_REQUEST['subscribe_users']); |
938 | 938 | |
939 | 939 | if (isset($_REQUEST['activate_start_date_check']) && $_REQUEST['activate_start_date_check'] == 1) { |
940 | - $publicated_on = $_REQUEST['publicated_on']; |
|
940 | + $publicated_on = $_REQUEST['publicated_on']; |
|
941 | 941 | } else { |
942 | 942 | $publicated_on = null; |
943 | 943 | } |
@@ -1008,7 +1008,7 @@ discard block |
||
1008 | 1008 | else { |
1009 | 1009 | $_SESSION['refresh'] = 1; |
1010 | 1010 | if (!empty($_REQUEST['parent_item_id'])) { |
1011 | - $_SESSION['from_learnpath']='yes'; |
|
1011 | + $_SESSION['from_learnpath'] = 'yes'; |
|
1012 | 1012 | $_SESSION['origintoolurl'] = 'lp_controller.php?action=admin_view&lp_id='.Security::remove_XSS($_REQUEST['lp_id']); |
1013 | 1013 | require 'resourcelinker.php'; |
1014 | 1014 | } else { |
@@ -1109,8 +1109,8 @@ discard block |
||
1109 | 1109 | error_log('New LP - No learnpath given for view', 0); |
1110 | 1110 | require 'lp_list.php'; |
1111 | 1111 | } else { |
1112 | - if ($debug > 0) {error_log('New LP - Trying to set current item to ' . $_REQUEST['item_id'], 0); } |
|
1113 | - if ( !empty($_REQUEST['item_id']) ) { |
|
1112 | + if ($debug > 0) {error_log('New LP - Trying to set current item to '.$_REQUEST['item_id'], 0); } |
|
1113 | + if (!empty($_REQUEST['item_id'])) { |
|
1114 | 1114 | $_SESSION['oLP']->set_current_item($_REQUEST['item_id']); |
1115 | 1115 | } |
1116 | 1116 | require 'lp_view.php'; |
@@ -1190,8 +1190,8 @@ discard block |
||
1190 | 1190 | break; |
1191 | 1191 | */ |
1192 | 1192 | case 'switch_attempt_mode': |
1193 | - if($debug>0) error_log('New LP - switch_reinit action triggered',0); |
|
1194 | - if(!$lp_found){ error_log('New LP - No learnpath given for switch',0); require 'lp_list.php'; } |
|
1193 | + if ($debug > 0) error_log('New LP - switch_reinit action triggered', 0); |
|
1194 | + if (!$lp_found) { error_log('New LP - No learnpath given for switch', 0); require 'lp_list.php'; } |
|
1195 | 1195 | $_SESSION['refresh'] = 1; |
1196 | 1196 | $_SESSION['oLP']->switch_attempt_mode(); |
1197 | 1197 | require 'lp_list.php'; |
@@ -1241,8 +1241,8 @@ discard block |
||
1241 | 1241 | error_log('New LP - No learnpath given for view', 0); |
1242 | 1242 | require 'lp_list.php'; |
1243 | 1243 | } else { |
1244 | - if ($debug > 0) {error_log('New LP - Trying to impress this LP item to ' . $_REQUEST['item_id'], 0); } |
|
1245 | - if (!empty($_REQUEST['item_id']) ) { |
|
1244 | + if ($debug > 0) {error_log('New LP - Trying to impress this LP item to '.$_REQUEST['item_id'], 0); } |
|
1245 | + if (!empty($_REQUEST['item_id'])) { |
|
1246 | 1246 | $_SESSION['oLP']->set_current_item($_REQUEST['item_id']); |
1247 | 1247 | } |
1248 | 1248 | require 'lp_impress.php'; |
@@ -1305,7 +1305,7 @@ discard block |
||
1305 | 1305 | $_SESSION['oLP']->lp_session_id |
1306 | 1306 | ); |
1307 | 1307 | |
1308 | - $forumCategoryId = !empty($forumCategory) ? $forumCategory['cat_id']: 0; |
|
1308 | + $forumCategoryId = !empty($forumCategory) ? $forumCategory['cat_id'] : 0; |
|
1309 | 1309 | |
1310 | 1310 | if (empty($forumCategoryId)) { |
1311 | 1311 | $forumCategoryId = store_forumcategory( |
@@ -1337,7 +1337,7 @@ discard block |
||
1337 | 1337 | } |
1338 | 1338 | } |
1339 | 1339 | |
1340 | - header('Location:' . api_get_self() . '?' . http_build_query([ |
|
1340 | + header('Location:'.api_get_self().'?'.http_build_query([ |
|
1341 | 1341 | 'action' => 'add_item', |
1342 | 1342 | 'type' => 'step', |
1343 | 1343 | 'lp_id' => $_SESSION['oLP']->lp_id |
@@ -1379,7 +1379,7 @@ discard block |
||
1379 | 1379 | } |
1380 | 1380 | } |
1381 | 1381 | |
1382 | - header('Location:' . api_get_self() . '?' . http_build_query([ |
|
1382 | + header('Location:'.api_get_self().'?'.http_build_query([ |
|
1383 | 1383 | 'action' => 'add_item', |
1384 | 1384 | 'type' => 'step', |
1385 | 1385 | 'lp_id' => $_SESSION['oLP']->lp_id |