Completed
Push — 1.10.x ( 60fa62...2aecf0 )
by Yannick
42:06
created
main/cron/import_csv.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 /* For licensing terms, see /license.txt */
3 3
 
4
-if (PHP_SAPI !='cli') {
4
+if (PHP_SAPI != 'cli') {
5 5
     die('Run this script through the command line or comment this line in the code');
6 6
 }
7 7
 
@@ -365,11 +365,11 @@  discard block
 block discarded – undo
365 365
                 $row = $this->cleanUserRow($row);
366 366
 
367 367
                 $user_id = UserManager::get_user_id_from_original_id(
368
-                    $row['extra_' . $this->extraFieldIdNameList['user']],
368
+                    $row['extra_'.$this->extraFieldIdNameList['user']],
369 369
                     $this->extraFieldIdNameList['user']
370 370
                 );
371
-                $userInfo  = array();
372
-                $userInfoByOfficialCode  = null;
371
+                $userInfo = array();
372
+                $userInfoByOfficialCode = null;
373 373
 
374 374
                 if (!empty($user_id)) {
375 375
                     $userInfo = api_get_user_info($user_id);
@@ -423,7 +423,7 @@  discard block
 block discarded – undo
423 423
                     $result = UserManager::update_user(
424 424
                         $userInfo['user_id'],
425 425
                         $row['firstname'], // <<-- changed
426
-                        $row['lastname'],  // <<-- changed
426
+                        $row['lastname'], // <<-- changed
427 427
                         $userInfo['username'],
428 428
                         null, //$password = null,
429 429
                         $row['auth_source'],
@@ -557,7 +557,7 @@  discard block
 block discarded – undo
557 557
 
558 558
                     if ($row['action'] == 'delete') {
559 559
                         // Inactive one year later
560
-                        $userInfo['expiration_date'] = api_get_utc_datetime(api_strtotime(time() + 365*24*60*60));
560
+                        $userInfo['expiration_date'] = api_get_utc_datetime(api_strtotime(time() + 365 * 24 * 60 * 60));
561 561
                     }
562 562
 
563 563
                     $password = $row['password']; // change password
@@ -606,8 +606,8 @@  discard block
 block discarded – undo
606 606
                     $result = UserManager::update_user(
607 607
                         $userInfo['user_id'],
608 608
                         $row['firstname'], // <<-- changed
609
-                        $row['lastname'],  // <<-- changed
610
-                        $row['username'],  // <<-- changed
609
+                        $row['lastname'], // <<-- changed
610
+                        $row['username'], // <<-- changed
611 611
                         $password, //$password = null,
612 612
                         $row['auth_source'],
613 613
                         $email,
@@ -674,7 +674,7 @@  discard block
 block discarded – undo
674 674
         $data = Import::csv_to_array($file);
675 675
 
676 676
         if (!empty($data)) {
677
-            $this->logger->addInfo(count($data) . " records found.");
677
+            $this->logger->addInfo(count($data)." records found.");
678 678
             $eventsToCreate = array();
679 679
             $errorFound = false;
680 680
             foreach ($data as $row) {
@@ -688,7 +688,7 @@  discard block
 block discarded – undo
688 688
                     );
689 689
                 }
690 690
 
691
-                $courseCode  = null;
691
+                $courseCode = null;
692 692
                 if (isset($row['coursecode'])) {
693 693
                     $courseCode = $row['coursecode'];
694 694
                 }
@@ -742,7 +742,7 @@  discard block
 block discarded – undo
742 742
                 }
743 743
 
744 744
                 $date = $row['date'];
745
-                $startTime  = $row['time_start'];
745
+                $startTime = $row['time_start'];
746 746
                 $endTime = $row['time_end'];
747 747
                 $title = $row['title'];
748 748
                 $comment = $row['comment'];
@@ -966,7 +966,7 @@  discard block
 block discarded – undo
966 966
                 $row = $this->cleanCourseRow($row);
967 967
 
968 968
                 $courseId = CourseManager::get_course_id_from_original_id(
969
-                    $row['extra_' . $this->extraFieldIdNameList['course']],
969
+                    $row['extra_'.$this->extraFieldIdNameList['course']],
970 970
                     $this->extraFieldIdNameList['course']
971 971
                 );
972 972
 
@@ -1084,7 +1084,7 @@  discard block
 block discarded – undo
1084 1084
         $data = Import::csv_reader($file);
1085 1085
 
1086 1086
         if (!empty($data)) {
1087
-            $this->logger->addInfo(count($data) . " records found.");
1087
+            $this->logger->addInfo(count($data)." records found.");
1088 1088
             foreach ($data as $row) {
1089 1089
                 $chamiloUserName = $row['UserName'];
1090 1090
                 $chamiloCourseCode = $row['CourseCode'];
@@ -1126,7 +1126,7 @@  discard block
 block discarded – undo
1126 1126
                 );
1127 1127
 
1128 1128
                 $this->logger->addError(
1129
-                    "User '$chamiloUserName' was remove from Session: #$chamiloSessionId - Course: " . $courseInfo['code']
1129
+                    "User '$chamiloUserName' was remove from Session: #$chamiloSessionId - Course: ".$courseInfo['code']
1130 1130
                 );
1131 1131
 
1132 1132
             }
@@ -1143,7 +1143,7 @@  discard block
 block discarded – undo
1143 1143
         $data = Import::csv_reader($file);
1144 1144
 
1145 1145
         if (!empty($data)) {
1146
-            $this->logger->addInfo(count($data) . " records found.");
1146
+            $this->logger->addInfo(count($data)." records found.");
1147 1147
             foreach ($data as $row) {
1148 1148
                 $chamiloUserName = $row['UserName'];
1149 1149
                 $chamiloCourseCode = $row['CourseCode'];
@@ -1198,7 +1198,7 @@  discard block
 block discarded – undo
1198 1198
                 }
1199 1199
 
1200 1200
                 $this->logger->addError(
1201
-                    "User '$chamiloUserName' with status $type was added to session: #$chamiloSessionId - Course: " . $courseInfo['code']
1201
+                    "User '$chamiloUserName' with status $type was added to session: #$chamiloSessionId - Course: ".$courseInfo['code']
1202 1202
                 );
1203 1203
             }
1204 1204
         }
@@ -1441,7 +1441,7 @@  discard block
 block discarded – undo
1441 1441
      */
1442 1442
     private function importSessions($file, $moveFile = true, &$teacherBackup = array(), &$groupBackup = array())
1443 1443
     {
1444
-        $avoid =  null;
1444
+        $avoid = null;
1445 1445
         if (isset($this->conditions['importSessions']) &&
1446 1446
             isset($this->conditions['importSessions']['update'])
1447 1447
         ) {
@@ -1486,7 +1486,7 @@  discard block
 block discarded – undo
1486 1486
         $data = Import::csv_reader($file);
1487 1487
 
1488 1488
         if (!empty($data)) {
1489
-            $this->logger->addInfo(count($data) . " records found.");
1489
+            $this->logger->addInfo(count($data)." records found.");
1490 1490
             foreach ($data as $row) {
1491 1491
                 $chamiloUserName = $row['UserName'];
1492 1492
                 $chamiloCourseCode = $row['CourseCode'];
@@ -1533,7 +1533,7 @@  discard block
 block discarded – undo
1533 1533
                 }
1534 1534
 
1535 1535
                 $this->logger->addError(
1536
-                    "User '$chamiloUserName' with status $type was added to session: #$chamiloSessionId - Course: " . $courseInfo['code']
1536
+                    "User '$chamiloUserName' with status $type was added to session: #$chamiloSessionId - Course: ".$courseInfo['code']
1537 1537
                 );
1538 1538
             }
1539 1539
         }
Please login to merge, or discard this patch.
main/cron/fix_online_time.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
  * @package chamilo.cron
7 7
  * @author Imanol Losada <[email protected]>
8 8
  */
9
-require_once __DIR__ . '/../inc/global.inc.php';
9
+require_once __DIR__.'/../inc/global.inc.php';
10 10
 
11 11
 /**
12 12
  * Get ids of COURSEMANAGERs that are inside a course right now
@@ -15,9 +15,9 @@  discard block
 block discarded – undo
15 15
 function getTeachersInCourseIds()
16 16
 {
17 17
     $table = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ONLINE);
18
-    $joinStatement = ' JOIN ' . Database::get_main_table(TABLE_MAIN_USER) . ' ON login_user_id = user_id';
18
+    $joinStatement = ' JOIN '.Database::get_main_table(TABLE_MAIN_USER).' ON login_user_id = user_id';
19 19
     return Database::select(
20
-        'login_user_id', $table . $joinStatement,
20
+        'login_user_id', $table.$joinStatement,
21 21
         array(
22 22
             'where' => array(
23 23
                 'c_id IS NOT NULL AND status = ?' => array(
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
     $dataBaseCurrentHour = array_shift($utcResult);
45 45
     $maximumIdleTimeInCourse = date(
46 46
         'Y-m-d H:i:s',
47
-        strtotime($dataBaseCurrentHour . ' ' . $timeLimit)
47
+        strtotime($dataBaseCurrentHour.' '.$timeLimit)
48 48
     );
49 49
     $table = Database::get_main_table(TABLE_STATISTIC_TRACK_E_COURSE_ACCESS);
50 50
     $onLineTrackTable = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ONLINE);
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
             array(
70 70
                 'logout_course_date' => date(
71 71
                     'Y-m-d H:i:s',
72
-                    strtotime($currentTeacherData['logout_course_date'] . ' ' . $extraTime)
72
+                    strtotime($currentTeacherData['logout_course_date'].' '.$extraTime)
73 73
                 )
74 74
             ),
75 75
             array(
Please login to merge, or discard this patch.
main/cron/fix_fill_blank.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@
 block discarded – undo
9 9
 
10 10
 $execute = isset($_GET['execute']) ? $_GET['execute'] : null;
11 11
 $courseId = isset($_GET['c_id']) ? $_GET['c_id'] : null;
12
-$questionId  = isset($_GET['question_id']) ? $_GET['question_id'] : null;
12
+$questionId = isset($_GET['question_id']) ? $_GET['question_id'] : null;
13 13
 
14 14
 $sql2 = "SELECT * FROM $table WHERE answer LIKE '%[%]%'";
15 15
 
Please login to merge, or discard this patch.
main/dashboard/index.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,12 +20,12 @@
 block discarded – undo
20 20
 
21 21
 // current section
22 22
 $this_section = SECTION_DASHBOARD;
23
-unset($_SESSION['this_section']);//for hmtl editor repository
23
+unset($_SESSION['this_section']); //for hmtl editor repository
24 24
 
25 25
 // get actions
26 26
 $actions = array('listing', 'store_user_block', 'disable_block');
27 27
 $action = 'listing';
28
-if (isset($_GET['action']) && in_array($_GET['action'],$actions)) {
28
+if (isset($_GET['action']) && in_array($_GET['action'], $actions)) {
29 29
 	$action = $_GET['action'];
30 30
 }
31 31
 
Please login to merge, or discard this patch.
main/dashboard/dashboard.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 // menu actions for dashboard views
14 14
 $views = array('blocks', 'list');
15 15
 
16
-if(isset($_GET['view']) && in_array($_GET['view'], $views)){
16
+if (isset($_GET['view']) && in_array($_GET['view'], $views)) {
17 17
 	$dashboard_view = $_GET['view'];
18 18
 }
19 19
 
@@ -21,16 +21,16 @@  discard block
 block discarded – undo
21 21
 
22 22
 if (isset($dashboard_view) && $dashboard_view == 'list') {
23 23
 	$link_blocks_view = '<a href="'.api_get_self().'?view=blocks">'.
24
-		Display::return_icon('blocks.png',get_lang('DashboardBlocks'),'',ICON_SIZE_MEDIUM).'</a>';
24
+		Display::return_icon('blocks.png', get_lang('DashboardBlocks'), '', ICON_SIZE_MEDIUM).'</a>';
25 25
 } else {
26 26
 	$link_list_view = '<a href="'.api_get_self().'?view=list">'.
27
-		Display::return_icon('edit.png',get_lang('EditBlocks'),'',ICON_SIZE_MEDIUM).'</a>';
27
+		Display::return_icon('edit.png', get_lang('EditBlocks'), '', ICON_SIZE_MEDIUM).'</a>';
28 28
 }
29 29
 
30 30
 $configuration_link = null;
31 31
 if (api_is_platform_admin()) {
32 32
 	$configuration_link = '<a href="'.api_get_path(WEB_CODE_PATH).'admin/settings.php?category=Plugins">'
33
-	.Display::return_icon('settings.png',get_lang('ConfigureDashboardPlugin'),'',ICON_SIZE_MEDIUM).'</a>';
33
+	.Display::return_icon('settings.png', get_lang('ConfigureDashboardPlugin'), '', ICON_SIZE_MEDIUM).'</a>';
34 34
 }
35 35
 
36 36
 echo '<div class="actions">';
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
         if (count($columns) > 0) {
57 57
             $columns_name = array_keys($columns);
58 58
             // blocks for column 1
59
-            if (in_array('column_1',$columns_name)) {
59
+            if (in_array('column_1', $columns_name)) {
60 60
                 echo '<div id="column1" class="col-md-6">';
61 61
                     foreach ($columns['column_1'] as $content) {
62 62
                         echo $content;
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
                 echo '</div>';
69 69
             }
70 70
             // blocks for column 2
71
-            if (in_array('column_2',$columns_name)) {
71
+            if (in_array('column_2', $columns_name)) {
72 72
                 // blocks for column 1
73 73
                 echo '<div id="column2" class="col-md-6">';
74 74
                     foreach ($columns['column_2'] as $content) {
Please login to merge, or discard this patch.
main/timeline/index.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -23,19 +23,19 @@  discard block
 block discarded – undo
23 23
 
24 24
 switch ($action) {
25 25
     case 'add':
26
-        $interbreadcrumb[]=array('url' => 'index.php','name' => get_lang('Timeline'));
27
-        $interbreadcrumb[]=array('url' => '#','name' => get_lang('Add'));
26
+        $interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('Timeline'));
27
+        $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('Add'));
28 28
         break;
29 29
     case 'edit':
30
-        $interbreadcrumb[]=array('url' => 'index.php','name' => get_lang('Timeline'));
31
-        $interbreadcrumb[]=array('url' => '#','name' => get_lang('Edit'));
30
+        $interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('Timeline'));
31
+        $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('Edit'));
32 32
         break;
33 33
     case 'add_item':
34
-        $interbreadcrumb[]=array('url' => 'index.php','name' => get_lang('Timeline'));
35
-        $interbreadcrumb[]=array('url' => '#','name' => get_lang('TimelineItem'));
34
+        $interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('Timeline'));
35
+        $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('TimelineItem'));
36 36
         break;
37 37
     default:
38
-        $interbreadcrumb[]=array('url' => '#','name' => get_lang('Timeline'));
38
+        $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('Timeline'));
39 39
 }
40 40
 
41 41
 //jqgrid will use this URL to do the selects
@@ -46,8 +46,8 @@  discard block
 block discarded – undo
46 46
 
47 47
 //Column config
48 48
 $column_model   = array(
49
-                        array('name'=>'name',           'index'=>'name',        'width'=>'120',   'align'=>'left'),
50
-                        array('name'=>'actions',        'index'=>'actions',     'width'=>'100',  'align'=>'left', 'sortable'=>'false')
49
+                        array('name'=>'name', 'index'=>'name', 'width'=>'120', 'align'=>'left'),
50
+                        array('name'=>'actions', 'index'=>'actions', 'width'=>'100', 'align'=>'left', 'sortable'=>'false')
51 51
                        );
52 52
 //Autowidth
53 53
 $extra_params['autowidth'] = 'true';
@@ -55,11 +55,11 @@  discard block
 block discarded – undo
55 55
 $extra_params['height'] = 'auto';
56 56
 
57 57
 //With this function we can add actions to the jgrid (edit, delete, etc)
58
-$htmlHeadXtra[] ='
58
+$htmlHeadXtra[] = '
59 59
 <script>
60 60
 $(function() {
61 61
     // grid definition see the $timeline->display() function
62
-    '.Display::grid_js('timelines',  $url,$columns,$column_model,$extra_params, array(), null,true).'
62
+    '.Display::grid_js('timelines', $url, $columns, $column_model, $extra_params, array(), null, true).'
63 63
 });
64 64
 </script>';
65 65
 
@@ -80,12 +80,12 @@  discard block
 block discarded – undo
80 80
                 $values = $form->exportValues();
81 81
                 $res    = $timeline->save($values);
82 82
                 if ($res) {
83
-                    $message = Display::return_message(get_lang('ItemAdded'),'success');
83
+                    $message = Display::return_message(get_lang('ItemAdded'), 'success');
84 84
                 }
85 85
             }
86 86
             $content = $timeline->listing();
87 87
         } else {
88
-            $actions .= '<a href="'.api_get_self().'">'.Display::return_icon('back.png',get_lang('Back'),'',ICON_SIZE_MEDIUM).'</a>';
88
+            $actions .= '<a href="'.api_get_self().'">'.Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM).'</a>';
89 89
             $form->addElement('hidden', 'sec_token');
90 90
             $form->setConstants(array('sec_token' => $token));
91 91
             $content = $form->return_form();
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
             }
107 107
             $timeline->display();
108 108
         } else {
109
-            $actions = '<a href="'.api_get_self().'">'.Display::return_icon('back.png',get_lang('Back'),'',ICON_SIZE_MEDIUM).'</a>';
109
+            $actions = '<a href="'.api_get_self().'">'.Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM).'</a>';
110 110
             $form->addElement('hidden', 'sec_token');
111 111
             $form->setConstants(array('sec_token' => $token));
112 112
             $content = $form->return_form();
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
             }
129 129
             $timeline->display();
130 130
         } else {
131
-            $actions = '<a href="'.api_get_self().'">'.Display::return_icon('back.png',get_lang('Back'),'',ICON_SIZE_MEDIUM).'</a>';
131
+            $actions = '<a href="'.api_get_self().'">'.Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM).'</a>';
132 132
             $form->addElement('hidden', 'sec_token');
133 133
             $form->setConstants(array('sec_token' => $token));
134 134
             $content = $form->return_form();
Please login to merge, or discard this patch.
main/timeline/view.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -6,8 +6,8 @@  discard block
 block discarded – undo
6 6
 */
7 7
 require_once '../inc/global.inc.php';
8 8
 
9
-$interbreadcrumb[]=array('url' => 'index.php','name' => get_lang('Timeline'));
10
-$interbreadcrumb[]=array('url' => 'index.php','name' => get_lang('Listing'));
9
+$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('Timeline'));
10
+$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('Listing'));
11 11
 
12 12
 $timeline = new Timeline();
13 13
 if (empty($_GET['id'])) {
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 }
16 16
 $url = $timeline->get_url($_GET['id']);
17 17
 $item = $timeline->get($_GET['id']);
18
-$interbreadcrumb[]=array('url' => '#','name' => $item['headline']);
18
+$interbreadcrumb[] = array('url' => '#', 'name' => $item['headline']);
19 19
 
20 20
 $htmlHeadXtra[] = api_get_css(api_get_path(WEB_LIBRARY_PATH).'javascript/timeline/timeline.css');
21 21
 $htmlHeadXtra[] = api_get_js('timeline/timeline-min.js');
Please login to merge, or discard this patch.
main/blog/download.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 session_cache_limiter('public');
16 16
 
17 17
 require_once '../inc/global.inc.php';
18
-$this_section=SECTION_COURSES;
18
+$this_section = SECTION_COURSES;
19 19
 
20 20
 // IMPORTANT to avoid caching of documents
21 21
 header('Expires: Wed, 01 Jan 1990 00:00:00 GMT');
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 $doc_url = str_replace(' ', '+', $doc_url);
33 33
 $doc_url = str_replace('/..', '', $doc_url); //echo $doc_url;
34 34
 
35
-if (! isset($_course)) {
35
+if (!isset($_course)) {
36 36
 	api_not_allowed(true);
37 37
 }
38 38
 $full_file_name = api_get_path(SYS_COURSE_PATH).api_get_course_path().'/upload/blog/'.$doc_url;
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 //if the rewrite rule asks for a directory, we redirect to the course view
41 41
 if (is_dir($full_file_name)) {
42 42
 	//remove last slash if present
43
-	while ($doc_url{$dul = strlen($doc_url)-1}=='/') $doc_url = substr($doc_url,0,$dul);
43
+	while ($doc_url{$dul = strlen($doc_url) - 1} == '/') $doc_url = substr($doc_url, 0, $dul);
44 44
 	//create the path
45 45
 	$document_explorer = api_get_path(WEB_COURSE_PATH).api_get_course_path(); // home course path
46 46
 	//redirect
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
     exit;
49 49
 }
50 50
 
51
-$tbl_blogs_attachment 	= Database::get_course_table(TABLE_BLOGS_ATTACHMENT);
51
+$tbl_blogs_attachment = Database::get_course_table(TABLE_BLOGS_ATTACHMENT);
52 52
 $course_id = api_get_course_int_id();
53 53
 
54 54
 // launch event
Please login to merge, or discard this patch.
main/blog/blog.php 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -13,15 +13,15 @@  discard block
 block discarded – undo
13 13
     api_not_allowed(true);
14 14
 }
15 15
 
16
-$this_section   = SECTION_COURSES;
17
-$current_course_tool  = TOOL_BLOGS;
16
+$this_section = SECTION_COURSES;
17
+$current_course_tool = TOOL_BLOGS;
18 18
 
19 19
 /* 	ACCESS RIGHTS */
20 20
 // notice for unauthorized people.
21 21
 api_protect_course_script(true);
22 22
 
23 23
 $lib_path = api_get_path(LIBRARY_PATH);
24
-$blog_table_attachment 	= Database::get_course_table(TABLE_BLOGS_ATTACHMENT);
24
+$blog_table_attachment = Database::get_course_table(TABLE_BLOGS_ATTACHMENT);
25 25
 
26 26
 $nameTools  = get_lang('Blogs');
27 27
 $DaysShort  = api_get_week_days_short();
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
 		$safe_comment_title,
136 136
 		$safe_comment_text,
137 137
 		$blog_id,
138
-		(int)$_GET['post_id'],
138
+		(int) $_GET['post_id'],
139 139
 		$_POST['comment_parent_id'],
140 140
 		$_POST['task_id']
141 141
 	);
