Completed
Push — 1.11.x ( 78f130...f6f5c2 )
by José
50:40 queued 24:26
created
certificates/index.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 block discarded – undo
35 35
             $pdfParams['orientation'] = 'landscape';
36 36
             $pageFormat = $pdfParams['orientation'] === 'landscape' ? 'A4-L' : 'A4';
37 37
             $userInfo = api_get_user_info($certificate->user_id);
38
-            $pdfName = api_replace_dangerous_char(get_lang('Certificate') . ' ' . $userInfo['username']);
38
+            $pdfName = api_replace_dangerous_char(get_lang('Certificate').' '.$userInfo['username']);
39 39
 
40 40
             $pdf = new PDF($pageFormat, $pdfParams['orientation'], $pdfParams);
41 41
             $pdf->html_to_pdf($certificatePathList, $pdfName, null, false, false);
Please login to merge, or discard this patch.
index.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@
 block discarded – undo
45 45
     Event::addEvent(
46 46
         LOG_ATTEMPTED_FORCED_LOGIN,
47 47
         'tried_hacking_get',
48
-        $_SERVER['REMOTE_ADDR'].(empty($_POST['login'])?'':'/'.$_POST['login']),
48
+        $_SERVER['REMOTE_ADDR'].(empty($_POST['login']) ? '' : '/'.$_POST['login']),
49 49
         null,
50 50
         $i
51 51
     );
Please login to merge, or discard this patch.
main/create_course/add_course.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 </script>';
40 40
 
41 41
 $interbreadcrumb[] = array(
42
-    'url' => api_get_path(WEB_PATH) . 'user_portal.php',
42
+    'url' => api_get_path(WEB_PATH).'user_portal.php',
43 43
     'name' => get_lang('MyCourses')
44 44
 );
45 45
 
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 );
87 87
 
88 88
 // Category category.
89
-$url = api_get_path(WEB_AJAX_PATH) . 'course.ajax.php?a=search_category';
89
+$url = api_get_path(WEB_AJAX_PATH).'course.ajax.php?a=search_category';
90 90
 
91 91
 $form->addElement(
92 92
     'select_ajax',
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
             get_lang('PickACourseAsATemplateForThisNewCourse'),
233 233
         ],
234 234
         null,
235
-        ['url' => api_get_path(WEB_AJAX_PATH) . 'course.ajax.php?a=search_course']
235
+        ['url' => api_get_path(WEB_AJAX_PATH).'course.ajax.php?a=search_course']
236 236
     );
237 237
 }
238 238
 
@@ -293,8 +293,8 @@  discard block
 block discarded – undo
293 293
             $params['course_language'] = $course_language;
294 294
             $params['gradebook_model_id'] = isset($course_values['gradebook_model_id']) ? $course_values['gradebook_model_id'] : null;
295 295
 
296
-            include_once api_get_path(SYS_CODE_PATH) . 'lang/english/trad4all.inc.php';
297
-            $file_to_include = api_get_path(SYS_CODE_PATH) . 'lang/' . $course_language . '/trad4all.inc.php';
296
+            include_once api_get_path(SYS_CODE_PATH).'lang/english/trad4all.inc.php';
297
+            $file_to_include = api_get_path(SYS_CODE_PATH).'lang/'.$course_language.'/trad4all.inc.php';
298 298
 
299 299
             if (file_exists($file_to_include)) {
300 300
                 include $file_to_include;
@@ -319,14 +319,14 @@  discard block
 block discarded – undo
319 319
                 $splash = api_get_setting('course_creation_splash_screen');
320 320
                 if ($splash === 'true') {
321 321
                     $url = api_get_path(WEB_CODE_PATH);
322
-                    $url .= 'course_info/start.php?' . api_get_cidreq_params($course_info['code']);
322
+                    $url .= 'course_info/start.php?'.api_get_cidreq_params($course_info['code']);
323 323
                     $url .= '&first=1';
324
-                    header('Location: ' . $url);
324
+                    header('Location: '.$url);
325 325
                     exit;
326 326
                 } else {
327 327
 
328
-                    $url = api_get_path(WEB_COURSE_PATH) . $course_info['directory'] . '/';
329
-                    header('Location: ' . $url);
328
+                    $url = api_get_path(WEB_COURSE_PATH).$course_info['directory'].'/';
329
+                    header('Location: '.$url);
330 330
                     exit;
331 331
                 }
332 332
             } else {
@@ -354,7 +354,7 @@  discard block
 block discarded – undo
354 354
 
355 355
             if ($request_id) {
356 356
                 $course_request_info = CourseRequestManager::get_course_request_info($request_id);
357
-                $message = (is_array($course_request_info) ? '<strong>' . $course_request_info['code'] . '</strong> : ' : '') . get_lang('CourseRequestCreated');
357
+                $message = (is_array($course_request_info) ? '<strong>'.$course_request_info['code'].'</strong> : ' : '').get_lang('CourseRequestCreated');
358 358
                 $message = Display::return_message(
359 359
                     $message,
360 360
                     'confirmation',
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
                     'div',
365 365
                     Display::url(
366 366
                         get_lang('Enter'),
367
-                        api_get_path(WEB_PATH) . 'user_portal.php',
367
+                        api_get_path(WEB_PATH).'user_portal.php',
368 368
                         ['class' => 'btn btn-default']
369 369
                     ),
370 370
                     ['style' => 'float: left; margin:0px; padding: 0px;']
Please login to merge, or discard this patch.
main/admin/skill_list.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 }
21 21
 
22 22
 $action = isset($_GET['action']) ? $_GET['action'] : 'list';
23
-$skillId = isset($_GET['id']) ? intval($_GET['id']): 0;
23
+$skillId = isset($_GET['id']) ? intval($_GET['id']) : 0;
24 24
 
25 25
 $entityManager = Database::getManager();
26 26
 
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
             );
56 56
         }
57 57
 
58
-        header('Location: ' . api_get_self());
58
+        header('Location: '.api_get_self());
59 59
         exit;
60 60
         break;
61 61
     case 'disable':
@@ -108,40 +108,40 @@  discard block
 block discarded – undo
108 108
             );
109 109
         }
110 110
 
111
-        header('Location: ' . api_get_self());
111
+        header('Location: '.api_get_self());
112 112
         exit;
113 113
         break;
