Completed
Push — 1.11.x ( 78f130...f6f5c2 )
by José
50:40 queued 24:26
created
main/inc/lib/grade_model.lib.php 3 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -259,10 +259,10 @@
 block discarded – undo
259 259
     }
260 260
 
261 261
     /**
262
-     * @param $form
262
+     * @param CatForm $form
263 263
      * @param string $name
264 264
      * @param null $default_value
265
-     * @return bool
265
+     * @return false|null
266 266
      */
267 267
     public function fill_grade_model_select_in_form(&$form, $name = 'gradebook_model_id', $default_value = null)
268 268
     {
Please login to merge, or discard this patch.
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -51,15 +51,15 @@  discard block
 block discarded – undo
51 51
     /**
52 52
      * Displays the title + grid
53 53
      */
54
-	public function display()
54
+    public function display()
55 55
     {
56
-		// action links
57
-		echo '<div class="actions" style="margin-bottom:20px">';
56
+        // action links
57
+        echo '<div class="actions" style="margin-bottom:20px">';
58 58
         echo '<a href="grade_models.php">'.Display::return_icon('back.png',get_lang('Back'),'', ICON_SIZE_MEDIUM).'</a>';
59
-		echo '<a href="'.api_get_self().'?action=add">'.Display::return_icon('add.png', get_lang('Add'), '', ICON_SIZE_MEDIUM).'</a>';
60
-		echo '</div>';
59
+        echo '<a href="'.api_get_self().'?action=add">'.Display::return_icon('add.png', get_lang('Add'), '', ICON_SIZE_MEDIUM).'</a>';
60
+        echo '</div>';
61 61
         echo Display::grid_html('grade_model');
62
-	}
62
+    }
63 63
 
64 64
     /**
65 65
      * Returns a Form validator Obj
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
         }
118 118
 
119 119
         $form->addElement('hidden', 'maxvalue', '100');
120
-		$form->addElement('hidden', 'minvalue', '0');
120
+        $form->addElement('hidden', 'minvalue', '0');
121 121
         $renderer = & $form->defaultRenderer();
122 122
 
123 123
         $component_array = array();
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
         // Setting the rules
193 193
         $form->addRule('name', get_lang('ThisFieldIsRequired'), 'required');
194 194
 
195
-		return $form;
195
+        return $form;
196 196
     }
197 197
 
198 198
     /**
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
      */
256 256
     public function delete($id)
257 257
     {
258
-	    parent::delete($id);
258
+        parent::delete($id);
259 259
     }
260 260
 
261 261
     /**
@@ -309,11 +309,11 @@  discard block
 block discarded – undo
309 309
     /**
310 310
      * GradeModelComponents constructor.
311 311
      */
312
-	public function __construct()
312
+    public function __construct()
313 313
     {
314 314
         parent::__construct();
315 315
         $this->table = Database::get_main_table(TABLE_GRADE_MODEL_COMPONENTS);
316
-	}
316
+    }
317 317
 
318 318
     /**
319 319
      * @param array $params
@@ -322,7 +322,7 @@  discard block
 block discarded – undo
322 322
      */
323 323
     public function save($params, $show_query = false)
324 324
     {
325
-	    $id = parent::save($params, $show_query);
325
+        $id = parent::save($params, $show_query);
326 326
 
327 327
         return $id;
328 328
     }
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
     public function __construct()
17 17
     {
18 18
         parent::__construct();
19
-        $this->table =  Database::get_main_table(TABLE_GRADE_MODEL);
19
+        $this->table = Database::get_main_table(TABLE_GRADE_MODEL);
20 20
     }
21 21
 