@@ -147,29 +147,29 @@  discard block
 block discarded – undo
147 147
 if (!empty($_POST['register'])) {
148 148
 	if (is_array($_POST['user'])) {
149 149
 		foreach ($_POST['user'] as $index => $user_id) {
150
-			Blog :: set_user_subscribed((int)$_GET['blog_id'], $user_id);
150
+			Blog :: set_user_subscribed((int) $_GET['blog_id'], $user_id);
151 151
 		}
152 152
 	}
153 153
 }
154 154
 if (!empty($_POST['unregister'])) {
155 155
 	if (is_array($_POST['user'])) {
156 156
 		foreach ($_POST['user'] as $index => $user_id) {
157
-			Blog :: set_user_unsubscribed((int)$_GET['blog_id'], $user_id);
157
+			Blog :: set_user_unsubscribed((int) $_GET['blog_id'], $user_id);
158 158
 		}
159 159
 	}
160 160
 }
161 161
 if (!empty($_GET['register'])) {
162
-	Blog :: set_user_subscribed((int)$_GET['blog_id'], (int)$_GET['user_id']);
162
+	Blog :: set_user_subscribed((int) $_GET['blog_id'], (int) $_GET['user_id']);
163 163
 	$return_message = array('type' => 'confirmation', 'message' => get_lang('UserRegistered'));
164 164
 	$flag = 1;
165 165
 }
