Completed
Push — 1.11.x ( 69878b...1da93a )
by José
64:32 queued 39:16
created
main/lp/lp_add_audio.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -16,8 +16,8 @@  discard block
 block discarded – undo
16 16
 
17 17
 $is_allowed_to_edit = api_is_allowed_to_edit(null, true);
18 18
 
19
-$isStudentView = isset($_REQUEST['isStudentView']) ? (int)$_REQUEST['isStudentView'] : null;
20
-$learnpath_id = (int)$_REQUEST['lp_id'];
19
+$isStudentView = isset($_REQUEST['isStudentView']) ? (int) $_REQUEST['isStudentView'] : null;
20
+$learnpath_id = (int) $_REQUEST['lp_id'];
21 21
 $submit = isset($_POST['submit_button']) ? $_POST['submit_button'] : null;
22 22
 
23 23
 $type = isset($_GET['type']) ? $_GET['type'] : null;
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 }
42 42
 
43 43
 if (!empty($gradebook) && $gradebook == 'view') {
44
-    $interbreadcrumb[] = array (
44
+    $interbreadcrumb[] = array(
45 45
         'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
46 46
         'name' => get_lang('ToolGradebook')
47 47
     );
@@ -65,12 +65,12 @@  discard block
 block discarded – undo
65 65
         );
66 66
         break;
67 67
     default:
68
-        $interbreadcrumb[]= array('url' => '#', 'name' => get_lang('NewStep'));
68
+        $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('NewStep'));
69 69
         break;
70 70
 }
71 71
 
72 72
 if ($action == 'add_item' && $type == 'document') {
73
-    $interbreadcrumb[]= array ('url' => '#', 'name' => get_lang('NewDocumentCreated'));
73
+    $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('NewDocumentCreated'));
74 74
 }
75 75
 
76 76
 // Theme calls.
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 $form = new FormValidator(
87 87
     'add_audio',
88 88
     'post',
89
-    api_get_self() . '?action=add_audio&id=' . $lp_item_id . '&' . api_get_cidreq().'&lp_id='.$learnpath_id,
89
+    api_get_self().'?action=add_audio&id='.$lp_item_id.'&'.api_get_cidreq().'&lp_id='.$learnpath_id,
90 90
     null,
91 91
     array('enctype' => 'multipart/form-data')
92 92
 );
@@ -100,8 +100,8 @@  discard block
 block discarded – undo
100 100
     $urlFile = api_get_path(WEB_COURSE_PATH).$courseInfo['path'].'/document/audio/'.$lp_item->audio.'?'.api_get_cidreq();
101 101
 
102 102
     if (!file_exists($file)) {
103
-        $file = api_get_path(SYS_COURSE_PATH).$courseInfo['path'].'/document'.$lpPathInfo['dir'] . '/' . $lp_item->audio;
104
-        $urlFile = api_get_path(WEB_COURSE_PATH).$courseInfo['path'].'/document'.$lpPathInfo['dir'] . '/' . $lp_item->audio.'?'.api_get_cidreq();
103
+        $file = api_get_path(SYS_COURSE_PATH).$courseInfo['path'].'/document'.$lpPathInfo['dir'].'/'.$lp_item->audio;
104
+        $urlFile = api_get_path(WEB_COURSE_PATH).$courseInfo['path'].'/document'.$lpPathInfo['dir'].'/'.$lp_item->audio.'?'.api_get_cidreq();
105 105
     }
106 106
 }
107 107
 
@@ -117,10 +117,10 @@  discard block
 block discarded – undo
117 117
 
118 118
 $page .= '<div id="doc_form" class="col-md-8">';
119 119
 
