Passed
Pull Request — 1.10.x (#986)
by
unknown
65:04
created
plugin/buycourses/src/service_success.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 
47 47
         unset($_SESSION['bc_service_sale_id']);
48 48
 
49
-        header('Location: ' . api_get_path(WEB_PLUGIN_PATH) . 'buycourses/index.php');
49
+        header('Location: '.api_get_path(WEB_PLUGIN_PATH).'buycourses/index.php');
50 50
         exit;
51 51
     }
52 52
 
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
     }
180 180
 
181 181
     unset($_SESSION['bc_service_sale_id']);
182
-    header('Location: ' . api_get_path(WEB_PLUGIN_PATH) . 'buycourses/src/service_catalog.php');
182
+    header('Location: '.api_get_path(WEB_PLUGIN_PATH).'buycourses/src/service_catalog.php');
183 183
     exit;
184 184
 }
185 185
 
Please login to merge, or discard this patch.
plugin/buycourses/src/service_process_confirm.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -47,8 +47,8 @@  discard block
 block discarded – undo
47 47
             $serviceSale['price'],
48 48
             $currency['iso_code'],
49 49
             'paypal',
50
-            api_get_path(WEB_PLUGIN_PATH) . 'buycourses/src/service_success.php',
51
-            api_get_path(WEB_PLUGIN_PATH) . 'buycourses/src/error.php',
50
+            api_get_path(WEB_PLUGIN_PATH).'buycourses/src/service_success.php',
51
+            api_get_path(WEB_PLUGIN_PATH).'buycourses/src/error.php',
52 52
             $extra,
53 53
             true
54 54
         );
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 
98 98
                 unset($_SESSION['bc_service_sale_id']);
99 99
 
100
-                header('Location: ' . api_get_path(WEB_PLUGIN_PATH) . 'buycourses/index.php');
100
+                header('Location: '.api_get_path(WEB_PLUGIN_PATH).'buycourses/index.php');
101 101
                 exit;
102 102
             }
103 103
 
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
             );
137 137
 
138 138
             unset($_SESSION['bc_service_sale_id']);
139
-            header('Location: ' . api_get_path(WEB_PLUGIN_PATH) . 'buycourses/src/service_catalog.php');
139
+            header('Location: '.api_get_path(WEB_PLUGIN_PATH).'buycourses/src/service_catalog.php');
140 140
             exit;
141 141
         }
142 142
 
Please login to merge, or discard this patch.
plugin/buycourses/src/service_process.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 $currentUserId = api_get_user_id();
13 13
 
14 14
 if (empty($currentUserId)) {
15
-    header('Location: ' . api_get_path(WEB_CODE_PATH) . 'auth/inscription.php');
15
+    header('Location: '.api_get_path(WEB_CODE_PATH).'auth/inscription.php');
16 16
     exit;
17 17
 }
18 18
 
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 $typeUser = intval($_REQUEST['t']) === BuyCoursesPlugin::SERVICE_TYPE_USER;
36 36
 $typeCourse = intval($_REQUEST['t']) === BuyCoursesPlugin::SERVICE_TYPE_COURSE;
37 37
 $typeSession = intval($_REQUEST['t']) === BuyCoursesPlugin::SERVICE_TYPE_SESSION;
38
-$queryString = 'i=' . intval($_REQUEST['i']) . '&t=' . intval($_REQUEST['t']);
38
+$queryString = 'i='.intval($_REQUEST['i']).'&t='.intval($_REQUEST['t']);
39 39
 
40 40
 $serviceInfo = $plugin->getServices(intval($_REQUEST['i']));
41 41
 $userInfo = api_get_user_info();
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
         Display::addFlash(
50 50
             Display::return_message($plugin->get_lang('AdditionalInfoRequired'), 'error', false)
51 51
         );
52
-        header('Location:' . api_get_self() . '?' . $queryString);
52
+        header('Location:'.api_get_self().'?'.$queryString);
53 53
         exit;
54 54
     }
55 55
     
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
         Display::addFlash(
58 58
             Display::return_message($plugin->get_lang('NeedToSelectPaymentType'), 'error', false)
59 59
         );
60
-        header('Location:' . api_get_self() . '?' . $queryString);
60
+        header('Location:'.api_get_self().'?'.$queryString);
61 61
         exit;
62 62
     }