114 114
     case 'list':
115 115
         //no break
116 116
     default:
117
-        $interbreadcrumb[] = array ("url" => 'index.php', "name" => get_lang('PlatformAdmin'));
117
+        $interbreadcrumb[] = array("url" => 'index.php', "name" => get_lang('PlatformAdmin'));
118 118
 
119 119
         $message = Session::has('message') ? Session::read('message') : null;
120 120
 
121 121
         $toolbar = Display::toolbarButton(
122 122
             get_lang('CreateSkill'),
123
-            api_get_path(WEB_CODE_PATH) . 'admin/skill_create.php',
123
+            api_get_path(WEB_CODE_PATH).'admin/skill_create.php',
124 124
             'plus',
125 125
             'success',
126 126
             ['title' => get_lang('CreateSkill')]
127 127
         );
128 128
         $toolbar .= Display::toolbarButton(
129 129
             get_lang('SkillsWheel'),
130
-            api_get_path(WEB_CODE_PATH) . 'admin/skills_wheel.php',
130
+            api_get_path(WEB_CODE_PATH).'admin/skills_wheel.php',
131 131
             'bullseye',
132 132
             'primary',
133 133
             ['title' => get_lang('CreateSkill')]
134 134
         );
135 135
         $toolbar .= Display::toolbarButton(
136 136
             get_lang('BadgesManagement'),
137
-            api_get_path(WEB_CODE_PATH) . 'admin/skill_badge_list.php',
137
+            api_get_path(WEB_CODE_PATH).'admin/skill_badge_list.php',
138 138
             'shield',
139 139
             'warning',
140 140
             ['title' => get_lang('BadgesManagement')]
141 141
         );
