Completed
Push — 1.10.x ( c82817...6a93c3 )
by Yannick
202:42 queued 149:59
created
main/newscorm/lp_add_audio.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
 
18 18
 $isStudentView  = isset($_REQUEST['isStudentView']) ? (int) $_REQUEST['isStudentView'] : null;
19 19
 $learnpath_id   = (int) $_REQUEST['lp_id'];
20
-$submit			= isset($_POST['submit_button']) ? $_POST['submit_button'] : null;
20
+$submit = isset($_POST['submit_button']) ? $_POST['submit_button'] : null;
21 21
 
22 22
 $type = isset($_GET['type']) ? $_GET['type'] : null;
23 23
 $action = isset($_GET['action']) ? $_GET['action'] : null;
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 }
41 41
 
42 42
 if (!empty($gradebook) && $gradebook == 'view') {
43
-    $interbreadcrumb[] = array (
43
+    $interbreadcrumb[] = array(
44 44
         'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
45 45
         'name' => get_lang('ToolGradebook')
46 46
     );
@@ -51,19 +51,19 @@  discard block
 block discarded – undo
51 51
 
52 52
 switch ($type) {
53 53
     case 'chapter':
54
-        $interbreadcrumb[]= array('url' => 'lp_controller.php?action=add_item&type=step&lp_id='.$_SESSION['oLP']->get_id(), 'name' => get_lang('NewStep'));
55
-        $interbreadcrumb[]= array('url' => '#', 'name' => get_lang('NewChapter'));
54
+        $interbreadcrumb[] = array('url' => 'lp_controller.php?action=add_item&type=step&lp_id='.$_SESSION['oLP']->get_id(), 'name' => get_lang('NewStep'));
55
+        $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('NewChapter'));
56 56
         break;
57 57
     case 'document':
58
-        $interbreadcrumb[]= array('url' => 'lp_controller.php?action=add_item&type=step&lp_id='.$_SESSION['oLP']->get_id(), 'name' => get_lang('NewStep'));
58
+        $interbreadcrumb[] = array('url' => 'lp_controller.php?action=add_item&type=step&lp_id='.$_SESSION['oLP']->get_id(), 'name' => get_lang('NewStep'));
59 59
         break;
60 60
     default:
61
-        $interbreadcrumb[]= array('url' => '#', 'name' => get_lang('NewStep'));
61
+        $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('NewStep'));
62 62
         break;
63 63
 }
64 64
 
65 65
 if ($action == 'add_item' && $type == 'document') {
66
-    $interbreadcrumb[]= array ('url' => '#', 'name' => get_lang('NewDocumentCreated'));
66
+    $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('NewDocumentCreated'));
67 67
 }
68 68
 
69 69
 // Theme calls.
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 $form = new FormValidator(
80 80
     'add_audio',
81 81
     'post',
82
-    api_get_self() . '?action=add_audio&id=' . $lp_item_id . '&' . api_get_cidreq().'&lp_id='.$learnpath_id,
82
+    api_get_self().'?action=add_audio&id='.$lp_item_id.'&'.api_get_cidreq().'&lp_id='.$learnpath_id,
83 83
     null,
84 84
     array('enctype' => 'multipart/form-data')
85 85
 );
Please login to merge, or discard this patch.
main/newscorm/openoffice_presentation.class.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
             );
86 86
 
87 87
             // Generating the thumbnail.
88
-            $image = $this->base_work_dir.$this->created_dir .'/'. $file_name;
88
+            $image = $this->base_work_dir.$this->created_dir.'/'.$file_name;
89 89
 
90 90
             $pattern = '/(\w+)\.png$/';
91 91
             $replacement = '${1}_thumb.png';
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 
102 102
             $my_new_image = new Image($image);
103 103
             $my_new_image->resize($thumb_width, $thumb_height);
104
-            $my_new_image->send_image($this->base_work_dir.$this->created_dir .'/'. $thumb_name, -1, 'png');
104
+            $my_new_image->send_image($this->base_work_dir.$this->created_dir.'/'.$thumb_name, -1, 'png');
105 105
 
106 106
             // Adding the thumbnail to documents.
