Completed
Pull Request — 1.11.x (#1421)
by José
46:34 queued 10:32
created
main/lp/aicc_hacp.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 //$_user							= $_SESSION['_user'];
56 56
 $file = $_SESSION['file'];
57 57
 $oLP = unserialize($_SESSION['lpobject']);
58
-$oItem =& $oLP->items[$oLP->current];
58
+$oItem = & $oLP->items[$oLP->current];
59 59
 if (!is_object($oItem)) {
60 60
     error_log('New LP - aicc_hacp - Could not load oItem item', 0);
61 61
     exit;
@@ -69,8 +69,8 @@  discard block
 block discarded – undo
69 69
     'evaluation' => array(),
70 70
     'student_data' => array(),
71 71
 );
72
-$convert_enc = array('%25','%0D','%0A','%09','%20','%2D','%2F','%3B','%3F','%7B','%7D','%7C','%5C','%5E','%7E','%5B','%5D','%60','%23','%3E','%3C','%22');
73
-$convert_dec = array('%',"\r","\n","\t",' ','-','/',';','?','{','}','|','\\','^','~','[',']','`','#','>','<','"');
72
+$convert_enc = array('%25', '%0D', '%0A', '%09', '%20', '%2D', '%2F', '%3B', '%3F', '%7B', '%7D', '%7C', '%5C', '%5E', '%7E', '%5B', '%5D', '%60', '%23', '%3E', '%3C', '%22');
73
+$convert_dec = array('%', "\r", "\n", "\t", ' ', '-', '/', ';', '?', '{', '}', '|', '\\', '^', '~', '[', ']', '`', '#', '>', '<', '"');
74 74
 $crlf = "\r\n";
75 75
 //$tab = "\t";
76 76
 $tab = "";
Please login to merge, or discard this patch.
main/lp/scormMetadata.class.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -88,7 +88,7 @@
 block discarded – undo
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
                          }