63 63
     
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 
66 66
     if ($serviceSaleId !== false) {
67 67
         $_SESSION['bc_service_sale_id'] = $serviceSaleId;
68
-        header('Location: ' . api_get_path(WEB_PLUGIN_PATH) . 'buycourses/src/service_process_confirm.php');  
68
+        header('Location: '.api_get_path(WEB_PLUGIN_PATH).'buycourses/src/service_process_confirm.php');  
69 69
     }
70 70
 
71 71
     exit;
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 
83 83
 if ($typeUser) {
84 84
     $users = $em->getRepository('ChamiloUserBundle:User')->findAll();
85
-    $selectOptions[$userInfo['user_id']] = api_get_person_name($userInfo['firstname'], $userInfo['lastname']) . ' (' . get_lang('Myself') . ')';
85
+    $selectOptions[$userInfo['user_id']] = api_get_person_name($userInfo['firstname'], $userInfo['lastname']).' ('.get_lang('Myself').')';
86 86
     if (!empty($users)) {
87 87
         foreach ($users as $user) {
88 88
             if (intval($userInfo['user_id']) !== intval($user->getId())) {
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
             }
91 91
         }
92 92
     }
93
-    $form->addSelect('info_select',get_lang('User'), $selectOptions);
93
+    $form->addSelect('info_select', get_lang('User'), $selectOptions);
94 94
 } elseif ($typeCourse) {
95 95
     $user = $em->getRepository('ChamiloUserBundle:User')->find($currentUserId);
96 96
     $courses = $user->getCourses();
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
             $selectOptions[$course->getCourse()->getId()] = $course->getCourse()->getTitle();
100 100
         }
101 101
     }
102
-    $form->addSelect('info_select',get_lang('Course'), $selectOptions);
102
+    $form->addSelect('info_select', get_lang('Course'), $selectOptions);
103 103
 } elseif ($typeSession) {
104 104
     $user = $em->getRepository('ChamiloUserBundle:User')->find($currentUserId);
105 105
     $sessions = $user->getSessionCourseSubscriptions();
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
             $selectOptions[$session->getSession()->getId()] = $session->getSession()->getName();
109 109
         }
110 110
     }
111
-    $form->addSelect('info_select',get_lang('Session'), $selectOptions);
111
+    $form->addSelect('info_select', get_lang('Session'), $selectOptions);
112 112
 }
113 113
 
114 114
 $form->addHeader($plugin->get_lang('PaymentMethods'));
Please login to merge, or discard this patch.
plugin/buycourses/src/buycourses.ajax.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -55,20 +55,20 @@  discard block
 block discarded – undo
55 55
         
56 56
         $userInfo = api_get_user_info($sale['user_id']);
57 57
         
58
-        $html = '<h2>' . $sale['product_name'] .'</h2>';
58
+        $html = '<h2>'.$sale['product_name'].'</h2>';
59 59
         $html .= '<div class="row">';
60 60
         $html .= '<div class="col-sm-6 col-md-6">';
61 61
         $html .= '<ul>';
62
-        $html .= '<li><b>'. $plugin->get_lang('OrderPrice') . ':</b> '. $sale['price'] . '</li>';
63
-        $html .= '<li><b>'. $plugin->get_lang('CurrencyType') . ':</b> '. $currency['iso_code'] . '</li>';
64
-        $html .= '<li><b>'. $plugin->get_lang('ProductType') . ':</b> '. $productType . '</li>';
65
-        $html .= '<li><b>'. $plugin->get_lang('OrderDate') . ':</b> '. api_format_date($sale['date'], DATE_TIME_FORMAT_LONG_24H) . '</li>';
66
-        $html .= '<li><b>'. $plugin->get_lang('Buyer') . ':</b> '. $userInfo['complete_name'] . '</li>';
67
-        $html .= '<li><b>'. $plugin->get_lang('PaymentMethods') . ':</b> '. $paymentType . '</li>';
62
+        $html .= '<li><b>'.$plugin->get_lang('OrderPrice').':</b> '.$sale['price'].'</li>';
63
+        $html .= '<li><b>'.$plugin->get_lang('CurrencyType').':</b> '.$currency['iso_code'].'</li>';
64
+        $html .= '<li><b>'.$plugin->get_lang('ProductType').':</b> '.$productType.'</li>';
65
+        $html .= '<li><b>'.$plugin->get_lang('OrderDate').':</b> '.api_format_date($sale['date'], DATE_TIME_FORMAT_LONG_24H).'</li>';
66
+        $html .= '<li><b>'.$plugin->get_lang('Buyer').':</b> '.$userInfo['complete_name'].'</li>';
67
+        $html .= '<li><b>'.$plugin->get_lang('PaymentMethods').':</b> '.$paymentType.'</li>';
68 68
         $html .= '</ul>';