120
-$htmlHeadXtra[] = '<script src="' . api_get_path(WEB_LIBRARY_JS_PATH) . 'rtc/RecordRTC.js"></script>';
121
-$htmlHeadXtra[] = '<script src="' . api_get_path(WEB_LIBRARY_PATH) . 'wami-recorder/recorder.js"></script>';
122
-$htmlHeadXtra[] = '<script src="' . api_get_path(WEB_LIBRARY_PATH) . 'wami-recorder/gui.js"></script>';
123
-$htmlHeadXtra[] = '<script type="text/javascript" src="' . api_get_path(WEB_LIBRARY_PATH) . 'swfobject/swfobject.js"></script>';
120
+$htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_JS_PATH).'rtc/RecordRTC.js"></script>';
121
+$htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'wami-recorder/recorder.js"></script>';
122
+$htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'wami-recorder/gui.js"></script>';
123
+$htmlHeadXtra[] = '<script type="text/javascript" src="'.api_get_path(WEB_LIBRARY_PATH).'swfobject/swfobject.js"></script>';
124 124
 
125 125
 $tpl = new Template(null);
126 126
 $tpl->assign('unique_file_id', api_get_unique_id());
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
         Display::getMediaPlayer($file, array('url' => $urlFile)).
142 142
         "</div>";
143 143
     $form->addElement('label', get_lang('Listen'), $audioPlayer);
144
-    $url = api_get_path(WEB_CODE_PATH) . 'lp/lp_controller.php?lp_id='.$_SESSION['oLP']->get_id().'&action=add_audio&id='.$lp_item_id.'&delete_file=1&'.api_get_cidreq();
144
+    $url = api_get_path(WEB_CODE_PATH).'lp/lp_controller.php?lp_id='.$_SESSION['oLP']->get_id().'&action=add_audio&id='.$lp_item_id.'&delete_file=1&'.api_get_cidreq();
145 145
     $form->addElement('label', null, Display::url(get_lang('RemoveAudio'), $url, array('class' => 'btn btn-danger')));
