Completed
Push — 1.10.x ( c82817...6a93c3 )
by Yannick
202:42 queued 149:59
created
main/course_progress/thematic_plan.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -10,21 +10,21 @@  discard block
 block discarded – undo
10 10
 // actions menu
11 11
 $new_thematic_plan_data = array();
12 12
 if (!empty($thematic_plan_data))
13
-foreach($thematic_plan_data as $thematic_item) {
13
+foreach ($thematic_plan_data as $thematic_item) {
14 14
     $thematic_simple_list[] = $thematic_item['description_type'];
15 15
     $new_thematic_plan_data[$thematic_item['description_type']] = $thematic_item;
16 16
 }
17 17
 
18 18
 $new_id = ADD_THEMATIC_PLAN;
19 19
 if (!empty($thematic_simple_list))
20
-foreach($thematic_simple_list as $item) {
20
+foreach ($thematic_simple_list as $item) {
21 21
     if ($item >= ADD_THEMATIC_PLAN) {
22 22
         $new_id = $item + 1;
23 23
         $default_thematic_plan_title[$item] = $new_thematic_plan_data[$item]['title'];
24 24
     }
25 25
 }
26 26
 
27
-$i=1;
27
+$i = 1;
28 28
 
29 29
 echo Display::tag('h2', $thematic_data['title']);
30 30
 echo $thematic_data['content'];
@@ -66,8 +66,8 @@  discard block
 block discarded – undo
66 66
                 $thematic_plan = null;
67 67
             } else {
68 68
                 $thematic_plan = null;
69
-                $default['title['.$id.']']       = $title;
70
-                $default['description['.$id.']']= '';
69
+                $default['title['.$id.']'] = $title;
70
+                $default['description['.$id.']'] = '';
71 71
             }
72 72
             $form->setDefaults($default);
73 73
         }
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
         $header_form = $default_thematic_plan_title[$description_type];
81 81
     }
82 82
     if (!$error) {
83
-        $token = md5(uniqid(rand(),TRUE));
83
+        $token = md5(uniqid(rand(), TRUE));
84 84
         $_SESSION['thematic_plan_token'] = $token;
85 85
     }
86 86
 
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
 
136 136
     // error messages
137 137
     if ($error) {
138
-        Display::display_error_message(get_lang('FormHasErrorsPleaseComplete'),false);
138
+        Display::display_error_message(get_lang('FormHasErrorsPleaseComplete'), false);
139 139
     }
140 140
     $form->display();
141 141
 }
Please login to merge, or discard this patch.
main/course_progress/thematic.php 1 patch
Spacing   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -23,25 +23,25 @@  discard block
 block discarded – undo
23 23
         case 'thematic_add' :
24 24
         case 'thematic_import_select' :
25 25
             echo '<a href="index.php?'.api_get_cidreq().'">'.
26
-                Display::return_icon('back.png',get_lang('BackTo').' '.get_lang('ThematicDetails'),'',ICON_SIZE_MEDIUM).'</a>';
26
+                Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('ThematicDetails'), '', ICON_SIZE_MEDIUM).'</a>';
27 27
             break;
28 28
         case 'thematic_list' :
29 29
             echo '<a href="index.php?'.api_get_cidreq().'&action=thematic_add'.$url_token.'">'.
30
-                Display::return_icon('new_course_progress.png',get_lang('NewThematicSection'),'',ICON_SIZE_MEDIUM).'</a>';
30
+                Display::return_icon('new_course_progress.png', get_lang('NewThematicSection'), '', ICON_SIZE_MEDIUM).'</a>';
31 31
             break;
32 32
         case 'thematic_details' :
33 33
             echo '<a href="index.php?'.api_get_cidreq().'&action=thematic_add'.$url_token.'">'.
34
-                Display::return_icon('new_course_progress.png',get_lang('NewThematicSection'),'',ICON_SIZE_MEDIUM).'</a>';
34
+                Display::return_icon('new_course_progress.png', get_lang('NewThematicSection'), '', ICON_SIZE_MEDIUM).'</a>';
35 35
             echo '<a href="index.php?'.api_get_cidreq().'&action=thematic_import_select'.$url_token.'">'.
36
-                Display::return_icon('import_csv.png',get_lang('ImportThematic'),'',ICON_SIZE_MEDIUM).'</a>';
36
+                Display::return_icon('import_csv.png', get_lang('ImportThematic'), '', ICON_SIZE_MEDIUM).'</a>';
37 37
             echo '<a href="index.php?'.api_get_cidreq().'&action=thematic_export'.$url_token.'">'.
38
-                Display::return_icon('export_csv.png',get_lang('ExportThematic'),'', ICON_SIZE_MEDIUM).'</a>';
38
+                Display::return_icon('export_csv.png', get_lang('ExportThematic'), '', ICON_SIZE_MEDIUM).'</a>';
39 39
             echo '<a href="index.php?'.api_get_cidreq().'&action=thematic_export_pdf'.$url_token.'">'.
40
-                Display::return_icon('pdf.png',get_lang('ExportToPDF'),'', ICON_SIZE_MEDIUM).'</a>';
40
+                Display::return_icon('pdf.png', get_lang('ExportToPDF'), '', ICON_SIZE_MEDIUM).'</a>';
41 41
             break;
42 42
         default :
43 43
             echo '<a href="index.php?'.api_get_cidreq().'&action=thematic_add'.$url_token.'">'.
44
-                Display::return_icon('new_course_progress.png',get_lang('NewThematicSection'),'',ICON_SIZE_MEDIUM).'</a>';
44
+                Display::return_icon('new_course_progress.png', get_lang('NewThematicSection'), '', ICON_SIZE_MEDIUM).'</a>';
45 45
     }
46 46
     echo '</div>';
47 47
 }
@@ -57,10 +57,10 @@  discard block
 block discarded – undo