69 69
         $html .= '</div>';
70 70
         $html .= '<div class="col-sm-6 col-md-6">';
71
-        $html .= '<img class="thumbnail" src="'. $productImage .'" >';
71
+        $html .= '<img class="thumbnail" src="'.$productImage.'" >';
72 72
         $html .= '</div>';
73 73
         $html .= '</div>';
74 74
 
@@ -116,9 +116,9 @@  discard block
 block discarded – undo
116 116
         $html = '<div class="row">'
117 117
         . '<p>'
118 118
             . '<ul>'
119
-                . '<li>'. get_plugin_lang("PayoutsTotalCompleted", "BuyCoursesPlugin") .' <b>'. $stats['completed_count'] .'</b> - '. get_plugin_lang("TotalAmount", "BuyCoursesPlugin") .' <b>'. $stats['completed_total_amount'] .' '. $currency['iso_code'] . '</b></li>'
120
-                . '<li>'. get_plugin_lang("PayoutsTotalPending", "BuyCoursesPlugin") .' <b>'. $stats['pending_count'] .'</b> - '. get_plugin_lang("TotalAmount", "BuyCoursesPlugin") .' <b>'. $stats['pending_total_amount'] .' '. $currency['iso_code'] . '</b></li>'
121
-                . '<li>'. get_plugin_lang("PayoutsTotalCancelled", "BuyCoursesPlugin") .' <b>'. $stats['canceled_count'] .'</b> - '. get_plugin_lang("TotalAmount", "BuyCoursesPlugin") .' <b>'. $stats['canceled_total_amount'] .' '. $currency['iso_code'] . '</b></li>'
119
+                . '<li>'.get_plugin_lang("PayoutsTotalCompleted", "BuyCoursesPlugin").' <b>'.$stats['completed_count'].'</b> - '.get_plugin_lang("TotalAmount", "BuyCoursesPlugin").' <b>'.$stats['completed_total_amount'].' '.$currency['iso_code'].'</b></li>'
120
+                . '<li>'.get_plugin_lang("PayoutsTotalPending", "BuyCoursesPlugin").' <b>'.$stats['pending_count'].'</b> - '.get_plugin_lang("TotalAmount", "BuyCoursesPlugin").' <b>'.$stats['pending_total_amount'].' '.$currency['iso_code'].'</b></li>'
121
+                . '<li>'.get_plugin_lang("PayoutsTotalCancelled", "BuyCoursesPlugin").' <b>'.$stats['canceled_count'].'</b> - '.get_plugin_lang("TotalAmount", "BuyCoursesPlugin").' <b>'.$stats['canceled_total_amount'].' '.$currency['iso_code'].'</b></li>'
122 122
             . '</ul>'
123 123
         . '</p>';
124 124
         $html .= '</div>';
@@ -158,15 +158,15 @@  discard block
 block discarded – undo
158 158
         
159 159
         $isoCode = $currentCurrency['iso_code'];
160 160
         
161
-        $html .= '<p>'. get_plugin_lang("VerifyTotalAmountToProceedPayout", "BuyCoursesPlugin") .'</p>';
161
+        $html .= '<p>'.get_plugin_lang("VerifyTotalAmountToProceedPayout", "BuyCoursesPlugin").'</p>';
162 162
         $html .= ''
163 163
         . '<p>'
164 164
             . '<ul>'
165
-                . '<li>'. get_plugin_lang("TotalAcounts", "BuyCoursesPlugin") .' <b>'. $totalAccounts .'</b></li>'
166
-                . '<li>'. get_plugin_lang("TotalPayout", "BuyCoursesPlugin") .' <b>'. $isoCode .' '. $totalPayout .'</b></li>'
165
+                . '<li>'.get_plugin_lang("TotalAcounts", "BuyCoursesPlugin").' <b>'.$totalAccounts.'</b></li>'
166
+                . '<li>'.get_plugin_lang("TotalPayout", "BuyCoursesPlugin").' <b>'.$isoCode.' '.$totalPayout.'</b></li>'
167 167
             . '</ul>'
