@@ -48,8 +48,8 @@ discard block |
||
48 | 48 | $sale['price'], |
49 | 49 | $currency['iso_code'], |
50 | 50 | 'paypal', |
51 | - api_get_path(WEB_PLUGIN_PATH) . 'buycourses/src/success.php', |
|
52 | - api_get_path(WEB_PLUGIN_PATH) . 'buycourses/src/error.php', |
|
51 | + api_get_path(WEB_PLUGIN_PATH).'buycourses/src/success.php', |
|
52 | + api_get_path(WEB_PLUGIN_PATH).'buycourses/src/error.php', |
|
53 | 53 | $extra |
54 | 54 | ); |
55 | 55 | |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | |
95 | 95 | unset($_SESSION['bc_sale_id']); |
96 | 96 | |
97 | - header('Location: ' . api_get_path(WEB_PLUGIN_PATH) . 'buycourses/index.php'); |
|
97 | + header('Location: '.api_get_path(WEB_PLUGIN_PATH).'buycourses/index.php'); |
|
98 | 98 | exit; |
99 | 99 | } |
100 | 100 | |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | ); |
132 | 132 | |
133 | 133 | unset($_SESSION['bc_sale_id']); |
134 | - header('Location: ' . api_get_path(WEB_PLUGIN_PATH) . 'buycourses/src/course_catalog.php'); |
|
134 | + header('Location: '.api_get_path(WEB_PLUGIN_PATH).'buycourses/src/course_catalog.php'); |
|
135 | 135 | exit; |
136 | 136 | } |
137 | 137 | |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | ) |
204 | 204 | ); |
205 | 205 | |
206 | - header('Location: ' . api_get_path(WEB_PLUGIN_PATH) . 'buycourses/index.php'); |
|
206 | + header('Location: '.api_get_path(WEB_PLUGIN_PATH).'buycourses/index.php'); |
|
207 | 207 | exit; |
208 | 208 | } |
209 | 209 | } |
@@ -42,8 +42,8 @@ discard block |
||
42 | 42 | // purchase-specific fields are ignored. This little condition handle this fact. |
43 | 43 | $itemPrice = $serviceSale['price']; |
44 | 44 | |
45 | - $returnUrl = api_get_path(WEB_PLUGIN_PATH) . 'buycourses/src/service_success.php'; |
|
46 | - $cancelUrl = api_get_path(WEB_PLUGIN_PATH) . 'buycourses/src/service_error.php'; |
|
45 | + $returnUrl = api_get_path(WEB_PLUGIN_PATH).'buycourses/src/service_success.php'; |
|
46 | + $cancelUrl = api_get_path(WEB_PLUGIN_PATH).'buycourses/src/service_error.php'; |
|
47 | 47 | |
48 | 48 | // The extra params for handle the hard job, this var is VERY IMPORTANT !! |
49 | 49 | $extra = ''; |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | |
76 | 76 | $plugin->cancelServiceSale(intval($serviceSale['id'])); |
77 | 77 | |
78 | - header('Location: '. api_get_path(WEB_PLUGIN_PATH) . 'buycourses/src/service_catalog.php'); |
|
78 | + header('Location: '.api_get_path(WEB_PLUGIN_PATH).'buycourses/src/service_catalog.php'); |
|
79 | 79 | exit; |
80 | 80 | } |
81 | 81 | |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | Display::addFlash( |
113 | 113 | Display::return_message($plugin->get_lang('OrderCancelled'), 'error', false) |
114 | 114 | ); |
115 | - header('Location: '. api_get_path(WEB_PLUGIN_PATH) . 'buycourses/src/service_catalog.php'); |
|
115 | + header('Location: '.api_get_path(WEB_PLUGIN_PATH).'buycourses/src/service_catalog.php'); |
|
116 | 116 | exit; |
117 | 117 | } |
118 | 118 | |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | ); |
152 | 152 | |
153 | 153 | unset($_SESSION['bc_service_sale_id']); |
154 | - header('Location: ' . api_get_path(WEB_PLUGIN_PATH) . 'buycourses/src/service_catalog.php'); |
|
154 | + header('Location: '.api_get_path(WEB_PLUGIN_PATH).'buycourses/src/service_catalog.php'); |
|
155 | 155 | exit; |
156 | 156 | } |
157 | 157 | |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | ) |
202 | 202 | ); |
203 | 203 | |
204 | - header('Location: ' . api_get_path(WEB_PLUGIN_PATH) . 'buycourses/index.php'); |
|
204 | + header('Location: '.api_get_path(WEB_PLUGIN_PATH).'buycourses/index.php'); |
|
205 | 205 | exit; |
206 | 206 | } |
207 | 207 | } |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | return false; |
111 | 111 | } |
112 | 112 | |
113 | - require_once api_get_path(SYS_PLUGIN_PATH) . 'buycourses/database.php'; |
|
113 | + require_once api_get_path(SYS_PLUGIN_PATH).'buycourses/database.php'; |
|
114 | 114 | } |
115 | 115 | |
116 | 116 | /** |
@@ -158,10 +158,10 @@ discard block |
||
158 | 158 | $item = $this->getItemByProduct(intval($productId), $productType); |
159 | 159 | $return['html'] = '<div class="buycourses-price">'; |
160 | 160 | if ($item) { |
161 | - $return['html'] .= '<span class="label label-primary"><b>'. $item['iso_code'] .' ' . $item['price'] . '</b></span>'; |
|
161 | + $return['html'] .= '<span class="label label-primary"><b>'.$item['iso_code'].' '.$item['price'].'</b></span>'; |
|
162 | 162 | $return['verificator'] = true; |
163 | 163 | } else { |
164 | - $return['html'] .= '<span class="label label-primary"><b>'. $this->get_lang('Free'). '</b></span>'; |
|
164 | + $return['html'] .= '<span class="label label-primary"><b>'.$this->get_lang('Free').'</b></span>'; |
|
165 | 165 | $return['verificator'] = false; |
166 | 166 | } |
167 | 167 | $return['html'] .= '</div>'; |
@@ -179,15 +179,15 @@ discard block |
||
179 | 179 | * @return string $html |
180 | 180 | */ |
181 | 181 | public function returnBuyCourseButton($productId, $productType) { |
182 | - $url = api_get_path(WEB_PLUGIN_PATH) . |
|
183 | - 'buycourses/src/process.php?i=' . |
|
184 | - intval($productId) . |
|
185 | - '&t=' . |
|
182 | + $url = api_get_path(WEB_PLUGIN_PATH). |
|
183 | + 'buycourses/src/process.php?i='. |
|
184 | + intval($productId). |
|
185 | + '&t='. |
|
186 | 186 | $productType |
187 | 187 | ; |
188 | 188 | |
189 | - $html = ' <a class="btn btn-success btn-sm" title="' . $this->get_lang('Buy') . '" href="' . $url . '">' . |
|
190 | - Display::returnFontAwesomeIcon('fa fa-shopping-cart') . '</a>'; |
|
189 | + $html = ' <a class="btn btn-success btn-sm" title="'.$this->get_lang('Buy').'" href="'.$url.'">'. |
|
190 | + Display::returnFontAwesomeIcon('fa fa-shopping-cart').'</a>'; |
|
191 | 191 | |
192 | 192 | return $html; |
193 | 193 | } |
@@ -733,7 +733,7 @@ discard block |
||
733 | 733 | ); |
734 | 734 | |
735 | 735 | if (!empty($sessionImage)) { |
736 | - $sessionInfo['image'] = api_get_path(WEB_UPLOAD_PATH) . $sessionImage['value']; |
|
736 | + $sessionInfo['image'] = api_get_path(WEB_UPLOAD_PATH).$sessionImage['value']; |
|
737 | 737 | } |
738 | 738 | |
739 | 739 | $sessionCourses = $session->getCourses(); |
@@ -1189,7 +1189,7 @@ discard block |
||
1189 | 1189 | |
1190 | 1190 | $str = ''; |
1191 | 1191 | |
1192 | - srand((double)microtime() * 1000000); |
|
1192 | + srand((double) microtime() * 1000000); |
|
1193 | 1193 | |
1194 | 1194 | for ($i = 0; $i < $length; $i++) { |
1195 | 1195 | $numbers = rand(0, strlen($salt) - 1); |
@@ -1536,8 +1536,8 @@ discard block |
||
1536 | 1536 | */ |
1537 | 1537 | public function getPayouts($status = self::PAYOUT_STATUS_PENDING, $payoutId = false, $userId = false) |
1538 | 1538 | { |
1539 | - $condition = ($payoutId) ? 'AND p.id = '. intval($payoutId) : ''; |
|
1540 | - $condition2 = ($userId) ? ' AND p.user_id = ' . intval($userId) : ''; |
|
1539 | + $condition = ($payoutId) ? 'AND p.id = '.intval($payoutId) : ''; |
|
1540 | + $condition2 = ($userId) ? ' AND p.user_id = '.intval($userId) : ''; |
|
1541 | 1541 | $typeResult = ($condition) ? 'first' : 'all'; |
1542 | 1542 | $payoutsTable = Database::get_main_table(BuyCoursesPlugin::TABLE_PAYPAL_PAYOUTS); |
1543 | 1543 | $saleTable = Database::get_main_table(BuyCoursesPlugin::TABLE_SALE); |
@@ -1564,14 +1564,14 @@ discard block |
||
1564 | 1564 | INNER JOIN $saleTable s ON s.id = p.sale_id |
1565 | 1565 | INNER JOIN $currencyTable c ON s.currency_id = c.id |
1566 | 1566 | LEFT JOIN $extraFieldValues efv ON p.user_id = efv.item_id |
1567 | - AND field_id = " . intval($paypalExtraField['id']) . " |
|
1567 | + AND field_id = ".intval($paypalExtraField['id'])." |
|
1568 | 1568 | "; |
1569 | 1569 | |
1570 | 1570 | $payouts = Database::select( |
1571 | 1571 | "p.* , u.firstname, u.lastname, efv.value as paypal_account, s.reference as sale_reference, s.price as item_price, c.iso_code", |
1572 | 1572 | "$payoutsTable p $innerJoins", |
1573 | 1573 | [ |
1574 | - 'where' => ['p.status = ? '.$condition . ' ' .$condition2 => $status] |
|
1574 | + 'where' => ['p.status = ? '.$condition.' '.$condition2 => $status] |
|
1575 | 1575 | ], |
1576 | 1576 | $typeResult |
1577 | 1577 | ); |
@@ -1635,7 +1635,7 @@ discard block |
||
1635 | 1635 | $platformCommission = $this->getPlatformCommission(); |
1636 | 1636 | |
1637 | 1637 | $sale = $this->getSale($saleId); |
1638 | - $teachersCommission = number_format((floatval($sale['price']) * intval($platformCommission['commission']))/100, 2); |
|
1638 | + $teachersCommission = number_format((floatval($sale['price']) * intval($platformCommission['commission'])) / 100, 2); |
|
1639 | 1639 | |
1640 | 1640 | |
1641 | 1641 | $beneficiaries = $this->getBeneficiariesBySale($saleId); |
@@ -1647,7 +1647,7 @@ discard block |
||
1647 | 1647 | 'payout_date' => getdate(), |
1648 | 1648 | 'sale_id' => intval($saleId), |
1649 | 1649 | 'user_id' => $beneficiary['user_id'], |
1650 | - 'commission' => number_format((floatval($teachersCommission) * intval($beneficiary['commissions']))/100, 2), |
|
1650 | + 'commission' => number_format((floatval($teachersCommission) * intval($beneficiary['commissions'])) / 100, 2), |
|
1651 | 1651 | 'status' => self::PAYOUT_STATUS_PENDING |
1652 | 1652 | ] |
1653 | 1653 | ); |
@@ -2229,17 +2229,17 @@ discard block |
||
2229 | 2229 | */ |
2230 | 2230 | public function getPath($var) |
2231 | 2231 | { |
2232 | - $pluginPath = api_get_path(WEB_PLUGIN_PATH) . 'buycourses/'; |
|
2232 | + $pluginPath = api_get_path(WEB_PLUGIN_PATH).'buycourses/'; |
|
2233 | 2233 | $paths = [ |
2234 | - 'SERVICE_IMAGES' => $pluginPath . 'uploads/services/images/', |
|
2235 | - 'SRC' => $pluginPath . 'src/', |
|
2236 | - 'VIEW' => $pluginPath . 'view/', |
|
2237 | - 'UPLOADS' => $pluginPath . 'uploads/', |
|
2238 | - 'LANGUAGES' => $pluginPath . 'lang/', |
|
2239 | - 'RESOURCES' => $pluginPath . 'resources/', |
|
2240 | - 'RESOURCES_IMG' => $pluginPath . 'resources/img/', |
|
2241 | - 'RESOURCES_CSS' => $pluginPath . 'resources/css/', |
|
2242 | - 'RESOURCES_JS' => $pluginPath . 'resources/js/', |
|
2234 | + 'SERVICE_IMAGES' => $pluginPath.'uploads/services/images/', |
|
2235 | + 'SRC' => $pluginPath.'src/', |
|
2236 | + 'VIEW' => $pluginPath.'view/', |
|
2237 | + 'UPLOADS' => $pluginPath.'uploads/', |
|
2238 | + 'LANGUAGES' => $pluginPath.'lang/', |
|
2239 | + 'RESOURCES' => $pluginPath.'resources/', |
|
2240 | + 'RESOURCES_IMG' => $pluginPath.'resources/img/', |
|
2241 | + 'RESOURCES_CSS' => $pluginPath.'resources/css/', |
|
2242 | + 'RESOURCES_JS' => $pluginPath.'resources/js/', |
|
2243 | 2243 | ]; |
2244 | 2244 | |
2245 | 2245 | return $paths[$var]; |
@@ -58,20 +58,20 @@ discard block |
||
58 | 58 | |
59 | 59 | $userInfo = api_get_user_info($sale['user_id']); |
60 | 60 | |
61 | - $html = '<h2>' . $sale['product_name'] .'</h2>'; |
|
61 | + $html = '<h2>'.$sale['product_name'].'</h2>'; |
|
62 | 62 | $html .= '<div class="row">'; |
63 | 63 | $html .= '<div class="col-sm-6 col-md-6">'; |
64 | 64 | $html .= '<ul>'; |
65 | - $html .= '<li><b>'. $plugin->get_lang('OrderPrice') . ':</b> '. $sale['price'] . '</li>'; |
|
66 | - $html .= '<li><b>'. $plugin->get_lang('CurrencyType') . ':</b> '. $currency['iso_code'] . '</li>'; |
|
67 | - $html .= '<li><b>'. $plugin->get_lang('ProductType') . ':</b> '. $productType . '</li>'; |
|
68 | - $html .= '<li><b>'. $plugin->get_lang('OrderDate') . ':</b> '. api_format_date($sale['date'], DATE_TIME_FORMAT_LONG_24H) . '</li>'; |
|
69 | - $html .= '<li><b>'. $plugin->get_lang('Buyer') . ':</b> '. $userInfo['complete_name'] . '</li>'; |
|
70 | - $html .= '<li><b>'. $plugin->get_lang('PaymentMethods') . ':</b> '. $paymentType . '</li>'; |
|
65 | + $html .= '<li><b>'.$plugin->get_lang('OrderPrice').':</b> '.$sale['price'].'</li>'; |
|
66 | + $html .= '<li><b>'.$plugin->get_lang('CurrencyType').':</b> '.$currency['iso_code'].'</li>'; |
|
67 | + $html .= '<li><b>'.$plugin->get_lang('ProductType').':</b> '.$productType.'</li>'; |
|
68 | + $html .= '<li><b>'.$plugin->get_lang('OrderDate').':</b> '.api_format_date($sale['date'], DATE_TIME_FORMAT_LONG_24H).'</li>'; |
|
69 | + $html .= '<li><b>'.$plugin->get_lang('Buyer').':</b> '.$userInfo['complete_name'].'</li>'; |
|
70 | + $html .= '<li><b>'.$plugin->get_lang('PaymentMethods').':</b> '.$paymentType.'</li>'; |
|
71 | 71 | $html .= '</ul>'; |
72 | 72 | $html .= '</div>'; |
73 | 73 | $html .= '<div class="col-sm-6 col-md-6">'; |
74 | - $html .= '<img class="thumbnail" src="'. $productImage .'" >'; |
|
74 | + $html .= '<img class="thumbnail" src="'.$productImage.'" >'; |
|
75 | 75 | $html .= '</div>'; |
76 | 76 | $html .= '</div>'; |
77 | 77 | |
@@ -119,9 +119,9 @@ discard block |
||
119 | 119 | $html = '<div class="row">' |
120 | 120 | . '<p>' |
121 | 121 | . '<ul>' |
122 | - . '<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>' |
|
123 | - . '<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>' |
|
124 | - . '<li>'. get_plugin_lang("PayoutsTotalCanceled", "BuyCoursesPlugin") .' <b>'. $stats['canceled_count'] .'</b> - '. get_plugin_lang("TotalAmount", "BuyCoursesPlugin") .' <b>'. $stats['canceled_total_amount'] .' '. $currency['iso_code'] . '</b></li>' |
|
122 | + . '<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>' |
|
123 | + . '<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>' |
|
124 | + . '<li>'.get_plugin_lang("PayoutsTotalCanceled", "BuyCoursesPlugin").' <b>'.$stats['canceled_count'].'</b> - '.get_plugin_lang("TotalAmount", "BuyCoursesPlugin").' <b>'.$stats['canceled_total_amount'].' '.$currency['iso_code'].'</b></li>' |
|
125 | 125 | . '</ul>' |
126 | 126 | . '</p>'; |
127 | 127 | $html .= '</div>'; |
@@ -161,15 +161,15 @@ discard block |
||
161 | 161 | |
162 | 162 | $isoCode = $currentCurrency['iso_code']; |
163 | 163 | |
164 | - $html .= '<p>'. get_plugin_lang("VerifyTotalAmountToProceedPayout", "BuyCoursesPlugin") .'</p>'; |
|
164 | + $html .= '<p>'.get_plugin_lang("VerifyTotalAmountToProceedPayout", "BuyCoursesPlugin").'</p>'; |
|
165 | 165 | $html .= '' |
166 | 166 | . '<p>' |
167 | 167 | . '<ul>' |
168 | - . '<li>'. get_plugin_lang("TotalAcounts", "BuyCoursesPlugin") .' <b>'. $totalAccounts .'</b></li>' |
|
169 | - . '<li>'. get_plugin_lang("TotalPayout", "BuyCoursesPlugin") .' <b>'. $isoCode .' '. $totalPayout .'</b></li>' |
|
168 | + . '<li>'.get_plugin_lang("TotalAcounts", "BuyCoursesPlugin").' <b>'.$totalAccounts.'</b></li>' |
|
169 | + . '<li>'.get_plugin_lang("TotalPayout", "BuyCoursesPlugin").' <b>'.$isoCode.' '.$totalPayout.'</b></li>' |
|
170 | 170 | . '</ul>' |
171 | 171 | . '</p>'; |
172 | - $html .= '<p>'. get_plugin_lang("CautionThisProcessCantBeCanceled", "BuyCoursesPlugin") .'</p>'; |
|
172 | + $html .= '<p>'.get_plugin_lang("CautionThisProcessCantBeCanceled", "BuyCoursesPlugin").'</p>'; |
|
173 | 173 | $html .= '<br /><br />'; |
174 | 174 | $html .= '<div id="spinner" class="text-center"></div>'; |
175 | 175 | |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | |
224 | 224 | } else { |
225 | 225 | |
226 | - 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); |
|
226 | + 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); |
|
227 | 227 | |
228 | 228 | } |
229 | 229 | |
@@ -312,7 +312,7 @@ discard block |
||
312 | 312 | |
313 | 313 | echo json_encode($cargo); |
314 | 314 | |
315 | - } catch(Exception $e) { |
|
315 | + } catch (Exception $e) { |
|
316 | 316 | |
317 | 317 | $cargo = json_decode($e->getMessage(), true); |
318 | 318 | |
@@ -411,7 +411,7 @@ discard block |
||
411 | 411 | |
412 | 412 | echo json_encode($cargo); |
413 | 413 | |
414 | - } catch(Exception $e) { |
|
414 | + } catch (Exception $e) { |
|
415 | 415 | |
416 | 416 | $cargo = json_decode($e->getMessage(), true); |
417 | 417 | |
@@ -451,9 +451,9 @@ discard block |
||
451 | 451 | break; |
452 | 452 | } |
453 | 453 | |
454 | - $ajaxCallFile = $plugin->getPath('SRC') . 'buycourses.ajax.php'; |
|
454 | + $ajaxCallFile = $plugin->getPath('SRC').'buycourses.ajax.php'; |
|
455 | 455 | |
456 | - $serviceImg = $plugin->getPath('SERVICE_IMAGES') . $serviceSale['service']['image']; |
|
456 | + $serviceImg = $plugin->getPath('SERVICE_IMAGES').$serviceSale['service']['image']; |
|
457 | 457 | $html = "<img class='img-responsive text-center' src='$serviceImg'>"; |
458 | 458 | $html .= "<br />"; |
459 | 459 | $html .= "<legend>{$plugin->get_lang('ServiceInformation')}</legend>"; |
@@ -473,7 +473,7 @@ discard block |
||
473 | 473 | } |
474 | 474 | $html .= "<li><b>{$plugin->get_lang('AppliesTo')}:</b> $nodeType</li> "; |
475 | 475 | $html .= "<li><b>{$plugin->get_lang('Price')}:</b> {$serviceSale['service']['price']} {$serviceSale['currency']}</li> "; |
476 | - $duration = $serviceSale['service']['duration_days'] . ' ' . $plugin->get_lang('Days'); |
|
476 | + $duration = $serviceSale['service']['duration_days'].' '.$plugin->get_lang('Days'); |
|
477 | 477 | $html .= "</ul>"; |
478 | 478 | $html .= "<legend>{$plugin->get_lang('SaleInfo')}</legend>"; |
479 | 479 | $html .= "<ul>"; |
@@ -555,10 +555,10 @@ discard block |
||
555 | 555 | 'success' |
556 | 556 | ); |
557 | 557 | } else { |
558 | - $html .= Display::return_message('Error - ' . $plugin->get_lang('ErrorContactPlatformAdmin'), 'error'); |
|
558 | + $html .= Display::return_message('Error - '.$plugin->get_lang('ErrorContactPlatformAdmin'), 'error'); |
|
559 | 559 | } |
560 | 560 | |
561 | - $html .= "<a id='finish-button' class='btn btn-primary'>" . $plugin->get_lang('ClickHereToFinish') . "</a>"; |
|
561 | + $html .= "<a id='finish-button' class='btn btn-primary'>".$plugin->get_lang('ClickHereToFinish')."</a>"; |
|
562 | 562 | $html .= "</div>"; |
563 | 563 | $html .= "<script>"; |
564 | 564 | $html .= "$('#finish-button').click(function() {"; |
@@ -584,10 +584,10 @@ discard block |
||
584 | 584 | 'warning' |
585 | 585 | ); |
586 | 586 | } else { |
587 | - $html .= Display::return_message('Error - ' . $plugin->get_lang('ErrorContactPlatformAdmin'), 'error'); |
|
587 | + $html .= Display::return_message('Error - '.$plugin->get_lang('ErrorContactPlatformAdmin'), 'error'); |
|
588 | 588 | } |
589 | 589 | |
590 | - $html .= "<a id='finish-button' class='btn btn-primary'>" . $plugin->get_lang('ClickHereToFinish') . "</a>"; |
|
590 | + $html .= "<a id='finish-button' class='btn btn-primary'>".$plugin->get_lang('ClickHereToFinish')."</a>"; |
|
591 | 591 | $html .= "</div>"; |
592 | 592 | $html .= "<script>"; |
593 | 593 | $html .= "$('#finish-button').click(function() {"; |
@@ -3151,12 +3151,12 @@ |
||
3151 | 3151 | $end->format('e') |
3152 | 3152 | ); |
3153 | 3153 | $title = api_convert_encoding( |
3154 | - (string)$event->summary, |
|
3154 | + (string) $event->summary, |
|
3155 | 3155 | $charset, |
3156 | 3156 | 'UTF-8' |
3157 | 3157 | ); |
3158 | 3158 | $description = api_convert_encoding( |
3159 | - (string)$event->description, |
|
3159 | + (string) $event->description, |
|
3160 | 3160 | $charset, |
3161 | 3161 | 'UTF-8' |
3162 | 3162 | ); |
@@ -73,14 +73,14 @@ discard block |
||
73 | 73 | $accessUrlId = api_get_current_access_url_id(); |
74 | 74 | $customLogoPath = "themes/$theme/images/header-logo-custom$accessUrlId.png"; |
75 | 75 | |
76 | - if (file_exists(api_get_path(SYS_PUBLIC_PATH) . "css/$customLogoPath")) { |
|
77 | - return api_get_path(WEB_CSS_PATH) . $customLogoPath; |
|
76 | + if (file_exists(api_get_path(SYS_PUBLIC_PATH)."css/$customLogoPath")) { |
|
77 | + return api_get_path(WEB_CSS_PATH).$customLogoPath; |
|
78 | 78 | } |
79 | 79 | |
80 | 80 | $originalLogoPath = "themes/$theme/images/header-logo.png"; |
81 | 81 | |
82 | - if (file_exists(api_get_path(SYS_CSS_PATH) . $originalLogoPath)) { |
|
83 | - return api_get_path(WEB_CSS_PATH) . $originalLogoPath; |
|
82 | + if (file_exists(api_get_path(SYS_CSS_PATH).$originalLogoPath)) { |
|
83 | + return api_get_path(WEB_CSS_PATH).$originalLogoPath; |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | return null; |
@@ -100,10 +100,10 @@ discard block |
||
100 | 100 | $siteName = api_get_setting('siteName'); |
101 | 101 | |
102 | 102 | if ($logoPath === null) { |
103 | - $headerLogo = \Display::url($siteName, api_get_path(WEB_PATH) . 'index.php'); |
|
103 | + $headerLogo = \Display::url($siteName, api_get_path(WEB_PATH).'index.php'); |
|
104 | 104 | |
105 | 105 | if (!empty($institutionUrl) && !empty($institution)) { |
106 | - $headerLogo .= ' - ' . \Display::url($institution, $institutionUrl); |
|
106 | + $headerLogo .= ' - '.\Display::url($institution, $institutionUrl); |
|
107 | 107 | } |
108 | 108 | |
109 | 109 | $courseInfo = api_get_course_info(); |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | |
128 | 128 | $image = \Display::img($logoPath, $institution, $imageAttributes); |
129 | 129 | |
130 | - return \Display::url($image, api_get_path(WEB_PATH) . 'index.php'); |
|
130 | + return \Display::url($image, api_get_path(WEB_PATH).'index.php'); |
|
131 | 131 | } |
132 | 132 | |
133 | 133 | /** |
@@ -139,9 +139,9 @@ discard block |
||
139 | 139 | public static function stripGivenTags($string, $tags) |
140 | 140 | { |
141 | 141 | foreach ($tags as $tag) { |
142 | - $string2 = preg_replace('#</' . $tag . '[^>]*>#i', ' ', $string); |
|
142 | + $string2 = preg_replace('#</'.$tag.'[^>]*>#i', ' ', $string); |
|
143 | 143 | if ($string2 != $string) { |
144 | - $string = preg_replace('/<' . $tag . '[^>]*>/i', ' ', $string2); |
|
144 | + $string = preg_replace('/<'.$tag.'[^>]*>/i', ' ', $string2); |
|
145 | 145 | } |
146 | 146 | } |
147 | 147 | return $string; |
@@ -22,14 +22,14 @@ discard block |
||
22 | 22 | $tbl_announcement_group = Database :: get_main_table(TABLE_MAIN_SYSTEM_ANNOUNCEMENTS_GROUPS); |
23 | 23 | $userGroup = new UserGroup(); |
24 | 24 | |
25 | - $temp_user_groups = $userGroup->get_groups_by_user(api_get_user_id(),0); |
|
25 | + $temp_user_groups = $userGroup->get_groups_by_user(api_get_user_id(), 0); |
|
26 | 26 | $groups = array(); |
27 | 27 | foreach ($temp_user_groups as $user_group) { |
28 | 28 | $groups = array_merge($groups, array($user_group['id'])); |
29 | 29 | $groups = array_merge($groups, $userGroup->get_parent_groups($user_group['id'])); |
30 | 30 | } |
31 | 31 | |
32 | - $groups_string = '('.implode($groups,',').')'; |
|
32 | + $groups_string = '('.implode($groups, ',').')'; |
|
33 | 33 | $now = api_get_utc_datetime(); |
34 | 34 | $sql = "SELECT *, DATE_FORMAT(date_start,'%d-%m-%Y %h:%i:%s') AS display_date |
35 | 35 | FROM $db_table |
@@ -104,13 +104,13 @@ discard block |
||
104 | 104 | * @param string $user_id |
105 | 105 | * @return string |
106 | 106 | */ |
107 | - public static function display_all_announcements($visible, $id = -1, $start = 0,$user_id='') |
|
107 | + public static function display_all_announcements($visible, $id = -1, $start = 0, $user_id = '') |
|
108 | 108 | { |
109 | 109 | $user_selected_language = api_get_interface_language(); |
110 | 110 | $start = intval($start); |
111 | 111 | $userGroup = new UserGroup(); |
112 | 112 | $tbl_announcement_group = Database :: get_main_table(TABLE_MAIN_SYSTEM_ANNOUNCEMENTS_GROUPS); |
113 | - $temp_user_groups = $userGroup->get_groups_by_user(api_get_user_id(),0); |
|
113 | + $temp_user_groups = $userGroup->get_groups_by_user(api_get_user_id(), 0); |
|
114 | 114 | $groups = array(); |
115 | 115 | foreach ($temp_user_groups as $user_group) { |
116 | 116 | $groups = array_merge($groups, array($user_group['id'])); |
@@ -118,10 +118,10 @@ discard block |
||
118 | 118 | } |
119 | 119 | |
120 | 120 | // Checks if tables exists to not break platform not updated |
121 | - $groups_string = '('.implode($groups,',').')'; |
|
121 | + $groups_string = '('.implode($groups, ',').')'; |
|
122 | 122 | |
123 | 123 | $db_table = Database :: get_main_table(TABLE_MAIN_SYSTEM_ANNOUNCEMENTS); |
124 | - $now = api_get_utc_datetime(); |
|
124 | + $now = api_get_utc_datetime(); |
|
125 | 125 | |
126 | 126 | $sql = "SELECT * FROM ".$db_table." |
127 | 127 | WHERE |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | if (!isset($_GET['start']) || $_GET['start'] == 0) { |
156 | 156 | $sql .= " ORDER BY date_start DESC LIMIT ".$start.",20"; |
157 | 157 | } else { |
158 | - $sql .= " ORDER BY date_start DESC LIMIT ".($start+1).",20"; |
|
158 | + $sql .= " ORDER BY date_start DESC LIMIT ".($start + 1).",20"; |
|
159 | 159 | } |
160 | 160 | $announcements = Database::query($sql); |
161 | 161 | $content = ''; |
@@ -204,10 +204,10 @@ discard block |
||
204 | 204 | */ |
205 | 205 | public static function display_arrow($user_id) |
206 | 206 | { |
207 | - $start = (int)$_GET['start']; |
|
207 | + $start = (int) $_GET['start']; |
|
208 | 208 | $nb_announcement = SystemAnnouncementManager :: count_nb_announcement($start, $user_id); |
209 | - $next = ((int)$_GET['start']+19); |
|
210 | - $prev = ((int)$_GET['start']-19); |
|
209 | + $next = ((int) $_GET['start'] + 19); |
|
210 | + $prev = ((int) $_GET['start'] - 19); |
|
211 | 211 | $content = ''; |
212 | 212 | if (!isset($_GET['start']) || $_GET['start'] == 0) { |
213 | 213 | if ($nb_announcement > 20) { |
@@ -567,7 +567,7 @@ discard block |
||
567 | 567 | $sendEmailTest |
568 | 568 | ); |
569 | 569 | } else { |
570 | - if ($send_mail==1) { |
|
570 | + if ($send_mail == 1) { |
|
571 | 571 | SystemAnnouncementManager::send_system_announcement_by_email( |
572 | 572 | $title, |
573 | 573 | $content, |
@@ -678,7 +678,7 @@ discard block |
||
678 | 678 | $language = null, |
679 | 679 | $sendEmailTest = false |
680 | 680 | ) { |
681 | - $content = str_replace(array('\r\n', '\n', '\r'),'', $content); |
|
681 | + $content = str_replace(array('\r\n', '\n', '\r'), '', $content); |
|
682 | 682 | $now = api_get_utc_datetime(); |
683 | 683 | |
684 | 684 | if ($sendEmailTest) { |
@@ -704,7 +704,7 @@ discard block |
||
704 | 704 | WHERE status = '5' "; |
705 | 705 | } |
706 | 706 | |
707 | - if ($teacher<> 0 && $student <> 0) { |
|
707 | + if ($teacher <> 0 && $student <> 0) { |
|
708 | 708 | $sql = "SELECT DISTINCT u.user_id FROM $user_table u $url_condition |
709 | 709 | WHERE 1 = 1 "; |
710 | 710 | } |
@@ -737,7 +737,7 @@ discard block |
||
737 | 737 | |
738 | 738 | $message_sent = false; |
739 | 739 | |
740 | - while ($row = Database::fetch_array($result,'ASSOC')) { |
|
740 | + while ($row = Database::fetch_array($result, 'ASSOC')) { |
|
741 | 741 | MessageManager::send_message_simple($row['user_id'], $title, $content); |
742 | 742 | $message_sent = true; |
743 | 743 | } |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | // Show message to confirm that a tool it to be hidden from available tools |
23 | 23 | // visibility 0,1->2 |
24 | 24 | if (!empty($_GET['askDelete'])) { |
25 | - $content .='<div id="toolhide">'.get_lang('DelLk').'<br /> |
|
25 | + $content .= '<div id="toolhide">'.get_lang('DelLk').'<br /> |
|
26 | 26 | <a href="'.api_get_self().'">'.get_lang('No').'</a> | |
27 | 27 | <a href="'.api_get_self().'?delete=yes&id='.$id.'">'.get_lang('Yes').'</a> |
28 | 28 | </div>'; |
@@ -49,11 +49,11 @@ discard block |
||
49 | 49 | |
50 | 50 | // Start of tools for CourseAdmins (teachers/tutors) |
51 | 51 | if ($session_id === 0 && api_is_course_admin() && api_is_allowed_to_edit(null, true)) { |
52 | - $content .= '<div class="alert alert-success" style="border:0px; margin-top: 0px;padding:0px;"> |
|
52 | + $content .= '<div class="alert alert-success" style="border:0px; margin-top: 0px;padding:0px;"> |
|
53 | 53 | <div class="normal-message" id="id_normal_message" style="display:none">'; |
54 | - $content .= '<img src="'.api_get_path(WEB_PATH).'main/inc/lib/javascript/indicator.gif"/> '; |
|
55 | - $content .= get_lang('PleaseStandBy'); |
|
56 | - $content .= '</div> |
|
54 | + $content .= '<img src="'.api_get_path(WEB_PATH).'main/inc/lib/javascript/indicator.gif"/> '; |
|
55 | + $content .= get_lang('PleaseStandBy'); |
|
56 | + $content .= '</div> |
|
57 | 57 | <div class="alert alert-success" id="id_confirmation_message" style="display:none"></div> |
58 | 58 | </div>'; |
59 | 59 | |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | $list2 = CourseHome::get_tools_category(TOOL_COURSE_PLUGIN); |
80 | 80 | |
81 | 81 | $my_list = array_merge($my_list, $list2); |
82 | - $items = CourseHome::show_tools_category($my_list); |
|
82 | + $items = CourseHome::show_tools_category($my_list); |
|
83 | 83 | $content .= return_block(get_lang('Interaction'), $items, 'course-tools-interaction'); |
84 | 84 | |
85 | 85 | $my_list = CourseHome::get_tools_category(TOOL_ADMIN_PLATFORM); |
@@ -94,10 +94,10 @@ discard block |
||
94 | 94 | <span class="viewcaption">'.get_lang('SessionData').'</span> |
95 | 95 | <table class="course_activity_home">'; |
96 | 96 | $content .= CourseHome::show_session_data($session_id); |
97 | - $content .= '</table></div></div>'; |
|
97 | + $content .= '</table></div></div>'; |
|
98 | 98 | } |
99 | 99 | |
100 | - $content .= '<div class="row">'; |
|
100 | + $content .= '<div class="row">'; |
|
101 | 101 | $my_list = CourseHome::get_tools_category(TOOL_STUDENT_VIEW); |
102 | 102 | $content .= CourseHome::show_tools_category($my_list); |
103 | 103 | $content .= '</div>'; |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | { |
180 | 180 | $html = '<div class="row"> |
181 | 181 | <div class="col-xs-12 col-md-12"> |
182 | - <div class="title-tools">' . $title . '</div> |
|
182 | + <div class="title-tools">' . $title.'</div> |
|
183 | 183 | </div> |
184 | 184 | </div> |
185 | 185 | <div class="row '.$class.'">'.$content.'</div>'; |
@@ -356,7 +356,7 @@ discard block |
||
356 | 356 | array(), |
357 | 357 | null, |
358 | 358 | ICON_SIZE_MEDIUM |
359 | - ) . ' ' . $tool_name . '</a>'; |
|
359 | + ).' '.$tool_name.'</a>'; |
|
360 | 360 | |
361 | 361 | // This part displays the links to hide or remove a tool. |
362 | 362 | // These links are only visible by the course manager. |
@@ -696,7 +696,7 @@ discard block |
||
696 | 696 | $session_id = api_get_session_id(); |
697 | 697 | $is_platform_admin = api_is_platform_admin(); |
698 | 698 | |
699 | - if ($session_id == 0 ) { |
|
699 | + if ($session_id == 0) { |
|
700 | 700 | $is_allowed_to_edit = api_is_allowed_to_edit(null, true) && api_is_course_admin(); |
701 | 701 | } else { |
702 | 702 | $is_allowed_to_edit = api_is_allowed_to_edit(null, true) && !api_is_coach(); |
@@ -1072,8 +1072,8 @@ discard block |
||
1072 | 1072 | |
1073 | 1073 | $toolName = api_underscore_to_camel_case($toolName); |
1074 | 1074 | |
1075 | - if (isset($GLOBALS['Tool' . $toolName])) { |
|
1076 | - return get_lang('Tool' . $toolName); |
|
1075 | + if (isset($GLOBALS['Tool'.$toolName])) { |
|
1076 | + return get_lang('Tool'.$toolName); |
|
1077 | 1077 | } |
1078 | 1078 | |
1079 | 1079 | return $toolName; |
@@ -1172,7 +1172,7 @@ discard block |
||
1172 | 1172 | $navigation_items = self::get_navigation_items(true); |
1173 | 1173 | $course_id = api_get_course_id(); |
1174 | 1174 | |
1175 | - $class= null; |
|
1175 | + $class = null; |
|
1176 | 1176 | $idLearn = null; |
1177 | 1177 | $item = null; |
1178 | 1178 | $marginLeft = 160; |
@@ -1197,10 +1197,10 @@ discard block |
||
1197 | 1197 | } else if (api_get_setting('show_navigation_menu') == 'icons') { |
1198 | 1198 | $class = 'icons'; |
1199 | 1199 | $marginLeft = 25; |
1200 | - $item = Display::return_icon(substr($navigation_item['image'],0,-3)."png", $navigation_item['name'], array('class'=>'tool-img'), ICON_SIZE_SMALL); |
|
1200 | + $item = Display::return_icon(substr($navigation_item['image'], 0, -3)."png", $navigation_item['name'], array('class'=>'tool-img'), ICON_SIZE_SMALL); |
|
1201 | 1201 | } else { |
1202 | 1202 | $class = 'icons-text'; |
1203 | - $item = $navigation_item['name'] . Display::return_icon(substr($navigation_item['image'],0,-3)."png", $navigation_item['name'], array('class'=>'tool-img'), ICON_SIZE_SMALL); |
|
1203 | + $item = $navigation_item['name'].Display::return_icon(substr($navigation_item['image'], 0, -3)."png", $navigation_item['name'], array('class'=>'tool-img'), ICON_SIZE_SMALL); |
|
1204 | 1204 | } |
1205 | 1205 | |
1206 | 1206 | if (stristr($url_item['path'], $url_current['path'])) { |
@@ -1212,13 +1212,13 @@ discard block |
||
1212 | 1212 | if (strpos($navigation_item['link'], 'chat') !== false && |
1213 | 1213 | api_get_course_setting('allow_open_chat_window', $course_id) |
1214 | 1214 | ) { |
1215 | - $html .= '<a ' . $idLearn . ' class="btn btn-default text-left ' . $class . ' " href="javascript: void(0);" onclick="javascript: window.open(\''.$navigation_item['link'].'\',\'window_chat'.api_get_course_id().'\',config=\'height=\'+600+\', width=\'+825+\', left=2, top=2, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, directories=no, status=no\')" target="'.$navigation_item['target'].'"'; |
|
1215 | + $html .= '<a '.$idLearn.' class="btn btn-default text-left '.$class.' " href="javascript: void(0);" onclick="javascript: window.open(\''.$navigation_item['link'].'\',\'window_chat'.api_get_course_id().'\',config=\'height=\'+600+\', width=\'+825+\', left=2, top=2, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, directories=no, status=no\')" target="'.$navigation_item['target'].'"'; |
|
1216 | 1216 | $html .= ' title="'.$navigation_item['name'].'">'; |
1217 | - $html .= $item; |
|
1217 | + $html .= $item; |
|
1218 | 1218 | $html .= '</a>'; |
1219 | 1219 | } else { |
1220 | - $html .= '<a ' . $idLearn . ' class="btn btn-default text-left ' . $class . '" href="'.$navigation_item['link'].'" target="_top" title="'.$navigation_item['name'].'">'; |
|
1221 | - $html .= $item; |
|
1220 | + $html .= '<a '.$idLearn.' class="btn btn-default text-left '.$class.'" href="'.$navigation_item['link'].'" target="_top" title="'.$navigation_item['name'].'">'; |
|
1221 | + $html .= $item; |
|
1222 | 1222 | $html .= '</a>'; |
1223 | 1223 | } |
1224 | 1224 | |
@@ -1226,14 +1226,14 @@ discard block |
||
1226 | 1226 | } |
1227 | 1227 | $html .= '</ul>'; |
1228 | 1228 | $html .= '<script>$(function() { |
1229 | - $("#toolnavbox a").stop().animate({"margin-left":"-' . $marginLeft . 'px"},1000); |
|
1229 | + $("#toolnavbox a").stop().animate({"margin-left":"-' . $marginLeft.'px"},1000); |
|
1230 | 1230 | $("#toolnavbox > li").hover( |
1231 | 1231 | function () { |
1232 | 1232 | $("a",$(this)).stop().animate({"margin-left":"-2px"},200); |
1233 | 1233 | $("span",$(this)).css("display","block"); |
1234 | 1234 | }, |
1235 | 1235 | function () { |
1236 | - $("a",$(this)).stop().animate({"margin-left":"-' . $marginLeft . 'px"},200); |
|
1236 | + $("a",$(this)).stop().animate({"margin-left":"-' . $marginLeft.'px"},200); |
|
1237 | 1237 | $("span",$(this)).css("display","initial"); |
1238 | 1238 | } |
1239 | 1239 | ); |
@@ -1329,7 +1329,7 @@ discard block |
||
1329 | 1329 | return array(); |
1330 | 1330 | } |
1331 | 1331 | |
1332 | - $table = Database::get_course_table(TABLE_TOOL_LIST); |
|
1332 | + $table = Database::get_course_table(TABLE_TOOL_LIST); |
|
1333 | 1333 | $sql = "SELECT * FROM $table |
1334 | 1334 | WHERE category in ('authoring','interaction') |
1335 | 1335 | AND c_id = $courseId |
@@ -1435,7 +1435,7 @@ discard block |
||
1435 | 1435 | $temp = new Image($path); |
1436 | 1436 | $r = $temp->convert2bw(); |
1437 | 1437 | $ext = pathinfo($path, PATHINFO_EXTENSION); |
1438 | - $bwPath = substr($path,0,-(strlen($ext)+1)) . '_na.' . $ext; |
|
1438 | + $bwPath = substr($path, 0, -(strlen($ext) + 1)).'_na.'.$ext; |
|
1439 | 1439 | |
1440 | 1440 | if ($r === false) { |
1441 | 1441 | error_log('Conversion to B&W of '.$path.' failed in '.__FILE__.' at line '.__LINE__); |