57 57
     $parameters['action'] = $action;
58 58
     $table->set_additional_parameters($parameters);
59 59
     $table->set_header(0, '', false, array('style'=>'width:20px;'));
60
-    $table->set_header(1, get_lang('Title'), false );
60
+    $table->set_header(1, get_lang('Title'), false);
61 61
     if (api_is_allowed_to_edit(null, true)) {
62
-        $table->set_header(2, get_lang('Actions'), false,array('style'=>'text-align:center;width:40%;'));
63
-        $table->set_form_actions(array ('thematic_delete_select' => get_lang('DeleteAllThematics')));
62
+        $table->set_header(2, get_lang('Actions'), false, array('style'=>'text-align:center;width:40%;'));
63
+        $table->set_form_actions(array('thematic_delete_select' => get_lang('DeleteAllThematics')));
64 64
     }
65 65
     $table->display();
66 66
 
@@ -72,11 +72,11 @@  discard block
 block discarded – undo
72 72
 
73 73
     if (isset($last_id) && $last_id) {
74 74
         $link_to_thematic_plan = '<a href="index.php?'.api_get_cidreq().'&action=thematic_plan_list&thematic_id='.$last_id.'">'.
75
-            Display::return_icon('lesson_plan.png', get_lang('ThematicPlan'), array('style'=>'vertical-align:middle;float:none;'),ICON_SIZE_SMALL).'</a>';
75
+            Display::return_icon('lesson_plan.png', get_lang('ThematicPlan'), array('style'=>'vertical-align:middle;float:none;'), ICON_SIZE_SMALL).'</a>';
76 76
         $link_to_thematic_advance = '<a href="index.php?'.api_get_cidreq().'&action=thematic_advance_list&thematic_id='.$last_id.'">'.
77
-            Display::return_icon('lesson_plan_calendar.png', get_lang('ThematicAdvance'), array('style'=>'vertical-align:middle;float:none;'),ICON_SIZE_SMALL).'</a>';
77
+            Display::return_icon('lesson_plan_calendar.png', get_lang('ThematicAdvance'), array('style'=>'vertical-align:middle;float:none;'), ICON_SIZE_SMALL).'</a>';
78 78
         Display::display_confirmation_message(
79
-            get_lang('ThematicSectionHasBeenCreatedSuccessfull').'<br />'.sprintf(get_lang('NowYouShouldAddThematicPlanXAndThematicAdvanceX'),$link_to_thematic_plan, $link_to_thematic_advance),
79
+            get_lang('ThematicSectionHasBeenCreatedSuccessfull').'<br />'.sprintf(get_lang('NowYouShouldAddThematicPlanXAndThematicAdvanceX'), $link_to_thematic_plan, $link_to_thematic_advance),
80 80
             false
81 81
         );
82 82
     }
@@ -113,27 +113,27 @@  discard block
 block discarded – undo
113 113
             $actions_first_col = '';