168 168
         . '</p>';
169
-        $html .= '<p>'. get_plugin_lang("CautionThisProcessCantBeCancelled", "BuyCoursesPlugin") .'</p>';
169
+        $html .= '<p>'.get_plugin_lang("CautionThisProcessCantBeCancelled", "BuyCoursesPlugin").'</p>';
170 170
         $html .= '</br></br>';
171 171
         $html .= '<div id="spinner" class="text-center"></div>';
172 172
                 
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
             
221 221
         } else {
222 222
 
223
-            echo Display::return_message('<b>'.$result['L_SEVERITYCODE0'].' '.$result['L_ERRORCODE0'].'</b> - '.$result['L_SHORTMESSAGE0'].'</br><ul><li>'. $result['L_LONGMESSAGE0'].'</li></ul>', 'error', false);
223
+            echo Display::return_message('<b>'.$result['L_SEVERITYCODE0'].' '.$result['L_ERRORCODE0'].'</b> - '.$result['L_SHORTMESSAGE0'].'</br><ul><li>'.$result['L_LONGMESSAGE0'].'</li></ul>', 'error', false);
224 224
             
225 225
         }
226 226
         
Please login to merge, or discard this patch.
plugin/buycourses/src/panel.ajax.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -37,20 +37,20 @@  discard block
 block discarded – undo
37 37
         
38 38
         $userInfo = api_get_user_info($sale['user_id']);
39 39
         
40
-        $html = '<h2>' . $sale['product_name'] .'</h2>';
40
+        $html = '<h2>'.$sale['product_name'].'</h2>';
41 41
         $html .= '<div class="row">';
42 42
         $html .= '<div class="col-sm-6 col-md-6">';
43 43
         $html .= '<ul>';
44
-        $html .= '<li><b>'. $plugin->get_lang('OrderPrice') . ':</b> '. $sale['price'] . '</li>';
45
-        $html .= '<li><b>'. $plugin->get_lang('CurrencyType') . ':</b> '. $currency['iso_code'] . '</li>';
46
-        $html .= '<li><b>'. $plugin->get_lang('ProductType') . ':</b> '. $productType . '</li>';
47
-        $html .= '<li><b>'. $plugin->get_lang('OrderDate') . ':</b> '. api_format_date($sale['date'], DATE_TIME_FORMAT_LONG_24H) . '</li>';
48
-        $html .= '<li><b>'. $plugin->get_lang('Buyer') . ':</b> '. $userInfo['complete_name'] . '</li>';
49
-        $html .= '<li><b>'. $plugin->get_lang('PaymentMethods') . ':</b> '. $paymentType . '</li>';
44
+        $html .= '<li><b>'.$plugin->get_lang('OrderPrice').':</b> '.$sale['price'].'</li>';
45
+        $html .= '<li><b>'.$plugin->get_lang('CurrencyType').':</b> '.$currency['iso_code'].'</li>';
46
+        $html .= '<li><b>'.$plugin->get_lang('ProductType').':</b> '.$productType.'</li>';
47
+        $html .= '<li><b>'.$plugin->get_lang('OrderDate').':</b> '.api_format_date($sale['date'], DATE_TIME_FORMAT_LONG_24H).'</li>';
48
+        $html .= '<li><b>'.$plugin->get_lang('Buyer').':</b> '.$userInfo['complete_name'].'</li>';
49
+        $html .= '<li><b>'.$plugin->get_lang('PaymentMethods').':</b> '.$paymentType.'</li>';
50 50
         $html .= '</ul>';
51 51
         $html .= '</div>';
52 52
         $html .= '<div class="col-sm-6 col-md-6">';
53
-        $html .= '<img class="thumbnail" src="'. $productImage .'" >';
53
+        $html .= '<img class="thumbnail" src="'.$productImage.'" >';
54 54
         $html .= '</div>';
55 55
         $html .= '</div>';
56 56
 
@@ -95,9 +95,9 @@  discard block
 block discarded – undo
95 95
         $html = '<div class="row">'
96 96
         . '<p>'
97 97
             . '<ul>'