142 142
         $toolbar .= Display::toolbarButton(
143 143
             get_lang('ImportSkillsListCSV'),
144
-            api_get_path(WEB_CODE_PATH) . 'admin/skills_import.php',
144
+            api_get_path(WEB_CODE_PATH).'admin/skills_import.php',
145 145
             'arrow-up',
146 146
             'info',
147 147
             ['title' => get_lang('BadgesManagement')]
Please login to merge, or discard this patch.
main/admin/teachers_time_by_session_report.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 $cidReset = true;
13 13
 
14 14
 require_once '../inc/global.inc.php';
15
-require_once api_get_path(SYS_CODE_PATH) . 'work/work.lib.php';
15
+require_once api_get_path(SYS_CODE_PATH).'work/work.lib.php';
16 16
 
17 17
 if (!api_is_platform_admin(true) && !api_is_teacher()) {
18 18
     api_not_allowed(true);
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 
48 48
     foreach ($sessionCourses as $sessionCourse) {
49 49
         $course = $sessionCourse->getCourse();
50
-        $coursesInfo[$course->getId()] =  $course->getCode();
50
+        $coursesInfo[$course->getId()] = $course->getCode();
51 51
         $criteria = Criteria::create()->where(
52 52
             Criteria::expr()->eq("status", Session::COACH)
53 53
         );
@@ -70,10 +70,10 @@  discard block
 block discarded – undo
70 70
                 ];
71 71
             }
72 72
 
73
-            $usersInfo[$user->getId()][$course->getId() . '_number_of_students'] = null;
74
-            $usersInfo[$user->getId()][$course->getId() . '_number_of_works'] = null;
75
-            $usersInfo[$user->getId()][$course->getId() . '_last_work'] = null;
76
-            $usersInfo[$user->getId()][$course->getId() . '_time_spent_of_course'] = null;
73
+            $usersInfo[$user->getId()][$course->getId().'_number_of_students'] = null;
74
+            $usersInfo[$user->getId()][$course->getId().'_number_of_works'] = null;
75
+            $usersInfo[$user->getId()][$course->getId().'_last_work'] = null;
76
+            $usersInfo[$user->getId()][$course->getId().'_time_spent_of_course'] = null;
77 77
 
78 78
             if (!$session->hasCoachInCourseWithStatus($user, $course)) {
79 79
                 continue;
@@ -83,9 +83,9 @@  discard block
 block discarded – undo
83 83
                 ->getRepository('ChamiloCourseBundle:CStudentPublication')
84 84
                 ->findByTeacher($user, $course, $session->getId());
85 85
 
86
-            $usersInfo[$user->getId()][$course->getId() . '_number_of_students'] = $sessionCourse->getNbrUsers();
87
-            $usersInfo[$user->getId()][$course->getId() . '_number_of_works'] = count($works);
88
-            $usersInfo[$user->getId()][$course->getId() . '_time_spent_of_course'] = api_time_to_hms(
86
+            $usersInfo[$user->getId()][$course->getId().'_number_of_students'] = $sessionCourse->getNbrUsers();
87
+            $usersInfo[$user->getId()][$course->getId().'_number_of_works'] = count($works);
88
+            $usersInfo[$user->getId()][$course->getId().'_time_spent_of_course'] = api_time_to_hms(
89 89
                 Tracking::get_time_spent_on_the_course($user->getId(), $course->getId(), $session->getId())
90 90
             );
91 91
 
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 
98 98
             $lastFormattedDate = api_format_date($lastWork->getSentDate()->getTimestamp(), DATE_TIME_FORMAT_SHORT);
99 99
 
100
-            $usersInfo[$user->getId()][$course->getId() . '_last_work'] = api_format_date(
100
+            $usersInfo[$user->getId()][$course->getId().'_last_work'] = api_format_date(
101 101
                 $lastWork->getSentDate()->getTimestamp(),
102 102
                 DATE_TIME_FORMAT_SHORT
103 103
             );
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
 }
107 107
 
108 108
 if (isset($_GET['export']) && $session && ($coursesInfo && $usersInfo)) {
109
-    $fileName = get_lang('TeacherTimeReport') . ' ' . api_get_local_time();
109
+    $fileName = get_lang('TeacherTimeReport').' '.api_get_local_time();
110 110
 
111 111
     $dataToExport = [];
112 112
     $dataToExport[] = [$toolName, $session->getName()];
@@ -167,9 +167,9 @@  discard block
 block discarded – undo
167 167
 }
168 168
 
169 169
 $this_section = SECTION_PLATFORM_ADMIN;
170
-$interbreadcrumb[] = ['url' => api_get_path(WEB_CODE_PATH) . 'mySpace/', 'name' => get_lang('Reporting')];
170
+$interbreadcrumb[] = ['url' => api_get_path(WEB_CODE_PATH).'mySpace/', 'name' => get_lang('Reporting')];
171 171
 $interbreadcrumb[] = [
172
-    'url' => api_get_path(WEB_CODE_PATH) . 'mySpace/session.php',
172
+    'url' => api_get_path(WEB_CODE_PATH).'mySpace/session.php',
173 173
     'name' => get_lang('FollowedSessions')
174 174
 ];
175 175
 
@@ -179,11 +179,11 @@  discard block
 block discarded – undo
179 179
     $actions = [
180 180
         Display::url(
181 181
             Display::return_icon('export_csv.png', get_lang('ExportAsCSV'), [], ICON_SIZE_MEDIUM),
182
-            api_get_self() . '?' . http_build_query(['export' => 'csv', 'session' => $session->getId()])
182
+            api_get_self().'?'.http_build_query(['export' => 'csv', 'session' => $session->getId()])
183 183
         ),
184 184
         Display::url(
185 185
             Display::return_icon('export_excel.png', get_lang('ExportAsXLS'), [], ICON_SIZE_MEDIUM),
186
-            api_get_self() . '?' . http_build_query(['export' => 'xls', 'session' => $session->getId()])
186
+            api_get_self().'?'.http_build_query(['export' => 'xls', 'session' => $session->getId()])
187 187
         )
188 188
     ];
189 189
 }
Please login to merge, or discard this patch.
main/group/group_category.php 2 patches
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -7,12 +7,12 @@  discard block
 block discarded – undo
7 7
 
8 8
 require_once '../inc/global.inc.php';
9 9
 $this_section = SECTION_COURSES;
10
-$current_course_tool  = TOOL_GROUP;
10
+$current_course_tool = TOOL_GROUP;
11 11
 
12 12
 // Notice for unauthorized people.
13 13
 api_protect_course_script(true);
14 14
 
15
-if (!api_is_allowed_to_edit(false,true) ||
15
+if (!api_is_allowed_to_edit(false, true) ||
16 16
     !(isset ($_GET['id']) ||
17 17
     isset ($_POST['id']) ||
18 18
     isset ($_GET['action']) ||
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
             'groups_per_user' => 1,
60 60
             'doc_state' => GroupManager::TOOL_PRIVATE,
61 61
             'work_state' => GroupManager::TOOL_PRIVATE,
62
-            'wiki_state' => GroupManager::TOOL_PRIVATE ,
62
+            'wiki_state' => GroupManager::TOOL_PRIVATE,
63 63
             'chat_state' => GroupManager::TOOL_PRIVATE,
64 64
             'calendar_state' => GroupManager::TOOL_PRIVATE,
65 65
             'announcements_state'=> GroupManager::TOOL_PRIVATE,
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 
114 114
     // Groups per user
115 115
     $possible_values = array();
116
-    for ($i = 1; $i <= 10; $i ++) {
116
+    for ($i = 1; $i <= 10; $i++) {
117 117
         $possible_values[$i] = $i;
118 118
     }
119 119
     $possible_values[GroupManager::GROUP_PER_MEMBER_NO_LIMIT] = get_lang('All');
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
 
139 139
     $form->addElement('html', '<div class="col-md-6">');
140 140
     // Description
141
-    $form->addElement('textarea', 'description', get_lang('Description'), array ('rows' => 6));
141
+    $form->addElement('textarea', 'description', get_lang('Description'), array('rows' => 6));
142 142
     $form->addElement('html', '</div>');
143 143
     $form->addElement('html', '</div>');
144 144
 } else {
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
 $form->addGroup(
159 159
     $group,
160 160
     '',
161
-    Display::return_icon('user.png', get_lang('GroupSelfRegistration')) . ' ' . get_lang('GroupSelfRegistration'),
161
+    Display::return_icon('user.png', get_lang('GroupSelfRegistration')).' '.get_lang('GroupSelfRegistration'),
162 162
     null,
163 163
     false
164 164
 );
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
 $form->addGroup(
173 173
     $group,
174 174
     '',
175
-    Display::return_icon('folder.png', get_lang('GroupDocument')) . ' ' . get_lang('GroupDocument'),
175
+    Display::return_icon('folder.png', get_lang('GroupDocument')).' '.get_lang('GroupDocument'),
176 176
     null,
177 177
     false
178 178
 );
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
 $form->addGroup(
187 187
     $group,
188 188
     '',
189
-    Display::return_icon('work.png', get_lang('GroupWork'), array(), ICON_SIZE_SMALL) . ' ' . get_lang('GroupWork'),
189
+    Display::return_icon('work.png', get_lang('GroupWork'), array(), ICON_SIZE_SMALL).' '.get_lang('GroupWork'),
190 190
     '',
191 191
     false);
192 192
 
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
 $form->addGroup(
200 200
     $group,
201 201
     '',
202
-    Display::return_icon('agenda.png', get_lang('GroupCalendar')) . ' ' . get_lang('GroupCalendar'),
202
+    Display::return_icon('agenda.png', get_lang('GroupCalendar')).' '.get_lang('GroupCalendar'),
203 203
     null,
204 204
     false
205 205
 );
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
 $form->addGroup(
217 217
     $group,
218 218
     '',
219
-    Display::return_icon('announce.png', get_lang('GroupAnnouncements')) . ' ' . get_lang('GroupAnnouncements'),
219
+    Display::return_icon('announce.png', get_lang('GroupAnnouncements')).' '.get_lang('GroupAnnouncements'),
220 220
     null,
221 221
     false
222 222
 );
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
 $form->addGroup(
231 231
     $group,
232 232
     '',
233
-    Display::return_icon('forum.png', get_lang('GroupForum')) . ' ' . get_lang('GroupForum'),
233
+    Display::return_icon('forum.png', get_lang('GroupForum')).' '.get_lang('GroupForum'),
234 234
     null,
235 235
     false
236 236
 );
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
 $form->addGroup(
245 245
     $group,
246 246
     '',
247
-    Display::return_icon('wiki.png', get_lang('GroupWiki')) . ' ' . get_lang('GroupWiki'),
247
+    Display::return_icon('wiki.png', get_lang('GroupWiki')).' '.get_lang('GroupWiki'),
248 248
     null,
249 249
     false
250 250
 );
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
 $form->addGroup(
259 259
     $group,
260 260
     '',
261
-    Display::return_icon('chat.png', get_lang('Chat')) . ' ' . get_lang('Chat'),
261
+    Display::return_icon('chat.png', get_lang('Chat')).' '.get_lang('Chat'),
262 262
     null,
263 263
     false
264 264
 );
@@ -333,7 +333,7 @@  discard block
 block discarded – undo
333 333
 // actions bar
334 334
 echo '<div class="actions">';
335 335
 echo '<a href="group.php">'.
336
-    Display::return_icon('back.png', get_lang('BackToGroupList'),'',ICON_SIZE_MEDIUM).'</a>';
336
+    Display::return_icon('back.png', get_lang('BackToGroupList'), '', ICON_SIZE_MEDIUM).'</a>';
337 337
 echo '</div>';
338 338
 
339 339
 $defaults = $category;
Please login to merge, or discard this patch.
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
     isset ($_GET['action']) ||
19 19
     isset ($_POST['action']))
20 20
 ) {
21
-	api_not_allowed();
21
+    api_not_allowed();
22 22
 }
23 23
 
24 24
 /**
@@ -86,30 +86,30 @@  discard block
 block discarded – undo
86 86
 
87 87
 // Build the form
88 88
 if (isset($_GET['id'])) {
89
-	// Update settings of existing category
90
-	$action = 'update_settings';
89
+    // Update settings of existing category
90
+    $action = 'update_settings';
91 91
     $form = new FormValidator(
92 92
         'group_category',
93 93
         'post',
94 94
         api_get_self().'?id='.$category['id'].'&'.api_get_cidreq()
95 95
     );
96
-	$form->addElement('hidden', 'id');
96
+    $form->addElement('hidden', 'id');
97 97
 } else {
98 98
     // Checks if the field was created in the table Category. It creates it if is neccesary
99 99
     $table_category = Database :: get_course_table(TABLE_GROUP_CATEGORY);
100 100
     if (!Database::query("SELECT wiki_state FROM $table_category WHERE c_id = $course_id")) {
101 101
         Database::query("ALTER TABLE $table_category ADD wiki_state tinyint(3) UNSIGNED NOT NULL default '1' WHERE c_id = $course_id");
102 102
     }
103
-	// Create a new category
104
-	$action = 'add_category';
105
-	$form = new FormValidator('group_category');
103
+    // Create a new category
104
+    $action = 'add_category';
105
+    $form = new FormValidator('group_category');
106 106
 }
107 107
 
108 108
 // If categories allowed, show title & description field
109 109
 if (api_get_setting('allow_group_categories') == 'true') {
110 110
     $form->addElement('header', $nameTools);
111 111
     $form->addElement('html', '<div class="row"><div class="col-md-6">');
112
-	$form->addText('title', get_lang('Title'));
112
+    $form->addText('title', get_lang('Title'));
113 113
 
114 114
     // Groups per user
115 115
     $possible_values = array();
@@ -142,8 +142,8 @@  discard block
 block discarded – undo
142 142
     $form->addElement('html', '</div>');
143 143
     $form->addElement('html', '</div>');
144 144
 } else {
145
-	$form->addElement('hidden', 'title');
146
-	$form->addElement('hidden', 'description');
145
+    $form->addElement('hidden', 'title');
146
+    $form->addElement('hidden', 'description');
147 147
 }
148 148
 
149 149
 $form->addElement('header', get_lang('DefaultSettingsForNewGroups'));
Please login to merge, or discard this patch.
main/upload/upload.document.php 3 patches
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -47,9 +47,9 @@  discard block
 block discarded – undo
47 47
  */
48 48
 //user has submitted a file
49 49
 if (isset($_FILES['user_upload'])) {
50
-	$upload_ok = process_uploaded_file($_FILES['user_upload']);
51
-	if ($upload_ok) {
52
-		//file got on the server without problems, now process it
50
+    $upload_ok = process_uploaded_file($_FILES['user_upload']);
51
+    if ($upload_ok) {
52
+        //file got on the server without problems, now process it
53 53
         $new_path = handle_uploaded_document(
54 54
             $_course,
55 55
             $_FILES['user_upload'],
@@ -61,21 +61,21 @@  discard block
 block discarded – undo
61 61
             $_POST['unzip'],
62 62
             $_POST['if_exists']
63 63
         );
64
-    	$new_comment = isset($_POST['comment']) ? Database::escape_string(trim($_POST['comment'])) : '';
65
-    	$new_title = isset($_POST['title']) ? Database::escape_string(trim($_POST['title'])) : '';
64
+        $new_comment = isset($_POST['comment']) ? Database::escape_string(trim($_POST['comment'])) : '';
65
+        $new_title = isset($_POST['title']) ? Database::escape_string(trim($_POST['title'])) : '';
66 66
 
67
-    	if ($new_path && ($new_comment || $new_title))
68
-    	if (($docid = DocumentManager::get_document_id($_course, $new_path))) {
69
-        	$table_document = Database::get_course_table(TABLE_DOCUMENT);
70
-        	$ct = '';
67
+        if ($new_path && ($new_comment || $new_title))
68
+        if (($docid = DocumentManager::get_document_id($_course, $new_path))) {
69
+            $table_document = Database::get_course_table(TABLE_DOCUMENT);
70
+            $ct = '';
71 71
             if ($new_comment) {
72 72
                 $ct .= ", comment='$new_comment'";
73 73
             }
74 74
             if ($new_title) {
75 75
                 $ct .= ", title='$new_title'";
76 76
             }
77
-        	Database::query("UPDATE $table_document SET" . substr($ct, 1) ." WHERE id = '$docid'");
78
-    	}
77
+            Database::query("UPDATE $table_document SET" . substr($ct, 1) ." WHERE id = '$docid'");
78
+        }
79 79
         //check for missing images in html files
80 80
         $missing_files = check_for_missing_files($base_work_dir.$_POST['curdirpath'].$new_path);
81 81
         if ($missing_files) {
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
 //they want to create a directory
134 134
 if (isset($_POST['create_dir']) && $_POST['dirname']!='') {
135 135
     $added_slash = $path == '/' ? '' : '/';
136
-	$dir_name = $path.$added_slash.api_replace_dangerous_char($_POST['dirname']);
136
+    $dir_name = $path.$added_slash.api_replace_dangerous_char($_POST['dirname']);
137 137
     $created_dir = create_unexisting_directory(
138 138
         $_course,
139 139
         api_get_user_id(),
@@ -153,15 +153,15 @@  discard block
 block discarded – undo
153 153
 }
154 154
 
155 155
 if (isset($_GET['createdir'])) {
156
-	//create the form that asks for the directory name
157
-	$new_folder_text = '<form action="'.api_get_self().'" method="POST">';
158
-	$new_folder_text .= '<input type="hidden" name="curdirpath" value="'.$path.'"/>';
159
-	$new_folder_text .= get_lang('NewDir') .' ';
160
-	$new_folder_text .= '<input type="text" name="dirname"/>';
161
-	$new_folder_text .= '<input type="submit" name="create_dir" value="'.get_lang('Ok').'"/>';
162
-	$new_folder_text .= '</form>';
163
-	//show the form
164
-	Display::display_normal_message($new_folder_text);
156
+    //create the form that asks for the directory name
157
+    $new_folder_text = '<form action="'.api_get_self().'" method="POST">';
158
+    $new_folder_text .= '<input type="hidden" name="curdirpath" value="'.$path.'"/>';
159
+    $new_folder_text .= get_lang('NewDir') .' ';
160
+    $new_folder_text .= '<input type="text" name="dirname"/>';
161
+    $new_folder_text .= '<input type="submit" name="create_dir" value="'.get_lang('Ok').'"/>';
162
+    $new_folder_text .= '</form>';
163
+    //show the form
164
+    Display::display_normal_message($new_folder_text);
165 165
 } else {	//give them a link to create a directory
166 166
 ?>
167 167
 	<p>
Please login to merge, or discard this patch.
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -11,9 +11,9 @@  discard block
 block discarded – undo
11 11
  */
12 12
 
13 13
 $_course = api_get_course_info();
14
-$courseDir = $_course['path'] . "/document";
14
+$courseDir = $_course['path']."/document";
15 15
 $sys_course_path = api_get_path(SYS_COURSE_PATH);
16
-$base_work_dir = $sys_course_path . $courseDir;
16
+$base_work_dir = $sys_course_path.$courseDir;
17 17
 $noPHP_SELF = true;
18 18
 $max_filled_space = DocumentManager::get_course_quota();
19 19
 
@@ -35,12 +35,12 @@  discard block
 block discarded – undo
35 35
  */
36 36
 $nameTools = get_lang('UplUploadDocument');
37 37
 $interbreadcrumb[] = array(
38
-    "url" => api_get_path(WEB_CODE_PATH)."document/document.php?curdirpath=" . urlencode($path) . '&'.api_get_cidreq(),
38
+    "url" => api_get_path(WEB_CODE_PATH)."document/document.php?curdirpath=".urlencode($path).'&'.api_get_cidreq(),
39 39
     "name" => $langDocuments
40 40
 );
41 41
 Display::display_header($nameTools, "Doc");
42 42
 //show the title
43
-api_display_tool_title($nameTools . $add_group_to_title);
43
+api_display_tool_title($nameTools.$add_group_to_title);
44 44
 
45 45
 /**
46 46
  * Process
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
             if ($new_title) {
75 75
                 $ct .= ", title='$new_title'";
76 76
             }
77
-        	Database::query("UPDATE $table_document SET" . substr($ct, 1) ." WHERE id = '$docid'");
77
+        	Database::query("UPDATE $table_document SET".substr($ct, 1)." WHERE id = '$docid'");
78 78
     	}
79 79
         //check for missing images in html files
80 80
         $missing_files = check_for_missing_files($base_work_dir.$_POST['curdirpath'].$new_path);
@@ -124,14 +124,14 @@  discard block
 block discarded – undo
124 124
         replace_img_path_in_html_file(
125 125
             $_POST['img_file_path'],
126 126
             $paths_to_replace_in_file,
127
-            $base_work_dir . $_POST['related_file']
127
+            $base_work_dir.$_POST['related_file']
128 128
         );
129 129
         //update parent folders
130 130
         item_property_update_on_folder($_course, $_POST['curdirpath'], $_user['user_id']);
131 131
     }
132 132
 }
133 133
 //they want to create a directory
134
-if (isset($_POST['create_dir']) && $_POST['dirname']!='') {
134
+if (isset($_POST['create_dir']) && $_POST['dirname'] != '') {
135 135
     $added_slash = $path == '/' ? '' : '/';
136 136
 	$dir_name = $path.$added_slash.api_replace_dangerous_char($_POST['dirname']);
137 137
     $created_dir = create_unexisting_directory(
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
 	//create the form that asks for the directory name
157 157
 	$new_folder_text = '<form action="'.api_get_self().'" method="POST">';
158 158
 	$new_folder_text .= '<input type="hidden" name="curdirpath" value="'.$path.'"/>';
159
-	$new_folder_text .= get_lang('NewDir') .' ';
159
+	$new_folder_text .= get_lang('NewDir').' ';
160 160
 	$new_folder_text .= '<input type="text" name="dirname"/>';
161 161
 	$new_folder_text .= '<input type="submit" name="create_dir" value="'.get_lang('Ok').'"/>';
162 162
 	$new_folder_text .= '</form>';
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
 	<p>
168 168
         <a href="<?php echo api_get_self(); ?>?path=<?php echo $path; ?>&amp;createdir=1">
169 169
             <?php echo Display::return_icon('new_folder.gif'); ?>
170
-            <?php echo(get_lang('CreateDir'));?>
170
+            <?php echo(get_lang('CreateDir')); ?>
171 171
         </a>
172 172
     </p>
173 173
 <?php
@@ -190,11 +190,11 @@  discard block
 block discarded – undo
190 190
 </td>
191 191
 </tr>
192 192
 <tr>
193
-<td><?php echo get_lang('Title');?></td>
193
+<td><?php echo get_lang('Title'); ?></td>
194 194
 <td><input type="text" size="20" name="title" style="width:300px;"></td>
195 195
 </tr>
196 196
 <tr>
197
-<td valign="top"><?php echo get_lang('Comment');?></td>
197
+<td valign="top"><?php echo get_lang('Comment'); ?></td>
198 198
 <td><textarea rows="3" cols="20" name="comment" wrap="virtual" style="width:300px;"></textarea></td>
199 199
 </tr>
200 200
 <tr>
@@ -202,21 +202,21 @@  discard block
 block discarded – undo
202 202
 <?php echo get_lang('Options'); ?>
203 203
 </td>
204 204
 <td>
205
-- <input type="checkbox" name="unzip" value="1" onclick="check_unzip()"/> <?php echo(get_lang('Uncompress'));?><br/>
206
-- <?php echo (get_lang('UplWhatIfFileExists'));?><br/>
207
-&nbsp;&nbsp;&nbsp;<input type="radio" name="if_exists" value="nothing" title="<?php echo (get_lang('UplDoNothingLong'));?>" checked="checked"/>  <?php echo (get_lang('UplDoNothing'));?><br/>
208
-&nbsp;&nbsp;&nbsp;<input type="radio" name="if_exists" value="overwrite" title="<?php echo (get_lang('UplOverwriteLong'));?>"/> <?php echo (get_lang('UplOverwrite'));?><br/>
209
-&nbsp;&nbsp;&nbsp;<input type="radio" name="if_exists" value="rename" title="<?php echo (get_lang('UplRenameLong'));?>"/> <?php echo (get_lang('UplRename'));?>
205
+- <input type="checkbox" name="unzip" value="1" onclick="check_unzip()"/> <?php echo(get_lang('Uncompress')); ?><br/>
206
+- <?php echo (get_lang('UplWhatIfFileExists')); ?><br/>
207
+&nbsp;&nbsp;&nbsp;<input type="radio" name="if_exists" value="nothing" title="<?php echo (get_lang('UplDoNothingLong')); ?>" checked="checked"/>  <?php echo (get_lang('UplDoNothing')); ?><br/>
208
+&nbsp;&nbsp;&nbsp;<input type="radio" name="if_exists" value="overwrite" title="<?php echo (get_lang('UplOverwriteLong')); ?>"/> <?php echo (get_lang('UplOverwrite')); ?><br/>
209
+&nbsp;&nbsp;&nbsp;<input type="radio" name="if_exists" value="rename" title="<?php echo (get_lang('UplRenameLong')); ?>"/> <?php echo (get_lang('UplRename')); ?>
210 210
 </td>
211 211
 </tr>
212 212
 </table>
213 213
 
214
-<input type="submit" value="<?php echo(get_lang('Ok'));?>">
214
+<input type="submit" value="<?php echo(get_lang('Ok')); ?>">
215 215
 </form>
216 216
 <!-- end upload form -->
217 217
 
218 218
  <!-- so they can get back to the documents   -->
219
- <p><?php echo (get_lang('Back'));?> <?php echo (get_lang('To'));?> <a href="document.php?curdirpath=<?php echo $path; ?>"><?php echo (get_lang('DocumentsOverview'));?></a></p>
219
+ <p><?php echo (get_lang('Back')); ?> <?php echo (get_lang('To')); ?> <a href="document.php?curdirpath=<?php echo $path; ?>"><?php echo (get_lang('DocumentsOverview')); ?></a></p>
220 220
 <?php
221 221
 
222 222
 Display::display_footer();
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -64,9 +64,10 @@
 block discarded – undo
64 64
     	$new_comment = isset($_POST['comment']) ? Database::escape_string(trim($_POST['comment'])) : '';
65 65
     	$new_title = isset($_POST['title']) ? Database::escape_string(trim($_POST['title'])) : '';
66 66
 
67
-    	if ($new_path && ($new_comment || $new_title))
68
-    	if (($docid = DocumentManager::get_document_id($_course, $new_path))) {
67
+    	if ($new_path && ($new_comment || $new_title)) {
68
+    	    	if (($docid = DocumentManager::get_document_id($_course, $new_path))) {
69 69
         	$table_document = Database::get_course_table(TABLE_DOCUMENT);
70
+    	}
70 71
         	$ct = '';
71 72
             if ($new_comment) {
72 73
                 $ct .= ", comment='$new_comment'";
Please login to merge, or discard this patch.
main/exercise/adminhp.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -7,12 +7,12 @@  discard block
 block discarded – undo
7 7
 */
8 8
 require_once '../inc/global.inc.php';
9 9
 
10
-$this_section=SECTION_COURSES;
10
+$this_section = SECTION_COURSES;
11 11
 
12 12
 $_course = api_get_course_info();
13 13
 
14 14
 if (isset($_REQUEST["cancel"])) {
15
-    if ($_REQUEST["cancel"]==get_lang('Cancel')) {
15
+    if ($_REQUEST["cancel"] == get_lang('Cancel')) {
16 16
         header("Location: exercise.php");
17 17
         exit;
18 18
     }
@@ -20,16 +20,16 @@  discard block
 block discarded – undo
20 20
 
21 21
 $newName = !empty($_REQUEST['newName']) ? $_REQUEST['newName'] : '';
22 22
 $hotpotatoesName = !empty($_REQUEST['hotpotatoesName']) ? Security::remove_XSS($_REQUEST['hotpotatoesName']) : '';
23
-$is_allowedToEdit=api_is_allowed_to_edit(null,true);
23
+$is_allowedToEdit = api_is_allowed_to_edit(null, true);
24 24
 
25 25
 // document path
26
-$documentPath=api_get_path(SYS_COURSE_PATH).$_course['path'].'/document';
26
+$documentPath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document';
27 27
 
28 28
 // picture path
29
-$picturePath=$documentPath.'/images';
29
+$picturePath = $documentPath.'/images';
30 30
 
31 31
 // audio path
32
-$audioPath=$documentPath.'/audio';
32
+$audioPath = $documentPath.'/audio';
33 33
 
34 34
 // Database table definitions
35 35
 if (!$is_allowedToEdit) {
@@ -37,21 +37,21 @@  discard block
 block discarded – undo
37 37
 }
38 38
 
39 39
 if (isset($_SESSION['gradebook'])) {
40
-    $gradebook=	$_SESSION['gradebook'];
40
+    $gradebook = $_SESSION['gradebook'];
41 41
 }
42 42
 
43
-if (!empty($gradebook) && $gradebook=='view') {
44
-    $interbreadcrumb[]= array (
43
+if (!empty($gradebook) && $gradebook == 'view') {
44
+    $interbreadcrumb[] = array(
45 45
         'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
46 46
         'name' => get_lang('ToolGradebook'),
47 47
     );
48 48
 }
49 49
 
50
-$interbreadcrumb[]=array("url" => "exercise.php","name" => get_lang('Exercises'));
50
+$interbreadcrumb[] = array("url" => "exercise.php", "name" => get_lang('Exercises'));
51 51
 
52 52
 $nameTools = get_lang('adminHP');
53 53
 
54
-Display::display_header($nameTools,"Exercise");
54
+Display::display_header($nameTools, "Exercise");
55 55
 
56 56
 /** @todo probably wrong !!!! */
57 57
 require_once api_get_path(SYS_CODE_PATH).'/exercise/hotpotatoes.lib.php';
@@ -64,9 +64,9 @@  discard block
 block discarded – undo
64 64
 
65 65
 <?php
66 66
 if (isset($newName)) {
67
-    if ($newName!="") {
67
+    if ($newName != "") {
68 68
         //alter database record for that test
69
-        SetComment($hotpotatoesName,$newName);
69
+        SetComment($hotpotatoesName, $newName);
70 70
         echo "<script language='Javascript' type='text/javascript'> window.location='exercise.php'; </script>";
71 71
     }
72 72
 }
@@ -78,10 +78,10 @@  discard block
 block discarded – undo
78 78
 $lstrComment = '';
79 79
 $lstrComment = GetComment($hotpotatoesName);
80 80
 if ($lstrComment == '') {
81
-    $lstrComment = GetQuizName($hotpotatoesName,$documentPath);
81
+    $lstrComment = GetQuizName($hotpotatoesName, $documentPath);
82 82
 }
83 83
 if ($lstrComment == '') {
84
-    $lstrComment = basename($hotpotatoesName,$documentPath);
84
+    $lstrComment = basename($hotpotatoesName, $documentPath);
85 85
 }
86 86
 
87 87
 echo $lstrComment;
Please login to merge, or discard this patch.
main/exercise/hotspot.class.php 2 patches
Indentation   +98 added lines, -98 removed lines patch added patch discarded remove patch
@@ -12,31 +12,31 @@  discard block
 block discarded – undo
12 12
  **/
13 13
 class HotSpot extends Question
14 14
 {
15
-	public static $typePicture = 'hotspot.png';
16
-	public static $explanationLangVar = 'HotSpot';
15
+    public static $typePicture = 'hotspot.png';
16
+    public static $explanationLangVar = 'HotSpot';
17 17
 
18 18
     /**
19 19
      * HotSpot constructor.
20 20
      */
21
-	public function __construct()
22
-	{
23
-		parent::__construct();
24
-		$this->type = HOT_SPOT;
25
-	}
26
-
27
-	public function display()
28
-	{
29
-	}
30
-
31
-	/**
32
-	 * @param FormValidator $form
33
-	 * @param int $fck_config
34
-	 */
35
-	public function createForm (&$form, $fck_config=0)
36
-	{
37
-		parent::createForm($form, $fck_config);
38
-
39
-		if (!isset($_GET['editQuestion'])) {
21
+    public function __construct()
22
+    {
23
+        parent::__construct();
24
+        $this->type = HOT_SPOT;
25
+    }
26
+
27
+    public function display()
28
+    {
29
+    }
30
+
31
+    /**
32
+     * @param FormValidator $form
33
+     * @param int $fck_config
34
+     */
35
+    public function createForm (&$form, $fck_config=0)
36
+    {
37
+        parent::createForm($form, $fck_config);
38
+
39
+        if (!isset($_GET['editQuestion'])) {
40 40
             $form->addElement(
41 41
                 'file',
42 42
                 'imageUpload',
@@ -46,54 +46,54 @@  discard block
 block discarded – undo
46 46
                 )
47 47
             );
48 48
 
49
-			// setting the save button here and not in the question class.php
50
-			// Saving a question
51
-			$form->addButtonSave(get_lang('GoToQuestion'), 'submitQuestion');
52
-			//$form->addButtonSave(get_lang('GoToQuestion'), 'submitQuestion');
53
-			$form->addRule('imageUpload', get_lang('OnlyImagesAllowed'), 'filetype', array ('jpg', 'jpeg', 'png', 'gif'));
54
-			$form->addRule('imageUpload', get_lang('NoImage'), 'uploadedfile');
55
-		} else {
56
-			// setting the save button here and not in the question class.php
57
-			// Editing a question
58
-			$form->addButtonUpdate(get_lang('ModifyExercise'), 'submitQuestion');
59
-		}
60
-	}
61
-
62
-	/**
63
-	 * @param FormValidator $form
64
-	 * @param null $objExercise
65
-	 * @return null|false
66
-	 */
67
-	public function processCreation($form, $objExercise = null)
68
-	{
69
-		$file_info = $form->getSubmitValue('imageUpload');
70
-		$_course = api_get_course_info();
71
-		parent::processCreation($form, $objExercise);
72
-
73
-		if(!empty($file_info['tmp_name'])) {
74
-			$this->uploadPicture($file_info['tmp_name'], $file_info['name']);
75
-			$documentPath  = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document';
76
-			$picturePath   = $documentPath.'/images';
77
-
78
-			// fixed width ang height
79
-			if (file_exists($picturePath.'/'.$this->picture)) {
80
-				$this->resizePicture('width', 800);
81
-				$this->save();
82
-			} else {
83
-				return false;
84
-			}
85
-		}
86
-	}
87
-
88
-	function createAnswersForm($form)
89
-	{
90
-		// nothing
91
-	}
92
-
93
-	function processAnswersCreation($form)
94
-	{
95
-		// nothing
96
-	}
49
+            // setting the save button here and not in the question class.php
50
+            // Saving a question
51
+            $form->addButtonSave(get_lang('GoToQuestion'), 'submitQuestion');
52
+            //$form->addButtonSave(get_lang('GoToQuestion'), 'submitQuestion');
53
+            $form->addRule('imageUpload', get_lang('OnlyImagesAllowed'), 'filetype', array ('jpg', 'jpeg', 'png', 'gif'));
54
+            $form->addRule('imageUpload', get_lang('NoImage'), 'uploadedfile');
55
+        } else {
56
+            // setting the save button here and not in the question class.php
57
+            // Editing a question
58
+            $form->addButtonUpdate(get_lang('ModifyExercise'), 'submitQuestion');
59
+        }
60
+    }
61
+
62
+    /**
63
+     * @param FormValidator $form
64
+     * @param null $objExercise
65
+     * @return null|false
66
+     */
67
+    public function processCreation($form, $objExercise = null)
68
+    {
69
+        $file_info = $form->getSubmitValue('imageUpload');
70
+        $_course = api_get_course_info();
71
+        parent::processCreation($form, $objExercise);
72
+
73
+        if(!empty($file_info['tmp_name'])) {
74
+            $this->uploadPicture($file_info['tmp_name'], $file_info['name']);
75
+            $documentPath  = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document';
76
+            $picturePath   = $documentPath.'/images';
77
+
78
+            // fixed width ang height
79
+            if (file_exists($picturePath.'/'.$this->picture)) {
80
+                $this->resizePicture('width', 800);
81
+                $this->save();
82
+            } else {
83
+                return false;
84
+            }
85
+        }
86
+    }
87
+
88
+    function createAnswersForm($form)
89
+    {
90
+        // nothing
91
+    }
92
+
93
+    function processAnswersCreation($form)
94
+    {
95
+        // nothing
96
+    }
97 97
 }
98 98
 
99 99
 /**
@@ -101,38 +101,38 @@  discard block
 block discarded – undo
101 101
  */
102 102
 class HotSpotDelineation extends HotSpot
103 103
 {
104
-	public static $typePicture = 'hotspot-delineation.png';
105
-	public static $explanationLangVar = 'HotspotDelineation';
104
+    public static $typePicture = 'hotspot-delineation.png';
105
+    public static $explanationLangVar = 'HotspotDelineation';
106 106
 
107 107
     /**
108 108
      * HotSpotDelineation constructor.
109 109
      */
110
-	public function __construct()
111
-	{
112
-		parent::__construct();
113
-		$this -> type = HOT_SPOT_DELINEATION;
114
-
115
-	}
116
-
117
-	function createForm(&$form, $fck_config=0)
118
-	{
119
-		parent::createForm ($form, $fck_config);
120
-	}
121
-
122
-	function processCreation ($form, $objExercise = null)
123
-	{
124
-		$file_info = $form -> getSubmitValue('imageUpload');
125
-		parent::processCreation ($form, $objExercise);
126
-	}
127
-
128
-	function createAnswersForm ($form)
129
-	{
130
-		parent::createAnswersForm ($form);
131
-	}
132
-
133
-	function processAnswersCreation ($form)
134
-	{
135
-		parent::processAnswersCreation ($form);
136
-	}
110
+    public function __construct()
111
+    {
112
+        parent::__construct();
113
+        $this -> type = HOT_SPOT_DELINEATION;
114
+
115
+    }
116
+
117
+    function createForm(&$form, $fck_config=0)
118
+    {
119
+        parent::createForm ($form, $fck_config);
120
+    }
121
+
122
+    function processCreation ($form, $objExercise = null)
123
+    {
124
+        $file_info = $form -> getSubmitValue('imageUpload');
125
+        parent::processCreation ($form, $objExercise);
126
+    }
127
+
128
+    function createAnswersForm ($form)
129
+    {
130
+        parent::createAnswersForm ($form);
131
+    }
132
+
133
+    function processAnswersCreation ($form)
134
+    {
135
+        parent::processAnswersCreation ($form);
136
+    }
137 137
 }
138 138
 
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 	 * @param FormValidator $form
33 33
 	 * @param int $fck_config
34 34
 	 */
35
-	public function createForm (&$form, $fck_config=0)
35
+	public function createForm(&$form, $fck_config = 0)
36 36
 	{
37 37
 		parent::createForm($form, $fck_config);
38 38
 
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 			// Saving a question
51 51
 			$form->addButtonSave(get_lang('GoToQuestion'), 'submitQuestion');
52 52
 			//$form->addButtonSave(get_lang('GoToQuestion'), 'submitQuestion');
53
-			$form->addRule('imageUpload', get_lang('OnlyImagesAllowed'), 'filetype', array ('jpg', 'jpeg', 'png', 'gif'));
53
+			$form->addRule('imageUpload', get_lang('OnlyImagesAllowed'), 'filetype', array('jpg', 'jpeg', 'png', 'gif'));
54 54
 			$form->addRule('imageUpload', get_lang('NoImage'), 'uploadedfile');
55 55
 		} else {
56 56
 			// setting the save button here and not in the question class.php
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 		$_course = api_get_course_info();
71 71
 		parent::processCreation($form, $objExercise);
72 72
 
73
-		if(!empty($file_info['tmp_name'])) {
73
+		if (!empty($file_info['tmp_name'])) {
74 74
 			$this->uploadPicture($file_info['tmp_name'], $file_info['name']);
75 75
 			$documentPath  = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document';
76 76
 			$picturePath   = $documentPath.'/images';
@@ -114,25 +114,25 @@  discard block
 block discarded – undo
114 114
 
115 115
 	}
116 116
 
117
-	function createForm(&$form, $fck_config=0)
117
+	function createForm(&$form, $fck_config = 0)
118 118
 	{
119
-		parent::createForm ($form, $fck_config);
119
+		parent::createForm($form, $fck_config);
120 120
 	}
121 121
 
122
-	function processCreation ($form, $objExercise = null)
122
+	function processCreation($form, $objExercise = null)
123 123
 	{
124 124
 		$file_info = $form -> getSubmitValue('imageUpload');
125
-		parent::processCreation ($form, $objExercise);
125
+		parent::processCreation($form, $objExercise);
126 126
 	}
127 127
 
128
-	function createAnswersForm ($form)
128
+	function createAnswersForm($form)
129 129
 	{
130
-		parent::createAnswersForm ($form);
130
+		parent::createAnswersForm($form);
131 131
 	}
132 132
 
133
-	function processAnswersCreation ($form)
133
+	function processAnswersCreation($form)
134 134
 	{
135
-		parent::processAnswersCreation ($form);
135
+		parent::processAnswersCreation($form);
136 136
 	}
137 137
 }
138 138
 
Please login to merge, or discard this patch.