166 166
 if (!empty($_GET['unregister'])) {
167
-	Blog :: set_user_unsubscribed((int)$_GET['blog_id'], (int)$_GET['user_id']);
167
+	Blog :: set_user_unsubscribed((int) $_GET['blog_id'], (int) $_GET['user_id']);
168 168
 }
169 169
 
170 170
 if (isset($_GET['action']) && $_GET['action'] == 'manage_tasks') {
171 171
 	if (isset($_GET['do']) && $_GET['do'] == 'delete') {
172
-		Blog :: delete_task($blog_id, (int)$_GET['task_id']);
172
+		Blog :: delete_task($blog_id, (int) $_GET['task_id']);
173 173
 		$return_message = array('type' => 'confirmation', 'message' => get_lang('TaskDeleted'));
174 174
 	}
175 175
 
@@ -182,9 +182,9 @@  discard block
 block discarded – undo
182 182
 if (isset($_GET['action']) && $_GET['action'] == 'view_post') {
183 183
 	$task_id = (isset ($_GET['task_id']) && is_numeric($_GET['task_id'])) ? $_GET['task_id'] : 0;
184 184
 
185
-	if (isset($_GET['do']) && $_GET['do'] == 'delete_comment')	{
185
+	if (isset($_GET['do']) && $_GET['do'] == 'delete_comment') {
186 186
 		if (api_is_allowed('BLOG_'.$blog_id, 'article_comments_delete', $task_id)) {
187
-			Blog :: delete_comment($blog_id, (int)$_GET['post_id'],(int)$_GET['comment_id']);
187
+			Blog :: delete_comment($blog_id, (int) $_GET['post_id'], (int) $_GET['comment_id']);
188 188
 			$return_message = array('type' => 'confirmation', 'message' => get_lang('CommentDeleted'));
189 189
 		} else {
190 190
 			$error = true;
@@ -192,9 +192,9 @@  discard block
 block discarded – undo
192 192
 		}
193 193
 	}
194 194
 
195
-	if (isset($_GET['do']) && $_GET['do'] == 'delete_article')	{
195
+	if (isset($_GET['do']) && $_GET['do'] == 'delete_article') {
196 196
 		if (api_is_allowed('BLOG_'.$blog_id, 'article_delete', $task_id)) {
197
-			Blog :: delete_post($blog_id, (int)$_GET['article_id']);
197
+			Blog :: delete_post($blog_id, (int) $_GET['article_id']);
198 198
 			$action = ''; // Article is gone, go to blog home
199 199
 			$return_message = array('type' => 'confirmation', 'message' => get_lang('BlogDeleted'));
200 200
 		} else {
@@ -205,13 +205,13 @@  discard block
 block discarded – undo
205 205
 	if (isset($_GET['do']) && $_GET['do'] == 'rate') {
206 206
 		if (isset($_GET['type']) && $_GET['type'] == 'post') {
207 207
 			if (api_is_allowed('BLOG_'.$blog_id, 'article_rate')) {
208
-				Blog :: add_rating('post', $blog_id, (int)$_GET['post_id'], (int)$_GET['rating']);
208
+				Blog :: add_rating('post', $blog_id, (int) $_GET['post_id'], (int) $_GET['rating']);
209 209
 				$return_message = array('type' => 'confirmation', 'message' => get_lang('RatingAdded'));
210 210
 			}
211 211
 		}
212 212
 		if (isset($_GET['type']) && $_GET['type'] == 'comment') {
213 213
 			if (api_is_allowed('BLOG_'.$blog_id, 'article_comments_add')) {
214
-				Blog :: add_rating('comment', $blog_id, (int)$_GET['comment_id'], (int)$_GET['rating']);
214
+				Blog :: add_rating('comment', $blog_id, (int) $_GET['comment_id'], (int) $_GET['rating']);
215 215
 				$return_message = array('type' => 'confirmation', 'message' => get_lang('RatingAdded'));
216 216
 			}
217 217
 		}
@@ -290,16 +290,16 @@  discard block
 block discarded – undo
290 290
 echo '<div class=actions>';
291 291
 ?>
292 292
 	<a href="<?php echo api_get_self(); ?>?blog_id=<?php echo $blog_id ?>&<?php echo api_get_cidreq(); ?>" title="<?php echo get_lang('Home') ?>">
293
-    <?php echo Display::return_icon('blog.png', get_lang('Home'),'',ICON_SIZE_MEDIUM); ?></a>
294
-	<?php if(api_is_allowed('BLOG_'.$blog_id, 'article_add')) { ?>
293
+    <?php echo Display::return_icon('blog.png', get_lang('Home'), '', ICON_SIZE_MEDIUM); ?></a>
294
+	<?php if (api_is_allowed('BLOG_'.$blog_id, 'article_add')) { ?>
295 295
     <a href="<?php echo api_get_self(); ?>?action=new_post&amp;blog_id=<?php echo $blog_id ?>" title="<?php echo get_lang('NewPost') ?>">
296
-    <?php echo Display::return_icon('new_article.png', get_lang('NewPost'),'',ICON_SIZE_MEDIUM); ?></a><?php } ?>
297
-	<?php if(api_is_allowed('BLOG_'.$blog_id, 'task_management')) { ?>
296
+    <?php echo Display::return_icon('new_article.png', get_lang('NewPost'), '', ICON_SIZE_MEDIUM); ?></a><?php } ?>
297
+	<?php if (api_is_allowed('BLOG_'.$blog_id, 'task_management')) { ?>
298 298
     <a href="<?php echo api_get_self(); ?>?action=manage_tasks&amp;blog_id=<?php echo $blog_id ?>" title="<?php echo get_lang('ManageTasks') ?>">
299
-    <?php echo Display::return_icon('blog_tasks.png', get_lang('TaskManager'),'',ICON_SIZE_MEDIUM); ?></a><?php } ?>
300
-	<?php if(api_is_allowed('BLOG_'.$blog_id, 'member_management')) { ?>
299
+    <?php echo Display::return_icon('blog_tasks.png', get_lang('TaskManager'), '', ICON_SIZE_MEDIUM); ?></a><?php } ?>
300
+	<?php if (api_is_allowed('BLOG_'.$blog_id, 'member_management')) { ?>
301 301
     <a href="<?php echo api_get_self(); ?>?action=manage_members&amp;blog_id=<?php echo $blog_id ?>" title="<?php echo get_lang('ManageMembers') ?>">
302
-    <?php echo Display::return_icon('blog_admin_users.png', get_lang('MemberManager'),'',ICON_SIZE_MEDIUM); ?></a><?php } ?>
302
+    <?php echo Display::return_icon('blog_admin_users.png', get_lang('MemberManager'), '', ICON_SIZE_MEDIUM); ?></a><?php } ?>
303 303
 <?php
304 304
 echo '</div>';
305 305
 
@@ -317,8 +317,8 @@  discard block
 block discarded – undo
317 317
                 <div class="panel-heading"><?php echo get_lang('Calendar') ?></div>
318 318
                 <div class="panel-body">
319 319
                     <?php
320
-                        $month = isset($_GET['month']) ? (int)$_GET['month'] : (int) date('m');
321
-                        $year = isset($_GET['year']) ? (int)$_GET['year'] : date('Y');
320
+                        $month = isset($_GET['month']) ? (int) $_GET['month'] : (int) date('m');
321
+                        $year = isset($_GET['year']) ? (int) $_GET['year'] : date('Y');
322 322
                         Blog::display_minimonthcalendar($month, $year, $blog_id);
323 323
                     ?>
324 324
                 </div>
@@ -363,7 +363,7 @@  discard block
 block discarded – undo
363 363
 $course_id = api_get_course_int_id();
364 364
 
365 365
 if (isset ($_GET['task_id']) && is_numeric($_GET['task_id'])) {
366
-	$task_id = (int)$_GET['task_id'];
366
+	$task_id = (int) $_GET['task_id'];
367 367
 } else {
368 368
 	$task_id = 0;
369 369
 	$tbl_blogs_tasks_rel_user = Database :: get_course_table(TABLE_BLOGS_TASKS_REL_USER);
Please login to merge, or discard this patch.