98
-                . '<li>'. get_plugin_lang("PayoutsTotalCompleted", "BuyCoursesPlugin") .' <b>'. $stats['completed_count'] .'</b> - '. get_plugin_lang("TotalAmount", "BuyCoursesPlugin") .' <b>'. $stats['completed_total_amount'] .' '. $currency['iso_code'] . '</b></li>'
99
-                . '<li>'. get_plugin_lang("PayoutsTotalPending", "BuyCoursesPlugin") .' <b>'. $stats['pending_count'] .'</b> - '. get_plugin_lang("TotalAmount", "BuyCoursesPlugin") .' <b>'. $stats['pending_total_amount'] .' '. $currency['iso_code'] . '</b></li>'
100
-                . '<li>'. get_plugin_lang("PayoutsTotalCancelled", "BuyCoursesPlugin") .' <b>'. $stats['canceled_count'] .'</b> - '. get_plugin_lang("TotalAmount", "BuyCoursesPlugin") .' <b>'. $stats['canceled_total_amount'] .' '. $currency['iso_code'] . '</b></li>'
98
+                . '<li>'.get_plugin_lang("PayoutsTotalCompleted", "BuyCoursesPlugin").' <b>'.$stats['completed_count'].'</b> - '.get_plugin_lang("TotalAmount", "BuyCoursesPlugin").' <b>'.$stats['completed_total_amount'].' '.$currency['iso_code'].'</b></li>'
99
+                . '<li>'.get_plugin_lang("PayoutsTotalPending", "BuyCoursesPlugin").' <b>'.$stats['pending_count'].'</b> - '.get_plugin_lang("TotalAmount", "BuyCoursesPlugin").' <b>'.$stats['pending_total_amount'].' '.$currency['iso_code'].'</b></li>'
100
+                . '<li>'.get_plugin_lang("PayoutsTotalCancelled", "BuyCoursesPlugin").' <b>'.$stats['canceled_count'].'</b> - '.get_plugin_lang("TotalAmount", "BuyCoursesPlugin").' <b>'.$stats['canceled_total_amount'].' '.$currency['iso_code'].'</b></li>'
101 101
             . '</ul>'
102 102
         . '</p>';
103 103
         $html .= '</div>';
@@ -137,15 +137,15 @@  discard block
 block discarded – undo
137 137
         
138 138
         $isoCode = $currentCurrency['iso_code'];
139 139
         
140
-        $html .= '<p>'. get_plugin_lang("VerifyTotalAmountToProceedPayout", "BuyCoursesPlugin") .'</p>';
140
+        $html .= '<p>'.get_plugin_lang("VerifyTotalAmountToProceedPayout", "BuyCoursesPlugin").'</p>';
141 141
         $html .= ''
142 142
         . '<p>'
143 143
             . '<ul>'
144
-                . '<li>'. get_plugin_lang("TotalAcounts", "BuyCoursesPlugin") .' <b>'. $totalAccounts .'</b></li>'
145
-                . '<li>'. get_plugin_lang("TotalPayout", "BuyCoursesPlugin") .' <b>'. $isoCode .' '. $totalPayout .'</b></li>'
144
+                . '<li>'.get_plugin_lang("TotalAcounts", "BuyCoursesPlugin").' <b>'.$totalAccounts.'</b></li>'
145
+                . '<li>'.get_plugin_lang("TotalPayout", "BuyCoursesPlugin").' <b>'.$isoCode.' '.$totalPayout.'</b></li>'
146 146
             . '</ul>'
147 147
         . '</p>';
148
-        $html .= '<p>'. get_plugin_lang("CautionThisProcessCantBeCanceled", "BuyCoursesPlugin") .'</p>';
148
+        $html .= '<p>'.get_plugin_lang("CautionThisProcessCantBeCanceled", "BuyCoursesPlugin").'</p>';
149 149
         $html .= '</br></br>';
150 150
         $html .= '<div id="spinner" class="text-center"></div>';
151 151
                 
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
             
200 200
         } else {
201 201
 
202
-            echo Display::return_message('<b>'.$result['L_SEVERITYCODE0'].' '.$result['L_ERRORCODE0'].'</b> - '.$result['L_SHORTMESSAGE0'].'</br><ul><li>'. $result['L_LONGMESSAGE0'].'</li></ul>', 'error', false);
202
+            echo Display::return_message('<b>'.$result['L_SEVERITYCODE0'].' '.$result['L_ERRORCODE0'].'</b> - '.$result['L_SHORTMESSAGE0'].'</br><ul><li>'.$result['L_LONGMESSAGE0'].'</li></ul>', 'error', false);
203 203
             
204 204
         }