146 146
 } else {
147 147
     $form->addElement('file', 'file');
Please login to merge, or discard this patch.
main/lp/openoffice_document.class.php 3 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@
 block discarded – undo
49 49
         // Create the directory
50 50
         $result = $this->generate_lp_folder($_course, $this->file_name);
51 51
 
52
-         // Create the directory
52
+            // Create the directory
53 53
         $this->base_work_dir = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document';
54 54
         ///learning_path/ppt_dirname directory
55 55
         $this->created_dir = substr($result['dir'], 0, strlen($result['dir']) -1);
Please login to merge, or discard this patch.
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -186,9 +186,9 @@
 block discarded – undo
186 186
 
187 187
     /**
188 188
      * Get images files from remote host (with webservices)
189
-     * @param   array $file current ppt file details
189
+     * @param   string $file current ppt file details
190 190
      * @param   string  $size The expected final size of the rendered slides
191
-     * @return  array images files
191
+     * @return  string images files
192 192
      */
193 193
     private function _get_remote_ppt2lp_files($file, $size = null)
194 194
     {
Please login to merge, or discard this patch.
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -58,9 +58,9 @@  discard block
 block discarded – undo
58 58
         ///learning_path/ppt_dirname directory
59 59
         $this->created_dir = $result['dir'];
60 60
         if (substr($this->created_dir, -1, 1) == '/') {
61
-            $this->file_path = $this->created_dir . api_replace_dangerous_char($file['name']);
61
+            $this->file_path = $this->created_dir.api_replace_dangerous_char($file['name']);
62 62
         } else {
63
-            $this->file_path = $this->created_dir . '/' . api_replace_dangerous_char($file['name']);
63
+            $this->file_path = $this->created_dir.'/'.api_replace_dangerous_char($file['name']);
64 64
         }
65 65
 
66 66
         //var_dump($this->file_name, $this->file_path, $this->base_work_dir, $this->created_dir);
@@ -104,18 +104,18 @@  discard block
 block discarded – undo
104 104
             $perm = api_get_setting('permissions_for_new_files');
105 105
 
106 106
             if (IS_WINDOWS_OS) { // IS_WINDOWS_OS has been defined in main_api.lib.php
107
-                $converter_path = str_replace('/', '\\', api_get_path(SYS_PATH) . 'main/inc/lib/ppt2png');
108
-                $class_path = $converter_path . ';' . $converter_path . '/jodconverter-2.2.2.jar;' . $converter_path . '/jodconverter-cli-2.2.2.jar';
107
+                $converter_path = str_replace('/', '\\', api_get_path(SYS_PATH).'main/inc/lib/ppt2png');
108
+                $class_path = $converter_path.';'.$converter_path.'/jodconverter-2.2.2.jar;'.$converter_path.'/jodconverter-cli-2.2.2.jar';
109 109
                 //$cmd = 'java -cp "'.$class_path.'" DokeosConverter';
110
-                $cmd = 'java -Dfile.encoding=UTF-8 -cp "' . $class_path . '" DokeosConverter';
110
+                $cmd = 'java -Dfile.encoding=UTF-8 -cp "'.$class_path.'" DokeosConverter';
111 111
             } else {
112
-                $converter_path = api_get_path(SYS_PATH) . 'main/inc/lib/ppt2png';
112
+                $converter_path = api_get_path(SYS_PATH).'main/inc/lib/ppt2png';
113 113
                 //$class_path = '-cp .:jodconverter-2.2.1.jar:jodconverter-cli-2.2.1.jar';
114 114
                 $class_path = ' -Dfile.encoding=UTF-8 -cp .:jodconverter-2.2.2.jar:jodconverter-cli-2.2.2.jar';
115
-                $cmd = 'cd ' . $converter_path . ' && java ' . $class_path . ' DokeosConverter';
115
+                $cmd = 'cd '.$converter_path.' && java '.$class_path.' DokeosConverter';
116 116
             }
117 117
 
118
-            $cmd .= ' -p ' . api_get_setting('service_ppt2lp', 'port');
118
+            $cmd .= ' -p '.api_get_setting('service_ppt2lp', 'port');
119 119
             // Call to the function implemented by child.
120 120
             $cmd .= $this->add_command_parameters();
121 121
             // To allow openoffice to manipulate docs.
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
             @chmod($this->base_work_dir.$this->file_path, 0777);
125 125
 
126 126
             $locale = $this->original_locale; // TODO: Improve it because we're not sure this locale is present everywhere.
127
-            putenv('LC_ALL=' . $locale);
127
+            putenv('LC_ALL='.$locale);
128 128
 
129 129
             $files = array();
130 130
             $return = 0;
@@ -150,12 +150,12 @@  discard block
 block discarded – undo
150 150
             $result = $this->_get_remote_ppt2lp_files($file, $size);
151 151
             $result = unserialize($result);
152 152
             // Save remote images to server
153
-            chmod($this->base_work_dir . $this->created_dir, api_get_permissions_for_new_directories());
153
+            chmod($this->base_work_dir.$this->created_dir, api_get_permissions_for_new_directories());
154 154
             if (!empty($result['images'])) {
155 155
                 foreach ($result['images'] as $image => $img_data) {
156 156
                     $image_path = $this->base_work_dir.$this->created_dir;
157
-                    @file_put_contents($image_path . '/' . $image, base64_decode($img_data));
158
-                    @chmod($image_path . '/' . $image, 0777);
157
+                    @file_put_contents($image_path.'/'.$image, base64_decode($img_data));
158
+                    @chmod($image_path.'/'.$image, 0777);
159 159
                 }
160 160
             }
161 161
 
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
         $uri = '';
200 200
         $result = preg_match('/^([a-zA-Z0-9]*):\/\/([^\/]*)\//', $ppt2lp_host, $matches);
201 201
         if ($result) {
202
-            $uri = $matches[1] . '://' . $matches[2] . '/';
202
+            $uri = $matches[1].'://'.$matches[2].'/';
203 203
         } else {
204 204
             $uri = $ppt2lp_host;
205 205
         }
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
             'compression' => SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP | 9,
219 219
         );
220 220
         if (substr($ppt2lp_host, 0, 5) === 'https') {
221
-            $options['ssl_method'] =  SOAP_SSL_METHOD_TLS;
221
+            $options['ssl_method'] = SOAP_SSL_METHOD_TLS;
222 222
         }
223 223
         $client = new SoapClient(null, $options);
224 224
         $result = '';
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
             //error_log('['.time().'] Calling wsConvertPpt webservice on ' . $ppt2lp_host);
240 240
             $result = $client->__call('wsConvertPpt', array('pptData' => $params));
241 241
         } catch (Exception $e) {
242
-            error_log('['.time().'] Chamilo SOAP call error: ' . $e->getMessage());
242
+            error_log('['.time().'] Chamilo SOAP call error: '.$e->getMessage());
243 243
         }
