Completed
Pull Request — 1.11.x (#1599)
by José
28:19
created
main/inc/ajax/forum.ajax.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
  */
9 9
 
10 10
 require_once '../global.inc.php';
11
-require_once api_get_path(SYS_CODE_PATH) . 'forum/forumfunction.inc.php';
11
+require_once api_get_path(SYS_CODE_PATH).'forum/forumfunction.inc.php';
12 12
 
13 13
 // First, protect this script
14 14
 api_protect_course_script(false);
@@ -63,13 +63,13 @@  discard block
 block discarded – undo
63 63
                     break;
64 64
                 }
65 65
                 // If pass all previous control, user can edit post
66
-                $courseId = isset($_REQUEST['c_id'])? intval($_REQUEST['c_id']) : api_get_course_int_id();
66
+                $courseId = isset($_REQUEST['c_id']) ? intval($_REQUEST['c_id']) : api_get_course_int_id();
67 67
                 $json['courseId'] = $courseId;
68
-                $forumId = isset($_REQUEST['forum'])? intval($_REQUEST['forum']) : null;
68
+                $forumId = isset($_REQUEST['forum']) ? intval($_REQUEST['forum']) : null;
69 69
                 $json['forum'] = $forumId;
70
-                $threadId = isset($_REQUEST['thread'])? intval($_REQUEST['thread']) : null;
70
+                $threadId = isset($_REQUEST['thread']) ? intval($_REQUEST['thread']) : null;
71 71
                 $json['thread'] = $threadId;
72
-                $postId = isset($_REQUEST['postId'])? intval($_REQUEST['postId']) : null;
72
+                $postId = isset($_REQUEST['postId']) ? intval($_REQUEST['postId']) : null;
73 73
                 $json['postId'] = $postId;
74 74
 