107 107
             $document_id_thumb = add_document(
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
     <body>
128 128
         <img src="'.$slide_src.'" />
129 129
     </body>
130
-</html>');  // This indentation is to make the generated html files to look well.
130
+</html>'); // This indentation is to make the generated html files to look well.
131 131
 
132 132
             fclose($fp);
133 133
             $document_id = add_document(
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
                     foreach ($specific_fields as $specific_field) {
163 163
                         if (isset($_REQUEST[$specific_field['code']])) {
164 164
                             $sterms = trim($_REQUEST[$specific_field['code']]);
165
-                            $all_specific_terms .= ' '. $sterms;
165
+                            $all_specific_terms .= ' '.$sterms;
166 166
                             if (!empty($sterms)) {
167 167
                                 $sterms = explode(',', $sterms);
168 168
                                 foreach ($sterms as $sterm) {
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
                             }
172 172
                         }
173 173
                     }
174
-                    $slide_body = $all_specific_terms .' '. $slide_body;
174
+                    $slide_body = $all_specific_terms.' '.$slide_body;
175 175
                     $ic_slide->addValue('content', $slide_body);
176 176
                     /* FIXME:  cidReq:lp_id:doc_id al indexar  */
177 177
                     // Add a comment to say terms separated by commas.
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
                         SE_COURSE_ID => $courseid,
184 184
                         SE_TOOL_ID => TOOL_LEARNPATH,
185 185
                         SE_DATA => array('lp_id' => $lp_id, 'lp_item' => $previous, 'document_id' => $document_id),
186
-                        SE_USER => (int)api_get_user_id(),
186
+                        SE_USER => (int) api_get_user_id(),
187 187
                     );
188 188
                     $ic_slide->xapian_data = serialize($xapian_data);
189 189
                     $di->addChunk($ic_slide);
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
         $_course = api_get_course_info();
222 222
         foreach ($files as $file) {
223 223
             // '||' is used as separator between slide name (with accents) and file name (without accents).
224
-            list($slide_name,$file_name) = explode('||',$file);
224
+            list($slide_name, $file_name) = explode('||', $file);
225 225
             $slide_name = api_htmlentities($slide_name, ENT_COMPAT, $this->original_charset);
226 226
             $slide_name = str_replace('&rsquo;', '\'', $slide_name);
227 227
             $slide_name = api_convert_encoding($slide_name, api_get_system_encoding(), $this->original_charset);
Please login to merge, or discard this patch.
main/newscorm/blank.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@
 block discarded – undo
16 16
 Display::display_reduced_header();
17 17
 
18 18
 if (isset($_GET['error'])) {
19
-    switch ($_GET['error']){
19
+    switch ($_GET['error']) {
20 20
         case 'document_deleted':
21 21
             echo '<br /><br />';
22 22
             Display::display_error_message(get_lang('DocumentHasBeenDeleted'));
Please login to merge, or discard this patch.
main/newscorm/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/newscorm/scormOrganization.class.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -98,7 +98,7 @@
 block discarded – undo
98 98
         foreach ($this->items as $id => $dummy) {
99 99
             $abs_order = 0;
100 100
             // Passes the array as a pointer so it is modified in $list directly.
101
-            $this->items[$id]->get_flat_list($list,$abs_order, $i, 0);
101
+            $this->items[$id]->get_flat_list($list, $abs_order, $i, 0);
102 102
             $i++;
103 103
         }
104 104
 
Please login to merge, or discard this patch.
main/newscorm/storageapi.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
         and sco_id = '$sv_sco'
104 104
         and course_id = '$sv_course'
105 105
         and sv_key = '$sv_key'
106
-        order by sv_value ".($sv_asc ? "ASC": "DESC")." limit $sv_length";
106
+        order by sv_value ".($sv_asc ? "ASC" : "DESC")." limit $sv_length";
107 107
 //	$sql_data = "select sv.user_id as user_id, sv_key as variable, sv_value as value
108 108
 //		from ".Database::get_main_table(TABLE_TRACK_STORED_VALUES)." sv
109 109
 //		where sv.user_id in (select u2.user_id from ($sql_leaders) u2)
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
         and search.sco_id = '$sv_sco'
136 136
         and search.course_id = '$sv_course'
137 137
         and search.sv_key = '$sv_key'
138
-        and list.sv_value ".($sv_asc ? "<=": ">=")." search.sv_value
138
+        and list.sv_value ".($sv_asc ? "<=" : ">=")." search.sv_value
139 139
         and list.sco_id = search.sco_id
140 140
         and list.course_id = search.course_id
141 141
         and list.sv_key = search.sv_key
Please login to merge, or discard this patch.
main/newscorm/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/newscorm/scormItem.class.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
                                         }
101 101
                                         break;
102 102
                                     case 'item':
103
-                                        $oItem = new scormItem('manifest',$child);
103
+                                        $oItem = new scormItem('manifest', $child);
104 104
                                         if ($oItem->identifier != '') {
105 105
                                             $this->sub_items[$oItem->identifier] = $oItem;
106 106
                                         }
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
                         $attributes = $element->attributes;
120 120
                         //$keep_href = '';
121 121
                         foreach ($attributes as $attrib) {
122
-                            switch($attrib->name){
122
+                            switch ($attrib->name) {
123 123
                                 case 'identifier':
124 124
                                     $this->identifier = $attrib->value;
125 125
                                     break;
@@ -172,8 +172,8 @@  discard block
 block discarded – undo
172 172
         );
173 173
         $abs_order++;
174 174
         $i = 1;
175
-        foreach($this->sub_items as $id => $dummy) {
176
-            $oSubitem =& $this->sub_items[$id];
175
+        foreach ($this->sub_items as $id => $dummy) {
176
+            $oSubitem = & $this->sub_items[$id];
177 177
             $oSubitem->get_flat_list($list, $abs_order, $i, $level + 1);
178 178
             $i++;
179 179
         }
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
         parent::save($from_outside, $prereqs_complete);
189 189
         // Under certain conditions, the scorm_contact should not be set, because no scorm signal was sent.
190 190
         $this->scorm_contact = true;
191
-        if (!$this->scorm_contact){
191
+        if (!$this->scorm_contact) {
192 192
             //error_log('New LP - was expecting SCORM message but none received', 0);
193 193
         }
194 194
     }
Please login to merge, or discard this patch.
main/newscorm/lp_add.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -68,12 +68,12 @@  discard block
 block discarded – undo
68 68
     Course admin section
69 69
     - all the functions not available for students - always available in this case (page only shown to admin)
70 70
 */
71
-if (isset($_SESSION['gradebook'])){
71
+if (isset($_SESSION['gradebook'])) {
72 72
     $gradebook = $_SESSION['gradebook'];
73 73
 }
74 74
 
75
-if (!empty($gradebook) && $gradebook=='view') {
76
-    $interbreadcrumb[]= array (
75
+if (!empty($gradebook) && $gradebook == 'view') {
76
+    $interbreadcrumb[] = array(
77 77
         'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
78 78
         'name' => get_lang('ToolGradebook')
79 79
     );
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 
86 86
 echo '<div class="actions">';
87 87
 echo '<a href="lp_controller.php?cidReq='.$_course['sysCode'].'">'.
88
-        Display::return_icon('back.png', get_lang('ReturnToLearningPaths'),'',ICON_SIZE_MEDIUM).'</a>';
88
+        Display::return_icon('back.png', get_lang('ReturnToLearningPaths'), '', ICON_SIZE_MEDIUM).'</a>';
89 89
 echo '</div>';
90 90
 
91 91
 Display::display_normal_message(get_lang('AddLpIntro'), false);
@@ -119,22 +119,22 @@  discard block
 block discarded – undo
119 119
 
120 120
 // Start date
121 121
 $form->addElement('checkbox', 'activate_start_date_check', null, get_lang('EnableStartTime'), array('onclick' => 'activate_start_date()'));
122
-$form->addElement('html','<div id="start_date_div" style="display:block;">');
122
+$form->addElement('html', '<div id="start_date_div" style="display:block;">');
123 123
 $form->addElement('DatePicker', 'publicated_on', get_lang('PublicationDate'));
124
-$form->addElement('html','</div>');
124
+$form->addElement('html', '</div>');
125 125
 
126 126
 //End date
127 127
 $form->addElement('checkbox', 'activate_end_date_check', null, get_lang('EnableEndTime'), array('onclick' => 'activate_end_date()'));
128
-$form->addElement('html','<div id="end_date_div" style="display:none;">');
128
+$form->addElement('html', '<div id="end_date_div" style="display:none;">');
129 129
 $form->addElement('DatePicker', 'expired_on', get_lang('ExpirationDate'));
130
-$form->addElement('html','</div>');
130
+$form->addElement('html', '</div>');
131 131
 
132
-$form->addElement('html','</div>');
132
+$form->addElement('html', '</div>');
133 133
 
134
-$defaults['activate_start_date_check']  = 1;
134
+$defaults['activate_start_date_check'] = 1;
135 135
 
136 136
 $defaults['publicated_on'] = date('Y-m-d 08:00:00');
137
-$defaults['expired_on'] = date('Y-m-d 08:00:00',time()+86400);
137
+$defaults['expired_on'] = date('Y-m-d 08:00:00', time() + 86400);
138 138
 
139 139
 $form->setDefaults($defaults);
140 140
 $form->addButtonCreate(get_lang('CreateLearningPath'));
Please login to merge, or discard this patch.