Please login to merge, or discard this patch.
main/lp/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/lp/lp_view_item.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 if (isset($_GET['lp_item_id'])) {
21 21
 
22 22
     // Get parameter only came from lp_view.php.
23
-    $lp_item_id  = intval($_GET['lp_item_id']);
23
+    $lp_item_id = intval($_GET['lp_item_id']);
24 24
     if (isset($_SESSION['lpobject'])) {
25 25
         $oLP = unserialize($_SESSION['lpobject']);
26 26
     }
@@ -73,13 +73,13 @@  discard block
 block discarded – undo
73 73
 
74 74
 $course_id = api_get_course_int_id();
75 75
 $sql_query = "SELECT * FROM $tbl_lp WHERE c_id = $course_id AND id = $learnpath_id";
76
-$result=Database::query($sql_query);
76
+$result = Database::query($sql_query);
77 77
 $therow = Database::fetch_array($result);
78 78
 
79 79
 /* SHOWING THE ADMIN TOOLS	*/
80 80
 
81 81
 if (api_is_in_gradebook()) {
82
-    $interbreadcrumb[] = array (
82
+    $interbreadcrumb[] = array(
83 83
         'url' => api_get_path(WEB_CODE_PATH).'gradebook/index.php?'.api_get_cidreq(),
84 84
         'name' => get_lang('ToolGradebook')
85 85
     );
Please login to merge, or discard this patch.
main/lp/lp_ajax_switch_item.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -198,7 +198,7 @@
 block discarded – undo
198 198
         //"lms_progress_bar_mode='".$myprogress_mode."';" .
199 199
         "olms.lms_view_id=".$view_id.";".
200 200
         "olms.lms_user_id=".$user_id.";".
201
-        "olms.next_item=".$new_item_id.";". // This one is very important to replace possible literal strings.
201
+        "olms.next_item=".$new_item_id.";".// This one is very important to replace possible literal strings.
202 202
         "olms.lms_next_item=".$mynext.";".
203 203
         "olms.lms_previous_item=".$myprevious.";".
204 204
         "olms.lms_item_type = '".$myitemtype."';".
Please login to merge, or discard this patch.
main/lp/lp_edit_item.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 }
100 100
 
101 101
 if (!empty($gradebook) && $gradebook == 'view') {
102
-    $interbreadcrumb[] = array (
102
+    $interbreadcrumb[] = array(
103 103
         'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
104 104
         'name' => get_lang('ToolGradebook')
105 105
     );
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 $show_learn_path = true;
113 113
 $lp_theme_css = $_SESSION['oLP']->get_theme();
114 114
 
115
-Display::display_header(get_lang('Edit'),'Path');
115
+Display::display_header(get_lang('Edit'), 'Path');
116 116
 $suredel = trim(get_lang('AreYouSureToDeleteJS'));
117 117
 
118 118
 ?>
@@ -165,8 +165,8 @@  discard block
 block discarded – undo
165 165
 $path_item = isset($_GET['path_item']) ? $_GET['path_item'] : 0;
166 166
 $path_item = Database::escape_string($path_item);
167 167
 $tbl_doc = Database :: get_course_table(TABLE_DOCUMENT);
168
-$sql_doc = "SELECT path FROM " . $tbl_doc . "
169
-            WHERE c_id = $course_id AND id = '". $path_item."' ";
168
+$sql_doc = "SELECT path FROM ".$tbl_doc."
169
+            WHERE c_id = $course_id AND id = '".$path_item."' ";
170 170
 
171 171
 $res_doc = Database::query($sql_doc);
172 172
 $path_file = Database::result($res_doc, 0, 0);
Please login to merge, or discard this patch.
main/lp/lp_impress.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
Please login to merge, or discard this patch.
main/lp/lp_ajax_save_objectives.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -28,10 +28,10 @@
 block discarded – undo
28 28
         error_log('In xajax_save_objectives('.$lp_id.','.$user_id.','.$view_id.','.$item_id.',"'.(count($objectives) > 0 ? count($objectives) : '').'")', 0);
29 29
     }
30 30
     $mylp = learnpath::getLpFromSession(api_get_course_id(), $lp_id, $user_id);
31
-    $mylpi =& $mylp->items[$item_id];
32
-    if (is_array($objectives) && count($objectives)>0){
33
-        foreach ($objectives as $index=>$objective){
34
-            $mylpi->add_objective($index,$objectives[$index]);
31
+    $mylpi = & $mylp->items[$item_id];
32
+    if (is_array($objectives) && count($objectives) > 0) {
33
+        foreach ($objectives as $index=>$objective) {
34
+            $mylpi->add_objective($index, $objectives[$index]);
35 35
         }
36 36
         $mylpi->write_objectives_to_db();
37 37
     }
Please login to merge, or discard this patch.
main/lp/openoffice_text_document.class.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
         $intro_content = api_substr($content, 0, api_strpos($content, $matches[0][0]));
118 118
         $items_to_create[get_lang('Introduction')] = $intro_content;
119 119
 
120
-        for ($i = 0; $i<count($matches[0]); $i++) {
120
+        for ($i = 0; $i < count($matches[0]); $i++) {
121 121
 
122 122
             if (empty($matches[1][$i]))
123 123
                 continue;
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
 
175 175
         $first_item = 0;
176 176
 
177
-        foreach($pages as $key => $page_content) {
177
+        foreach ($pages as $key => $page_content) {
178 178
             // For every pages, we create a new file.
179 179
 
180 180
             $key += 1;
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
                     foreach ($specific_fields as $specific_field) {
214 214
                         if (isset($_REQUEST[$specific_field['code']])) {
215 215
                             $sterms = trim($_REQUEST[$specific_field['code']]);
216
-                            $all_specific_terms .= ' '. $sterms;
216
+                            $all_specific_terms .= ' '.$sterms;
217 217
                             if (!empty($sterms)) {
218 218
                                 $sterms = explode(',', $sterms);
219 219
                                 foreach ($sterms as $sterm) {
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
                             }
223 223
                         }
224 224
                     }
225
-                    $page_content = $all_specific_terms .' '. $page_content;
225
+                    $page_content = $all_specific_terms.' '.$page_content;
226 226
                     $ic_slide->addValue('content', $page_content);
227 227
                     // Add a comment to say terms separated by commas.
228 228
                     $courseid = api_get_course_id();
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
                         SE_COURSE_ID => $courseid,
234 234
                         SE_TOOL_ID => TOOL_LEARNPATH,
235 235
                         SE_DATA => array('lp_id' => $lp_id, 'lp_item' => $previous, 'document_id' => $document_id),
236
-                        SE_USER => (int)api_get_user_id(),
236
+                        SE_USER => (int) api_get_user_id(),
237 237
                     );
238 238
                     $ic_slide->xapian_data = serialize($xapian_data);
239 239
                     $di->addChunk($ic_slide);
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
             $content = '<body><div style="width:'.$max_width.'">'.$content;
277 277
         }
278 278
 
279
-        $content = preg_replace('|</body>|i','</div>\\0', $content, -1, $count);
279
+        $content = preg_replace('|</body>|i', '</div>\\0', $content, -1, $count);
280 280
         if ($count < 1) {
281 281
             $content = $content.'</div></body>';
282 282
         }
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
                 }
305 305
 
306 306
             } elseif ($img_width > $max_width - 10) {
307
-                $picture_resized = str_ireplace('width='.$img_width, 'width="'.($max_width-10).'"', $images[0][$key]);
307
+                $picture_resized = str_ireplace('width='.$img_width, 'width="'.($max_width - 10).'"', $images[0][$key]);
308 308
                 $content = str_replace($images[0][$key], $picture_resized, $content);
309 309
             }
310 310
         }
Please login to merge, or discard this patch.