75 75
                 if (!empty($courseId) &&
Please login to merge, or discard this patch.
main/inc/ajax/link.ajax.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
             // set URL and other appropriate options
24 24
             $defaults = array(
25 25
                 CURLOPT_URL => $url,
26
-                CURLOPT_FOLLOWLOCATION => true,         // follow redirects accept youtube.com
26
+                CURLOPT_FOLLOWLOCATION => true, // follow redirects accept youtube.com
27 27
                 CURLOPT_HEADER => 0,
28 28
                 CURLOPT_RETURNTRANSFER => true,
29 29
                 CURLOPT_TIMEOUT => 4
Please login to merge, or discard this patch.
main/inc/ajax/session.ajax.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
             $list_sessions = SessionManager::get_sessions_by_user($user_id, true);
16 16
             if (!empty($list_sessions)) {
17 17
                 foreach ($list_sessions as $session_item) {
18
-                    echo $session_item['session_name'] . '<br />';
18
+                    echo $session_item['session_name'].'<br />';
19 19
                 }
20 20
             } else {
21 21
                 echo get_lang('NoSessionsForThisUser');
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
                 [
30 30
                     's.name' => [
31 31
                         'operator' => 'LIKE',
32
-                        'value' => "%" . $_REQUEST['q'] . "%"
32
+                        'value' => "%".$_REQUEST['q']."%"
33 33
                     ]
34 34
                 ]
35 35
             );
Please login to merge, or discard this patch.
main/inc/ajax/chat.ajax.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@  discard block
 block discarded – undo
5 5
  * Responses to AJAX calls
6 6
  */
7 7
 
8
-$_dont_save_user_course_access  = true;
8
+$_dont_save_user_course_access = true;
9 9
 
10 10
 require_once '../global.inc.php';
11 11
 
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 }
35 35
 
36 36
 $to_user_id = isset($_REQUEST['to']) ? $_REQUEST['to'] : null;
37
-$message	= isset($_REQUEST['message']) ? $_REQUEST['message'] : null;
37
+$message = isset($_REQUEST['message']) ? $_REQUEST['message'] : null;
38 38
 
39 39
 if (!isset($_SESSION['chatHistory'])) {
40 40
     $_SESSION['chatHistory'] = array();
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 }
46 46
 
47 47
 $chat = new Chat();
48
-if (chat::disableChat()){
48
+if (chat::disableChat()) {
49 49
     exit;
50 50
 }
51 51
 if ($chat->is_chat_blocked_by_exercises()) {
@@ -85,9 +85,9 @@  discard block
 block discarded – undo
85 85
             $room = VideoChat::getChatRoomByUsers(api_get_user_id(), $to_user_id);
86 86
         }
87 87
 
88
-        $videoChatUrl = api_get_path(WEB_LIBRARY_JS_PATH) . "chat/video.php?room={$room['id']}";
88
+        $videoChatUrl = api_get_path(WEB_LIBRARY_JS_PATH)."chat/video.php?room={$room['id']}";
89 89
         $videoChatLink = Display::url(
90
-            Display::returnFontAwesomeIcon('video-camera') . get_lang('StartVideoChat'),
90
+            Display::returnFontAwesomeIcon('video-camera').get_lang('StartVideoChat'),
91 91
             $videoChatUrl
92 92
         );
93 93
 
Please login to merge, or discard this patch.
main/inc/ajax/myspace.ajax.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -58,9 +58,9 @@
 block discarded – undo
58 58
             $db['is_empty'] = false;
59 59
             $db['result'] = convert_to_string($sql_result);
60 60
             $rst = get_stats($user_id, $course_code, $start_date, $end_date);
61
-            $foo_stats = '<strong>' . get_lang('Total') . ': </strong>' . $rst['total'] . '<br />';
62
-            $foo_stats .= '<strong>' . get_lang('Average') . ': </strong>' . $rst['avg'] . '<br />';
63
-            $foo_stats .= '<strong>' . get_lang('Quantity') . ' : </strong>' . $rst['times'] . '<br />';
61
+            $foo_stats = '<strong>'.get_lang('Total').': </strong>'.$rst['total'].'<br />';
62
+            $foo_stats .= '<strong>'.get_lang('Average').': </strong>'.$rst['avg'].'<br />';
63
+            $foo_stats .= '<strong>'.get_lang('Quantity').' : </strong>'.$rst['times'].'<br />';
64 64
             $db['stats'] = $foo_stats;
65 65
             $db['graph_result'] = grapher($sql_result, $start_date, $end_date, $type);
66 66
         } else {
Please login to merge, or discard this patch.
main/inc/ajax/user_manager.ajax.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
                 <div class="row">
59 59
                     <div class="col-sm-10 col-sm-offset-2">
60 60
                         <a class="btn btn-primary" id="send_message_link">
61
-                            <em class="fa fa-envelope"></em> ' . get_lang('Send') . '
61
+                            <em class="fa fa-envelope"></em> ' . get_lang('Send').'
62 62
                         </a>
63 63
                     </div>
64 64
                 </div>
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 
113 113
             if (!empty($user_id)) {
114 114
                 $user_table = Database :: get_main_table(TABLE_MAIN_USER);
115
-                $sql="UPDATE $user_table SET active='".$status."' WHERE user_id='".$user_id."'";
115
+                $sql = "UPDATE $user_table SET active='".$status."' WHERE user_id='".$user_id."'";
116 116
                 $result = Database::query($sql);
117 117
 
118 118
                 //Send and email if account is active
@@ -122,13 +122,13 @@  discard block
 block discarded – undo
122 122
                     $emailsubject = '['.api_get_setting('siteName').'] '.get_lang('YourReg').' '.api_get_setting('siteName');
123 123
                     $email_admin = api_get_setting('emailAdministrator');
124 124
                     $sender_name = api_get_person_name(api_get_setting('administratorName'), api_get_setting('administratorSurname'), null, PERSON_NAME_EMAIL_ADDRESS);
125
-                    $emailbody=get_lang('Dear')." ".stripslashes($recipient_name).",\n\n";
125
+                    $emailbody = get_lang('Dear')." ".stripslashes($recipient_name).",\n\n";
126 126
 
127
-                    $emailbody.=sprintf(get_lang('YourAccountOnXHasJustBeenApprovedByOneOfOurAdministrators'), api_get_setting('siteName'))."\n";
128
-                    $emailbody.=sprintf(get_lang('YouCanNowLoginAtXUsingTheLoginAndThePasswordYouHaveProvided'), api_get_path(WEB_PATH)).",\n\n";
129
-                    $emailbody.=get_lang('HaveFun')."\n\n";
127
+                    $emailbody .= sprintf(get_lang('YourAccountOnXHasJustBeenApprovedByOneOfOurAdministrators'), api_get_setting('siteName'))."\n";
128
+                    $emailbody .= sprintf(get_lang('YouCanNowLoginAtXUsingTheLoginAndThePasswordYouHaveProvided'), api_get_path(WEB_PATH)).",\n\n";
129
+                    $emailbody .= get_lang('HaveFun')."\n\n";
130 130
                     //$emailbody.=get_lang('Problem'). "\n\n". get_lang('SignatureFormula');
131
-                    $emailbody.=api_get_person_name(api_get_setting('administratorName'), api_get_setting('administratorSurname'))."\n". get_lang('Manager'). " ".api_get_setting('siteName')."\nT. ".api_get_setting('administratorTelephone')."\n" .get_lang('Email') ." : ".api_get_setting('emailAdministrator');
131
+                    $emailbody .= api_get_person_name(api_get_setting('administratorName'), api_get_setting('administratorSurname'))."\n".get_lang('Manager')." ".api_get_setting('siteName')."\nT. ".api_get_setting('administratorTelephone')."\n".get_lang('Email')." : ".api_get_setting('emailAdministrator');
132 132
 
133 133
                     $additionalParameters = array(
134 134
                         'smsType' => SmsPlugin::ACCOUNT_APPROVED_CONNECT,
Please login to merge, or discard this patch.
main/inc/lib/AnnouncementEmail.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -196,7 +196,7 @@
 block discarded – undo
196 196
      *
197 197
      * @return array
198 198
      */
199
-    public function sender($key = '',  $userId = '')
199
+    public function sender($key = '', $userId = '')
200 200
     {
201 201
         $_user = api_get_user_info($userId);
202 202
 
Please login to merge, or discard this patch.
main/inc/lib/custom_pages.class.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
      */
36 36
     public static function path($name = '')
37 37
     {
38
-        return api_get_path(SYS_PATH) . 'custompages/' . $name;
38
+        return api_get_path(SYS_PATH).'custompages/'.$name;
39 39
     }
40 40
 
41 41
     /**
@@ -50,12 +50,12 @@  discard block
 block discarded – undo
50 50
             return false;
51 51
         }
52 52
 
53
-        $file = self::path($page_name . '.php');
53
+        $file = self::path($page_name.'.php');
54 54
         if (file_exists($file)) {
55 55
             include($file);
56 56
             exit;
57 57
         } else {
58
-            error_log('CustomPages::displayPage : could not read file ' . $file);
58
+            error_log('CustomPages::displayPage : could not read file '.$file);
59 59
         }
60 60
     }
61 61
 
@@ -69,14 +69,14 @@  discard block
 block discarded – undo
69 69
     public static function getURLImages($url_id = null)
70 70
     {
71 71
         if (is_null($url_id)) {
72
-            $url = 'http://' . $_SERVER['HTTP_HOST'] . '/';
72
+            $url = 'http://'.$_SERVER['HTTP_HOST'].'/';
73 73
             $url_id = UrlManager::get_url_id($url);
74 74
         }
75
-        $url_images_dir = api_get_path(SYS_PATH) . 'custompages/url-images/';
75
+        $url_images_dir = api_get_path(SYS_PATH).'custompages/url-images/';
76 76
         $images = array();
77 77
         for ($img_id = 1; $img_id <= 3; $img_id++) {
78
-            if (file_exists($url_images_dir . $url_id . '_url_image_' . $img_id . '.png')) {
79
-                $images[] = api_get_path(WEB_PATH) . 'custompages/url-images/' . $url_id . '_url_image_' . $img_id . '.png';
78
+            if (file_exists($url_images_dir.$url_id.'_url_image_'.$img_id.'.png')) {
79
+                $images[] = api_get_path(WEB_PATH).'custompages/url-images/'.$url_id.'_url_image_'.$img_id.'.png';
80 80
             }
81 81
         }
82 82
 
Please login to merge, or discard this patch.
main/inc/lib/redirect.class.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
             self::navigate($url);
35 35
         }
36 36
 
37
-        $url = self::www() . $url;
37
+        $url = self::www().$url;
38 38
         self::navigate($url);
39 39
     }
40 40
 
@@ -67,25 +67,25 @@  discard block
 block discarded – undo
67 67
                     case COURSEMANAGER:
68 68
                         $redir = api_get_setting('teacher_page_after_login');
69 69
                         if (!empty($redir)) {
70
-                            self::navigate(api_get_path(WEB_PATH) . $redir);
70
+                            self::navigate(api_get_path(WEB_PATH).$redir);
71 71
                         }
72 72
                         break;
73 73
                     case STUDENT:
74 74
                         $redir = api_get_setting('student_page_after_login');
75 75
                         if (!empty($redir)) {
76
-                            self::navigate(api_get_path(WEB_PATH) . $redir);
76
+                            self::navigate(api_get_path(WEB_PATH).$redir);
77 77
                         }
78 78
                         break;
79 79
                     case DRH:
80 80
                         $redir = api_get_setting('drh_page_after_login');
81 81
                         if (!empty($redir)) {
82
-                            self::navigate(api_get_path(WEB_PATH) . $redir);
82
+                            self::navigate(api_get_path(WEB_PATH).$redir);
83 83
                         }
84 84
                         break;
85 85
                     case SESSIONADMIN:
86 86
                         $redir = api_get_setting('sessionadmin_page_after_login');
87 87
                         if (!empty($redir)) {
88
-                            self::navigate(api_get_path(WEB_PATH) . $redir);
88
+                            self::navigate(api_get_path(WEB_PATH).$redir);
89 89
                         }
90 90
                         break;
91 91
                     default:
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
             }
112 112
             $page_after_login = api_get_setting('page_after_login');
113 113
             if (!empty($page_after_login)) {
114
-                self::navigate(api_get_path(WEB_PATH) . $page_after_login);
114
+                self::navigate(api_get_path(WEB_PATH).$page_after_login);
115 115
             }
116 116
         }
117 117
     }
Please login to merge, or discard this patch.