22 22
     /**
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
     {
56 56
 		// action links
57 57
 		echo '<div class="actions" style="margin-bottom:20px">';
58
-        echo '<a href="grade_models.php">'.Display::return_icon('back.png',get_lang('Back'),'', ICON_SIZE_MEDIUM).'</a>';
58
+        echo '<a href="grade_models.php">'.Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM).'</a>';
59 59
 		echo '<a href="'.api_get_self().'?action=add">'.Display::return_icon('add.png', get_lang('Add'), '', ICON_SIZE_MEDIUM).'</a>';
60 60
 		echo '</div>';
61 61
         echo Display::grid_html('grade_model');
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
             $form->addElement('hidden', 'components['.$i.'][id]', null);
130 130
 
131 131
             $template_percentage =
132
-            '<div id=' . $i . ' style="display: '.(($i<=$nr_items)?'inline':'none').';" class="form-group">                
132
+            '<div id='.$i.' style="display: '.(($i <= $nr_items) ? 'inline' : 'none').';" class="form-group">                
133 133
                 <label for="" class="col-sm-2 control-label">
134 134
                     {label}
135 135
                 </label>
@@ -143,11 +143,11 @@  discard block
 block discarded – undo
143 143
 
144 144
             $template_title =
145 145
             '&nbsp{element} <!-- BEGIN error --> <span class="form_error">{error}</span><!-- END error -->
146
-             <a href="javascript:plusItem(' . ($counter+1) . ')">
147
-                '.Display::return_icon('add.png', get_lang('Add'), ['id' => 'plus-' . ($counter+1), 'style' => 'display: '.(($counter>=$nr_items) ? 'inline':'none') ]).'
146
+             <a href="javascript:plusItem(' . ($counter + 1).')">
147
+                '.Display::return_icon('add.png', get_lang('Add'), ['id' => 'plus-'.($counter + 1), 'style' => 'display: '.(($counter >= $nr_items) ? 'inline' : 'none')]).'
148 148
             </a>
149
-            <a href="javascript:minItem(' . ($counter) . ')">
150
-                '.Display::return_icon('delete.png', get_lang('Delete'), ['id' => 'min-' . ($counter), 'style' => 'display: '.(($counter>=$nr_items) ? 'inline':'none') ]).'
149
+            <a href="javascript:minItem(' . ($counter).')">
150
+                '.Display::return_icon('delete.png', get_lang('Delete'), ['id' => 'min-'.($counter), 'style' => 'display: '.(($counter >= $nr_items) ? 'inline' : 'none')]).'
151 151
             </a>
152 152
             </div></div>';
153 153
             $renderer->setElementTemplate($template_title, 'components['.$i.'][title]');
Please login to merge, or discard this patch.
main/attendance/attendance_add.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 
13 13
 // error messages
14 14
 if (isset($error)) {
15
-    Display::display_error_message(get_lang('FormHasErrorsPleaseComplete'),false);
15
+    Display::display_error_message(get_lang('FormHasErrorsPleaseComplete'), false);
16 16
 }
17 17
 
18 18
 if (!isset($error)) {
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 $form->addElement('hidden', 'sec_token', $token);
29 29
 
30 30
 $form->addText('title', get_lang('Title'), true);
31
-$form->applyFilter('title','html_filter');
31
+$form->applyFilter('title', 'html_filter');
32 32
 $form->addHtmlEditor(
33 33
     'description',
34 34
     get_lang('Description'),
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 if ((api_get_session_id() != 0 && Gradebook::is_active()) || api_get_session_id() == 0) {
42 42
     $form->addButtonAdvancedSettings('id_qualify');
43 43
 
44
-    $form->addElement('html','<div id="id_qualify_options" style="display:none">');
44
+    $form->addElement('html', '<div id="id_qualify_options" style="display:none">');
45 45
 
46 46
     // Qualify Attendance for gradebook option
47 47
     $form->addElement(
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
         get_lang('QualifyAttendanceGradebook'),
52 52
         'onclick="javascript: if(this.checked){document.getElementById(\'options_field\').style.display = \'block\';}else{document.getElementById(\'options_field\').style.display = \'none\';}"'
53 53
     );
54
-    $form->addElement('html','<div id="options_field" style="display:none">');
54
+    $form->addElement('html', '<div id="options_field" style="display:none">');
55 55
 
56 56
     GradebookUtils::load_gradebook_select_in_tool($form);
57 57
 
@@ -64,8 +64,8 @@  discard block
 block discarded – undo
64 64
         'value="0.00" Style="width:40px" onfocus="javascript: this.select();"'
65 65
     );
66 66
     $form->applyFilter('attendance_weight', 'html_filter');
67
-    $form->addElement('html','</div>');
68
-    $form->addElement('html','</div>');
67
+    $form->addElement('html', '</div>');
68
+    $form->addElement('html', '</div>');
69 69
 }
70 70
 $form->addButtonCreate(get_lang('Save'));
71 71
 $form->display();
Please login to merge, or discard this patch.
main/attendance/attendance_edit.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 
13 13
 // error messages
14 14
 if (isset($error)) {
15
-    Display::display_error_message(get_lang('FormHasErrorsPleaseComplete'),false);
15
+    Display::display_error_message(get_lang('FormHasErrorsPleaseComplete'), false);
16 16
 }
17 17
 
18 18
 if (!isset($error)) {
@@ -49,18 +49,18 @@  discard block
 block discarded – undo
49 49
 if (Gradebook::is_active()) {
50 50
     if (!empty($attendance_qualify_title) || !empty($attendance_weight)) {
51 51
         $form->addButtonAdvancedSettings('id_qualify');
52
-        $form->addElement('html','<div id="id_qualify_options" style="display:block">');
52
+        $form->addElement('html', '<div id="id_qualify_options" style="display:block">');
53 53
         $form->addElement(
54 54
             'checkbox',
55 55
             'attendance_qualify_gradebook',
56 56
             '',
57 57
             get_lang('QualifyAttendanceGradebook'),
58
-            array('checked'=>'true','onclick'=>'javascript: if(this.checked){document.getElementById(\'options_field\').style.display = \'block\';}else{document.getElementById(\'options_field\').style.display = \'none\';}')
58
+            array('checked'=>'true', 'onclick'=>'javascript: if(this.checked){document.getElementById(\'options_field\').style.display = \'block\';}else{document.getElementById(\'options_field\').style.display = \'none\';}')
59 59
         );
60
-        $form->addElement('html','<div id="options_field" style="display:block">');
60
+        $form->addElement('html', '<div id="options_field" style="display:block">');
61 61
     } else {
62 62
         $form->addButtonAdvancedSettings('id_qualify');
63
-        $form->addElement('html','<div id="id_qualify_options" style="display:none">');
63
+        $form->addElement('html', '<div id="id_qualify_options" style="display:none">');
64 64
         $form->addElement(
65 65
             'checkbox',
66 66
             'attendance_qualify_gradebook',
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
             get_lang('QualifyAttendanceGradebook'),
69 69
             'onclick="javascript: if(this.checked){document.getElementById(\'options_field\').style.display = \'block\';}else{document.getElementById(\'options_field\').style.display = \'none\';}"'
70 70
         );
71
-        $form->addElement('html','<div id="options_field" style="display:none">');
71
+        $form->addElement('html', '<div id="options_field" style="display:none">');
72 72
     }
73 73
     GradebookUtils::load_gradebook_select_in_tool($form);
74 74
     $form->addElement('text', 'attendance_qualify_title', get_lang('TitleColumnGradebook'));
Please login to merge, or discard this patch.
main/attendance/attendance_sheet.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
     $form = new FormValidator(
25 25
             'filter',
26 26
             'post',
27
-            'index.php?action=attendance_sheet_list&' . api_get_cidreq().'&attendance_id=' . $attendance_id,
27
+            'index.php?action=attendance_sheet_list&'.api_get_cidreq().'&attendance_id='.$attendance_id,
28 28
             null,
29 29
             array(),
30 30
             'inline'
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
                             <th width="100px"><?php echo get_lang('AttendancesFaults')?></th>
216 216
                         </tr>
217 217
                         <tr class="tableFloatingHeaderOriginal" >
218
-                            <th width="10px"><?php echo '#';?></th>
218
+                            <th width="10px"><?php echo '#'; ?></th>
219 219
                             <th width="10px"><?php echo get_lang('Photo')?></th>
220 220
                             <th width="150px"><?php echo get_lang('LastName')?></th>
221 221
                             <th width="140px"><?php echo get_lang('FirstName')?></th>
@@ -229,9 +229,9 @@  discard block
 block discarded – undo
229 229
                         foreach ($users_in_course as $data) {
230 230
                             $faults = 0;
231 231
                             if ($i % 2 == 0) {
232
-                                $class='row_odd';
232
+                                $class = 'row_odd';
233 233
                             } else {
234
-                                $class='row_even';
234
+                                $class = 'row_even';
235 235
                             }
236 236
                             $username = api_htmlentities(sprintf(get_lang('LoginX'), $data['username']), ENT_QUOTES);
237 237
                             ?>
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
                                 <td><span title="<?php echo $username ?>"><?php echo $data['lastname'] ?></span></td>
242 242
                                 <td><?php echo $data['firstname'] ?></td>
243 243
                                 <td>
244
-                                    <div class="attendance-faults-bar" style="background-color:<?php echo (!empty($data['result_color_bar'])?$data['result_color_bar']:'none') ?>">
244
+                                    <div class="attendance-faults-bar" style="background-color:<?php echo (!empty($data['result_color_bar']) ? $data['result_color_bar'] : 'none') ?>">
245 245
                                         <?php echo $data['attendance_result'] ?>
246 246
                                     </div>
247 247
                                 </td>
@@ -263,7 +263,7 @@  discard block
 block discarded – undo
263 263
                     foreach ($attendant_calendar as $calendar) {
264 264
                         $date = $calendar['date'];
265 265
                         $time = $calendar['time'];
266
-                        $datetime = '<div class="grey">'. $date . ' - ' . $time . '</div>';
266
+                        $datetime = '<div class="grey">'.$date.' - '.$time.'</div>';
267 267
 
268 268
                         $img_lock = Display::return_icon(
269 269
                             'lock-closed.png',
@@ -272,21 +272,21 @@  discard block
 block discarded – undo
272 272
                         );
273 273
 
274 274
                         if (!empty($calendar['done_attendance'])) {
275
-                            $datetime = '<div class="blue">' . $date . ' - ' . $time . '</div>';
275
+                            $datetime = '<div class="blue">'.$date.' - '.$time.'</div>';
276 276
                         }
277 277
                         $disabled_check = 'disabled = "true"';
278 278
                         $input_hidden = '<input type="hidden" id="hidden_input_'.$calendar['id'].'" name="hidden_input[]" value="" disabled />';
279 279
                         if ($next_attendance_calendar_id == $calendar['id']) {
280 280
                             $input_hidden = '<input type="hidden" id="hidden_input_'.$calendar['id'].'" name="hidden_input[]" value="'.$calendar['id'].'" />';
281 281
                             $disabled_check = '';
282
-                            $img_lock = Display::return_icon('lock-closed.png',get_lang('DateLock'),array('class'=>'img_unlock','id'=>'datetime_column_'.$calendar['id']));
282
+                            $img_lock = Display::return_icon('lock-closed.png', get_lang('DateLock'), array('class'=>'img_unlock', 'id'=>'datetime_column_'.$calendar['id']));
283 283
                         }
284 284
 
285 285
                         $result .= '<th>';
286 286
                         $result .= '<div class="date-attendance">'.$datetime.'&nbsp;';
287 287
 
288 288
                         if (api_is_allowed_to_edit(null, true)) {
289
-                            $result .= '<span id="attendance_lock" style="cursor:pointer">'.(!$is_locked_attendance || api_is_platform_admin()?$img_lock:'').'</span>';
289
+                            $result .= '<span id="attendance_lock" style="cursor:pointer">'.(!$is_locked_attendance || api_is_platform_admin() ? $img_lock : '').'</span>';
290 290
                         }
291 291
 
292 292
                         if ($is_locked_attendance == false) {
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
                     }
298 298
                 } else {
299 299
                     $result  = '<th width="2000px"><span><a href="index.php?'.api_get_cidreq().'&action=calendar_list&attendance_id='.$attendance_id.'">';
300
-                    $result .= Display::return_icon('attendance_calendar.png',get_lang('AttendanceCalendar'),'',ICON_SIZE_MEDIUM).' '.get_lang('GoToAttendanceCalendar').'</a></span></th>';
300
+                    $result .= Display::return_icon('attendance_calendar.png', get_lang('AttendanceCalendar'), '', ICON_SIZE_MEDIUM).' '.get_lang('GoToAttendanceCalendar').'</a></span></th>';
301 301
                 }
302 302
 
303 303
                 echo '<tr class="tableFloatingHeader row_odd" style="position: absolute; top: 0px; left: 0px; visibility: hidden; margin:0px;padding:0px">';
@@ -311,7 +311,7 @@  discard block
 block discarded – undo
311 311
                 $i = 0;
312 312
                 foreach ($users_in_course as $user) {
313 313
                     $class = '';
314
-                    if ($i%2 == 0) {
314
+                    if ($i % 2 == 0) {
315 315
                         $class = 'row_even';
316 316
                     } else {
317 317
                         $class = 'row_odd';
@@ -358,7 +358,7 @@  discard block
 block discarded – undo
358 358
                                     echo '<input type="checkbox" name="check_presence['.$calendar['id'].'][]" value="'.$user['user_id'].'" '.$disabled.' '.$checked.' />';
359 359
                                     echo '<span class="anchor_'.$calendar['id'].'"></span>';
360 360
                                 } else {
361
-                                    echo $presence ? Display::return_icon('checkbox_on.gif',get_lang('Presence')) : Display::return_icon('checkbox_off.gif',get_lang('Presence'));
361
+                                    echo $presence ? Display::return_icon('checkbox_on.gif', get_lang('Presence')) : Display::return_icon('checkbox_off.gif', get_lang('Presence'));
362 362
                                 }
363 363
                             } else {
364 364
                                 switch ($presence) {
@@ -389,7 +389,7 @@  discard block
 block discarded – undo
389 389
                         </td>';
390 390
                     }
391 391
                     echo '</tr>';
392
-                    $i++ ;
392
+                    $i++;
393 393
                 }
394 394
                 echo '</tbody></table>';
395 395
                 echo '</div></div>';
@@ -417,13 +417,13 @@  discard block
 block discarded – undo
417 417
     echo Display::page_header(get_lang('AttendanceSheetReport'));
418 418
     // View for students
419 419
     ?>
420
-    <?php if(!empty($users_presence)) { ?>
420
+    <?php if (!empty($users_presence)) { ?>
421 421
         <div>
422 422
             <table width="250px;">
423 423
                 <tr>
424 424
                     <td><?php echo get_lang('ToAttend').': ' ?></td>
425 425
                     <td>
426
-                        <center><div class="attendance-faults-bar" style="background-color:<?php echo (!empty($faults['color_bar'])?$faults['color_bar']:'none') ?>">
426
+                        <center><div class="attendance-faults-bar" style="background-color:<?php echo (!empty($faults['color_bar']) ? $faults['color_bar'] : 'none') ?>">
427 427
                         <?php echo $faults['faults'].'/'.$faults['total'].' ('.$faults['faults_porcent'].'%)' ?></div></center>
428 428
                     </td>
429 429
                 </tr>
@@ -448,7 +448,7 @@  discard block
 block discarded – undo
448 448
                 ?>
449 449
                 <tr class="<?php echo $class ?>">
450 450
                     <td>
451
-                        <?php echo $presence['presence'] ? Display::return_icon('checkbox_on.gif',get_lang('Presence')) : Display::return_icon('checkbox_off.gif',get_lang('Presence')) ?>
451
+                        <?php echo $presence['presence'] ? Display::return_icon('checkbox_on.gif', get_lang('Presence')) : Display::return_icon('checkbox_off.gif', get_lang('Presence')) ?>
452 452
                         <?php echo "&nbsp; ".$presence['date_time'] ?>
453 453
                     </td>
454 454
                 </tr>
Please login to merge, or discard this patch.
main/inc/lib/dashboard.lib.php 3 patches
Indentation   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -307,8 +307,8 @@  discard block
 block discarded – undo
307 307
             }
308 308
         }
309 309
 
310
-		return $block_data;
311
-	}
310
+        return $block_data;
311
+    }
312 312
 
313 313
     /**
314 314
      * get data about enabled dashboard block (stored insise block table)
@@ -491,42 +491,42 @@  discard block
 block discarded – undo
491 491
         return $data;
492 492
     }
493 493
 
494
-	/**
495
-	 * This function update extra user blocks data after closing a dashboard block
496
-	 * @param int 		User id
497
-	 * @param string	plugin path
498
-	 * @param integer $user_id
499
-	 * @return bool
500
-	 */
501
-	public static function close_user_block($user_id, $path)
494
+    /**
495
+     * This function update extra user blocks data after closing a dashboard block
496
+     * @param int 		User id
497
+     * @param string	plugin path
498
+     * @param integer $user_id
499
+     * @return bool
500
+     */
501
+    public static function close_user_block($user_id, $path)
502 502
     {
503
-		$enabled_dashboard_blocks = self::get_enabled_dashboard_blocks($path);
504
-		$user_block_data = self::get_user_block_data($user_id);
505
-
506
-		foreach ($enabled_dashboard_blocks as $enabled_block) {
507
-			unset($user_block_data[$enabled_block['id']]);
508
-		}
509
-
510
-		// get columns and blocks id for updating extra user data
511
-		$columns = array();
512
-		$user_blocks_id = array();
513
-		foreach ($user_block_data as $data) {
514
-			$user_blocks_id[$data['block_id']] = true;
515
-			$columns[$data['block_id']] = $data['column'];
516
-		}
517
-
518
-		// update extra user blocks data
519
-		$upd_extra_field = self::store_user_blocks($user_id, $user_blocks_id, $columns);
520
-
521
-		return $upd_extra_field;
522
-	}
523
-
524
-	/**
525
-	 * get links for styles from dashboard plugins
526
-	 * @return string   links
527
-	 */
528
-	public static function get_links_for_styles_from_dashboard_plugins() {
529
-
530
-		return '<link rel="stylesheet" href="'.api_get_path(WEB_PLUGIN_PATH).'dashboard/css/default.css" type="text/css" />'.PHP_EOL;
531
-	}
503
+        $enabled_dashboard_blocks = self::get_enabled_dashboard_blocks($path);
504
+        $user_block_data = self::get_user_block_data($user_id);
505
+
506
+        foreach ($enabled_dashboard_blocks as $enabled_block) {
507
+            unset($user_block_data[$enabled_block['id']]);
508
+        }
509
+
510
+        // get columns and blocks id for updating extra user data
511
+        $columns = array();
512
+        $user_blocks_id = array();
513
+        foreach ($user_block_data as $data) {
514
+            $user_blocks_id[$data['block_id']] = true;
515
+            $columns[$data['block_id']] = $data['column'];
516
+        }
517
+
518
+        // update extra user blocks data
519
+        $upd_extra_field = self::store_user_blocks($user_id, $user_blocks_id, $columns);
520
+
521
+        return $upd_extra_field;
522
+    }
523
+
524
+    /**
525
+     * get links for styles from dashboard plugins
526
+     * @return string   links
527
+     */
528
+    public static function get_links_for_styles_from_dashboard_plugins() {
529
+
530
+        return '<link rel="stylesheet" href="'.api_get_path(WEB_PLUGIN_PATH).'dashboard/css/default.css" type="text/css" />'.PHP_EOL;
531
+    }
532 532
 }
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
                         'tr',