244 244
         // Make sure we destroy the SOAP client as it may generate SSL connection
245 245
         // binding issue (if using SSL)
@@ -272,38 +272,38 @@  discard block
 block discarded – undo
272 272
         $ppt2lpHost = api_get_setting('service_ppt2lp', 'host');
273 273
         $permissionFile = api_get_permissions_for_new_files();
274 274
         $permissionFolder = api_get_permissions_for_new_directories();
275
-        if (file_exists($this->base_work_dir . '/' . $this->created_dir)) {
275
+        if (file_exists($this->base_work_dir.'/'.$this->created_dir)) {
276 276
 
277 277
             return $ids;
278 278
         }
279 279
 
280 280
         if ($ppt2lpHost == 'localhost') {
281 281
             if (IS_WINDOWS_OS) { // IS_WINDOWS_OS has been defined in main_api.lib.php
282
-                $converterPath = str_replace('/', '\\', api_get_path(SYS_PATH) . 'main/inc/lib/ppt2png');
283
-                $classPath = $converterPath . ';' . $converterPath . '/jodconverter-2.2.2.jar;' . $converterPath . '/jodconverter-cli-2.2.2.jar';
284
-                $cmd = 'java -Dfile.encoding=UTF-8 -jar "' . $classPath . '/jodconverter-2.2.2.jar"';
282
+                $converterPath = str_replace('/', '\\', api_get_path(SYS_PATH).'main/inc/lib/ppt2png');
283
+                $classPath = $converterPath.';'.$converterPath.'/jodconverter-2.2.2.jar;'.$converterPath.'/jodconverter-cli-2.2.2.jar';
284
+                $cmd = 'java -Dfile.encoding=UTF-8 -jar "'.$classPath.'/jodconverter-2.2.2.jar"';
285 285
             } else {
286
-                $converterPath = api_get_path(SYS_PATH) . 'main/inc/lib/ppt2png';
286
+                $converterPath = api_get_path(SYS_PATH).'main/inc/lib/ppt2png';
287 287
                 $classPath = ' -Dfile.encoding=UTF-8 -jar jodconverter-cli-2.2.2.jar';
288
-                $cmd = 'cd ' . $converterPath . ' && java ' . $classPath . ' ';
288
+                $cmd = 'cd '.$converterPath.' && java '.$classPath.' ';
289 289
             }
290 290
 
291
-            $cmd .= ' -p ' . api_get_setting('service_ppt2lp', 'port');
291
+            $cmd .= ' -p '.api_get_setting('service_ppt2lp', 'port');
292 292
             // Call to the function implemented by child.
293
-            $cmd .= ' "' . $this->base_work_dir . '/' . $this->file_path . '"  "' . $this->base_work_dir . '/' . $this->created_dir . '"';
293
+            $cmd .= ' "'.$this->base_work_dir.'/'.$this->file_path.'"  "'.$this->base_work_dir.'/'.$this->created_dir.'"';
294 294
             // To allow openoffice to manipulate docs.
295 295
             @chmod($this->base_work_dir, $permissionFolder);
296
-            @chmod($this->base_work_dir . '/' . $this->file_path, $permissionFile);
296
+            @chmod($this->base_work_dir.'/'.$this->file_path, $permissionFile);
297 297
 
298 298
             $locale = $this->original_locale; // TODO: Improve it because we're not sure this locale is present everywhere.
299
-            putenv('LC_ALL=' . $locale);
299
+            putenv('LC_ALL='.$locale);
300 300
 
301 301
             $files = array();
302 302
             $return = 0;
303 303
             $shell = exec($cmd, $files, $return);
304 304
             // TODO: Chown is not working, root keep user privileges, should be www-data
305
-            @chown($this->base_work_dir . '/' . $this->created_dir, 'www-data');
306
-            @chmod($this->base_work_dir . '/' . $this->created_dir, $permissionFile);
305
+            @chown($this->base_work_dir.'/'.$this->created_dir, 'www-data');
306
+            @chmod($this->base_work_dir.'/'.$this->created_dir, $permissionFile);
307 307
 
308 308
             if ($return != 0) { // If the java application returns an error code.
309 309
                 switch ($return) {
@@ -342,14 +342,14 @@  discard block
 block discarded – undo
342 342
             */
343 343
         }
344 344
 
345
-        if (file_exists($this->base_work_dir . '/' . $this->created_dir)) {
345
+        if (file_exists($this->base_work_dir.'/'.$this->created_dir)) {
346 346
 
347 347
             // Register Files to Document tool
348 348
             $ids[] = add_document(
349 349
                 $_course,
350
-                '/' . $this->created_dir,
350
+                '/'.$this->created_dir,
351 351
                 'file',
352
-                filesize($this->base_work_dir . '/' . $this->created_dir),
352
+                filesize($this->base_work_dir.'/'.$this->created_dir),
353 353
                 $convertedTitle,
354 354
                 sprintf(
355 355
                     get_lang('FileConvertedFromXToY'),
Please login to merge, or discard this patch.
main/lp/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/gradebook/exercise_jump.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 $doExerciseUrl = '';
23 23
 
24 24
 if (isset($_GET['doexercise'])) {
25
-    $doExerciseUrl = api_get_path(WEB_CODE_PATH) . 'exercise/overview.php?' . http_build_query([
25
+    $doExerciseUrl = api_get_path(WEB_CODE_PATH).'exercise/overview.php?'.http_build_query([
26 26
         'session_id' => $session_id,
27 27
         'cidReq' => $cidReq,
28 28
         'gradebook' => $gradebook,
@@ -35,14 +35,14 @@  discard block
 block discarded – undo
35 35
 
36 36
 // no support for hot potatoes
37 37
 if ($type == LINK_HOTPOTATOES) {
38
-    $doExerciseUrl = api_get_path(WEB_CODE_PATH) . 'exercise/exercice.php?session_id='.$session_id.'&cidReq='.Security::remove_XSS($cidReq);
38
+    $doExerciseUrl = api_get_path(WEB_CODE_PATH).'exercise/exercice.php?session_id='.$session_id.'&cidReq='.Security::remove_XSS($cidReq);
39 39
 }
40 40
 
41 41
 if (isset($_GET['doexercise'])) {
42 42
     header('Location: '.$doExerciseUrl);
43 43
     exit;
44 44
 } else {
45
-    $url = api_get_path(WEB_CODE_PATH) . 'exercise/overview.php?session_id='.$session_id.'&cidReq='.Security::remove_XSS($cidReq);
45
+    $url = api_get_path(WEB_CODE_PATH).'exercise/overview.php?session_id='.$session_id.'&cidReq='.Security::remove_XSS($cidReq);
46 46
     if (isset($_GET['gradebook'])) {
47 47
         $url .= '&gradebook=view&exerciseId='.intval($_GET['exerciseId']);
48 48
 
@@ -58,11 +58,11 @@  discard block
 block discarded – undo
58 58
                         // If the exercise was added once redirect to the LP
59 59
                         $firstLp = current($exercise->lpList);
60 60
                         if (isset($firstLp['lp_id'])) {
61
-                            $url = api_get_path(WEB_CODE_PATH) . 'lp/lp_controller.php?' . api_get_cidreq() . '&lp_id=' . $firstLp['lp_id'] . '&action=view&isStudentView=true';
61
+                            $url = api_get_path(WEB_CODE_PATH).'lp/lp_controller.php?'.api_get_cidreq().'&lp_id='.$firstLp['lp_id'].'&action=view&isStudentView=true';
62 62
                         }
63 63
                     } else {
64 64
                         // If the exercise was added multiple times show the LP list
65
-                        $url = api_get_path(WEB_CODE_PATH) . 'lp/lp_controller.php?' . api_get_cidreq().'&action=list';
65
+                        $url = api_get_path(WEB_CODE_PATH).'lp/lp_controller.php?'.api_get_cidreq().'&action=list';
66 66
                     }
67 67
                 }
68 68
             }
Please login to merge, or discard this patch.
main/upload/form.document.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -12,8 +12,8 @@  discard block
 block discarded – undo
12 12
  */
13 13
 $noPHP_SELF = false;
14 14
 $nameTools = get_lang('FileUpload');
15
-$interbreadcrumb[]= array ("url"=>"../lp/lp_controller.php?action=list", "name"=> get_lang(TOOL_DOCUMENT));
16
-Display::display_header($nameTools,"Doc");
15
+$interbreadcrumb[] = array("url"=>"../lp/lp_controller.php?action=list", "name"=> get_lang(TOOL_DOCUMENT));
16
+Display::display_header($nameTools, "Doc");
17 17
 //show the title
18 18
 api_display_tool_title($nameTools.$add_group_to_title);
19 19
 ?>
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 <div id="dynamic_div" style="display:block;margin-left:40%;margin-top:10px;height:50px;">
22 22
 </div>
23 23
 <div id="upload_form_div" name="form_div" style="display:block;">
24
-	<form method="POST" action="upload.php" id="upload_form" enctype="multipart/form-data" onsubmit="javascript: myUpload.start('dynamic_div','progressbar_green.gif','<?php echo(get_lang('Uploading', ''));?>','upload_form_div');">
24
+	<form method="POST" action="upload.php" id="upload_form" enctype="multipart/form-data" onsubmit="javascript: myUpload.start('dynamic_div','progressbar_green.gif','<?php echo(get_lang('Uploading', '')); ?>','upload_form_div');">
25 25
 		<input type="hidden" name="curdirpath" value="<?php echo $path; ?>">
26 26
 		<input type="hidden" name="tool" value="<?php echo $my_tool; ?>">
27 27
 		<input type="file" name="user_file">
Please login to merge, or discard this patch.
main/inc/lib/search/tool_processors/learnpath_processor.class.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -8,9 +8,9 @@  discard block
 block discarded – undo
8 8
 /**
9 9
  * Code
10 10
  */
11
-include_once dirname(__FILE__) . '/../../../global.inc.php';
12
-require_once dirname(__FILE__) . '/search_processor.class.php';
13
-require_once dirname(__FILE__) . '/../IndexableChunk.class.php';
11
+include_once dirname(__FILE__).'/../../../global.inc.php';
12
+require_once dirname(__FILE__).'/search_processor.class.php';
13
+require_once dirname(__FILE__).'/../IndexableChunk.class.php';
14 14
 
15 15
 /**
16 16
  * Process learning paths before pass it to search listing scripts
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
                     $visibility = api_get_item_visibility(api_get_course_info($courseid), TOOL_LEARNPATH, $lp_id);
53 53
                     if ($visibility) {
54 54
                         list($thumbnail, $image, $name, $author) = $this->get_information($courseid, $lp_id, $lp['has_document_id']);
55
-                        $url = api_get_path(WEB_CODE_PATH) . 'lp/lp_controller.php?cidReq=%s&action=view&lp_id=%s';
55
+                        $url = api_get_path(WEB_CODE_PATH).'lp/lp_controller.php?cidReq=%s&action=view&lp_id=%s';
56 56
                         $url = sprintf($url, $courseid, $lp_id);
57 57
                         $result = array(
58 58
                             'toolid' => TOOL_LEARNPATH,
@@ -128,16 +128,16 @@  discard block
 block discarded – undo
128 128
             $name = '';
129 129
             if ($row = Database::fetch_array($dk_result)) {
130 130
                 // Get the image path
131
-                $img_location = api_get_path(WEB_COURSE_PATH) . $course_path . "/document/";
131
+                $img_location = api_get_path(WEB_COURSE_PATH).$course_path."/document/";
132 132
                 $thumbnail_path = str_replace('.png.html', '_thumb.png', $row['path']);
133 133
                 $big_img_path = str_replace('.png.html', '.png', $row['path']);
134 134
                 $thumbnail = '';
135 135
                 if (!empty($thumbnail_path)) {
136
-                    $thumbnail = $img_location . $thumbnail_path;
136
+                    $thumbnail = $img_location.$thumbnail_path;
137 137
                 }
138 138
                 $image = '';
139 139
                 if (!empty($big_img_path)) {
140
-                    $image = $img_location . $big_img_path;
140
+                    $image = $img_location.$big_img_path;
141 141
                 }
142 142
                 $name = $row['name'];
143 143
             }
Please login to merge, or discard this patch.
main/gamification/my_progress.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
     $UserIsSubscribedToSession = SessionManager::isUserSubscribedAsStudent($lastSessionId, $user->getId());
43 43
 
44 44
     if (!empty($lastSessionId) && $UserIsSubscribedToSession) {
45
-        $urlWithSession = api_get_self() . '?' . http_build_query([
45
+        $urlWithSession = api_get_self().'?'.http_build_query([
46 46
             'session_id' => $lastCourseAccess->getSessionId()
47 47
         ]);
48 48
 
@@ -116,13 +116,13 @@  discard block
 block discarded – undo
116 116
         foreach ($learningPathList->list as $learningPathId => $learningPath) {
117 117
             $courseData['stats'][] = [
118 118
                 $learningPath['lp_name'],
119
-                'lp/lp_controller.php?' . http_build_query([
119
+                'lp/lp_controller.php?'.http_build_query([
120 120
                     'action' => 'stats',
121 121
                     'cidReq' => $course->getCode(),
122 122
                     'id_session' => $currentSession->getId(),
123 123
                     'gidReq' => 0,
124 124
                     'lp_id' => $learningPathId
125
-                ]) . api_get_cidreq()
125
+                ]).api_get_cidreq()
126 126
             ];
127 127
         }
128 128
 
Please login to merge, or discard this patch.
main/search/search_suggestions.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
  * @package chamilo.search
7 7
  */
8 8
 
9
-require_once dirname(__FILE__) . '/../inc/global.inc.php';
9
+require_once dirname(__FILE__).'/../inc/global.inc.php';
10 10
 
11 11
 function get_suggestions_from_search_engine($q)
12 12
 {
@@ -27,13 +27,13 @@  discard block
 block discarded – undo
27 27
     $i = 0;
28 28
     while ($row = Database::fetch_array($sql_result)) {
29 29
         $json[] = [
30
-            'id' => api_convert_encoding($row['value'],'UTF-8',$charset),
31
-            'value' => api_convert_encoding($row['value'],'UTF-8',$charset),
32
-            'label' => api_convert_encoding($row['value'],'UTF-8',$charset)
30
+            'id' => api_convert_encoding($row['value'], 'UTF-8', $charset),
31
+            'value' => api_convert_encoding($row['value'], 'UTF-8', $charset),
32
+            'label' => api_convert_encoding($row['value'], 'UTF-8', $charset)
33 33
         ];
34 34
 
35
-        if ($i<20) {
36
-            $data[ $row['course_code'] ] [ $row['tool_id'] ] [ $row['ref_id'] ] = 1;
35
+        if ($i < 20) {
36
+            $data[$row['course_code']] [$row['tool_id']] [$row['ref_id']] = 1;
37 37
         }
38 38
         $i++;
39 39
     }
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
                     }
96 96
                 }
97 97
                 foreach ($output as $i=>$out) {
98
-                    if (api_stristr($out,$q) === false) {continue;}
98
+                    if (api_stristr($out, $q) === false) {continue; }
99 99
                     $s = api_convert_encoding(substr($out, 0, -3), 'UTF-8', $charset);
100 100
                     if (!in_array($s, $more_sugg)) {
101 101
                         $more_sugg[] = $s;
Please login to merge, or discard this patch.
main/gradebook/gradebook_add_user.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -18,8 +18,8 @@  discard block
 block discarded – undo
18 18
 $newstudents = $evaluation[0]->get_not_subscribed_students();
19 19
 
20 20
 if (count($newstudents) == '0') {
21
-	header('Location: gradebook_view_result.php?nouser=&selecteval=' . Security::remove_XSS($_GET['selecteval']).'&'.api_get_cidreq());
22
-	exit;
21
+    header('Location: gradebook_view_result.php?nouser=&selecteval=' . Security::remove_XSS($_GET['selecteval']).'&'.api_get_cidreq());
22
+    exit;
23 23
 }
24 24
 $add_user_form = new EvalForm(
25 25
     EvalForm :: TYPE_ADD_USERS_TO_EVAL,
@@ -67,12 +67,12 @@  discard block
 block discarded – undo
67 67
 
68 68
 $interbreadcrumb[]= array ('url' => Security::remove_XSS($_SESSION['gradebook_dest']),'name' => get_lang('Gradebook'));
69 69
 $interbreadcrumb[]= array(
70
-	'url' => 'gradebook_view_result.php?selecteval=' .Security::remove_XSS($_GET['selecteval']).'&'.api_get_cidreq(),
71
-	'name' => get_lang('ViewResult')
70
+    'url' => 'gradebook_view_result.php?selecteval=' .Security::remove_XSS($_GET['selecteval']).'&'.api_get_cidreq(),
71
+    'name' => get_lang('ViewResult')
72 72
 );
73 73
 Display :: display_header(get_lang('AddUserToEval'));
74 74
 if (isset ($_GET['erroroneuser'])){
75
-	Display :: display_warning_message(get_lang('AtLeastOneUser'),false);
75
+    Display :: display_warning_message(get_lang('AtLeastOneUser'),false);
76 76
 }
77 77
 DisplayGradebook :: display_header_result($evaluation[0], null, 0,0);
78 78
 echo '<div class="main">';
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -14,11 +14,11 @@  discard block
 block discarded – undo
14 14
 api_block_anonymous_users();
15 15
 GradebookUtils::block_students();
16 16
 
17
-$evaluation= Evaluation :: load($_GET['selecteval']);
17
+$evaluation = Evaluation :: load($_GET['selecteval']);
18 18
 $newstudents = $evaluation[0]->get_not_subscribed_students();
19 19
 
20 20
 if (count($newstudents) == '0') {
21
-	header('Location: gradebook_view_result.php?nouser=&selecteval=' . Security::remove_XSS($_GET['selecteval']).'&'.api_get_cidreq());
21
+	header('Location: gradebook_view_result.php?nouser=&selecteval='.Security::remove_XSS($_GET['selecteval']).'&'.api_get_cidreq());
22 22
 	exit;
23 23
 }
24 24
 $add_user_form = new EvalForm(
@@ -65,16 +65,16 @@  discard block
 block discarded – undo
65 65
     }
66 66
 }
67 67
 
68
-$interbreadcrumb[]= array ('url' => Security::remove_XSS($_SESSION['gradebook_dest']),'name' => get_lang('Gradebook'));
69
-$interbreadcrumb[]= array(
70
-	'url' => 'gradebook_view_result.php?selecteval=' .Security::remove_XSS($_GET['selecteval']).'&'.api_get_cidreq(),
68
+$interbreadcrumb[] = array('url' => Security::remove_XSS($_SESSION['gradebook_dest']), 'name' => get_lang('Gradebook'));
69
+$interbreadcrumb[] = array(
70
+	'url' => 'gradebook_view_result.php?selecteval='.Security::remove_XSS($_GET['selecteval']).'&'.api_get_cidreq(),
71 71
 	'name' => get_lang('ViewResult')
72 72
 );
73 73
 Display :: display_header(get_lang('AddUserToEval'));
74
-if (isset ($_GET['erroroneuser'])){
75
-	Display :: display_warning_message(get_lang('AtLeastOneUser'),false);
74
+if (isset ($_GET['erroroneuser'])) {
75
+	Display :: display_warning_message(get_lang('AtLeastOneUser'), false);
76 76
 }
77
-DisplayGradebook :: display_header_result($evaluation[0], null, 0,0);
77
+DisplayGradebook :: display_header_result($evaluation[0], null, 0, 0);
78 78
 echo '<div class="main">';
79 79
 echo $add_user_form->toHtml();
80 80
 echo '</div>';
Please login to merge, or discard this patch.