114 114
             if (api_is_allowed_to_edit(null, true)) {
115 115
                 // Thematic title
116
-                $actions_first_col  = Display::url(
116
+                $actions_first_col = Display::url(
117 117
                     Display::return_icon('cd.gif', get_lang('Copy')),
118 118
                     'index.php?'.api_get_cidreq().'&action=thematic_copy&thematic_id='.$my_thematic_id.$params.$url_token
119 119
                 );
120
-                if (api_get_session_id() == 0 ) {
120
+                if (api_get_session_id() == 0) {
121 121
 
122 122
                     if ($thematic['display_order'] > 1) {
123
-                        $actions_first_col .= ' <a href="'.api_get_self().'?action=moveup&'.api_get_cidreq().'&thematic_id='.$my_thematic_id.$params.$url_token.'">'.Display::return_icon('up.png', get_lang('Up'),'',ICON_SIZE_SMALL).'</a>';
123
+                        $actions_first_col .= ' <a href="'.api_get_self().'?action=moveup&'.api_get_cidreq().'&thematic_id='.$my_thematic_id.$params.$url_token.'">'.Display::return_icon('up.png', get_lang('Up'), '', ICON_SIZE_SMALL).'</a>';
124 124
                     } else {
125
-                        $actions_first_col .= ' '.Display::return_icon('up_na.png','&nbsp;','',ICON_SIZE_SMALL);
125
+                        $actions_first_col .= ' '.Display::return_icon('up_na.png', '&nbsp;', '', ICON_SIZE_SMALL);
126 126
                     }
127 127
                     if (isset($thematic['max_thematic_item']) && $thematic['display_order'] < $thematic['max_thematic_item']) {
128
-                        $actions_first_col .= ' <a href="'.api_get_self().'?action=movedown&a'.api_get_cidreq().'&thematic_id='.$my_thematic_id.$params.$url_token.'">'.Display::return_icon('down.png',get_lang('Down'),'',ICON_SIZE_SMALL).'</a>';
128
+                        $actions_first_col .= ' <a href="'.api_get_self().'?action=movedown&a'.api_get_cidreq().'&thematic_id='.$my_thematic_id.$params.$url_token.'">'.Display::return_icon('down.png', get_lang('Down'), '', ICON_SIZE_SMALL).'</a>';
129 129
                     } else {
130
-                        $actions_first_col .= ' '.Display::return_icon('down_na.png','&nbsp;','',ICON_SIZE_SMALL);
130
+                        $actions_first_col .= ' '.Display::return_icon('down_na.png', '&nbsp;', '', ICON_SIZE_SMALL);
131 131
                     }
132 132
 
133 133
                 }
134 134
                 if (api_get_session_id() == $thematic['session_id']) {
135
-                    $actions_first_col .= '<a href="index.php?'.api_get_cidreq().'&action=thematic_edit&thematic_id='.$my_thematic_id.$params.$url_token.'">'.Display::return_icon('edit.png',get_lang('Edit'),'',ICON_SIZE_SMALL).'</a>';
136
-                    $actions_first_col .= '<a onclick="javascript:if(!confirm(\''.get_lang('AreYouSureToDelete').'\')) return false;" href="index.php?'.api_get_cidreq().'&action=thematic_delete&thematic_id='.$my_thematic_id.$params.$url_token.'">'.Display::return_icon('delete.png',get_lang('Delete'),'',ICON_SIZE_SMALL).'</a>';
135
+                    $actions_first_col .= '<a href="index.php?'.api_get_cidreq().'&action=thematic_edit&thematic_id='.$my_thematic_id.$params.$url_token.'">'.Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL).'</a>';
136
+                    $actions_first_col .= '<a onclick="javascript:if(!confirm(\''.get_lang('AreYouSureToDelete').'\')) return false;" href="index.php?'.api_get_cidreq().'&action=thematic_delete&thematic_id='.$my_thematic_id.$params.$url_token.'">'.Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'</a>';
137 137
                 }
138 138
 
139 139
                 $actions_first_col = Display::div($actions_first_col, array('id'=>'thematic_id_content_'.$thematic['id'], 'class'=>'thematic_tools'));
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
             //if (api_is_allowed_to_edit(null, true) &&  api_get_session_id() == $thematic['session_id']) {
150 150
             if (api_is_allowed_to_edit(null, true)) {
151 151
                 echo '<div style="text-align:right"><a href="index.php?'.api_get_cidreq().'&origin=thematic_details&action=thematic_plan_list&thematic_id='.$thematic['id'].'&width=700&height=500">'.
152
-                    Display::return_icon('edit.png', get_lang('EditThematicPlan'), array('style'=>'vertical-align:middle'),ICON_SIZE_MEDIUM).'</a></div><br />';
152
+                    Display::return_icon('edit.png', get_lang('EditThematicPlan'), array('style'=>'vertical-align:middle'), ICON_SIZE_MEDIUM).'</a></div><br />';
153 153
             }
154 154
 
155 155
             if (empty($thematic_plan_div[$thematic['id']])) {
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
             //if (api_is_allowed_to_edit(null, true) &&  api_get_session_id() == $thematic['session_id']) {
166 166
             if (api_is_allowed_to_edit(null, true)) {
167 167
                 echo '<div style="text-align:right"><a href="index.php?'.api_get_cidreq().'&action=thematic_advance_add&thematic_id='.$thematic['id'].'">'.
168
-                    Display::return_icon('add.png',get_lang('NewThematicAdvance'),'',ICON_SIZE_MEDIUM).'</a></div>';
168
+                    Display::return_icon('add.png', get_lang('NewThematicAdvance'), '', ICON_SIZE_MEDIUM).'</a></div>';
169 169
             }
170 170
 
171 171
             //if (api_is_allowed_to_edit(null, true) &&  api_get_session_id() == $thematic['session_id']) {
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
                                 [],
188 188
                                 ICON_SIZE_SMALL
189 189
                             ),
190
-                            'index.php?' . api_get_cidreq() . '&' . http_build_query([
190
+                            'index.php?'.api_get_cidreq().'&'.http_build_query([
191 191
                                 'action' => 'thematic_advance_edit',
192 192
                                 'thematic_id' => $thematic['id'],
193 193
                                 'thematic_advance_id' => $thematic_advance['id'],
@@ -198,17 +198,17 @@  discard block
 block discarded – undo
198 198
                                 'data-title' => get_lang('EditThematicAdvance')
199 199
                             ]
200 200
                         );
201
-                        $edit_link  .= '<a onclick="javascript:if(!confirm(\''.get_lang('AreYouSureToDelete').'\')) return false;" href="index.php?'.api_get_cidreq().'&action=thematic_advance_delete&thematic_id='.$thematic['id'].'&thematic_advance_id='.$thematic_advance['id'].'">'.
202
-                            Display::return_icon('delete.png',get_lang('Delete'),'',ICON_SIZE_SMALL).'</a></center>';
201
+                        $edit_link .= '<a onclick="javascript:if(!confirm(\''.get_lang('AreYouSureToDelete').'\')) return false;" href="index.php?'.api_get_cidreq().'&action=thematic_advance_delete&thematic_id='.$thematic['id'].'&thematic_advance_id='.$thematic_advance['id'].'">'.
202
+                            Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'</a></center>';
203 203
 
204 204
                         //Links
205 205
                         $edit_link = Display::div(
206
-                            Display::div($edit_link , array('id'=>'thematic_advance_tools_'.$thematic_advance['id'], 'class'=>'thematic_advance_actions')),
206
+                            Display::div($edit_link, array('id'=>'thematic_advance_tools_'.$thematic_advance['id'], 'class'=>'thematic_advance_actions')),
207 207
                             array('style'=>'height:20px;')
208 208
                         );
209 209
                     }
210 210
 
211
-                    $thematic_advance_item =  isset($thematic_advance_div[$thematic['id']][$thematic_advance['id']]) ? $thematic_advance_div[$thematic['id']][$thematic_advance['id']] : null;
211
+                    $thematic_advance_item = isset($thematic_advance_div[$thematic['id']][$thematic_advance['id']]) ? $thematic_advance_div[$thematic['id']][$thematic_advance['id']] : null;
212 212
                     echo Display::div($thematic_advance_item, array('id'=>'thematic_advance_'.$thematic_advance['id']));
213 213
                     echo $edit_link;
214 214
                     echo '</td>';
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
 } elseif ($action == 'thematic_add' || $action == 'thematic_edit') {
254 254
 
255 255
     // Display form
256
-    $form = new FormValidator('thematic_add','POST','index.php?action=thematic_add&'.api_get_cidreq());
256
+    $form = new FormValidator('thematic_add', 'POST', 'index.php?action=thematic_add&'.api_get_cidreq());
257 257
 
258 258
     if ($action == 'thematic_edit') {
259 259
         $form->addElement('header', '', get_lang('EditThematicSection'));
@@ -263,7 +263,7 @@  discard block
 block discarded – undo
263 263
     $form->addElement('hidden', 'action', $action);
264 264
 
265 265
     if (!empty($thematic_id)) {
266
-        $form->addElement('hidden', 'thematic_id',$thematic_id);
266
+        $form->addElement('hidden', 'thematic_id', $thematic_id);
267 267
     }
268 268
 
269 269
     $form->addText('title', get_lang('Title'), true, array('size'=>'50'));
@@ -275,8 +275,8 @@  discard block
 block discarded – undo
275 275
     if (!empty($thematic_data)) {
276 276
         if (api_get_session_id()) {
277 277
             if ($thematic_data['session_id'] != api_get_session_id()) {
278
-                $show_form  = false;
279
-                Display::display_error_message(get_lang('NotAllowedClickBack'),false);
278
+                $show_form = false;
279
+                Display::display_error_message(get_lang('NotAllowedClickBack'), false);
280 280
             }
281 281
         }
282 282
         // set default values
@@ -287,14 +287,14 @@  discard block
 block discarded – undo
287 287
 
288 288
     // error messages
289 289
     if (isset($error)) {
290
-        Display::display_error_message(get_lang('FormHasErrorsPleaseComplete'),false);
290
+        Display::display_error_message(get_lang('FormHasErrorsPleaseComplete'), false);
291 291
     }
292 292
     if ($show_form) {
293 293
         $form->display();
294 294
     }
295 295
 } elseif ($action == 'thematic_import_select') {
296 296
     // Create form to upload csv file.
297
-    $form = new FormValidator('thematic_import','POST','index.php?action=thematic_import&'.api_get_cidreq().$url_token);
297
+    $form = new FormValidator('thematic_import', 'POST', 'index.php?action=thematic_import&'.api_get_cidreq().$url_token);
298 298
     $form->addElement('header', get_lang('ImportThematic'));
299 299
     $form->addElement('file', 'file');
300 300
     $form->addElement('checkbox', 'replace', null, get_lang('DeleteAllThematic'));
Please login to merge, or discard this patch.
main/newscorm/openoffice_text.class.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
             if (empty($matches[1][$i]))
127 127
                 continue;
128 128
 
129
-            $content = strstr($content,$matches[0][$i]);
129
+            $content = strstr($content, $matches[0][$i]);
130 130
             if ($i + 1 !== count($matches[0])) {
131 131
                 $chapter_content = substr($content, 0, strpos($content, $matches[0][$i + 1]));
132 132
             } else {
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
 
149 149
             $document_id = add_document($_course, $this->created_dir.'/'.$html_file, 'file', filesize($this->base_work_dir.$this->created_dir.'/'.$html_file), $html_file);
150 150
 
151
-            if ($document_id){
151
+            if ($document_id) {
152 152
 
153 153
                 // Put the document in item_property update.
154 154
                 api_item_property_update(
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
                         foreach ($specific_fields as $specific_field) {
255 255
                             if (isset($_REQUEST[$specific_field['code']])) {
256 256
                                 $sterms = trim($_REQUEST[$specific_field['code']]);
257
-                                $all_specific_terms .= ' '. $sterms;
257
+                                $all_specific_terms .= ' '.$sterms;
258 258
                                 if (!empty($sterms)) {
259 259
                                     $sterms = explode(',', $sterms);
260 260
                                     foreach ($sterms as $sterm) {
@@ -263,10 +263,10 @@  discard block
 block discarded – undo
263 263
                                 }
264 264
                             }
265 265
                         }
266
-                        $page_content = $all_specific_terms .' '. $page_content;
266
+                        $page_content = $all_specific_terms.' '.$page_content;
267 267
                         $ic_slide->addValue('content', $page_content);
268 268
                         // Add a comment to say terms separated by commas.
269
-                        $courseid=api_get_course_id();
269
+                        $courseid = api_get_course_id();
270 270
                         $ic_slide->addCourseId($courseid);
271 271
                         $ic_slide->addToolId(TOOL_LEARNPATH);
272 272
                         $lp_id = $this->lp_id;
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
                             SE_COURSE_ID => $courseid,
275 275
                             SE_TOOL_ID => TOOL_LEARNPATH,
276 276
                             SE_DATA => array('lp_id' => $lp_id, 'lp_item'=> $previous, 'document_id' => $document_id),
277
-                            SE_USER => (int)api_get_user_id(),
277
+                            SE_USER => (int) api_get_user_id(),
278 278
                         );
279 279
                         $ic_slide->xapian_data = serialize($xapian_data);
280 280
                         $di->addChunk($ic_slide);
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
      * Returns additional Java command parameters
299 299
      * @return	string	The additional parameters to be used in the Java call
300 300
      */
301
-    function add_command_parameters(){
301
+    function add_command_parameters() {
302 302
         return ' -d woogie "'.$this->base_work_dir.'/'.$this->file_path.'"  "'.$this->base_work_dir.$this->created_dir.'/'.$this->file_name.'.html"';
303 303
     }
304 304
 
@@ -310,7 +310,7 @@  discard block
 block discarded – undo
310 310
      */
311 311
     function format_page_content($header, $content) {
312 312
         // Limit the width of the doc.
313
-        list($max_width, $max_height) = explode('x',api_get_setting('service_ppt2lp','size'));
313
+        list($max_width, $max_height) = explode('x', api_get_setting('service_ppt2lp', 'size'));
314 314
 
315 315
         $content = preg_replace("|<body[^>]*>|i", "\\0\r\n<div style=\"width:".$max_width."\">", $content, -1, $count);
316 316
         if ($count < 1) {
@@ -343,7 +343,7 @@  discard block
 block discarded – undo
343 343
                 }
344 344
 
345 345
             } elseif ($img_width > $max_width - 10) {
346
-                $picture_resized = str_ireplace('width='.$img_width, 'width="'.($max_width-10).'"', $images[0][$key]);
346
+                $picture_resized = str_ireplace('width='.$img_width, 'width="'.($max_width - 10).'"', $images[0][$key]);
347 347
                 $content = str_replace($images[0][$key], $picture_resized, $content);
348 348
             }
349 349
         }
Please login to merge, or discard this patch.
main/newscorm/lp_admin_view.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 
34 34
 $isStudentView  = isset($_REQUEST['isStudentView']) ? (int) $_REQUEST['isStudentView'] : null;
35 35
 $learnpath_id   = (int) $_REQUEST['lp_id'];
36
-$submit			= isset($_POST['submit_button']) ? $_POST['submit_button'] : null;
36
+$submit = isset($_POST['submit_button']) ? $_POST['submit_button'] : null;
37 37
 $_course = api_get_course_info();
38 38
 
39 39
 /* MAIN CODE */
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 }
62 62
 
63 63
 if (!empty($gradebook) && $gradebook == 'view') {
64
-    $interbreadcrumb[] = array (
64
+    $interbreadcrumb[] = array(
65 65
             'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
66 66
             'name' => get_lang('ToolGradebook')
67 67
         );
@@ -99,8 +99,8 @@  discard block
 block discarded – undo
99 99
             $in = implode(',', $lp_items_to_remove_audio);
100 100
         }
101 101
     }
102
-    if (count($lp_items_to_remove_audio)>0) {
103
-        $sql 	= "UPDATE $tbl_lp_item SET audio = '' WHERE c_id = $course_id AND id IN (".$in.")";
102
+    if (count($lp_items_to_remove_audio) > 0) {
103
+        $sql = "UPDATE $tbl_lp_item SET audio = '' WHERE c_id = $course_id AND id IN (".$in.")";
104 104
         $result = Database::query($sql);
105 105
     }
106 106
 
@@ -133,13 +133,13 @@  discard block
 block discarded – undo
133 133
                 // Adding something random to prevent overwriting.
134 134
                 $filename_components[count($filename_components) - 1] = time();
135 135
                 // Reconstructing the new filename.
136
-                $clean_name = implode($filename_components) .'.'.$file_extension;
136
+                $clean_name = implode($filename_components).'.'.$file_extension;
137 137
                 // Using the new name in the $_FILES superglobal.
138 138
                 $_FILES[$key]['name'] = $clean_name;
139 139
             }
140 140
 
141 141
             // Upload the file in the documents tool.
142
-            $file_path = handle_uploaded_document($_course, $_FILES[$key], api_get_path(SYS_COURSE_PATH).$_course['path'].'/document','/audio', api_get_user_id(), '', '', '', '', false);
142
+            $file_path = handle_uploaded_document($_course, $_FILES[$key], api_get_path(SYS_COURSE_PATH).$_course['path'].'/document', '/audio', api_get_user_id(), '', '', '', '', false);
143 143
 
144 144
             // Getting the filename only.
145 145
             $file_components = explode('/', $file_path);
Please login to merge, or discard this patch.
main/newscorm/lp_edit.php 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 }
23 23
 
24 24
 if (!empty($gradebook) && $gradebook == 'view') {
25
-    $interbreadcrumb[] = array (
25
+    $interbreadcrumb[] = array(
26 26
         'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
27 27
         'name' => get_lang('ToolGradebook')
28 28
     );
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 
53 53
 $gradebook = isset($_GET['gradebook']) ? Security::remove_XSS($_GET['gradebook']) : null;
54 54
 
55
-$defaults=array();
55
+$defaults = array();
56 56
 $form = new FormValidator('form1', 'post', 'lp_controller.php');
57 57
 
58 58
 // Form title
@@ -93,10 +93,10 @@  discard block
 block discarded – undo
93 93
 $content_proximity_select->addOption(get_lang('Remote'), 'remote');
94 94
 */
95 95
 //Hide toc frame
96
-$hide_toc_frame = $form->addElement('checkbox', 'hide_toc_frame', null, get_lang('HideTocFrame'),array('onclick' => '$("#lp_layout_column").toggle()' ));
96
+$hide_toc_frame = $form->addElement('checkbox', 'hide_toc_frame', null, get_lang('HideTocFrame'), array('onclick' => '$("#lp_layout_column").toggle()'));
97 97
 if (api_get_setting('allow_course_theme') == 'true') {
98 98
     $mycourselptheme = api_get_course_setting('allow_learning_path_theme');
99
-    if (!empty($mycourselptheme) && $mycourselptheme!=-1 && $mycourselptheme== 1) {
99
+    if (!empty($mycourselptheme) && $mycourselptheme != -1 && $mycourselptheme == 1) {
100 100
         //LP theme picker
101 101
         $theme_select = $form->addElement('SelectTheme', 'lp_theme', get_lang('Theme'));
102 102
         $form->applyFilter('lp_theme', 'trim');
@@ -107,27 +107,27 @@  discard block
 block discarded – undo
107 107
 }
108 108
 
109 109
 // Author
110
-$form->addElement('html_editor', 'lp_author', get_lang('Author'), array('size' => 80), array('ToolbarSet' => 'LearningPathAuthor', 'Width' => '100%', 'Height' => '150px') );
110
+$form->addElement('html_editor', 'lp_author', get_lang('Author'), array('size' => 80), array('ToolbarSet' => 'LearningPathAuthor', 'Width' => '100%', 'Height' => '150px'));
111 111
 $form->applyFilter('lp_author', 'html_filter');
112 112
 
113 113
 // LP image
114 114
 $form->add_progress_bar();
115 115
 if (strlen($_SESSION['oLP']->get_preview_image()) > 0) {
116
-    $show_preview_image='<img src='.api_get_path(WEB_COURSE_PATH).api_get_course_path().'/upload/learning_path/images/'.$_SESSION['oLP']->get_preview_image().'>';
116
+    $show_preview_image = '<img src='.api_get_path(WEB_COURSE_PATH).api_get_course_path().'/upload/learning_path/images/'.$_SESSION['oLP']->get_preview_image().'>';
117 117
     $form->addElement('label', get_lang('ImagePreview'), $show_preview_image);
118 118
     $form->addElement('checkbox', 'remove_picture', null, get_lang('DelImage'));
119 119
 }
120 120
 $label = ($_SESSION['oLP']->get_preview_image() != '' ? get_lang('UpdateImage') : get_lang('AddImage'));
121 121
 $form->addElement('file', 'lp_preview_image', array($label, get_lang('ImageWillResizeMsg')));
122 122
 
123
-$form->addRule('lp_preview_image', get_lang('OnlyImagesAllowed'), 'filetype', array ('jpg', 'jpeg', 'png', 'gif'));
123
+$form->addRule('lp_preview_image', get_lang('OnlyImagesAllowed'), 'filetype', array('jpg', 'jpeg', 'png', 'gif'));
124 124
 
125 125
 // Search terms (only if search is activated).
126 126
 if (api_get_setting('search_enabled') === 'true') {
127 127
     $specific_fields = get_specific_field_list();
128 128
     foreach ($specific_fields as $specific_field) {
129
-        $form -> addElement ('text', $specific_field['code'], $specific_field['name']);
130
-        $filter = array('c_id'=> "'". api_get_course_int_id() ."'", 'field_id' => $specific_field['id'], 'ref_id' => $_SESSION['oLP']->lp_id, 'tool_id' => '\''. TOOL_LEARNPATH .'\'');
129
+        $form -> addElement('text', $specific_field['code'], $specific_field['name']);
130
+        $filter = array('c_id'=> "'".api_get_course_int_id()."'", 'field_id' => $specific_field['id'], 'ref_id' => $_SESSION['oLP']->lp_id, 'tool_id' => '\''.TOOL_LEARNPATH.'\'');
131 131
         $values = get_specific_field_values_list($filter, array('value'));
132 132
         if (!empty($values)) {
133 133
             $arr_str_values = array();
@@ -149,36 +149,36 @@  discard block
 block discarded – undo
149 149
 $publicated_on = $_SESSION['oLP']->publicated_on;
150 150
 
151 151
 // Prerequisites
152
-$form->addElement('html','<div class="form-group">');
152
+$form->addElement('html', '<div class="form-group">');
153 153
 $items = $_SESSION['oLP']->display_lp_prerequisites_list();
154
-$form->addElement('html','<label class="col-md-2">'.get_lang('LearnpathPrerequisites').'</label>');
155
-$form->addElement('html','<div class="col-md-10">');
156
-$form->addElement('html',$items);
154
+$form->addElement('html', '<label class="col-md-2">'.get_lang('LearnpathPrerequisites').'</label>');
155
+$form->addElement('html', '<div class="col-md-10">');
156
+$form->addElement('html', $items);
157 157
 $form->addElement('html', '<div class="help-block">'.get_lang('LpPrerequisiteDescription').'</div></div></div>');
158 158
 
159 159
 //Start date
160
-$form->addElement('checkbox', 'activate_start_date_check', null,get_lang('EnableStartTime'), array('onclick' => 'activate_start_date()'));
160
+$form->addElement('checkbox', 'activate_start_date_check', null, get_lang('EnableStartTime'), array('onclick' => 'activate_start_date()'));
161 161
 $display_date = 'none';
162
-if ($publicated_on!='0000-00-00 00:00:00' && !empty($publicated_on)) {
162
+if ($publicated_on != '0000-00-00 00:00:00' && !empty($publicated_on)) {
163 163
 	$display_date = 'block';
164 164
 	$defaults['activate_start_date_check'] = 1;
165 165
 }
166 166
 
167
-$form->addElement('html','<div id="start_date_div" style="display:'.$display_date.';">');
167
+$form->addElement('html', '<div id="start_date_div" style="display:'.$display_date.';">');
168 168
 $form->addElement('DatePicker', 'publicated_on', get_lang('PublicationDate'));
169
-$form->addElement('html','</div>');
169
+$form->addElement('html', '</div>');
170 170
 
171 171
 //End date
172
-$form->addElement('checkbox', 'activate_end_date_check',  null, get_lang('EnableEndTime'),  array('onclick' => 'activate_end_date()'));
172
+$form->addElement('checkbox', 'activate_end_date_check', null, get_lang('EnableEndTime'), array('onclick' => 'activate_end_date()'));
173 173
 $display_date = 'none';
174
-if ($expired_on!='0000-00-00 00:00:00' && !empty($expired_on)) {
174
+if ($expired_on != '0000-00-00 00:00:00' && !empty($expired_on)) {
175 175
 	$display_date = 'block';
176 176
 	$defaults['activate_end_date_check'] = 1;
177 177
 }
178 178
 
179
-$form->addElement('html','<div id="end_date_div" style="display:'.$display_date.';">');
179
+$form->addElement('html', '<div id="end_date_div" style="display:'.$display_date.';">');
180 180
 $form->addElement('DatePicker', 'expired_on', get_lang('ExpirationDate'));
181
-$form->addElement('html','</div>');
181
+$form->addElement('html', '</div>');
182 182
 
183 183
 if (api_is_platform_admin()) {
184 184
     $form->addElement('checkbox', 'use_max_score', null, get_lang('UseMaxScore100'));
@@ -204,14 +204,14 @@  discard block
 block discarded – undo
204 204
 if ($enableLpExtraFields) {
205 205
     $htmlHeadXtra[] = '<script>
206 206
     $(function() {
207
-        ' . $extra['jquery_ready_content'] . '
207
+        ' . $extra['jquery_ready_content'].'
208 208
     });
209 209
     </script>';
210 210
 }
211 211
 
212 212
 
213
-$defaults['publicated_on']  = ($publicated_on!='0000-00-00 00:00:00' && !empty($publicated_on))? api_get_local_time($publicated_on) : date('Y-m-d 12:00:00');
214
-$defaults['expired_on']     = ($expired_on   !='0000-00-00 00:00:00' && !empty($expired_on) )? api_get_local_time($expired_on): date('Y-m-d 12:00:00',time()+84600);
213
+$defaults['publicated_on']  = ($publicated_on != '0000-00-00 00:00:00' && !empty($publicated_on)) ? api_get_local_time($publicated_on) : date('Y-m-d 12:00:00');
214
+$defaults['expired_on']     = ($expired_on != '0000-00-00 00:00:00' && !empty($expired_on)) ? api_get_local_time($expired_on) : date('Y-m-d 12:00:00', time() + 84600);
215 215
 //$defaults['max_attempts'] = $_SESSION['oLP']->get_max_attempts();
216 216
 $defaults['subscribe_users'] = $_SESSION['oLP']->getSubscribeUsers();
217 217
 $form->setDefaults($defaults);
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
     echo '<div class="col-md-12">';
227 227
     $form -> display();
228 228
     echo '</div>';
229
-} else{
229
+} else {
230 230
     echo '<div class="col-md-8">';
231 231
     $form -> display();
232 232
     echo '</div>';
Please login to merge, or discard this patch.
main/newscorm/scormResource.class.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@
 block discarded – undo
69 69
                         }
70 70
                     }
71 71
                     //$keep_href = '';
72
-                    if ($element->hasAttributes()){ //in some cases we get here with an empty attributes array
72
+                    if ($element->hasAttributes()) { //in some cases we get here with an empty attributes array
73 73
                         // TODO: Find when and why we get such a case (empty array).
74 74
                         $attributes = $element->attributes;
75 75
                         foreach ($attributes as $attrib) {
Please login to merge, or discard this patch.
main/newscorm/lp_ajax_switch_item_toc.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -124,22 +124,22 @@
 block discarded – undo
124 124
     $coreExit = $myLPI->get_core_exit();
125 125
 
126 126
     $return .=
127
-        "olms.lms_lp_id=".$lpId.";" .
128
-        "olms.lms_item_id=".$newItemId.";" .
129
-        "olms.lms_old_item_id=".$oldItemId.";" .
130
-        "olms.lms_initialized=0;" .
131
-        "olms.lms_view_id=".$viewId.";" .
132
-        "olms.lms_user_id=".$userId.";" .
133
-        "olms.next_item=".$newItemId.";" . // This one is very important to replace possible literal strings.
134
-        "olms.lms_next_item=".$nextItemId.";" .
135
-        "olms.lms_previous_item=".$previousItemId.";" .
136
-        "olms.lms_item_type = '".$itemType."';" .
137
-        "olms.lms_item_credit = '".$credit."';" .
138
-        "olms.lms_item_lesson_mode = '".$lessonMode."';" .
139
-        "olms.lms_item_launch_data = '".$launchData."';" .
140
-        "olms.lms_item_interactions_count = '".$interactionsCount."';" .
141
-        "olms.lms_item_objectives_count = '".$objectivesCount."';" .
142
-        "olms.lms_item_core_exit = '".$coreExit."';" .
127
+        "olms.lms_lp_id=".$lpId.";".
128
+        "olms.lms_item_id=".$newItemId.";".
129
+        "olms.lms_old_item_id=".$oldItemId.";".
130
+        "olms.lms_initialized=0;".
131
+        "olms.lms_view_id=".$viewId.";".
132
+        "olms.lms_user_id=".$userId.";".
133
+        "olms.next_item=".$newItemId.";".// This one is very important to replace possible literal strings.
134
+        "olms.lms_next_item=".$nextItemId.";".
135
+        "olms.lms_previous_item=".$previousItemId.";".
136
+        "olms.lms_item_type = '".$itemType."';".
137
+        "olms.lms_item_credit = '".$credit."';".
138
+        "olms.lms_item_lesson_mode = '".$lessonMode."';".
139
+        "olms.lms_item_launch_data = '".$launchData."';".
140
+        "olms.lms_item_interactions_count = '".$interactionsCount."';".
141
+        "olms.lms_item_objectives_count = '".$objectivesCount."';".
142
+        "olms.lms_item_core_exit = '".$coreExit."';".
143 143
         "olms.asset_timer = 0;";
144 144
 
145 145
     $return .= "update_toc('unhighlight','".$currentItem."');".
Please login to merge, or discard this patch.
main/newscorm/download.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 
25 25
 $doc_url = str_replace(array('../', '\\..', '\\0', '..\\'), array('', '', '', ''), $doc_url); //echo $doc_url;
26 26
 
27
-if (strpos($doc_url,'../') OR strpos($doc_url,'/..')) {
27
+if (strpos($doc_url, '../') OR strpos($doc_url, '/..')) {
28 28
     $doc_url = '';
29 29
 }
30 30
 $sys_course_path = api_get_path(SYS_COURSE_PATH).$_course['path'].'/scorm';
@@ -50,5 +50,5 @@  discard block
 block discarded – undo
50 50
     }
51 51
 }
52 52
 
53
-Display::display_error_message(get_lang('ProtectedDocument'));//api_not_allowed backbutton won't work.
53
+Display::display_error_message(get_lang('ProtectedDocument')); //api_not_allowed backbutton won't work.
54 54
 exit;
Please login to merge, or discard this patch.
main/newscorm/aicc_api.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -78,33 +78,33 @@  discard block
 block discarded – undo
78 78
 var commit = false ;
79 79
 
80 80
 // Strictly SCORM variables.
81
-var score=<?php echo $oItem->get_score();?>;
82
-var max=<?php echo $oItem->get_max();?>;
83
-var min=<?php echo $oItem->get_min();?>;
84
-var lesson_status='<?php echo $oItem->get_status();?>';
85
-var session_time='<?php echo $oItem->get_scorm_time('js');?>';
86
-var suspend_data = '<?php echo $oItem->get_suspend_data();?>';
87
-var lesson_location = '<?php echo $oItem->get_lesson_location();?>';
88
-var total_time = '<?php echo $oItem->get_scorm_time('js');?>';
81
+var score=<?php echo $oItem->get_score(); ?>;
82
+var max=<?php echo $oItem->get_max(); ?>;
83
+var min=<?php echo $oItem->get_min(); ?>;
84
+var lesson_status='<?php echo $oItem->get_status(); ?>';
85
+var session_time='<?php echo $oItem->get_scorm_time('js'); ?>';
86
+var suspend_data = '<?php echo $oItem->get_suspend_data(); ?>';
87
+var lesson_location = '<?php echo $oItem->get_lesson_location(); ?>';
88
+var total_time = '<?php echo $oItem->get_scorm_time('js'); ?>';
89 89
 
90 90
 // Chamilo internal variables.
91 91
 var saved_lesson_status = 'not attempted';
92
-var lms_lp_id = <?php echo $oLP->get_id();?>;
93
-var lms_item_id = <?php echo $oItem->get_id();?>;
92
+var lms_lp_id = <?php echo $oLP->get_id(); ?>;
93
+var lms_item_id = <?php echo $oItem->get_id(); ?>;
94 94
 //var lms_new_item_id = 0; //temporary value (only there between a load_item() and a LMSInitialize())
95 95
 var lms_been_synchronized = 0;
96 96
 var lms_initialized = 0;
97 97
 var lms_total_lessons = <?php echo $oLP->get_total_items_count(); ?>;
98
-var lms_complete_lessons = <?php echo $oLP->get_complete_items_count();?>;
99
-var lms_progress_bar_mode = '<?php echo $oLP->progress_bar_mode;?>';
98
+var lms_complete_lessons = <?php echo $oLP->get_complete_items_count(); ?>;
99
+var lms_progress_bar_mode = '<?php echo $oLP->progress_bar_mode; ?>';
100 100
 if(lms_progress_bar_mode == ''){lms_progress_bar_mode='%';}
101
-var lms_view_id = '<?php echo $oLP->get_view();?>';
101
+var lms_view_id = '<?php echo $oLP->get_view(); ?>';
102 102
 if(lms_view_id == ''){ lms_view_id = 1;}
103
-var lms_user_id = '<?php echo $_user['user_id'];?>';
104
-var lms_next_item = '<?php echo $oLP->get_next_item_id();?>';
105
-var lms_previous_item = '<?php echo $oLP->get_previous_item_id();?>';
106
-var lms_lp_type = '<?php echo $oLP->get_type();?>';
107
-var lms_item_type = '<?php echo $oItem->get_type();?>';
103
+var lms_user_id = '<?php echo $_user['user_id']; ?>';
104
+var lms_next_item = '<?php echo $oLP->get_next_item_id(); ?>';
105
+var lms_previous_item = '<?php echo $oLP->get_previous_item_id(); ?>';
106
+var lms_lp_type = '<?php echo $oLP->get_type(); ?>';
107
+var lms_item_type = '<?php echo $oItem->get_type(); ?>';
108 108
 
109 109
 // Backup for old values.
110 110
 var old_score = 0;
@@ -162,11 +162,11 @@  discard block
 block discarded – undo
162 162
     }else if(param == 'cmi.core.lesson_mode'){
163 163
         result='normal';
164 164
     }else if(param == 'cmi.suspend_data'){
165
-        result='<?php echo $oItem->get_suspend_data();?>';
165
+        result='<?php echo $oItem->get_suspend_data(); ?>';
166 166
     }else if(param == 'cmi.launch_data'){
167 167
         result='';
168 168
     }else if(param == 'cmi.objectives._count'){
169
-        result='<?php echo $oItem->get_view_count();?>';
169
+        result='<?php echo $oItem->get_view_count(); ?>';
170 170
     }
171 171
     /*
172 172
     // Switch not working??? WTF???
@@ -227,13 +227,13 @@  discard block
 block discarded – undo
227 227
             result='normal';
228 228
             break;
229 229
         case 'cmi.suspend_data'		:
230
-            result='<?php echo $oItem->get_suspend_data();?>';
230
+            result='<?php echo $oItem->get_suspend_data(); ?>';
231 231
             break;
232 232
         case 'cmi.launch_data'		:
233 233
             result='';
234 234
             break;
235 235
         case 'cmi.objectives._count':
236
-            result='<?php echo $oItem->get_view_count();?>';
236
+            result='<?php echo $oItem->get_view_count(); ?>';
237 237
             break;
238 238
         default 					:
239 239
             result='';
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
     $url = $_SERVER['HTTP_HOST'].$self;
286 286
     $url = substr($url, 0, -14); // 14 is the length of this file's name (/scorm_api.php).
287 287
     echo $url;
288
-    ?>/lp_controller.php?cidReq=<?php echo api_get_course_id();?>&action=save&lp_id=<?php echo $oLP->get_id();?>&" + param + "";
288
+    ?>/lp_controller.php?cidReq=<?php echo api_get_course_id(); ?>&action=save&lp_id=<?php echo $oLP->get_id(); ?>&" + param + "";
289 289
     logit_lms('saving data (status='+lesson_status+')',1);
290 290
     xajax_save_item(lms_lp_id, lms_user_id, lms_view_id, lms_item_id, score, max, min, lesson_status, session_time, suspend_data, lesson_location);
291 291
     //xajax_update_pgs();
Please login to merge, or discard this patch.