69 69
                         Display::tag(
70 70
                             'td',
71
-                            get_lang('CheckFilePermissions') . ' ' . Security::remove_XSS($plugin_info_file),
71
+                            get_lang('CheckFilePermissions').' '.Security::remove_XSS($plugin_info_file),
72 72
                             array('colspan' => '3')
73 73
                         )
74 74
                     );
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
             foreach ($disabled_blocks_data as $disabled_block) {
82 82
                 echo '<tr style="background-color:#eee">';
83 83
                 echo '<td><center><input type="checkbox" name="disabled_block" value="true" checked disabled /></center>';
84
-                for ($j = 0 ; $j < count($table_cols); $j++) {
84
+                for ($j = 0; $j < count($table_cols); $j++) {
85 85
                     if (isset($disabled_block[strtolower($table_cols[$j])])) {
86 86
                         if ($j == 2) {
87 87
                             echo '<td>';
@@ -192,10 +192,10 @@  discard block
 block discarded – undo
192 192
             // clean from block data
193 193
             if (!empty($not_selected_blocks_id)) {
194 194
                 $sql_check = "SELECT id FROM $tbl_block 
195
-                              WHERE id IN(".implode(',',$not_selected_blocks_id).")";
195
+                              WHERE id IN(".implode(',', $not_selected_blocks_id).")";
196 196
                 $rs_check = Database::query($sql_check);
197 197
                 if (Database::num_rows($rs_check) > 0) {
198
-                    $del = "DELETE FROM $tbl_block WHERE id IN(".implode(',',$not_selected_blocks_id).")";
198
+                    $del = "DELETE FROM $tbl_block WHERE id IN(".implode(',', $not_selected_blocks_id).")";
199 199
                     Database::query($del);
200 200
                 }
201 201
             }
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
                         $affected_rows = Database::affected_rows($result);
216 216
                     } else {
217 217
                         // insert
218
-                        $plugin_info_file = $dashboard_pluginpath . $testplugin . "/$testplugin.info";
218
+                        $plugin_info_file = $dashboard_pluginpath.$testplugin."/$testplugin.info";
219 219
                         $plugin_info = array();
220 220
                         if (file_exists($plugin_info_file)) {
221 221
                             $plugin_info = api_parse_info_file($plugin_info_file);
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
         // We check if plugin exists inside directory for updating active field
286 286
         $sql = "SELECT * FROM $tbl_block";
287 287
         $rs = Database::query($sql);
288
-        if (Database::num_rows($rs) > 0){
288
+        if (Database::num_rows($rs) > 0) {
289 289
             while ($row = Database::fetch_array($rs)) {
290 290
                 if (!in_array($row['path'], $possibleplugins)) {
291 291
                     $active = 0;
@@ -393,13 +393,13 @@  discard block
 block discarded – undo
393 393
                     echo '<td>'.$block['description'].'</td>';
394 394
                     echo '<td>
395 395
                             <select class="selectpicker show-tick form-control" name="columns['.$block['id'].']">
396
-                            <option value="1" '.(isset($user_block_data[$block['id']]) && $user_block_data[$block['id']]['column']==1?'selected':'').' >1</option>
397
-                            <option value="2" '.(isset($user_block_data[$block['id']]) && $user_block_data[$block['id']]['column']==2?'selected':'').' >2</option>
396
+                            <option value="1" '.(isset($user_block_data[$block['id']]) && $user_block_data[$block['id']]['column'] == 1 ? 'selected' : '').' >1</option>
397
+                            <option value="2" '.(isset($user_block_data[$block['id']]) && $user_block_data[$block['id']]['column'] == 2 ? 'selected' : '').' >2</option>
398 398
                             </select>
399 399
                           </td>';
400 400
                     echo '</tr>';
401 401
                 } else {
402
-                    echo Display::tag('tr',  Display::tag('td', get_lang('Error').' '.$controller_class, array('colspan'=>'3')));
402
+                    echo Display::tag('tr', Display::tag('td', get_lang('Error').' '.$controller_class, array('colspan'=>'3')));
403 403
                 }
404 404
             }
405 405
 
@@ -449,7 +449,7 @@  discard block
 block discarded – undo
449 449
      */
450 450
     public static function store_user_blocks($user_id, $enabled_blocks, $columns)
451 451
     {
452
-        $selected_blocks_id  = array();
452
+        $selected_blocks_id = array();
453 453
         if (is_array($enabled_blocks) && count($enabled_blocks) > 0) {
454 454
             $selected_blocks_id = array_keys($enabled_blocks);
455 455
         }
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -498,7 +498,7 @@
 block discarded – undo
498 498
 	 * @param int 		User id
499 499
 	 * @param string	plugin path
500 500
 	 * @param integer $user_id
501
-	 * @return bool
501
+	 * @return false|string
502 502
 	 */
503 503
 	public static function close_user_block($user_id, $path)
504 504
     {
Please login to merge, or discard this patch.
main/inc/lib/link.lib.php 2 patches
Doc Comments   +10 added lines, -1 removed lines patch added patch discarded remove patch
@@ -477,6 +477,7 @@  discard block
 block discarded – undo
477 477
      *
478 478
      * Get link info
479 479
      * @param int link id
480
+     * @param integer $id
480 481
      * @return array link info
481 482
      *
482 483
      **/
@@ -1058,7 +1059,9 @@  discard block
 block discarded – undo
1058 1059
     /**
1059 1060
      * Displays the edit, delete and move icons
1060 1061
      * @param int   Category ID
1061
-     * @return void
1062
+     * @param integer $currentCategory
1063
+     * @param integer $countCategories
1064
+     * @return string
1062 1065
      * @author Patrick Cool <[email protected]>, Ghent University
1063 1066
      */
1064 1067
     public static function showCategoryAdminTools($category, $currentCategory, $countCategories)
@@ -1222,6 +1225,7 @@  discard block
 block discarded – undo
1222 1225
     /**
1223 1226
      * CSV file import functions
1224 1227
      * @author René Haentjens , Ghent University
1228
+     * @param string $catname
1225 1229
      */
1226 1230
     public static function get_cat($catname)
1227 1231
     {
@@ -1261,6 +1265,11 @@  discard block
 block discarded – undo
1261 1265
     /**
1262 1266
      * CSV file import functions
1263 1267
      * @author René Haentjens , Ghent University
1268
+     * @param string $url
1269
+     * @param string $title
1270
+     * @param string $description
1271
+     * @param string $on_homepage
1272
+     * @param string $hidden
1264 1273
      */
1265 1274
     public static function put_link($url, $cat, $title, $description, $on_homepage, $hidden)
1266 1275
     {
Please login to merge, or discard this patch.
Spacing   +104 added lines, -104 removed lines patch added patch discarded remove patch
@@ -79,11 +79,11 @@  discard block
 block discarded – undo
79 79
         $params['session_id'] = api_get_session_id();
80 80
         $params['category_id'] = isset($params['category_id']) ? $params['category_id'] : 0;
81 81
 
82
-        $sql =  "SELECT MAX(display_order)
82
+        $sql = "SELECT MAX(display_order)
83 83
                 FROM  ".$this->table."
84 84
                 WHERE
85 85
                     c_id = $courseId AND
86
-                    category_id = '" . intval($params['category_id'])."'";
86
+                    category_id = '".intval($params['category_id'])."'";
87 87
         $result = Database:: query($sql);
88 88
         list ($orderMax) = Database:: fetch_row($result);
89 89
         $order = $orderMax + 1;
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
 
185 185
             // We ensure URL to be absolute.
186 186
             if (strpos($urllink, '://') === false) {
187
-                $urllink = 'http://' . $urllink;
187
+                $urllink = 'http://'.$urllink;
188 188
             }
189 189
 
190 190
             // If the title is empty, we use the URL as title.
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
                     'c_id' => $course_id,
207 207
                     'url' => $urllink,
208 208
                     'title' => $title,
209
-                    'description' => $description ,
209
+                    'description' => $description,
210 210
                     'category_id' => $selectcategory,
211 211
                     'on_homepage' => $onhomepage,
212 212
                     'target' => $target,
@@ -217,9 +217,9 @@  discard block
 block discarded – undo
217 217
                 if ((api_get_setting('search_enabled') == 'true') &&
218 218
                     $link_id && extension_loaded('xapian')
219 219
                 ) {
220
-                    require_once api_get_path(LIBRARY_PATH) . 'search/ChamiloIndexer.class.php';
221
-                    require_once api_get_path(LIBRARY_PATH) . 'search/IndexableChunk.class.php';
222
-                    require_once api_get_path(LIBRARY_PATH) . 'specific_fields_manager.lib.php';
220
+                    require_once api_get_path(LIBRARY_PATH).'search/ChamiloIndexer.class.php';
221
+                    require_once api_get_path(LIBRARY_PATH).'search/IndexableChunk.class.php';
222
+                    require_once api_get_path(LIBRARY_PATH).'specific_fields_manager.lib.php';
223 223
 
224 224
                     $course_int_id = $_course['real_id'];
225 225
                     $courseCode = $_course['code'];
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
                         if (isset($_REQUEST[$specific_field['code']])) {
233 233
                             $sterms = trim($_REQUEST[$specific_field['code']]);
234 234
                             if (!empty($sterms)) {
235
-                                $all_specific_terms .= ' ' . $sterms;
235
+                                $all_specific_terms .= ' '.$sterms;
236 236
                                 $sterms = explode(',', $sterms);
237 237
                                 foreach ($sterms as $sterm) {
238 238
                                     $ic_slide->addTerm(
@@ -259,12 +259,12 @@  discard block
 block discarded – undo
259 259
                         SE_COURSE_ID => $courseCode,
260 260
                         SE_TOOL_ID => TOOL_LINK,
261 261
                         SE_DATA => array(
262
-                            'link_id' => (int)$link_id
262
+                            'link_id' => (int) $link_id
263 263
                         ),
264
-                        SE_USER => (int)api_get_user_id(),
264
+                        SE_USER => (int) api_get_user_id(),
265 265
                     );
266 266
                     $ic_slide->xapian_data = serialize($xapian_data);
267
-                    $description = $all_specific_terms . ' ' . $description;
267
+                    $description = $all_specific_terms.' '.$description;
268 268
                     $ic_slide->addValue('content', $description);
269 269
 
270 270
                     // Add category name if set.
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
                         $sql_cat = sprintf(
277 277
                             $sql_cat,
278 278
                             $table_link_category,
279
-                            (int)$selectcategory,
279
+                            (int) $selectcategory,
280 280
                             $course_int_id
281 281
                         );
282 282
                         $result = Database:: query($sql_cat);
@@ -393,7 +393,7 @@  discard block
 block discarded – undo
393 393
                 // but the visibility is set to 2 (in item_property).
394 394
                 // This will make a restore function possible for the platform administrator.
395 395
                 $sql = "UPDATE $tbl_link SET on_homepage='0'
396
-                        WHERE c_id = $course_id AND id='" . $id . "'";
396
+                        WHERE c_id = $course_id AND id='".$id."'";
397 397
                 Database:: query($sql);
398 398
 
399 399
                 api_item_property_update(
@@ -409,12 +409,12 @@  discard block
 block discarded – undo
409 409
                 break;
410 410
             case 'category':
411 411
                 // First we delete the category itself and afterwards all the links of this category.
412
-                $sql = "DELETE FROM " . $tbl_categories . "
413
-                        WHERE c_id = $course_id AND id='" . $id . "'";
412
+                $sql = "DELETE FROM ".$tbl_categories."
413
+                        WHERE c_id = $course_id AND id='".$id."'";
414 414
                 Database:: query($sql);
415 415
 
416
-                $sql = "DELETE FROM " . $tbl_link . "
417
-                        WHERE c_id = $course_id AND category_id='" . $id . "'";
416
+                $sql = "DELETE FROM ".$tbl_link."
417
+                        WHERE c_id = $course_id AND category_id='".$id."'";
418 418
                 Database:: query($sql);
419 419
 
420 420
                 api_item_property_update(
@@ -451,16 +451,16 @@  discard block
 block discarded – undo
451 451
             $res = Database:: query($sql);
452 452
             if (Database:: num_rows($res) > 0) {
453 453
                 $row = Database:: fetch_array($res);
454
-                require_once api_get_path(LIBRARY_PATH) . 'search/ChamiloIndexer.class.php';
454
+                require_once api_get_path(LIBRARY_PATH).'search/ChamiloIndexer.class.php';
455 455
                 $di = new ChamiloIndexer();
456
-                $di->remove_document((int)$row['search_did']);
456
+                $di->remove_document((int) $row['search_did']);
457 457
             }
458 458
             $sql = 'DELETE FROM %s WHERE course_code=\'%s\' AND tool_id=\'%s\' AND ref_id_high_level=%s LIMIT 1';
459 459
             $sql = sprintf($sql, $tbl_se_ref, $course_id, TOOL_LINK, $link_id);
460 460
             Database:: query($sql);
461 461
 
462 462
             // Remove terms from db.
463
-            require_once api_get_path(LIBRARY_PATH) . 'specific_fields_manager.lib.php';
463
+            require_once api_get_path(LIBRARY_PATH).'specific_fields_manager.lib.php';
464 464
             delete_all_values_for_item($course_id, TOOL_DOCUMENT, $link_id);
465 465
         }
466 466
     }
@@ -482,7 +482,7 @@  discard block
 block discarded – undo
482 482
         }
483 483
 
484 484
         $sql = "SELECT * FROM $tbl_link
485
-                WHERE c_id = $course_id AND id='" . intval($id) . "' ";
485
+                WHERE c_id = $course_id AND id='".intval($id)."' ";
486 486
         $result = Database::query($sql);
487 487
         $data = array();
488 488
         if (Database::num_rows($result)) {
@@ -512,7 +512,7 @@  discard block
 block discarded – undo
512 512
 
513 513
         // We ensure URL to be absolute.
514 514
         if (strpos($values['url'], '://') === false) {
515
-            $values['url'] = 'http://' . $_POST['url'];
515
+            $values['url'] = 'http://'.$_POST['url'];
516 516
         }
517 517
 
518 518
         // If the title is empty, we use the URL as title.
@@ -535,7 +535,7 @@  discard block
 block discarded – undo
535 535
 
536 536
         // Finding the old category_id.
537 537
         $sql = "SELECT * FROM $tbl_link
538
-                WHERE c_id = $course_id AND id='" . $id . "'";
538
+                WHERE c_id = $course_id AND id='".$id."'";
539 539
         $result = Database:: query($sql);
540 540
         $row = Database:: fetch_array($result);
541 541
         $category_id = $row['category_id'];
@@ -545,7 +545,7 @@  discard block
 block discarded – undo
545 545
                     FROM $tbl_link 
546 546
                     WHERE
547 547
                         c_id = $course_id AND
548
-                        category_id='" . intval($values['category_id']) . "'";
548
+                        category_id='".intval($values['category_id'])."'";
549 549
             $result = Database:: query($sql);
550 550
             list ($max_display_order) = Database:: fetch_row($result);
551 551
             $max_display_order++;
@@ -614,7 +614,7 @@  discard block
 block discarded – undo
614 614
                             $_REQUEST[$specific_field['code']]
615 615
                         );
616 616
                         if (!empty($sterms)) {
617
-                            $all_specific_terms .= ' ' . $sterms;
617
+                            $all_specific_terms .= ' '.$sterms;
618 618
                             $sterms = explode(',', $sterms);
619 619
                             foreach ($sterms as $sterm) {
620 620
                                 $ic_slide->addTerm(
@@ -641,13 +641,13 @@  discard block
 block discarded – undo
641 641
                     SE_COURSE_ID => $course_id,
642 642
                     SE_TOOL_ID => TOOL_LINK,
643 643
                     SE_DATA => array(
644
-                        'link_id' => (int)$id
644
+                        'link_id' => (int) $id
645 645
                     ),
646
-                    SE_USER => (int)api_get_user_id(),
646
+                    SE_USER => (int) api_get_user_id(),
647 647
 
648 648
                 );
649 649
                 $ic_slide->xapian_data = serialize($xapian_data);
650
-                $link_description = $all_specific_terms . ' ' . $link_description;
650
+                $link_description = $all_specific_terms.' '.$link_description;
651 651
                 $ic_slide->addValue('content', $link_description);
652 652
 
653 653
                 // Add category name if set.
@@ -675,7 +675,7 @@  discard block
 block discarded – undo
675 675
                 $di = new ChamiloIndexer();
676 676
                 isset ($_POST['language']) ? $lang = Database:: escape_string($_POST['language']) : $lang = 'english';
677 677
                 $di->connectDb(null, null, $lang);
678
-                $di->remove_document((int)$se_ref['search_did']);
678
+                $di->remove_document((int) $se_ref['search_did']);
679 679
                 $di->addChunk($ic_slide);
680 680
 
681 681
                 // Index and return search engine document id.
@@ -796,7 +796,7 @@  discard block
 block discarded – undo
796 796
         $sql = "SELECT *, linkcat.id
797 797
                 FROM $tblLinkCategory linkcat
798 798
                 WHERE
799
-                    linkcat.c_id = " . $courseId . "
799
+                    linkcat.c_id = ".$courseId."
800 800
                     $sessionCondition
801 801
                 ORDER BY linkcat.display_order DESC";
802 802
 
@@ -808,10 +808,10 @@  discard block
 block discarded – undo
808 808
                 INNER JOIN $tblItemProperty itemproperties
809 809
                 ON (linkcat.id = itemproperties.ref AND linkcat.c_id = itemproperties.c_id)
810 810
                 WHERE
811
-                    itemproperties.tool = '" . TOOL_LINK_CATEGORY . "' AND
811
+                    itemproperties.tool = '".TOOL_LINK_CATEGORY."' AND
812 812
                     (itemproperties.visibility = '0' OR itemproperties.visibility = '1')
813 813
                     $sessionCondition AND
814
-                    linkcat.c_id = " . $courseId . "
814
+                    linkcat.c_id = ".$courseId."
815 815
                 ORDER BY linkcat.display_order DESC";
816 816
 
817 817
         $result = Database::query($sql);
@@ -834,10 +834,10 @@  discard block
 block discarded – undo
834 834
                 INNER JOIN $tblItemProperty itemproperties
835 835
                 ON (linkcat.id = itemproperties.ref AND linkcat.c_id = itemproperties.c_id)
836 836
                 WHERE
837
-                    itemproperties.tool = '" . TOOL_LINK_CATEGORY . "' AND
837
+                    itemproperties.tool = '".TOOL_LINK_CATEGORY."' AND
838 838
                     (itemproperties.visibility = '0' OR itemproperties.visibility = '1')
839 839
                     $sessionCondition AND
840
-                    linkcat.c_id = " . $courseId . "
840
+                    linkcat.c_id = ".$courseId."
841 841
                 ORDER BY linkcat.display_order DESC
842 842
                 ";
843 843
         $result = Database::query($sql);
@@ -867,12 +867,12 @@  discard block
 block discarded – undo
867 867
                 INNER JOIN $TABLE_ITEM_PROPERTY itemproperties
868 868
                 ON (link.id=itemproperties.ref AND link.c_id = itemproperties.c_id)
869 869
                 WHERE
870
-                    itemproperties.tool='" . TOOL_LINK . "' AND
871
-                    link.category_id='" . $catid . "' AND
870
+                    itemproperties.tool='".TOOL_LINK."' AND
871
+                    link.category_id='" . $catid."' AND
872 872
                     (itemproperties.visibility='0' OR itemproperties.visibility='1')
873 873
                     $condition_session AND
874
-                    link.c_id = " . $course_id . " AND
875
-                    itemproperties.c_id = " . $course_id . "
874
+                    link.c_id = ".$course_id." AND
875
+                    itemproperties.c_id = " . $course_id."
876 876
                 ORDER BY link.display_order ASC";
877 877
         $result = Database:: query($sql);
878 878
         $numberoflinks = Database:: num_rows($result);
@@ -895,23 +895,23 @@  discard block
 block discarded – undo
895 895
                         'check-circle-o',
896 896
                         'default btn-sm',
897 897
                         array(
898
-                            'onclick' => "check_url('" . $myrow['id'] . "', '" . addslashes($myrow['url']) . "');",
898
+                            'onclick' => "check_url('".$myrow['id']."', '".addslashes($myrow['url'])."');",
899 899
                             'title' => get_lang('CheckURL')
900 900
                         )
901 901
                     );
902 902
                     $link_validator .= Display::span(
903 903
                         '',
904 904
                         array(
905
-                        'id' => 'url_id_' . $myrow['id'],
905
+                        'id' => 'url_id_'.$myrow['id'],
906 906
                         'class' => 'check-link'
907 907
                         )
908 908
                     );
909 909
 
910 910
                     if ($session_id == $myrow['session_id']) {
911
-                        $url = api_get_self() . '?' . api_get_cidreq() .
912
-                            '&action=editlink&category=' . (!empty ($category) ? $category : '') .
913
-                            '&id=' . $myrow['id'] .
914
-                            '&category_id=' . $myrow['id'];
911
+                        $url = api_get_self().'?'.api_get_cidreq().
912
+                            '&action=editlink&category='.(!empty ($category) ? $category : '').
913
+                            '&id='.$myrow['id'].
914
+                            '&category_id='.$myrow['id'];
915 915
                         $title = get_lang('Edit');
916 916
                         $toolbar .= Display::toolbarButton(
917 917
                             '',
@@ -924,10 +924,10 @@  discard block
 block discarded – undo
924 924
                         );
925 925
 
926 926
                         if ($myrow['visibility'] == '1') {
927
-                            $url .= 'link.php?' . api_get_cidreq() .
928
-                                '&sec_token=' . $token .
929
-                                '&action=invisible&id=' . $myrow['id'] .
930
-                                '&scope=link&category_id=' . $myrow['category_id'];
927
+                            $url .= 'link.php?'.api_get_cidreq().
928
+                                '&sec_token='.$token.
929
+                                '&action=invisible&id='.$myrow['id'].
930
+                                '&scope=link&category_id='.$myrow['category_id'];
931 931
                             $title = get_lang('MakeInvisible');
932 932
                             $toolbar .= Display::toolbarButton(
933 933
                                 '',
@@ -941,7 +941,7 @@  discard block
 block discarded – undo
941 941
                         }
942 942
 
943 943
                         if ($myrow['visibility'] == '0') {
944
-                            $url .= 'link.php?' . api_get_cidreq() .'&sec_token=' . $token .'&action=visible&id=' . $myrow['id'] .'&scope=link&category_id=' . $myrow['category_id'];
944
+                            $url .= 'link.php?'.api_get_cidreq().'&sec_token='.$token.'&action=visible&id='.$myrow['id'].'&scope=link&category_id='.$myrow['category_id'];
945 945
                             $title = get_lang('MakeVisible');
946 946
                             $toolbar .= Display::toolbarButton(
947 947
                                 '',
@@ -962,24 +962,24 @@  discard block
 block discarded – undo
962 962
                         ];
963 963
                         $toolbar .= Display::toolbarButton(
964 964
                             get_lang('MoveUp'),
965
-                            'link.php?' . api_get_cidreq() . '&' . http_build_query($moveLinkParams),
965
+                            'link.php?'.api_get_cidreq().'&'.http_build_query($moveLinkParams),
966 966
                             'level-up',
967 967
                             'default',
968
-                            ['class' => 'btn-sm ' . ($i === 1 ? 'disabled' : '')],
968
+                            ['class' => 'btn-sm '.($i === 1 ? 'disabled' : '')],
969 969
                             false
970 970
                         );
971 971
                         $moveLinkParams['action'] = 'move_link_down';
972 972
                         $toolbar .= Display::toolbarButton(
973 973
                             get_lang('MoveDown'),
974
-                            'link.php?' . api_get_cidreq() . '&' . http_build_query($moveLinkParams),
974
+                            'link.php?'.api_get_cidreq().'&'.http_build_query($moveLinkParams),
975 975
                             'level-down',
976 976
                             'default',
977
-                            ['class' => 'btn-sm ' . ($i === $numberoflinks ? 'disabled' : '')],
977
+                            ['class' => 'btn-sm '.($i === $numberoflinks ? 'disabled' : '')],
978 978
                             false
979 979
                         );
980 980
 
981
-                        $url .= api_get_self() . '?' . api_get_cidreq() .'&sec_token=' . $token .'&action=deletelink&id=' . $myrow['id'] .'&category_id=' . $myrow['category_id'];
982
-                        $event = "javascript: if(!confirm('" . get_lang('LinkDelconfirm') . "'))return false;";
981
+                        $url .= api_get_self().'?'.api_get_cidreq().'&sec_token='.$token.'&action=deletelink&id='.$myrow['id'].'&category_id='.$myrow['category_id'];
982
+                        $event = "javascript: if(!confirm('".get_lang('LinkDelconfirm')."'))return false;";
983 983
                         $title = get_lang('Delete');
984 984
 
985 985
                         $toolbar .= Display::toolbarButton(
@@ -1017,7 +1017,7 @@  discard block
 block discarded – undo
1017 1017
                     $content .= '<div class="pull-right"><div class="btn-group">'.$toolbar.'</div></div>';
1018 1018
                     $content .= '<h4 class="list-group-item-heading">';
1019 1019
                     $content .= $iconLink;
1020
-                    $url =  'link_goto.php?' . api_get_cidreq() .'&link_id=' . $myrow['id'] .'&link_url=' . urlencode($myrow['url']);
1020
+                    $url = 'link_goto.php?'.api_get_cidreq().'&link_id='.$myrow['id'].'&link_url='.urlencode($myrow['url']);
1021 1021
                     $content .= Display::tag(
1022 1022
                         'a',
1023 1023
                         Security:: remove_XSS($myrow['title']),
@@ -1030,7 +1030,7 @@  discard block
 block discarded – undo
1030 1030
                     $content .= $session_img;
1031 1031
                     $content .= '</h4>';
1032 1032
 
1033
-                    $content .= '<p class="list-group-item-text">' . $myrow['description'] . '</p>';
1033
+                    $content .= '<p class="list-group-item-text">'.$myrow['description'].'</p>';
1034 1034
                     $content .= '</div>';
1035 1035
                 } else {
1036 1036
                     if (api_is_allowed_to_edit(null, true)) {
@@ -1038,7 +1038,7 @@  discard block
 block discarded – undo
1038 1038
                         $content .= '<div class="pull-right"><div class="btn-group">'.$toolbar.'</div></div>';
1039 1039
                         $content .= '<h4 class="list-group-item-heading">';
1040 1040
                         $content .= $iconLink;
1041
-                        $url = 'link_goto.php?' . api_get_cidreq() .'&link_id=' . $myrow['id'] . "&link_url=" . urlencode($myrow['url']);
1041
+                        $url = 'link_goto.php?'.api_get_cidreq().'&link_id='.$myrow['id']."&link_url=".urlencode($myrow['url']);
1042 1042
                         $content .= Display::tag(
1043 1043
                             'a',
1044 1044
                             Security:: remove_XSS($myrow['title']),
@@ -1051,7 +1051,7 @@  discard block
 block discarded – undo
1051 1051
                         $content .= $link_validator;
1052 1052
                         $content .= $session_img;
1053 1053
                         $content .= '</h4>';
1054
-                        $content .= '<p class="list-group-item-text">' . $myrow['description'] . '</p>';
1054
+                        $content .= '<p class="list-group-item-text">'.$myrow['description'].'</p>';
1055 1055
                         $content .= '</div>';
1056 1056
                     }
1057 1057
                 }
@@ -1073,58 +1073,58 @@  discard block
 block discarded – undo
1073 1073
     {
1074 1074
         $categoryId = $category['id'];
1075 1075
         $token = null;
1076
-        $tools = '<a href="' . api_get_self() . '?' . api_get_cidreq() . '&sec_token=' . $token . '&action=editcategory&id=' . $categoryId . '&category_id=' . $categoryId . '" title=' . get_lang('Modify') . '">' .
1076
+        $tools = '<a href="'.api_get_self().'?'.api_get_cidreq().'&sec_token='.$token.'&action=editcategory&id='.$categoryId.'&category_id='.$categoryId.'" title='.get_lang('Modify').'">'.
1077 1077
             Display:: return_icon(
1078 1078
                 'edit.png',
1079 1079
                 get_lang('Modify'),
1080 1080
                 array(),
1081 1081
                 ICON_SIZE_SMALL
1082
-            ) . '</a>';
1082
+            ).'</a>';
1083 1083
 
1084 1084
         // DISPLAY MOVE UP COMMAND only if it is not the top link.
1085 1085
         if ($currentCategory != 0) {
1086
-            $tools .= '<a href="' . api_get_self() . '?' . api_get_cidreq() . '&sec_token=' . $token . '&action=up&up='.$categoryId.'&category_id='.$categoryId.'" title="'.get_lang('Up').'">'.
1086
+            $tools .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&sec_token='.$token.'&action=up&up='.$categoryId.'&category_id='.$categoryId.'" title="'.get_lang('Up').'">'.
1087 1087
                 Display:: return_icon(
1088 1088
                     'up.png',
1089 1089
                     get_lang('Up'),
1090 1090
                     array(),
1091 1091
                     ICON_SIZE_SMALL
1092
-                ) . '</a>';
1092
+                ).'</a>';
1093 1093
         } else {
1094 1094
             $tools .= Display:: return_icon(
1095 1095
                 'up_na.png',
1096 1096
                 get_lang('Up'),
1097 1097
                 array(),
1098 1098
                 ICON_SIZE_SMALL
1099
-            ) . '</a>';
1099
+            ).'</a>';
1100 1100
         }
1101 1101
 
1102 1102
         // DISPLAY MOVE DOWN COMMAND only if it is not the bottom link.
1103
-        if ($currentCategory < $countCategories-1) {
1104
-            $tools .= '<a href="' . api_get_self() . '?' . api_get_cidreq() .'&sec_token=' . $token .'&action=down&down=' . $categoryId .'&category_id=' . $categoryId . '">'.
1103
+        if ($currentCategory < $countCategories - 1) {
1104
+            $tools .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&sec_token='.$token.'&action=down&down='.$categoryId.'&category_id='.$categoryId.'">'.
1105 1105
                 Display:: return_icon(
1106 1106
                     'down.png',
1107 1107
                     get_lang('Down'),
1108 1108
                     array(),
1109 1109
                     ICON_SIZE_SMALL
1110
-                ) . '</a>';
1110
+                ).'</a>';
1111 1111
         } else {
1112 1112
             $tools .= Display:: return_icon(
1113 1113
                     'down_na.png',
1114 1114
                     get_lang('Down'),
1115 1115
                     array(),
1116 1116
                     ICON_SIZE_SMALL
1117
-                ) . '</a>';
1117
+                ).'</a>';
1118 1118
         }
1119 1119
 
1120
-        $tools .= '<a href="' . api_get_self() . '?' . api_get_cidreq() .'&sec_token=' . $token .'&action=deletecategory&id='.$categoryId.            "&category_id=$categoryId\"
1121
-            onclick=\"javascript: if(!confirm('" . get_lang('CategoryDelconfirm') . "')) return false;\">".
1120
+        $tools .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&sec_token='.$token.'&action=deletecategory&id='.$categoryId."&category_id=$categoryId\"
1121
+            onclick=\"javascript: if(!confirm('".get_lang('CategoryDelconfirm')."')) return false;\">".
1122 1122
             Display:: return_icon(
1123 1123
                 'delete.png',
1124 1124
                 get_lang('Delete'),
1125 1125
                 array(),
1126 1126
                 ICON_SIZE_SMALL
1127
-            ) . '</a>';
1127
+            ).'</a>';
1128 1128
 
1129 1129
         return $tools;
1130 1130
     }
@@ -1180,12 +1180,12 @@  discard block
 block discarded – undo
1180 1180
                     $nextlinkOrder = $sortrow['display_order'];
1181 1181
 
1182 1182
                     Database:: query(
1183
-                        "UPDATE " . $movetable . "
1183
+                        "UPDATE ".$movetable."
1184 1184
                         SET display_order = '$nextlinkOrder'
1185 1185
                         WHERE c_id = $courseId  AND id =  '$thiscatlinkId'"
1186 1186
                     );
1187 1187
                     Database:: query(
1188
-                        "UPDATE " . $movetable . "
1188
+                        "UPDATE ".$movetable."
1189 1189
                         SET display_order = '$thislinkOrder'
1190 1190
                         WHERE c_id = $courseId  AND id =  '$nextlinkId'"
1191 1191
                     );
@@ -1213,10 +1213,10 @@  discard block
 block discarded – undo
1213 1213
         $course_id = api_get_course_int_id();
1214 1214
 
1215 1215
         $result = Database:: query(
1216
-            "SELECT id FROM " . $tbl_categories . "
1217
-            WHERE c_id = $course_id AND category_title='" . Database::escape_string(
1216
+            "SELECT id FROM ".$tbl_categories."
1217
+            WHERE c_id = $course_id AND category_title='".Database::escape_string(
1218 1218
                 $catname
1219
-            ) . "'"
1219
+            )."'"
1220 1220
         );
1221 1221
         if (Database:: num_rows($result) >= 1 && ($row = Database:: fetch_array(
1222 1222
                 $result
@@ -1226,7 +1226,7 @@  discard block
 block discarded – undo
1226 1226
         }
1227 1227
 
1228 1228
         $result = Database:: query(
1229
-            "SELECT MAX(display_order) FROM " . $tbl_categories . " WHERE c_id = $course_id "
1229
+            "SELECT MAX(display_order) FROM ".$tbl_categories." WHERE c_id = $course_id "
1230 1230
         );
1231 1231
         list ($max_order) = Database:: fetch_row($result);
1232 1232
 
@@ -1253,19 +1253,19 @@  discard block
 block discarded – undo
1253 1253
         $tbl_link = Database:: get_course_table(TABLE_LINK);
1254 1254
         $course_id = api_get_course_int_id();
1255 1255
 
1256
-        $urleq = "url='" . Database:: escape_string($url) . "'";
1257
-        $cateq = "category_id=" . intval($cat);
1256
+        $urleq = "url='".Database:: escape_string($url)."'";
1257
+        $cateq = "category_id=".intval($cat);
1258 1258
 
1259 1259
         $result = Database:: query("
1260 1260
             SELECT id FROM $tbl_link
1261
-            WHERE c_id = $course_id AND " . $urleq . ' AND ' . $cateq
1261
+            WHERE c_id = $course_id AND ".$urleq.' AND '.$cateq
1262 1262
         );
1263 1263
 
1264 1264
         if (Database:: num_rows($result) >= 1 && ($row = Database:: fetch_array($result))) {
1265 1265
             $sql = "UPDATE $tbl_link SET 
1266
-                        title = '" . Database:: escape_string($title) . "', 
1267
-                        description = '" . Database:: escape_string($description) . "'
1268
-                    WHERE c_id = $course_id AND  id='" . Database:: escape_string($row['id']) . "'";
1266
+                        title = '".Database:: escape_string($title)."', 
1267
+                        description = '" . Database:: escape_string($description)."'
1268
+                    WHERE c_id = $course_id AND  id='".Database:: escape_string($row['id'])."'";
1269 1269
             Database:: query($sql);
1270 1270
 
1271 1271
             $ipu = 'LinkUpdated';
@@ -1274,18 +1274,18 @@  discard block
 block discarded – undo
1274 1274
             // Add new link
1275 1275
             $result = Database:: query(
1276 1276
                 "SELECT MAX(display_order) FROM  $tbl_link
1277
-                WHERE c_id = $course_id AND category_id='" . intval($cat) . "'"
1277
+                WHERE c_id = $course_id AND category_id='".intval($cat)."'"
1278 1278
             );
1279 1279
             list ($max_order) = Database:: fetch_row($result);
1280 1280
 
1281 1281
             Database:: query(
1282 1282
                 "INSERT INTO $tbl_link (c_id, url, title, description, category_id, display_order, on_homepage)
1283
-                VALUES (" . api_get_course_int_id() . ",
1284
-                '" . Database:: escape_string($url) . "',
1285
-                '" . Database:: escape_string($title) . "',
1286
-                '" . Database:: escape_string($description) . "',
1287
-                '" . intval($cat) . "','" . (intval($max_order) + 1) . "',
1288
-                '" . intval($on_homepage) .
1283
+                VALUES (".api_get_course_int_id().",
1284
+                '" . Database:: escape_string($url)."',
1285
+                '" . Database:: escape_string($title)."',
1286
+                '" . Database:: escape_string($description)."',
1287
+                '" . intval($cat)."','".(intval($max_order) + 1)."',
1288
+                '" . intval($on_homepage).
1289 1289
                 "')"
1290 1290
             );
1291 1291
 
@@ -1362,30 +1362,30 @@  discard block
 block discarded – undo
1362 1362
                     )
1363 1363
                 ) { // possibly in <...>
1364 1364
                     if (($kwlist = trim($regs[1])) != '') {
1365
-                        $kw = '<i kw="' . htmlspecialchars($kwlist) . '">';
1365
+                        $kw = '<i kw="'.htmlspecialchars($kwlist).'">';
1366 1366
                     } else {
1367 1367
                         $kw = '';
1368 1368
                     }
1369 1369
                     // i.e. assume only one of the $hide_fields will be present
1370 1370
                     // and if found, hide the value as expando property of an <i> tag
1371 1371
                 } elseif (trim($value)) {
1372
-                    $d .= ', ' . $key . ':' . $value;
1372
+                    $d .= ', '.$key.':'.$value;
1373 1373
                 }
1374 1374
             }
1375 1375
         }
1376 1376
         if (!empty($d)) {
1377
-            $d = substr($d, 2) . ' - ';
1377
+            $d = substr($d, 2).' - ';
1378 1378
         }
1379 1379
 
1380 1380
         return Link::put_link(
1381 1381
             $url,
1382 1382
             $cat,
1383 1383
             $title,
1384
-            $kw . ereg_replace(
1384
+            $kw.ereg_replace(
1385 1385
                 '\[((/?(b|big|i|small|sub|sup|u))|br/)\]',
1386 1386
                 '<\\1>',
1387
-                htmlspecialchars($d . $linkdata['description'])
1388
-            ) . ($kw ? '</i>' : ''),
1387
+                htmlspecialchars($d.$linkdata['description'])
1388
+            ).($kw ? '</i>' : ''),
1389 1389
             $linkdata['on_homepage'] ? '1' : '0',
1390 1390
             $linkdata['hidden'] ? '1' : '0'
1391 1391
         );
@@ -1506,19 +1506,19 @@  discard block
 block discarded – undo
1506 1506
         echo '<div class="actions">';
1507 1507
         if (api_is_allowed_to_edit(null, true)) {
1508 1508
             echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=addlink&category_id='.$categoryId.'">'.
1509
-                Display::return_icon('new_link.png', get_lang('LinkAdd'),'',ICON_SIZE_MEDIUM).'</a>';
1509
+                Display::return_icon('new_link.png', get_lang('LinkAdd'), '', ICON_SIZE_MEDIUM).'</a>';
1510 1510
             echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=addcategory&category_id='.$categoryId.'">'.
1511
-                Display::return_icon('new_folder.png', get_lang('CategoryAdd'),'',ICON_SIZE_MEDIUM).'</a>';
1511
+                Display::return_icon('new_folder.png', get_lang('CategoryAdd'), '', ICON_SIZE_MEDIUM).'</a>';
1512 1512
         }
1513 1513
 
1514 1514
         $categories = Link::getLinkCategories($course_id, $session_id);
1515 1515
         $count = count($categories);
1516 1516
         if (!empty($count)) {
1517 1517
             echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=list&show=none">';
1518
-            echo Display::return_icon('forum_listview.png', get_lang('FlatView'), '', ICON_SIZE_MEDIUM) . ' </a>';
1518
+            echo Display::return_icon('forum_listview.png', get_lang('FlatView'), '', ICON_SIZE_MEDIUM).' </a>';
1519 1519
 
1520 1520
             echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=list&show=all">';
1521
-            echo Display::return_icon('forum_nestedview.png', get_lang('NestedView'), '', ICON_SIZE_MEDIUM) . '</a>';
1521
+            echo Display::return_icon('forum_nestedview.png', get_lang('NestedView'), '', ICON_SIZE_MEDIUM).'</a>';
1522 1522
         }
1523 1523
         echo '</div>';
1524 1524
 
@@ -1550,12 +1550,12 @@  discard block
 block discarded – undo
1550 1550
             $strVisibility = '';
1551 1551
             $visibilityClass = null;
1552 1552
             if ($myrow['visibility'] == '1') {
1553
-                $strVisibility =  '<a href="link.php?' . api_get_cidreq() .  '&sec_token='.$token.'&action=invisible&id=' . $myrow['id'] . '&scope=' . TOOL_LINK_CATEGORY . '" title="' . get_lang('Hide') . '">' .
1554
-                    Display :: return_icon('visible.png', get_lang('Hide'), array (), ICON_SIZE_SMALL) . '</a>';
1553
+                $strVisibility = '<a href="link.php?'.api_get_cidreq().'&sec_token='.$token.'&action=invisible&id='.$myrow['id'].'&scope='.TOOL_LINK_CATEGORY.'" title="'.get_lang('Hide').'">'.
1554
+                    Display :: return_icon('visible.png', get_lang('Hide'), array(), ICON_SIZE_SMALL).'</a>';
1555 1555
             } elseif ($myrow['visibility'] == '0') {
1556 1556
                 $visibilityClass = 'text-muted';
1557
-                $strVisibility =  ' <a href="link.php?' . api_get_cidreq() .  '&sec_token='.$token.'&action=visible&id=' . $myrow['id'] . '&scope=' . TOOL_LINK_CATEGORY . '" title="' . get_lang('Show') . '">' .
1558
-                    Display :: return_icon('invisible.png', get_lang('Show'), array (), ICON_SIZE_SMALL) . '</a>';
1557
+                $strVisibility = ' <a href="link.php?'.api_get_cidreq().'&sec_token='.$token.'&action=visible&id='.$myrow['id'].'&scope='.TOOL_LINK_CATEGORY.'" title="'.get_lang('Show').'">'.
1558
+                    Display :: return_icon('invisible.png', get_lang('Show'), array(), ICON_SIZE_SMALL).'</a>';
1559 1559
             }
1560 1560
 
1561 1561
             $header = '';
Please login to merge, or discard this patch.
main/inc/lib/lp_item.lib.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
 
37 37
     public function __construct($in_c_id = 0, $in_id = 0)
38 38
     {
39
-        if ($in_c_id > 0 && $in_id >0) {
39
+        if ($in_c_id > 0 && $in_id > 0) {
40 40
             $item_view_table = Database::get_course_table(TABLE_LP_ITEM);
41 41
             $sql = "SELECT * FROM $item_view_table
42 42
                     WHERE
Please login to merge, or discard this patch.
src/Chamilo/CourseBundle/Entity/CForumThread.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -181,7 +181,7 @@
 block discarded – undo
181 181
 
182 182
     /**
183 183
      * set threadPeerQualify
184
-     * @param $threadPeerQualify
184
+     * @param integer $threadPeerQualify
185 185
      * @return $this
186 186
      */
187 187
     public function setThreadPeerQualify($threadPeerQualify)
Please login to merge, or discard this patch.
main/social/profile.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -607,7 +607,7 @@
 block discarded – undo
607 607
                                 .' width="40px">';
608 608
                     $userInfo = api_get_user_info($user_invitation_id);
609 609
                     $invitations .= '<a href="'.api_get_path(WEB_PATH).'main/social/profile.php?u='.$user_invitation_id.'">'
610
-                                 .api_get_person_name($userInfo['firstname'],$userInfo['lastname']).'</a>';
610
+                                    .api_get_person_name($userInfo['firstname'],$userInfo['lastname']).'</a>';
611 611
                     
612 612
                     $invitations .='<div class="pull-right">';
613 613
                     $invitations .=  '<a title="'.get_lang('SocialAddToFriends').'" id="btn_accepted_'.$user_invitation_id.'" class="btn btn-default btn-sm" onclick="register_friend(this)" href="javascript:void(0)">'
Please login to merge, or discard this patch.
Spacing   +59 added lines, -59 removed lines patch added patch discarded remove patch
@@ -58,9 +58,9 @@  discard block
 block discarded – undo
58 58
 
59 59
     Display::addFlash(Display::return_message(get_lang('MessageSent')));
60 60
 
61
-    $url = api_get_path(WEB_CODE_PATH) . 'social/profile.php';
61
+    $url = api_get_path(WEB_CODE_PATH).'social/profile.php';
62 62
     $url .= empty($_SERVER['QUERY_STRING']) ? '' : '?'.Security::remove_XSS($_SERVER['QUERY_STRING']);
63
-    header('Location: ' . $url);
63
+    header('Location: '.$url);
64 64
     exit;
65 65
 
66 66
 } else if (!empty($_POST['social_wall_new_msg']) && !empty($_POST['messageId'])) {
@@ -75,9 +75,9 @@  discard block
 block discarded – undo
75 75
         MESSAGE_STATUS_WALL
76 76
     );
77 77
     Display::addFlash(Display::return_message(get_lang('MessageSent')));
78
-    $url = api_get_path(WEB_CODE_PATH) . 'social/profile.php';
78
+    $url = api_get_path(WEB_CODE_PATH).'social/profile.php';
79 79
     $url .= empty($_SERVER['QUERY_STRING']) ? '' : '?'.Security::remove_XSS($_SERVER['QUERY_STRING']);
80
-    header('Location: ' . $url);
80
+    header('Location: '.$url);
81 81
     exit;
82 82
 
83 83
 } else if (isset($_GET['messageId'])) {
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
             $status = SocialManager::deleteMessage($messageId);
90 90
 
91 91
             Display::addFlash(Display::return_message(get_lang('MessageDeleted')));
92
-            header('Location: ' . api_get_path(WEB_CODE_PATH) . 'social/profile.php');
92
+            header('Location: '.api_get_path(WEB_CODE_PATH).'social/profile.php');
93 93
             exit;
94 94
         }
95 95
     }
@@ -153,16 +153,16 @@  discard block
 block discarded – undo
153 153
 
154 154
 $ajax_url = api_get_path(WEB_AJAX_PATH).'message.ajax.php';
155 155
 $socialAjaxUrl = api_get_path(WEB_AJAX_PATH).'social.ajax.php';
156
-$javascriptDir = api_get_path(LIBRARY_PATH) . 'javascript/';
156
+$javascriptDir = api_get_path(LIBRARY_PATH).'javascript/';
157 157
 api_block_anonymous_users();
158 158
 $locale = api_get_language_isocode();
159 159
 // Add Jquery scroll pagination plugin
160 160
 $htmlHeadXtra[] = api_get_js('jscroll/jquery.jscroll.js');
161 161
 // Add Jquery Time ago plugin
162 162
 $htmlHeadXtra[] = api_get_asset('jquery-timeago/jquery.timeago.js');
163
-$timeAgoLocaleDir = $javascriptDir . 'jquery-timeago/locales/jquery.timeago.' . $locale . '.js';
163
+$timeAgoLocaleDir = $javascriptDir.'jquery-timeago/locales/jquery.timeago.'.$locale.'.js';
164 164
 if (file_exists($timeAgoLocaleDir)) {
165
-    $htmlHeadXtra[] = api_get_js('jquery-timeago/locales/jquery.timeago.' . $locale . '.js');
165
+    $htmlHeadXtra[] = api_get_js('jquery-timeago/locales/jquery.timeago.'.$locale.'.js');
166 166
 }
167 167
 
168 168
 $htmlHeadXtra[] = '<script>
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
 $(document).ready(function (){
171 171
     var container = $("#wallMessages");
172 172
     container.jscroll({
173
-        loadingHtml: "<div class=\"well_border\">' . get_lang('Loading') . ' </div>",
173
+        loadingHtml: "<div class=\"well_border\">' . get_lang('Loading').' </div>",
174 174
         nextSelector: "a.nextPage:last",
175 175
         contentSelector: "",
176 176
         callback: timeAgo
@@ -200,8 +200,8 @@  discard block
 block discarded – undo
200 200
 );
201 201
 
202 202
 if (isset($_GET['u']) && is_numeric($_GET['u']) && $_GET['u'] != api_get_user_id()) {
203
-    $info_user =   api_get_user_info($_GET['u']);
204
-    $interbreadcrumb[]= array(
203
+    $info_user = api_get_user_info($_GET['u']);
204
+    $interbreadcrumb[] = array(
205 205
         'url' => '#',
206 206
         'name' => $info_user['complete_name']
207 207
     );
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
 $list = [];
226 226
 if (is_array($personal_course_list)) {
227 227
     foreach ($personal_course_list as $my_course) {
228
-        if ($i<=10) {
228
+        if ($i <= 10) {
229 229
             $list[] = SocialManager::get_logged_user_course_html($my_course, $i);
230 230
             $course_list_code[] = array('code' => $my_course['code']);
231 231
         } else {
@@ -263,13 +263,13 @@  discard block
 block discarded – undo
263 263
 $social_wall_block = $wallSocialAddPost;
264 264
 
265 265
 // Social Post Wall
266
-$posts = SocialManager::getWallMessagesByUser($my_user_id, $friendId) ;
266
+$posts = SocialManager::getWallMessagesByUser($my_user_id, $friendId);
267 267
 
268 268
 $social_post_wall_block = empty($posts) ? '<p>'.get_lang("NoPosts").'</p>' : $posts;
269 269
 
270 270
 $socialAutoExtendLink = Display::url(
271 271
     get_lang('SeeMore'),
272
-    $socialAjaxUrl . '?u='. $my_user_id . '&a=listWallMessage&start=10&length=5',
272
+    $socialAjaxUrl.'?u='.$my_user_id.'&a=listWallMessage&start=10&length=5',
273 273
     array(
274 274
         'class' => 'nextPage next',
275 275
     )
@@ -291,12 +291,12 @@  discard block
 block discarded – undo
291 291
                 $(".spinner").html("'.
292 292
                     '<div class=\'text-center\'>'.
293 293
                         '<em class=\'fa fa-spinner fa-pulse fa-1x\'></em>'.
294
-                        '<p>'. get_lang('Loading') . ' ' . get_lang('Preview') .'</p>'.
294
+                        '<p>'.get_lang('Loading').' '.get_lang('Preview').'</p>'.
295 295
                     '</div>'.
296 296
                 '");
297 297
             },
298 298
             type: "POST",
299
-            url: "'. api_get_path(WEB_AJAX_PATH) .'social.ajax.php?a=readUrlWithOpenGraph",
299
+            url: "'. api_get_path(WEB_AJAX_PATH).'social.ajax.php?a=readUrlWithOpenGraph",
300 300
             data: "social_wall_new_msg_main=" + e.originalEvent.clipboardData.getData("text"),
301 301
             success: function(response) {
302 302
                 $("[name=\'wall_post_button\']").prop( "disabled", false );
@@ -391,7 +391,7 @@  discard block
 block discarded – undo
391 391
                                 .$tags['tag']
392 392
                                 .'</a>';
393 393
                         }
394
-                        if (is_array($user_tags) && count($user_tags)>0) {
394
+                        if (is_array($user_tags) && count($user_tags) > 0) {
395 395
                             $extra_information_value .= '<li class="list-group-item">'.ucfirst($extraFieldInfo['display_text']).': '
396 396
                                 .' '.implode('', $tag_tmp).'</li>';
397 397
                         }
@@ -415,7 +415,7 @@  discard block
 block discarded – undo
415 415
                         $extra_information_value .= '<li class="list-group-item">'.$data.'</li>';
416 416
                         break;
417 417
                     default:
418
-                        $extra_information_value .= '<li class="list-group-item">'.ucfirst($extraFieldInfo['display_text']) . ': ' . $data . '</li>';
418
+                        $extra_information_value .= '<li class="list-group-item">'.ucfirst($extraFieldInfo['display_text']).': '.$data.'</li>';
419 419
                         break;
420 420
                 }
421 421
             }
@@ -424,7 +424,7 @@  discard block
 block discarded – undo
424 424
         // if there are information to show
425 425
         if (!empty($extra_information_value)) {
426 426
 
427
-            $extra_information_value = '<ul class="list-group">' . $extra_information_value . '</ul>';
427
+            $extra_information_value = '<ul class="list-group">'.$extra_information_value.'</ul>';
428 428
 
429 429
             $extra_information .= Display::panelCollapse(
430 430
                 get_lang('ExtraInformation'),
@@ -504,10 +504,10 @@  discard block
 block discarded – undo
504 504
 
505 505
         if ($i > $max_numbers_of_group) {
506 506
             if (api_get_user_id() == $user_id) {
507
-                $my_groups .=  '<div class="box_shared_profile_group_actions">'
507
+                $my_groups .= '<div class="box_shared_profile_group_actions">'
508 508
                     .'<a href="groups.php?#tab_browse-1">'.get_lang('SeeAllMyGroups').'</a></div>';
509 509
             } else {
510
-                $my_groups .=  '<div class="box_shared_profile_group_actions">'
510
+                $my_groups .= '<div class="box_shared_profile_group_actions">'
511 511
                     .'<a href="'.api_get_path(WEB_CODE_PATH).'social/profile_friends_and_groups.inc.php'
512 512
                     .'?view=mygroups&height=390&width=610&user_id='.$user_id.'"'
513 513
                     .' class="ajax" title="'.get_lang('SeeAll').'" >'
@@ -520,7 +520,7 @@  discard block
 block discarded – undo
520 520
         $i = 1;
521 521
         foreach ($grid_my_groups as $group) {
522 522
             $my_groups .= '<div class="panel-body">';
523
-            $my_groups .=  $group[0];
523
+            $my_groups .= $group[0];
524 524
             $my_groups .= '</div>';
525 525
             $i++;
526 526
         }
@@ -543,7 +543,7 @@  discard block
 block discarded – undo
543 543
                 $i++;
544 544
             }
545 545
         }
546
-        $social_course_block .=  $my_courses;
546
+        $social_course_block .= $my_courses;
547 547
     }
548 548
 
549 549
     // Block Social Sessions
@@ -564,7 +564,7 @@  discard block
 block discarded – undo
564 564
 
565 565
     // Images uploaded by course
566 566
     $file_list = '';
567
-    if (is_array($course_list_code) && count($course_list_code)>0) {
567
+    if (is_array($course_list_code) && count($course_list_code) > 0) {
568 568
         foreach ($course_list_code as $course) {
569 569
             $file_list .= UserManager::get_user_upload_files_by_course(
570 570
                 $user_id,
@@ -576,7 +576,7 @@  discard block
 block discarded – undo
576 576
 
577 577
     $count_pending_invitations = 0;
578 578
     if (!isset($_GET['u']) ||
579
-        (isset($_GET['u']) && $_GET['u']==api_get_user_id())
579
+        (isset($_GET['u']) && $_GET['u'] == api_get_user_id())
580 580
     ) {
581 581
         $pending_invitations = SocialManager::get_list_invitation_of_friends_by_user_id(api_get_user_id());
582 582
         $list_get_path_web = SocialManager::get_list_web_path_user_invitation_by_user_id(api_get_user_id());
@@ -585,23 +585,23 @@  discard block
 block discarded – undo
585 585
 
586 586
     if (!empty($production_list) || !empty($file_list) || $count_pending_invitations > 0) {
587 587
         // Pending invitations
588
-        if (!isset($_GET['u']) || (isset($_GET['u']) && $_GET['u']==api_get_user_id())) {
588
+        if (!isset($_GET['u']) || (isset($_GET['u']) && $_GET['u'] == api_get_user_id())) {
589 589
             if ($count_pending_invitations > 0) {
590
-                $invitations =  '<ul class="list-group">';
590
+                $invitations = '<ul class="list-group">';
591 591
                 for ($i = 0; $i < $count_pending_invitations; $i++) {
592 592
                     $user_invitation_id = $pending_invitations[$i]['user_sender_id'];
593
-                    $invitations .=  '<li id="dpending_'.$user_invitation_id.'" class="list-group-item">';
594
-                    $invitations .=  '<img class="img-rounded" '
593
+                    $invitations .= '<li id="dpending_'.$user_invitation_id.'" class="list-group-item">';
594
+                    $invitations .= '<img class="img-rounded" '
595 595
                                 .' src="'.$list_get_path_web[$i]['dir'].'/'.$list_get_path_web[$i]['file'].'"'
596 596
                                 .' width="40px">';
597 597
                     $userInfo = api_get_user_info($user_invitation_id);
598 598
                     $invitations .= '<a href="'.api_get_path(WEB_PATH).'main/social/profile.php?u='.$user_invitation_id.'">'
599
-                                 .api_get_person_name($userInfo['firstname'],$userInfo['lastname']).'</a>';
599
+                                 .api_get_person_name($userInfo['firstname'], $userInfo['lastname']).'</a>';
600 600
 
601
-                    $invitations .='<div class="pull-right">';
601
+                    $invitations .= '<div class="pull-right">';
602 602
                     $invitations .= Display::toolbarButton(
603 603
                         get_lang('SocialAddToFriends'),
604
-                        api_get_path(WEB_AJAX_PATH) . 'social.ajax.php?' . http_build_query([
604
+                        api_get_path(WEB_AJAX_PATH).'social.ajax.php?'.http_build_query([
605 605
                             'a' => 'add_friend',
606 606
                             'friend_id' => $user_invitation_id,
607 607
                             'is_my_friend' => 'friend'
@@ -612,8 +612,8 @@  discard block
 block discarded – undo
612 612
                         false
613 613
                     );
614 614
                     $invitations .= '</div>';
615
-                    $invitations .=  '<div id="id_response"></div>';
616
-                    $invitations .=  '</li>';
615
+                    $invitations .= '<div id="id_response"></div>';
616
+                    $invitations .= '</li>';
617 617
                 }
618 618
                 $invitations .= '</ul>';
619 619
                 $listInvitations = Display::panelCollapse(
@@ -628,51 +628,51 @@  discard block
 block discarded – undo
628 628
         }
629 629
 
630 630
         // Productions
631
-        $production_list =  UserManager::build_production_list($user_id);
631
+        $production_list = UserManager::build_production_list($user_id);
632 632
         $product_content = '';
633 633
         if (!empty($production_list)) {
634 634
             $product_content .= '<div><h3>'.get_lang('MyProductions').'</h3></div>';
635
-            $product_content .=  $production_list;
636
-            $socialRightInformation .=  SocialManager::social_wrapper_div($product_content, 4);
635
+            $product_content .= $production_list;
636
+            $socialRightInformation .= SocialManager::social_wrapper_div($product_content, 4);
637 637
         }
638 638
 
639 639
         $images_uploaded = null;
640 640
         // Images uploaded by course
641 641
         if (!empty($file_list)) {
642
-            $images_uploaded .=  '<div><h3>'.get_lang('ImagesUploaded').'</h3></div>';
643
-            $images_uploaded .=  '<div class="social-content-information">';
644
-            $images_uploaded .=  $file_list;
645
-            $images_uploaded .=  '</div>';
646
-            $socialRightInformation .=  SocialManager::social_wrapper_div($images_uploaded, 4);
642
+            $images_uploaded .= '<div><h3>'.get_lang('ImagesUploaded').'</h3></div>';
643
+            $images_uploaded .= '<div class="social-content-information">';
644
+            $images_uploaded .= $file_list;
645
+            $images_uploaded .= '</div>';
646
+            $socialRightInformation .= SocialManager::social_wrapper_div($images_uploaded, 4);
647 647
         }
648 648
     }
649 649
 
650 650
     if (!empty($user_info['competences']) || !empty($user_info['diplomas'])
651
-        || !empty($user_info['openarea']) || !empty($user_info['teach']) ) {
651
+        || !empty($user_info['openarea']) || !empty($user_info['teach'])) {
652 652
 
653
-        $more_info .=  '<div><h3>'.get_lang('MoreInformation').'</h3></div>';
653
+        $more_info .= '<div><h3>'.get_lang('MoreInformation').'</h3></div>';
654 654
         if (!empty($user_info['competences'])) {
655
-            $more_info .=  '<br />';
656
-                $more_info .=  '<div class="social-actions-message"><strong>'.get_lang('MyCompetences').'</strong></div>';
657
-                $more_info .=  '<div class="social-profile-extended">'.$user_info['competences'].'</div>';
658
-            $more_info .=  '<br />';
655
+            $more_info .= '<br />';
656
+                $more_info .= '<div class="social-actions-message"><strong>'.get_lang('MyCompetences').'</strong></div>';
657
+                $more_info .= '<div class="social-profile-extended">'.$user_info['competences'].'</div>';
658
+            $more_info .= '<br />';
659 659
         }
660 660
         if (!empty($user_info['diplomas'])) {
661
-            $more_info .=  '<div class="social-actions-message"><strong>'.get_lang('MyDiplomas').'</strong></div>';
662
-            $more_info .=  '<div class="social-profile-extended">'.$user_info['diplomas'].'</div>';
663
-            $more_info .=  '<br />';
661
+            $more_info .= '<div class="social-actions-message"><strong>'.get_lang('MyDiplomas').'</strong></div>';
662
+            $more_info .= '<div class="social-profile-extended">'.$user_info['diplomas'].'</div>';
663
+            $more_info .= '<br />';
664 664
         }
665 665
         if (!empty($user_info['openarea'])) {
666
-            $more_info .=  '<div class="social-actions-message"><strong>'.get_lang('MyPersonalOpenArea').'</strong></div>';
667
-            $more_info .=  '<div class="social-profile-extended">'.$user_info['openarea'].'</div>';
668
-            $more_info .=  '<br />';
666
+            $more_info .= '<div class="social-actions-message"><strong>'.get_lang('MyPersonalOpenArea').'</strong></div>';
667
+            $more_info .= '<div class="social-profile-extended">'.$user_info['openarea'].'</div>';
668
+            $more_info .= '<br />';
669 669
         }
670 670
         if (!empty($user_info['teach'])) {
671
-            $more_info .=  '<div class="social-actions-message"><strong>'.get_lang('MyTeach').'</strong></div>';
672
-            $more_info .=  '<div class="social-profile-extended">'.$user_info['teach'].'</div>';
673
-            $more_info .=  '<br />';
671
+            $more_info .= '<div class="social-actions-message"><strong>'.get_lang('MyTeach').'</strong></div>';
672
+            $more_info .= '<div class="social-profile-extended">'.$user_info['teach'].'</div>';
673
+            $more_info .= '<br />';
674 674
         }
675
-        $socialRightInformation .=  SocialManager::social_wrapper_div($more_info, 4);
675
+        $socialRightInformation .= SocialManager::social_wrapper_div($more_info, 4);
676 676
     }
677 677
 }
678 678
 
@@ -694,7 +694,7 @@  discard block
 block discarded – undo
694 694
 $tpl->assign('social_right_information', $socialRightInformation);
695 695
 $tpl->assign('social_auto_extend_link', $socialAutoExtendLink);
696 696
 
697
-$formModalTpl =  new Template();
697
+$formModalTpl = new Template();
698 698
 $formModalTpl->assign('invitation_form', MessageManager::generate_invitation_form('send_invitation'));
699 699
 $formModals = $formModalTpl->fetch('default/social/form_modals.tpl');
700 700
 
Please login to merge, or discard this patch.