205 205
         
Please login to merge, or discard this patch.
plugin/buycourses/src/recurring_payment_process.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
             header('Location: service_catalog.php');
50 50
             exit;
51 51
         }
52
-        header('Location: ' . api_get_path(WEB_PLUGIN_PATH) . 'buycourses/src/service_panel.php');
52
+        header('Location: '.api_get_path(WEB_PLUGIN_PATH).'buycourses/src/service_panel.php');
53 53
         exit;
54 54
         break;
55 55
     case 'disable_recurring_payment':
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
             header('Location: service_catalog.php');
68 68
             exit;
69 69
         }
70
-        header('Location: ' . api_get_path(WEB_PLUGIN_PATH) . 'buycourses/src/service_panel.php');
70
+        header('Location: '.api_get_path(WEB_PLUGIN_PATH).'buycourses/src/service_panel.php');
71 71
         exit;
72 72
         break;     
73 73
 }
74 74
\ No newline at end of file
Please login to merge, or discard this patch.
main/template/default/auth/courses_categories.php 1 patch
Spacing   +26 added lines, -31 removed lines patch added patch discarded remove patch
@@ -15,17 +15,12 @@  discard block
 block discarded – undo
15 15
 
16 16
 $showCourses = CoursesAndSessionsCatalog::showCourses();
17 17
 $showSessions = CoursesAndSessionsCatalog::showSessions();
18
-$pageCurrent = isset($pageCurrent) ? $pageCurrent :
19
-    isset($_GET['pageCurrent']) ? intval($_GET['pageCurrent']) :
20
-        1;
21
-$pageLength = isset($pageLength) ? $pageLength :
22
-    isset($_GET['pageLength']) ? intval($_GET['pageLength']) :
23
-        10;
18
+$pageCurrent = isset($pageCurrent) ? $pageCurrent : isset($_GET['pageCurrent']) ? intval($_GET['pageCurrent']) : 1;
19
+$pageLength = isset($pageLength) ? $pageLength : isset($_GET['pageLength']) ? intval($_GET['pageLength']) : 10;
24 20
 $pageTotal = intval(ceil(intval($countCoursesInCategory) / $pageLength));
25 21
 $cataloguePagination = $pageTotal > 1 ?
26
-    getCataloguePagination($pageCurrent, $pageLength, $pageTotal) :
27
-    '';
28
-$search_term = isset($search_term) ? $search_term :null;
22
+    getCataloguePagination($pageCurrent, $pageLength, $pageTotal) : '';
23
+$search_term = isset($search_term) ? $search_term : null;
29 24
 
30 25
 if ($showSessions && isset($_POST['date'])) {
31 26
     $date = $_POST['date'];
@@ -66,7 +61,7 @@  discard block
 block discarded – undo
66 61
             $el.prepend('<?php echo Display::display_icon('nolines_minus.gif'); ?>');
67 62
 
68 63
             $.ajax({
69
-                url: '<?php echo api_get_path(WEB_AJAX_PATH) . 'course.ajax.php' ?>',
64
+                url: '<?php echo api_get_path(WEB_AJAX_PATH).'course.ajax.php' ?>',
70 65
                 type: 'GET',
71 66
                 dataType: 'json',
72 67
                 data: {
@@ -130,13 +125,13 @@  discard block
 block discarded – undo
130 125
         <?php
131 126
 
132 127
             $webAction = api_get_path(WEB_CODE_PATH).'auth/courses.php';
133
-            $action = (!empty($_REQUEST['action'])?Security::remove_XSS($_REQUEST['action']):'display_courses');
134
-            $pageLength = (!empty($_REQUEST['pageLength'])?intval($_REQUEST['pageLength']):10);
135
-            $pageCurrent = (!empty($_REQUEST['pageCurrent'])?intval($_REQUEST['pageCurrent']):1);
128
+            $action = (!empty($_REQUEST['action']) ? Security::remove_XSS($_REQUEST['action']) : 'display_courses');
129
+            $pageLength = (!empty($_REQUEST['pageLength']) ? intval($_REQUEST['pageLength']) : 10);
130
+            $pageCurrent = (!empty($_REQUEST['pageCurrent']) ? intval($_REQUEST['pageCurrent']) : 1);
136 131
             $form = '<form action="'.$webAction.'" method="GET" class="form-horizontal">';
137
-            $form .= '<input type="hidden" name="action" value="' . $action . '">';
138
-            $form .= '<input type="hidden" name="pageCurrent" value="' . $pageCurrent . '">';
139
-            $form .= '<input type="hidden" name="pageLength" value="' . $pageLength . '">';
132
+            $form .= '<input type="hidden" name="action" value="'.$action.'">';
133
+            $form .= '<input type="hidden" name="pageCurrent" value="'.$pageCurrent.'">';
134
+            $form .= '<input type="hidden" name="pageLength" value="'.$pageLength.'">';
140 135
             $form .= '<div class="form-group">';
141 136
             $form .= '<div class="col-sm-12">';
142 137
             $form .= '<select name="category_code" onchange="submit();" class="selectpicker show-tick form-control">';
@@ -145,11 +140,11 @@  discard block
 block discarded – undo
145 140
                 $categoryCode = $category['code'];
146 141
                 $countCourse = $category['count_courses'];
147 142
 
148
-                $form .= '<option '. ($categoryCode == $codeType? 'selected="selected" ':'') .' value="' . $category['code'] . '">' . $category['name'] . ' ( '. $countCourse .' ) </option>';
143
+                $form .= '<option '.($categoryCode == $codeType ? 'selected="selected" ' : '').' value="'.$category['code'].'">'.$category['name'].' ( '.$countCourse.' ) </option>';
149 144
                 if (!empty($browse_course_categories[$categoryCode])) {
150
-                    foreach ($browse_course_categories[$categoryCode] as $subCategory){
145
+                    foreach ($browse_course_categories[$categoryCode] as $subCategory) {
151 146
                         $subCategoryCode = $subCategory['code'];
152
-                        $form .= '<option '. ($subCategoryCode == $codeType ? 'selected="selected" ':'') .' value="' . $subCategory['code'] . '"> ---' . $subCategory['name'] . ' ( '. $subCategory['count_courses'] .' ) </option>';
147
+                        $form .= '<option '.($subCategoryCode == $codeType ? 'selected="selected" ' : '').' value="'.$subCategory['code'].'"> ---'.$subCategory['name'].' ( '.$subCategory['count_courses'].' ) </option>';
153 148
                     }
154 149
                 }
155 150
             }
@@ -212,7 +207,7 @@  discard block
 block discarded – undo
212 207
             $course_subscribe_allowed = ($course['subscribe'] == 1);
213 208
             $course_unsubscribe_allowed = ($course['unsubscribe'] == 1);
214 209
             $count_connections = $course['count_connections'];
215
-            $creation_date = substr($course['creation_date'],0,10);
210
+            $creation_date = substr($course['creation_date'], 0, 10);
216 211
             
217 212
             $plugin = BuyCoursesPlugin::create();
218 213
             $includeServices = $plugin->get('include_services') === 'true';
@@ -365,9 +360,9 @@  discard block
 block discarded – undo
365 360
     $ajax_url = api_get_path(WEB_AJAX_PATH).'course.ajax.php?a=add_course_vote';
366 361
     $teachers = CourseManager::get_teacher_list_from_course_code_to_string($course['code']);
367 362
     $rating = Display::return_rating_system('star_'.$course['real_id'], $ajax_url.'&course_id='.$course['real_id'], $course['point_info']);
368
-    $html .= $serviceNode ? '<h4 class="title"><a class="serviceCheckFont" href="' . $linkCourse . '">' . cut($title, 60) . ' <em class="fa fa-diamond"></em></a></h4>' : '<h4 class="title"><a href="' . $linkCourse . '">' . cut($title, 60) . '</a></h4>';
363
+    $html .= $serviceNode ? '<h4 class="title"><a class="serviceCheckFont" href="'.$linkCourse.'">'.cut($title, 60).' <em class="fa fa-diamond"></em></a></h4>' : '<h4 class="title"><a href="'.$linkCourse.'">'.cut($title, 60).'</a></h4>';
369 364
     $html .= '<div class="teachers">'.$teachers.'</div>';
370
-    $html .= '<div class="ranking">'. $rating . '</div>';
365
+    $html .= '<div class="ranking">'.$rating.'</div>';
371 366
 
372 367
     return $html;
373 368
 }
@@ -382,8 +377,8 @@  discard block
 block discarded – undo
382 377
     $title = $course['title'];
383 378
     $html = '';
384 379
     if (api_get_setting('show_courses_descriptions_in_catalog') == 'true') {
385
-        $html = '<a data-title="' . $title . '" class="ajax btn btn-default btn-sm" href="'.api_get_path(WEB_CODE_PATH).'inc/ajax/course_home.ajax.php?a=show_course_information&code='.$course['code'].'" title="' . get_lang('Description') . '">' .
386
-        Display::returnFontAwesomeIcon('info-circle') . '</a>';
380
+        $html = '<a data-title="'.$title.'" class="ajax btn btn-default btn-sm" href="'.api_get_path(WEB_CODE_PATH).'inc/ajax/course_home.ajax.php?a=show_course_information&code='.$course['code'].'" title="'.get_lang('Description').'">'.
381
+        Display::returnFontAwesomeIcon('info-circle').'</a>';
387 382
     }
388 383
 
389 384
     return $html;
@@ -395,7 +390,7 @@  discard block
 block discarded – undo
395 390
  */
396 391
 function return_goto_button($course)
397 392
 {
398
-    $html = ' <a class="btn btn-default btn-sm" title="' . get_lang('GoToCourse') . '" href="'.api_get_course_url($course['code']).'">'.
393
+    $html = ' <a class="btn btn-default btn-sm" title="'.get_lang('GoToCourse').'" href="'.api_get_course_url($course['code']).'">'.
399 394
     Display::returnFontAwesomeIcon('share').'</a>';
400 395
 
401 396
     return $html;
@@ -429,8 +424,8 @@  discard block
 block discarded – undo
429 424
  */
430 425
 function return_register_button($course, $stok, $code, $search_term)
431 426
 {
432
-    $html = ' <a class="btn btn-success btn-sm" title="' . get_lang('Subscribe') . '" href="'.api_get_self().'?action=subscribe_course&sec_token='.$stok.'&subscribe_course='.$course['code'].'&search_term='.$search_term.'&category_code='.$code.'">' .
433
-    Display::returnFontAwesomeIcon('sign-in') . '</a>';
427
+    $html = ' <a class="btn btn-success btn-sm" title="'.get_lang('Subscribe').'" href="'.api_get_self().'?action=subscribe_course&sec_token='.$stok.'&subscribe_course='.$course['code'].'&search_term='.$search_term.'&category_code='.$code.'">'.
428
+    Display::returnFontAwesomeIcon('sign-in').'</a>';
434 429
     return $html;
435 430
 }
436 431
 
@@ -442,8 +437,8 @@  discard block
 block discarded – undo
442 437
 {
443 438
     $plugin = BuyCoursesPlugin::create();
444 439
     $id_course = intval($id_course);
445
-    $html = ' <a class="btn btn-warning btn-sm" title="' . $plugin->get_lang('Services') . '"  role="button" data-toggle="popover" id="course-'.$id_course.'-services">' .
446
-    Display::returnFontAwesomeIcon('tags') . '</a>';
440
+    $html = ' <a class="btn btn-warning btn-sm" title="'.$plugin->get_lang('Services').'"  role="button" data-toggle="popover" id="course-'.$id_course.'-services">'.
441
+    Display::returnFontAwesomeIcon('tags').'</a>';
447 442
     return $html;
448 443
 }
449 444
 
@@ -456,7 +451,7 @@  discard block
 block discarded – undo
456 451
  */
457 452
 function return_unregister_button($course, $stok, $search_term, $code)
458 453
 {
459
-    $html = ' <a class="btn btn-danger btn-sm" title="' . get_lang('Unsubscribe') . '" href="'. api_get_self().'?action=unsubscribe&sec_token='.$stok.'&unsubscribe='.$course['code'].'&search_term='.$search_term.'&category_code='.$code.'">' .
460
-    Display::returnFontAwesomeIcon('sign-out') . '</a>';
454
+    $html = ' <a class="btn btn-danger btn-sm" title="'.get_lang('Unsubscribe').'" href="'.api_get_self().'?action=unsubscribe&sec_token='.$stok.'&unsubscribe='.$course['code'].'&search_term='.$search_term.'&category_code='.$code.'">'.
455
+    Display::returnFontAwesomeIcon('sign-out').'</a>';
461 456
     return $html;
462 457
 }
Please login to merge, or discard this patch.