@@ -29,9 +29,9 @@ |
||
29 | 29 | * @param string $title |
30 | 30 | * @param string $description |
31 | 31 | */ |
32 | - public function __construct($id,$title,$description,$display_order) |
|
32 | + public function __construct($id, $title, $description, $display_order) |
|
33 | 33 | { |
34 | - parent::__construct($id,RESOURCE_LINKCATEGORY); |
|
34 | + parent::__construct($id, RESOURCE_LINKCATEGORY); |
|
35 | 35 | $this->title = $title; |
36 | 36 | $this->description = $description; |
37 | 37 | $this->display_order = $display_order; |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | |
48 | 48 | $this_section = SECTION_COURSES; |
49 | 49 | $nameTools = get_lang('CopyCourse'); |
50 | -$returnLink = api_get_path(WEB_CODE_PATH) . 'course_info/maintenance_coach.php?' . api_get_cidreq(); |
|
50 | +$returnLink = api_get_path(WEB_CODE_PATH).'course_info/maintenance_coach.php?'.api_get_cidreq(); |
|
51 | 51 | $interbreadcrumb[] = array( |
52 | 52 | 'url' => $returnLink, |
53 | 53 | 'name' => get_lang('Maintenance') |
@@ -73,29 +73,29 @@ discard block |
||
73 | 73 | $attrs = ''; |
74 | 74 | if (count($attr) > 0) { |
75 | 75 | foreach ($attr as $key => $value) { |
76 | - $attrs .= ' ' . $key . '="' . $value . '"'; |
|
76 | + $attrs .= ' '.$key.'="'.$value.'"'; |
|
77 | 77 | } |
78 | 78 | } |
79 | - $output = '<select name="' . $name . '" ' . $attrs . '>'; |
|
79 | + $output = '<select name="'.$name.'" '.$attrs.'>'; |
|
80 | 80 | |
81 | 81 | if (count($sessions) == 0) { |
82 | - $output .= '<option value = "0">' . get_lang( |
|
82 | + $output .= '<option value = "0">'.get_lang( |
|
83 | 83 | 'ThereIsNotStillASession' |
84 | - ) . '</option>'; |
|
84 | + ).'</option>'; |
|
85 | 85 | } else { |
86 | - $output .= '<option value = "0">' . get_lang( |
|
86 | + $output .= '<option value = "0">'.get_lang( |
|
87 | 87 | 'SelectASession' |
88 | - ) . '</option>'; |
|
88 | + ).'</option>'; |
|
89 | 89 | } |
90 | 90 | |
91 | 91 | if (is_array($sessions)) { |
92 | 92 | foreach ($sessions as $session) { |
93 | 93 | $category_name = ''; |
94 | 94 | if (!empty($session['category_name'])) { |
95 | - $category_name = ' (' . $session['category_name'] . ')'; |
|
95 | + $category_name = ' ('.$session['category_name'].')'; |
|
96 | 96 | } |
97 | 97 | |
98 | - $output .= '<option value="' . $session['id'] . '">' . $session['name'] . ' ' . $category_name . '</option>'; |
|
98 | + $output .= '<option value="'.$session['id'].'">'.$session['name'].' '.$category_name.'</option>'; |
|
99 | 99 | } |
100 | 100 | } |
101 | 101 | $output .= '</select>'; |
@@ -120,43 +120,43 @@ discard block |
||
120 | 120 | // Actions |
121 | 121 | $html .= '<div class="actions">'; |
122 | 122 | // Link back to the documents overview |
123 | - $html .= '<a href="' . $returnLink . '">' . Display::return_icon( |
|
124 | - 'back.png', get_lang('BackTo') . ' ' . get_lang('Maintenance'), '', ICON_SIZE_MEDIUM |
|
125 | - ) . '</a>'; |
|
123 | + $html .= '<a href="'.$returnLink.'">'.Display::return_icon( |
|
124 | + 'back.png', get_lang('BackTo').' '.get_lang('Maintenance'), '', ICON_SIZE_MEDIUM |
|
125 | + ).'</a>'; |
|
126 | 126 | $html .= '</div>'; |
127 | 127 | |
128 | 128 | $html .= Display::return_message( |
129 | 129 | get_lang('CopyCourseFromSessionToSessionExplanation') |
130 | 130 | ); |
131 | 131 | |
132 | - $html .= '<form name="formulaire" method="post" action="' . api_get_self( |
|
133 | - ) . '?' . api_get_cidreq() . '" >'; |
|
132 | + $html .= '<form name="formulaire" method="post" action="'.api_get_self( |
|
133 | + ).'?'.api_get_cidreq().'" >'; |
|
134 | 134 | $html .= '<table border="0" cellpadding="5" cellspacing="0" width="100%">'; |
135 | 135 | |
136 | 136 | // Source |
137 | - $html .= '<tr><td width="15%"><b>' . get_lang( |
|
137 | + $html .= '<tr><td width="15%"><b>'.get_lang( |
|
138 | 138 | 'OriginCoursesFromSession' |
139 | - ) . ':</b></td>'; |
|
140 | - $html .= '<td width="10%" align="left">' . api_get_session_name( |
|
139 | + ).':</b></td>'; |
|
140 | + $html .= '<td width="10%" align="left">'.api_get_session_name( |
|
141 | 141 | $sessionId |
142 | - ) . '</td>'; |
|
142 | + ).'</td>'; |
|
143 | 143 | $html .= '<td width="50%">'; |
144 | - $html .= "{$courseInfo['title']} ({$courseInfo['code']})" . '</td></tr>'; |
|
144 | + $html .= "{$courseInfo['title']} ({$courseInfo['code']})".'</td></tr>'; |
|
145 | 145 | |
146 | 146 | // Destination |
147 | - $html .= '<tr><td width="15%"><b>' . get_lang( |
|
147 | + $html .= '<tr><td width="15%"><b>'.get_lang( |
|
148 | 148 | 'DestinationCoursesFromSession' |
149 | - ) . ':</b></td>'; |
|
149 | + ).':</b></td>'; |
|
150 | 150 | $html .= '<td width="10%" align="left"><div id="ajax_sessions_list_destination">'; |
151 | 151 | $html .= '<select name="sessions_list_destination" onchange="javascript: xajax_searchCourses(this.value,\'destination\');">'; |
152 | 152 | if (empty($sessions)) { |
153 | - $html .= '<option value = "0">' . get_lang( |
|
153 | + $html .= '<option value = "0">'.get_lang( |
|
154 | 154 | 'ThereIsNotStillASession' |
155 | - ) . '</option>'; |
|
155 | + ).'</option>'; |
|
156 | 156 | } else { |
157 | - $html .= '<option value = "0">' . get_lang( |
|
157 | + $html .= '<option value = "0">'.get_lang( |
|
158 | 158 | 'SelectASession' |
159 | - ) . '</option>'; |
|
159 | + ).'</option>'; |
|
160 | 160 | foreach ($sessions as $session) { |
161 | 161 | if ($session['id'] == $sessionId) { |
162 | 162 | continue; |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | continue; |
167 | 167 | } |
168 | 168 | |
169 | - $html .= '<option value="' . $session['id'] . '">' . $session['name'] . '</option>'; |
|
169 | + $html .= '<option value="'.$session['id'].'">'.$session['name'].'</option>'; |
|
170 | 170 | } |
171 | 171 | } |
172 | 172 | |
@@ -178,17 +178,17 @@ discard block |
||
178 | 178 | $html .= '</tr></table>'; |
179 | 179 | |
180 | 180 | $html .= "<fieldset>"; |
181 | - $html .= '<legend>' . get_lang('TypeOfCopy') . ' <small>(' . get_lang('CopyOnlySessionItems') . ')</small></legend>'; |
|
181 | + $html .= '<legend>'.get_lang('TypeOfCopy').' <small>('.get_lang('CopyOnlySessionItems').')</small></legend>'; |
|
182 | 182 | $html .= '<label class="radio"><input type="radio" id="copy_option_1" name="copy_option" value="full_copy" checked="checked"/>'; |
183 | - $html .= get_lang('FullCopy') . '</label>'; |
|
183 | + $html .= get_lang('FullCopy').'</label>'; |
|
184 | 184 | $html .= '<label class="radio"><input type="radio" id="copy_option_2" name="copy_option" value="select_items"/>'; |
185 | - $html .= ' ' . get_lang('LetMeSelectItems') . '</label><br/>'; |
|
185 | + $html .= ' '.get_lang('LetMeSelectItems').'</label><br/>'; |
|
186 | 186 | |
187 | 187 | $html .= "</fieldset>"; |
188 | 188 | |
189 | - $html .= '<button class="save" type="submit" onclick="javascript:if(!confirm(' . "'" . addslashes( |
|
189 | + $html .= '<button class="save" type="submit" onclick="javascript:if(!confirm('."'".addslashes( |
|
190 | 190 | api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES) |
191 | - ) . "'" . ')) return false;">' . get_lang('CopyCourse') . '</button>'; |
|
191 | + )."'".')) return false;">'.get_lang('CopyCourse').'</button>'; |
|
192 | 192 | $html .= '</form>'; |
193 | 193 | echo $html; |
194 | 194 | } |
@@ -214,10 +214,10 @@ discard block |
||
214 | 214 | |
215 | 215 | $courseTitle = str_replace("'", "\'", $course['title']); |
216 | 216 | |
217 | - $return .= '<option value="' . $course['code'] . '" title="' . @htmlspecialchars( |
|
218 | - $course['title'] . ' (' . $course['visual_code'] . ')', ENT_QUOTES, api_get_system_encoding() |
|
219 | - ) . '">' . |
|
220 | - $course['title'] . ' (' . $course['visual_code'] . ')</option>'; |
|
217 | + $return .= '<option value="'.$course['code'].'" title="'.@htmlspecialchars( |
|
218 | + $course['title'].' ('.$course['visual_code'].')', ENT_QUOTES, api_get_system_encoding() |
|
219 | + ).'">'. |
|
220 | + $course['title'].' ('.$course['visual_code'].')</option>'; |
|
221 | 221 | } |
222 | 222 | $return .= '</select>'; |
223 | 223 | $_SESSION['course_list_destination'] = $course_list_destination; |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | /* HTML head extra */ |
236 | 236 | |
237 | 237 | $htmlHeadXtra[] = $xajax->getJavascript( |
238 | - api_get_path(WEB_LIBRARY_PATH) . 'xajax/' |
|
238 | + api_get_path(WEB_LIBRARY_PATH).'xajax/' |
|
239 | 239 | ); |
240 | 240 | $htmlHeadXtra[] = '<script> |
241 | 241 | function checkSelected(id_select,id_radio,id_title,id_destination) { |
@@ -380,7 +380,7 @@ discard block |
||
380 | 380 | |
381 | 381 | CourseSelectForm :: display_form($course, $hiddenFields, true); |
382 | 382 | |
383 | - echo '<div style="float:right"><a href="javascript:window.history.go(-1);">' . |
|
383 | + echo '<div style="float:right"><a href="javascript:window.history.go(-1);">'. |
|
384 | 384 | Display::return_icon( |
385 | 385 | 'back.png', |
386 | 386 | get_lang('Back').' '.get_lang('To').' '.get_lang( |
@@ -388,7 +388,7 @@ discard block |
||
388 | 388 | ), |
389 | 389 | array('style' => 'vertical-align:middle') |
390 | 390 | ). |
391 | - get_lang('Back') . '</a></div>'; |
|
391 | + get_lang('Back').'</a></div>'; |
|
392 | 392 | } else { |
393 | 393 | Display::display_error_message( |
394 | 394 | get_lang('You must select a course from original session and select a destination session') |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | $form = new FormValidator( |
101 | 101 | 'survey', |
102 | 102 | 'post', |
103 | - api_get_self().'?action='.Security::remove_XSS($_GET['action']).'&survey_id='.$survey_id. '&' . api_get_cidreq() |
|
103 | + api_get_self().'?action='.Security::remove_XSS($_GET['action']).'&survey_id='.$survey_id.'&'.api_get_cidreq() |
|
104 | 104 | ); |
105 | 105 | |
106 | 106 | $form->addElement('header', $tool_name); |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | foreach ($field_list as $key => & $field) { |
217 | 217 | if ($field['visibility'] == 1) { |
218 | 218 | $form->addElement('checkbox', 'profile_'.$key, ' ', ' '.$field['name']); |
219 | - $input_name_list.= 'profile_'.$key.','; |
|
219 | + $input_name_list .= 'profile_'.$key.','; |
|
220 | 220 | } |
221 | 221 | } |
222 | 222 |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | |
37 | 37 | /** |
38 | 38 | * |
39 | - * @return StaticPlugin |
|
39 | + * @return BuyCoursesPlugin |
|
40 | 40 | */ |
41 | 41 | static function create() |
42 | 42 | { |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | /** |
253 | 253 | * Save a transfer account information |
254 | 254 | * @param array $params The transfer account |
255 | - * @return int Rows affected. Otherwise return false |
|
255 | + * @return false|string Rows affected. Otherwise return false |
|
256 | 256 | */ |
257 | 257 | public function saveTransferAccount($params) |
258 | 258 | { |
@@ -664,7 +664,7 @@ discard block |
||
664 | 664 | /** |
665 | 665 | * Get session info |
666 | 666 | * @param array $sessionId The session ID |
667 | - * @return array |
|
667 | + * @return Session |
|
668 | 668 | */ |
669 | 669 | public function getSessionInfo($sessionId) |
670 | 670 | { |
@@ -757,7 +757,7 @@ discard block |
||
757 | 757 | * Register a sale |
758 | 758 | * @param int $itemId The product ID |
759 | 759 | * @param int $paymentType The payment type |
760 | - * @return boolean |
|
760 | + * @return false|string |
|
761 | 761 | */ |
762 | 762 | public function registerSale($itemId, $paymentType) |
763 | 763 | { |
@@ -939,7 +939,7 @@ discard block |
||
939 | 939 | |
940 | 940 | /** |
941 | 941 | * Get payment types |
942 | - * @return array |
|
942 | + * @return string[] |
|
943 | 943 | */ |
944 | 944 | public function getPaymentTypes() |
945 | 945 | { |
@@ -977,7 +977,7 @@ discard block |
||
977 | 977 | |
978 | 978 | /** |
979 | 979 | * Get the statuses for sales |
980 | - * @return array |
|
980 | + * @return string[] |
|
981 | 981 | */ |
982 | 982 | public function getSaleStatuses() |
983 | 983 | { |
@@ -990,7 +990,7 @@ discard block |
||
990 | 990 | |
991 | 991 | /** |
992 | 992 | * Get the statuses for Payouts |
993 | - * @return array |
|
993 | + * @return string[] |
|
994 | 994 | */ |
995 | 995 | public function getPayoutStatuses() |
996 | 996 | { |
@@ -1003,7 +1003,7 @@ discard block |
||
1003 | 1003 | |
1004 | 1004 | /** |
1005 | 1005 | * Get the list of product types |
1006 | - * @return array |
|
1006 | + * @return string[] |
|
1007 | 1007 | */ |
1008 | 1008 | public function getProductTypes() |
1009 | 1009 | { |
@@ -1384,7 +1384,7 @@ discard block |
||
1384 | 1384 | /** |
1385 | 1385 | * Register a item |
1386 | 1386 | * @param array $itemData The item data |
1387 | - * @return int The item ID. Otherwise return false |
|
1387 | + * @return false|string The item ID. Otherwise return false |
|
1388 | 1388 | */ |
1389 | 1389 | public function registerItem(array $itemData) |
1390 | 1390 | { |
@@ -1542,7 +1542,7 @@ discard block |
||
1542 | 1542 | /** |
1543 | 1543 | * Verify if the beneficiary have a paypal account |
1544 | 1544 | * @param int $userId |
1545 | - * @return true if the user have a paypal account, false if not |
|
1545 | + * @return boolean if the user have a paypal account, false if not |
|
1546 | 1546 | */ |
1547 | 1547 | public function verifyPaypalAccountByBeneficiary($userId) |
1548 | 1548 | { |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | return false; |
92 | 92 | } |
93 | 93 | |
94 | - require_once api_get_path(SYS_PLUGIN_PATH) . 'buycourses/database.php'; |
|
94 | + require_once api_get_path(SYS_PLUGIN_PATH).'buycourses/database.php'; |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | /** |
@@ -135,10 +135,10 @@ discard block |
||
135 | 135 | $item = $this->getItemByProduct(intval($productId), $productType); |
136 | 136 | $return['html'] = '<div class="buycourses-price">'; |
137 | 137 | if ($item) { |
138 | - $return['html'] .= '<span class="label label-primary"><b>'. $item['iso_code'] .' ' . $item['price'] . '</b></span>'; |
|
138 | + $return['html'] .= '<span class="label label-primary"><b>'.$item['iso_code'].' '.$item['price'].'</b></span>'; |
|
139 | 139 | $return['verificator'] = true; |
140 | 140 | } else { |
141 | - $return['html'] .= '<span class="label label-primary"><b>'. $this->get_lang('Free'). '</b></span>'; |
|
141 | + $return['html'] .= '<span class="label label-primary"><b>'.$this->get_lang('Free').'</b></span>'; |
|
142 | 142 | $return['verificator'] = false; |
143 | 143 | } |
144 | 144 | $return['html'] .= '</div>'; |
@@ -156,15 +156,15 @@ discard block |
||
156 | 156 | * @return string $html |
157 | 157 | */ |
158 | 158 | public function returnBuyCourseButton($productId, $productType) { |
159 | - $url = api_get_path(WEB_PLUGIN_PATH) . |
|
160 | - 'buycourses/src/process.php?i=' . |
|
161 | - intval($productId) . |
|
162 | - '&t=' . |
|
159 | + $url = api_get_path(WEB_PLUGIN_PATH). |
|
160 | + 'buycourses/src/process.php?i='. |
|
161 | + intval($productId). |
|
162 | + '&t='. |
|
163 | 163 | $productType |
164 | 164 | ; |
165 | 165 | |
166 | - $html = ' <a class="btn btn-success btn-sm" title="' . $this->get_lang('Buy') . '" href="' . $url . '">' . |
|
167 | - Display::returnFontAwesomeIcon('fa fa-shopping-cart') . '</a>'; |
|
166 | + $html = ' <a class="btn btn-success btn-sm" title="'.$this->get_lang('Buy').'" href="'.$url.'">'. |
|
167 | + Display::returnFontAwesomeIcon('fa fa-shopping-cart').'</a>'; |
|
168 | 168 | |
169 | 169 | return $html; |
170 | 170 | } |
@@ -709,7 +709,7 @@ discard block |
||
709 | 709 | ); |
710 | 710 | |
711 | 711 | if (!empty($sessionImage)) { |
712 | - $sessionInfo['image'] = api_get_path(WEB_UPLOAD_PATH) . $sessionImage['value']; |
|
712 | + $sessionInfo['image'] = api_get_path(WEB_UPLOAD_PATH).$sessionImage['value']; |
|
713 | 713 | } |
714 | 714 | |
715 | 715 | $sessionCourses = $session->getCourses(); |
@@ -1151,7 +1151,7 @@ discard block |
||
1151 | 1151 | |
1152 | 1152 | $str = ''; |
1153 | 1153 | |
1154 | - srand((double)microtime() * 1000000); |
|
1154 | + srand((double) microtime() * 1000000); |
|
1155 | 1155 | |
1156 | 1156 | for ($i = 0; $i < $length; $i++) { |
1157 | 1157 | $numbers = rand(0, strlen($salt) - 1); |
@@ -1498,8 +1498,8 @@ discard block |
||
1498 | 1498 | */ |
1499 | 1499 | public function getPayouts($status = self::PAYOUT_STATUS_PENDING, $payoutId = false, $userId = false) |
1500 | 1500 | { |
1501 | - $condition = ($payoutId) ? 'AND p.id = '. intval($payoutId) : ''; |
|
1502 | - $condition2 = ($userId) ? ' AND p.user_id = ' . intval($userId) : ''; |
|
1501 | + $condition = ($payoutId) ? 'AND p.id = '.intval($payoutId) : ''; |
|
1502 | + $condition2 = ($userId) ? ' AND p.user_id = '.intval($userId) : ''; |
|
1503 | 1503 | $typeResult = ($condition) ? 'first' : 'all'; |
1504 | 1504 | $payoutsTable = Database::get_main_table(BuyCoursesPlugin::TABLE_PAYPAL_PAYOUTS); |
1505 | 1505 | $saleTable = Database::get_main_table(BuyCoursesPlugin::TABLE_SALE); |
@@ -1526,14 +1526,14 @@ discard block |
||
1526 | 1526 | INNER JOIN $saleTable s ON s.id = p.sale_id |
1527 | 1527 | INNER JOIN $currencyTable c ON s.currency_id = c.id |
1528 | 1528 | LEFT JOIN $extraFieldValues efv ON p.user_id = efv.item_id |
1529 | - AND field_id = " . intval($paypalExtraField['id']) . " |
|
1529 | + AND field_id = ".intval($paypalExtraField['id'])." |
|
1530 | 1530 | "; |
1531 | 1531 | |
1532 | 1532 | $payouts = Database::select( |
1533 | 1533 | "p.* , u.firstname, u.lastname, efv.value as paypal_account, s.reference as sale_reference, s.price as item_price, c.iso_code", |
1534 | 1534 | "$payoutsTable p $innerJoins", |
1535 | 1535 | [ |
1536 | - 'where' => ['p.status = ? '.$condition . ' ' .$condition2 => $status] |
|
1536 | + 'where' => ['p.status = ? '.$condition.' '.$condition2 => $status] |
|
1537 | 1537 | ], |
1538 | 1538 | $typeResult |
1539 | 1539 | ); |
@@ -1597,7 +1597,7 @@ discard block |
||
1597 | 1597 | $platformCommission = $this->getPlatformCommission(); |
1598 | 1598 | |
1599 | 1599 | $sale = $this->getSale($saleId); |
1600 | - $teachersCommission = number_format((floatval($sale['price']) * intval($platformCommission['commission']))/100, 2); |
|
1600 | + $teachersCommission = number_format((floatval($sale['price']) * intval($platformCommission['commission'])) / 100, 2); |
|
1601 | 1601 | |
1602 | 1602 | |
1603 | 1603 | $beneficiaries = $this->getBeneficiariesBySale($saleId); |
@@ -1609,7 +1609,7 @@ discard block |
||
1609 | 1609 | 'payout_date' => getdate(), |
1610 | 1610 | 'sale_id' => intval($saleId), |
1611 | 1611 | 'user_id' => $beneficiary['user_id'], |
1612 | - 'commission' => number_format((floatval($teachersCommission) * intval($beneficiary['commissions']))/100, 2), |
|
1612 | + 'commission' => number_format((floatval($teachersCommission) * intval($beneficiary['commissions'])) / 100, 2), |
|
1613 | 1613 | 'status' => self::PAYOUT_STATUS_PENDING |
1614 | 1614 | ] |
1615 | 1615 | ); |
@@ -230,7 +230,7 @@ |
||
230 | 230 | /** |
231 | 231 | * Get id |
232 | 232 | * |
233 | - * @return boolean |
|
233 | + * @return integer |
|
234 | 234 | */ |
235 | 235 | public function getId() |
236 | 236 | { |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | }; |
78 | 78 | |
79 | 79 | var geoError = function(error) { |
80 | - alert("Geocode ' . get_lang('Error') . ': " + error); |
|
80 | + alert("Geocode ' . get_lang('Error').': " + error); |
|
81 | 81 | }; |
82 | 82 | |
83 | 83 | var geoOptions = { |
@@ -128,11 +128,11 @@ discard block |
||
128 | 128 | infowindow.open(map, marker); |
129 | 129 | }); |
130 | 130 | } else { |
131 | - alert("' . get_lang("NotFound") . '"); |
|
131 | + alert("' . get_lang("NotFound").'"); |
|
132 | 132 | } |
133 | 133 | |
134 | 134 | } else { |
135 | - alert("Geocode ' . get_lang('Error') . ': " + status); |
|
135 | + alert("Geocode ' . get_lang('Error').': " + status); |
|
136 | 136 | } |
137 | 137 | }); |
138 | 138 | } |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | if (api_get_setting('registration', 'email') != 'true') { |
183 | 183 | $form->addRule('email', get_lang('ThisFieldIsRequired'), 'required'); |
184 | 184 | } |
185 | - $form->addRule('email', sprintf(get_lang('UsernameMaxXCharacters'), (string)USERNAME_MAX_LENGTH), 'maxlength', USERNAME_MAX_LENGTH); |
|
185 | + $form->addRule('email', sprintf(get_lang('UsernameMaxXCharacters'), (string) USERNAME_MAX_LENGTH), 'maxlength', USERNAME_MAX_LENGTH); |
|
186 | 186 | $form->addRule('email', get_lang('UserTaken'), 'username_available'); |
187 | 187 | } |
188 | 188 | |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | $form->addElement('text', 'username', get_lang('UserName'), array('id' => 'username', 'size' => USERNAME_MAX_LENGTH)); |
216 | 216 | $form->applyFilter('username', 'trim'); |
217 | 217 | $form->addRule('username', get_lang('ThisFieldIsRequired'), 'required'); |
218 | - $form->addRule('username', sprintf(get_lang('UsernameMaxXCharacters'), (string)USERNAME_MAX_LENGTH), 'maxlength', USERNAME_MAX_LENGTH); |
|
218 | + $form->addRule('username', sprintf(get_lang('UsernameMaxXCharacters'), (string) USERNAME_MAX_LENGTH), 'maxlength', USERNAME_MAX_LENGTH); |
|
219 | 219 | $form->addRule('username', get_lang('UsernameWrong'), 'username'); |
220 | 220 | $form->addRule('username', get_lang('UserTaken'), 'username_available'); |
221 | 221 | } |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | if (CHECK_PASS_EASY_TO_FIND) { |
247 | 247 | $form->addRule( |
248 | 248 | 'password1', |
249 | - get_lang('PassTooEasy') . ': ' . api_generate_password(), |
|
249 | + get_lang('PassTooEasy').': '.api_generate_password(), |
|
250 | 250 | 'callback', |
251 | 251 | 'api_check_password' |
252 | 252 | ); |
@@ -276,8 +276,8 @@ discard block |
||
276 | 276 | <div class="form-group"> |
277 | 277 | <label for="geolocalization" class="col-sm-2 control-label"></label> |
278 | 278 | <div class="col-sm-8"> |
279 | - <button class="null btn btn-default " id="geolocalization" name="geolocalization" type="submit"><em class="fa fa-map-marker"></em> ' . get_lang('Geolocalization') . '</button> |
|
280 | - <button class="null btn btn-default " id="myLocation" name="myLocation" type="submit"><em class="fa fa-crosshairs"></em> ' . get_lang('MyLocation') . '</button> |
|
279 | + <button class="null btn btn-default " id="geolocalization" name="geolocalization" type="submit"><em class="fa fa-map-marker"></em> ' . get_lang('Geolocalization').'</button> |
|
280 | + <button class="null btn btn-default " id="myLocation" name="myLocation" type="submit"><em class="fa fa-crosshairs"></em> ' . get_lang('MyLocation').'</button> |
|
281 | 281 | </div> |
282 | 282 | </div> |
283 | 283 | '); |
@@ -285,7 +285,7 @@ discard block |
||
285 | 285 | $form->addHtml(' |
286 | 286 | <div class="form-group"> |
287 | 287 | <label for="map" class="col-sm-2 control-label"> |
288 | - ' . get_lang('Map') . ' |
|
288 | + ' . get_lang('Map').' |
|
289 | 289 | </label> |
290 | 290 | <div class="col-sm-8"> |
291 | 291 | <div name="map" id="map" style="width:100%; height:300px;"> |
@@ -345,7 +345,7 @@ discard block |
||
345 | 345 | ) |
346 | 346 | ); |
347 | 347 | |
348 | - $captcha_question = $form->addElement('CAPTCHA_Image', 'captcha_question', '', $options); |
|
348 | + $captcha_question = $form->addElement('CAPTCHA_Image', 'captcha_question', '', $options); |
|
349 | 349 | $form->addElement('static', null, null, get_lang('ClickOnTheImageForANewOne')); |
350 | 350 | |
351 | 351 | $form->addElement('text', 'captcha', get_lang('EnterTheLettersYouSee'), array('size' => 40)); |
@@ -486,7 +486,7 @@ discard block |
||
486 | 486 | } |
487 | 487 | } |
488 | 488 | |
489 | - $tool_name = get_lang('Registration', null, (!empty($_POST['language'])?$_POST['language']: $_user['language'])); |
|
489 | + $tool_name = get_lang('Registration', null, (!empty($_POST['language']) ? $_POST['language'] : $_user['language'])); |
|
490 | 490 | |
491 | 491 | if (api_get_setting('allow_terms_conditions') === 'true' && $user_already_registered_show_terms) { |
492 | 492 | $tool_name = get_lang('TermsAndConditions'); |
@@ -507,7 +507,7 @@ discard block |
||
507 | 507 | } |
508 | 508 | |
509 | 509 | if (file_exists($home.'register_top_'.$user_selected_language.'.html')) { |
510 | - $home_top_temp = @(string)file_get_contents($home.'register_top_'.$user_selected_language.'.html'); |
|
510 | + $home_top_temp = @(string) file_get_contents($home.'register_top_'.$user_selected_language.'.html'); |
|
511 | 511 | $open = str_replace('{rel_path}', api_get_path(REL_PATH), $home_top_temp); |
512 | 512 | $open = api_to_system_encoding($open, api_detect_encoding(strip_tags($open))); |
513 | 513 | if (!empty($open)) { |
@@ -537,7 +537,7 @@ discard block |
||
537 | 537 | if (api_get_setting('show_terms_if_profile_completed') === 'true') { |
538 | 538 | $userInfo = api_get_user_info(); |
539 | 539 | if ($userInfo) { |
540 | - if ((int)$userInfo['profile_completed'] !== 1) { |
|
540 | + if ((int) $userInfo['profile_completed'] !== 1) { |
|
541 | 541 | api_not_allowed(true); |
542 | 542 | } |
543 | 543 | } |
@@ -747,7 +747,7 @@ discard block |
||
747 | 747 | Database::query($sql); |
748 | 748 | |
749 | 749 | // 2. Send mail to all platform admin |
750 | - $emailsubject = get_lang('ApprovalForNewAccount', null, $values['language']).': '.$values['username']; |
|
750 | + $emailsubject = get_lang('ApprovalForNewAccount', null, $values['language']).': '.$values['username']; |
|
751 | 751 | $emailbody = get_lang('ApprovalForNewAccount', null, $values['language'])."\n"; |
752 | 752 | $emailbody .= get_lang('UserName', null, $values['language']).': '.$values['username']."\n"; |
753 | 753 | |
@@ -850,7 +850,7 @@ discard block |
||
850 | 850 | '<p>'. |
851 | 851 | get_lang('Dear', null, $_user['language']).' '. |
852 | 852 | stripslashes(Security::remove_XSS($recipient_name)).',<br /><br />'. |
853 | - get_lang('PersonalSettings',null,$_user['language']).".</p>"; |
|
853 | + get_lang('PersonalSettings', null, $_user['language']).".</p>"; |
|
854 | 854 | |
855 | 855 | $form_data = array( |
856 | 856 | 'button' => Display::button('next', get_lang('Next', null, $_user['language']), array('class' => 'btn btn-primary btn-large')), |
@@ -874,14 +874,14 @@ discard block |
||
874 | 874 | } |
875 | 875 | } else { |
876 | 876 | if (!empty($values['email'])) { |
877 | - $text_after_registration.= '<p>'.get_lang('MailHasBeenSent', null, $_user['language']).'.</p>'; |
|
877 | + $text_after_registration .= '<p>'.get_lang('MailHasBeenSent', null, $_user['language']).'.</p>'; |
|
878 | 878 | } |
879 | 879 | |
880 | 880 | if ($is_allowedCreateCourse) { |
881 | 881 | if ($usersCanCreateCourse) { |
882 | - $form_data['message'] = '<p>'. get_lang('NowGoCreateYourCourse', null, $_user['language']). "</p>"; |
|
882 | + $form_data['message'] = '<p>'.get_lang('NowGoCreateYourCourse', null, $_user['language'])."</p>"; |
|
883 | 883 | } |
884 | - $form_data['action'] = api_get_path(WEB_CODE_PATH).'create_course/add_course.php'; |
|
884 | + $form_data['action'] = api_get_path(WEB_CODE_PATH).'create_course/add_course.php'; |
|
885 | 885 | |
886 | 886 | if (api_get_setting('course_validation') === 'true') { |
887 | 887 | $form_data['button'] = Display::button( |
@@ -904,7 +904,7 @@ discard block |
||
904 | 904 | } else { |
905 | 905 | if (api_get_setting('allow_students_to_browse_courses') == 'true') { |
906 | 906 | $form_data['action'] = 'courses.php?action=subscribe'; |
907 | - $form_data['message'] = '<p>'. get_lang('NowGoChooseYourCourses', null, $_user['language']). ".</p>"; |
|
907 | + $form_data['message'] = '<p>'.get_lang('NowGoChooseYourCourses', null, $_user['language']).".</p>"; |
|
908 | 908 | } else { |
909 | 909 | $form_data['action'] = api_get_path(WEB_PATH).'user_portal.php'; |
910 | 910 | } |
@@ -70,8 +70,8 @@ discard block |
||
70 | 70 | |
71 | 71 | $zip_file = CourseArchiver::write_course($course); |
72 | 72 | Display::display_confirmation_message(get_lang('BackupCreated')); |
73 | - echo '<br /><a class="btn btn-primary btn-large" href="' . api_get_path(WEB_CODE_PATH) . 'course_info/download.php?archive=' . $zip_file . '&' . api_get_cidreq() . '"> |
|
74 | - ' . get_lang('Download') . '</a>'; |
|
73 | + echo '<br /><a class="btn btn-primary btn-large" href="'.api_get_path(WEB_CODE_PATH).'course_info/download.php?archive='.$zip_file.'&'.api_get_cidreq().'"> |
|
74 | + ' . get_lang('Download').'</a>'; |
|
75 | 75 | |
76 | 76 | } elseif (Security::check_token('post') && ( |
77 | 77 | isset($_POST['backup_option']) && |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | $form = new FormValidator( |
97 | 97 | 'create_backup_form', |
98 | 98 | 'post', |
99 | - api_get_self() . '?' . api_get_cidreq() |
|
99 | + api_get_self().'?'.api_get_cidreq() |
|
100 | 100 | ); |
101 | 101 | $form->addElement('header', get_lang('SelectOptionForBackup')); |
102 | 102 | $form->addElement('radio', 'backup_option', '', get_lang('CreateFullBackup'), 'full_backup'); |
@@ -3054,7 +3054,7 @@ |
||
3054 | 3054 | * @param integer $thread_qualify |
3055 | 3055 | * @param integer $qualify_time |
3056 | 3056 | * @param integer $session_id |
3057 | - * @return array optional |
|
3057 | + * @return string|null optional |
|
3058 | 3058 | * @author Isaac Flores <[email protected]>, U.N.A.S University |
3059 | 3059 | * @version October 2008, dokeos 1.8.6 |
3060 | 3060 | */ |
@@ -64,10 +64,10 @@ discard block |
||
64 | 64 | var l = $(this); |
65 | 65 | var id = l.closest("tr").attr("id"); |
66 | 66 | var filename = l.closest("tr").find(".attachFilename").html(); |
67 | - if (confirm("' . get_lang('AreYouSureToDeleteJS') . '", filename)) { |
|
67 | + if (confirm("' . get_lang('AreYouSureToDeleteJS').'", filename)) { |
|
68 | 68 | $.ajax({ |
69 | 69 | type: "POST", |
70 | - url: "'.api_get_path(WEB_AJAX_PATH) . 'forum.ajax.php?'.api_get_cidreq().'&a=delete_file&attachId=" + id +"&thread='.$threadId .'&forum='.$forumId .'", |
|
70 | + url: "'.api_get_path(WEB_AJAX_PATH).'forum.ajax.php?'.api_get_cidreq().'&a=delete_file&attachId=" + id +"&thread='.$threadId.'&forum='.$forumId.'", |
|
71 | 71 | dataType: "json", |
72 | 72 | success: function(data) { |
73 | 73 | if (data.error == false) { |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | function show_add_forumcategory_form($inputvalues = array(), $lp_id) |
181 | 181 | { |
182 | 182 | // Initialize the object. |
183 | - $form = new FormValidator('forumcategory', 'post', 'index.php?' . api_get_cidreq()); |
|
183 | + $form = new FormValidator('forumcategory', 'post', 'index.php?'.api_get_cidreq()); |
|
184 | 184 | // hidden field if from learning path |
185 | 185 | |
186 | 186 | $form->addElement('hidden', 'lp_id', $lp_id); |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | function show_add_forum_form($inputvalues = array(), $lp_id) |
231 | 231 | { |
232 | 232 | $_course = api_get_course_info(); |
233 | - $form = new FormValidator('forumcategory', 'post', 'index.php?' . api_get_cidreq()); |
|
233 | + $form = new FormValidator('forumcategory', 'post', 'index.php?'.api_get_cidreq()); |
|
234 | 234 | |
235 | 235 | // The header for the form |
236 | 236 | if (!empty($inputvalues)) { |
@@ -347,9 +347,9 @@ discard block |
||
347 | 347 | // Forum image |
348 | 348 | $form->addProgress(); |
349 | 349 | if (!empty($inputvalues['forum_image'])) { |
350 | - $baseImagePath = api_get_course_path() . '/upload/forum/images/' . $inputvalues['forum_image']; |
|
351 | - $image_path = api_get_path(WEB_COURSE_PATH) . $baseImagePath; |
|
352 | - $sysImagePath = api_get_path(SYS_COURSE_PATH) . $baseImagePath; |
|
350 | + $baseImagePath = api_get_course_path().'/upload/forum/images/'.$inputvalues['forum_image']; |
|
351 | + $image_path = api_get_path(WEB_COURSE_PATH).$baseImagePath; |
|
352 | + $sysImagePath = api_get_path(SYS_COURSE_PATH).$baseImagePath; |
|
353 | 353 | |
354 | 354 | if (file_exists($sysImagePath)) { |
355 | 355 | $show_preview_image = Display::img($image_path, null, ['class' => 'img-responsive']); |
@@ -1007,24 +1007,24 @@ discard block |
||
1007 | 1007 | $html = ''; |
1008 | 1008 | $id = Security::remove_XSS($id); |
1009 | 1009 | if ($current_visibility_status == '1') { |
1010 | - $html .= '<a href="' . api_get_self() . '?' . api_get_cidreq() . '&'; |
|
1010 | + $html .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&'; |
|
1011 | 1011 | if (is_array($additional_url_parameters)) { |
1012 | 1012 | foreach ($additional_url_parameters as $key => $value) { |
1013 | - $html .= $key . '=' . $value . '&'; |
|
1013 | + $html .= $key.'='.$value.'&'; |
|
1014 | 1014 | } |
1015 | 1015 | } |
1016 | - $html.='action=invisible&content='.$content.'&id='.$id.'">'. |
|
1016 | + $html .= 'action=invisible&content='.$content.'&id='.$id.'">'. |
|
1017 | 1017 | Display::return_icon('visible.png', get_lang('MakeInvisible'), array(), ICON_SIZE_SMALL).'</a>'; |
1018 | 1018 | } |
1019 | 1019 | if ($current_visibility_status == '0') { |
1020 | - $html .= '<a href="' . api_get_self() . '?' . api_get_cidreq() . '&'; |
|
1020 | + $html .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&'; |
|
1021 | 1021 | if (is_array($additional_url_parameters)) { |
1022 | 1022 | foreach ($additional_url_parameters as $key => $value) { |
1023 | - $html .= $key . '=' . $value . '&'; |
|
1023 | + $html .= $key.'='.$value.'&'; |
|
1024 | 1024 | } |
1025 | 1025 | } |
1026 | - $html .= 'action=visible&content=' . $content . '&id=' . $id . '">' . |
|
1027 | - Display::return_icon('invisible.png', get_lang('MakeVisible'), array(), ICON_SIZE_SMALL) . '</a>'; |
|
1026 | + $html .= 'action=visible&content='.$content.'&id='.$id.'">'. |
|
1027 | + Display::return_icon('invisible.png', get_lang('MakeVisible'), array(), ICON_SIZE_SMALL).'</a>'; |
|
1028 | 1028 | } |
1029 | 1029 | return $html; |
1030 | 1030 | } |
@@ -1052,21 +1052,21 @@ discard block |
||
1052 | 1052 | $html .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&'; |
1053 | 1053 | if (is_array($additional_url_parameters)) { |
1054 | 1054 | foreach ($additional_url_parameters as $key => $value) { |
1055 | - $html .= $key . '=' . $value . '&'; |
|
1055 | + $html .= $key.'='.$value.'&'; |
|
1056 | 1056 | } |
1057 | 1057 | } |
1058 | - $html.= 'action=unlock&content='.$content.'&id='.$id.'">'. |
|
1058 | + $html .= 'action=unlock&content='.$content.'&id='.$id.'">'. |
|
1059 | 1059 | Display::return_icon('lock.png', get_lang('Unlock'), array(), ICON_SIZE_SMALL).'</a>'; |
1060 | 1060 | } |
1061 | 1061 | if ($current_lock_status == '0') { |
1062 | 1062 | $html .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&'; |
1063 | 1063 | if (is_array($additional_url_parameters)) { |
1064 | 1064 | foreach ($additional_url_parameters as $key => $value) { |
1065 | - $html .= $key . '=' . $value . '&'; |
|
1065 | + $html .= $key.'='.$value.'&'; |
|
1066 | 1066 | } |
1067 | 1067 | } |
1068 | - $html .= 'action=lock&content=' . $content . '&id=' . $id . '">' . |
|
1069 | - Display::return_icon('unlock.png', get_lang('Lock'), array(), ICON_SIZE_SMALL) . '</a>'; |
|
1068 | + $html .= 'action=lock&content='.$content.'&id='.$id.'">'. |
|
1069 | + Display::return_icon('unlock.png', get_lang('Lock'), array(), ICON_SIZE_SMALL).'</a>'; |
|
1070 | 1070 | } |
1071 | 1071 | return $html; |
1072 | 1072 | } |
@@ -1244,7 +1244,7 @@ discard block |
||
1244 | 1244 | $sort_column = 'forum_order'; |
1245 | 1245 | // We also need the forum_category of this forum. |
1246 | 1246 | $sql = "SELECT forum_category FROM $table_forums |
1247 | - WHERE c_id = $course_id AND forum_id = " . intval($id); |
|
1247 | + WHERE c_id = $course_id AND forum_id = ".intval($id); |
|
1248 | 1248 | $result = Database::query($sql); |
1249 | 1249 | $row = Database::fetch_array($result); |
1250 | 1250 | $forum_category = $row['forum_category']; |
@@ -1269,7 +1269,7 @@ discard block |
||
1269 | 1269 | forum_categories.c_id = $course_id AND |
1270 | 1270 | item_properties.c_id = $course_id AND |
1271 | 1271 | forum_categories.cat_id=item_properties.ref AND |
1272 | - item_properties.tool='" . TOOL_FORUM_CATEGORY . "' |
|
1272 | + item_properties.tool='".TOOL_FORUM_CATEGORY."' |
|
1273 | 1273 | ORDER BY forum_categories.cat_order $sort_direction"; |
1274 | 1274 | } |
1275 | 1275 | if ($content == 'forum') { |
@@ -1277,7 +1277,7 @@ discard block |
||
1277 | 1277 | FROM $table |
1278 | 1278 | WHERE |
1279 | 1279 | c_id = $course_id AND |
1280 | - forum_category='" . Database::escape_string($forum_category) . "' |
|
1280 | + forum_category='".Database::escape_string($forum_category)."' |
|
1281 | 1281 | ORDER BY forum_order $sort_direction"; |
1282 | 1282 | } |
1283 | 1283 | // Finding the items that need to be switched. |
@@ -1301,16 +1301,16 @@ discard block |
||
1301 | 1301 | // We do an extra check if we do not have illegal values. If your remove this if statment you will |
1302 | 1302 | // be able to mess with the sorting by refreshing the page over and over again. |
1303 | 1303 | if ($this_sort != '' && $next_sort != '' && $next_id != '' && $this_id != '') { |
1304 | - $sql = "UPDATE $table SET $sort_column='" . Database::escape_string($this_sort) . "' |
|
1305 | - WHERE c_id = $course_id AND $id_column='" . Database::escape_string($next_id) . "'"; |
|
1304 | + $sql = "UPDATE $table SET $sort_column='".Database::escape_string($this_sort)."' |
|
1305 | + WHERE c_id = $course_id AND $id_column='".Database::escape_string($next_id)."'"; |
|
1306 | 1306 | Database::query($sql); |
1307 | 1307 | |
1308 | - $sql = "UPDATE $table SET $sort_column='" . Database::escape_string($next_sort) . "' |
|
1309 | - WHERE c_id = $course_id AND $id_column='" . Database::escape_string($this_id) . "'"; |
|
1308 | + $sql = "UPDATE $table SET $sort_column='".Database::escape_string($next_sort)."' |
|
1309 | + WHERE c_id = $course_id AND $id_column='".Database::escape_string($this_id)."'"; |
|
1310 | 1310 | Database::query($sql); |
1311 | 1311 | } |
1312 | 1312 | |
1313 | - return get_lang(ucfirst($content) . 'Moved'); |
|
1313 | + return get_lang(ucfirst($content).'Moved'); |
|
1314 | 1314 | } |
1315 | 1315 | |
1316 | 1316 | /** |
@@ -1572,7 +1572,7 @@ discard block |
||
1572 | 1572 | INNER JOIN $table_forums forum |
1573 | 1573 | ON (forum.forum_id = item_properties.ref AND forum.c_id = item_properties.c_id) |
1574 | 1574 | WHERE |
1575 | - forum.forum_id = " . intval($id) . " AND |
|
1575 | + forum.forum_id = ".intval($id)." AND |
|
1576 | 1576 | forum.c_id = $course_id AND |
1577 | 1577 | item_properties.visibility != 2 AND |
1578 | 1578 | item_properties.tool = '".TOOL_FORUM."' |
@@ -1582,7 +1582,7 @@ discard block |
||
1582 | 1582 | $sql2 = "SELECT count(*) AS number_of_threads, forum_id |
1583 | 1583 | FROM $table_threads |
1584 | 1584 | WHERE |
1585 | - forum_id = " . intval($id) . " |
|
1585 | + forum_id = ".intval($id)." |
|
1586 | 1586 | GROUP BY forum_id"; |
1587 | 1587 | } |
1588 | 1588 | |
@@ -1810,7 +1810,7 @@ discard block |
||
1810 | 1810 | $groupCondition = ''; |
1811 | 1811 | if (!empty($groupInfo)) { |
1812 | 1812 | $groupIid = $groupInfo['iid']; |
1813 | - $groupCondition = " AND item_properties.to_group_id = '$groupIid' "; |
|
1813 | + $groupCondition = " AND item_properties.to_group_id = '$groupIid' "; |
|
1814 | 1814 | } |
1815 | 1815 | |
1816 | 1816 | $sessionCondition = api_get_session_condition($sessionId, true, false, 'item_properties.session_id'); |
@@ -2301,7 +2301,7 @@ discard block |
||
2301 | 2301 | { |
2302 | 2302 | $table_forums = Database :: get_course_table(TABLE_FORUM); |
2303 | 2303 | $table_item_property = Database :: get_course_table(TABLE_ITEM_PROPERTY); |
2304 | - $courseId = empty($courseId) ? api_get_course_int_id(): intval($courseId); |
|
2304 | + $courseId = empty($courseId) ? api_get_course_int_id() : intval($courseId); |
|
2305 | 2305 | $forum_id = intval($forum_id); |
2306 | 2306 | |
2307 | 2307 | $sql = "SELECT * |
@@ -2742,11 +2742,11 @@ discard block |
||
2742 | 2742 | $form = new FormValidator( |
2743 | 2743 | 'thread', |
2744 | 2744 | 'post', |
2745 | - api_get_self() . '?' . http_build_query([ |
|
2745 | + api_get_self().'?'.http_build_query([ |
|
2746 | 2746 | 'forum' => $myForum, |
2747 | 2747 | 'gradebook' => $myGradebook, |
2748 | 2748 | 'thread' => $myThread, |
2749 | - ]) . '&' . api_get_cidreq() |
|
2749 | + ]).'&'.api_get_cidreq() |
|
2750 | 2750 | ); |
2751 | 2751 | |
2752 | 2752 | $form->addElement('header', get_lang('EditThread')); |
@@ -2809,7 +2809,7 @@ discard block |
||
2809 | 2809 | $form->addElement('html', '</div>'); |
2810 | 2810 | |
2811 | 2811 | if (!empty($formValues)) { |
2812 | - $defaults['thread_qualify_gradebook'] = ($formValues['threadQualifyMax'] > 0 && empty($_POST)) ? 1 : 0 ; |
|
2812 | + $defaults['thread_qualify_gradebook'] = ($formValues['threadQualifyMax'] > 0 && empty($_POST)) ? 1 : 0; |
|
2813 | 2813 | $defaults['thread_title'] = prepare4display($formValues['threadTitle']); |
2814 | 2814 | $defaults['thread_sticky'] = strval(intval($formValues['threadSticky'])); |
2815 | 2815 | $defaults['thread_peer_qualify'] = intval($formValues['threadPeerQualify']); |
@@ -2877,13 +2877,13 @@ discard block |
||
2877 | 2877 | $my_post = isset($_GET['post']) ? (int) $_GET['post'] : ''; |
2878 | 2878 | $my_gradebook = isset($_GET['gradebook']) ? Security::remove_XSS($_GET['gradebook']) : ''; |
2879 | 2879 | |
2880 | - $url = api_get_self() . '?' . http_build_query([ |
|
2880 | + $url = api_get_self().'?'.http_build_query([ |
|
2881 | 2881 | 'action' => $action, |
2882 | 2882 | 'forum' => $forumId, |
2883 | 2883 | 'gradebook' => $my_gradebook, |
2884 | 2884 | 'thread' => $myThread, |
2885 | 2885 | 'post' => $my_post |
2886 | - ]) . '&' . api_get_cidreq(); |
|
2886 | + ]).'&'.api_get_cidreq(); |
|
2887 | 2887 | |
2888 | 2888 | $form = new FormValidator( |
2889 | 2889 | 'thread', |
@@ -3180,7 +3180,7 @@ discard block |
||
3180 | 3180 | |
3181 | 3181 | if ($row[0] == 0) { |
3182 | 3182 | $sql = "INSERT INTO $table_threads_qualify (c_id, user_id, thread_id,qualify,qualify_user_id,qualify_time,session_id) |
3183 | - VALUES (".$course_id.", '".$user_id."','".$thread_id."',".(float)$thread_qualify.", '".$currentUserId."','".$qualify_time."','".$session_id."')"; |
|
3183 | + VALUES (".$course_id.", '".$user_id."','".$thread_id."',".(float) $thread_qualify.", '".$currentUserId."','".$qualify_time."','".$session_id."')"; |
|
3184 | 3184 | Database::query($sql); |
3185 | 3185 | |
3186 | 3186 | $insertId = Database::insert_id(); |
@@ -4772,9 +4772,9 @@ discard block |
||
4772 | 4772 | continue; |
4773 | 4773 | } |
4774 | 4774 | |
4775 | - $course_dir = $_course['path'] . '/upload/forum'; |
|
4775 | + $course_dir = $_course['path'].'/upload/forum'; |
|
4776 | 4776 | $sys_course_path = api_get_path(SYS_COURSE_PATH); |
4777 | - $updir = $sys_course_path . $course_dir; |
|
4777 | + $updir = $sys_course_path.$course_dir; |
|
4778 | 4778 | |
4779 | 4779 | // Try to add an extension to the file if it hasn't one. |
4780 | 4780 | $new_file_name = add_ext_on_mime( |
@@ -4791,7 +4791,7 @@ discard block |
||
4791 | 4791 | } |
4792 | 4792 | |
4793 | 4793 | $new_file_name = uniqid(''); |
4794 | - $new_path = $updir . '/' . $new_file_name; |
|
4794 | + $new_path = $updir.'/'.$new_file_name; |
|
4795 | 4795 | $result = @move_uploaded_file($attachment['tmp_name'], $new_path); |
4796 | 4796 | $safe_file_comment = Database::escape_string($file_comment); |
4797 | 4797 | $safe_file_name = Database::escape_string($file_name); |
@@ -4957,16 +4957,16 @@ discard block |
||
4957 | 4957 | $forum_table_attachment = Database::get_course_table(TABLE_FORUM_ATTACHMENT); |
4958 | 4958 | $course_id = api_get_course_int_id(); |
4959 | 4959 | |
4960 | - $cond = (!empty($id_attach)) ? " iid = " . (int) $id_attach . "" : " post_id = " . (int) $post_id . ""; |
|
4960 | + $cond = (!empty($id_attach)) ? " iid = ".(int) $id_attach."" : " post_id = ".(int) $post_id.""; |
|
4961 | 4961 | $sql = "SELECT path FROM $forum_table_attachment WHERE c_id = $course_id AND $cond"; |
4962 | 4962 | $res = Database::query($sql); |
4963 | 4963 | $row = Database::fetch_array($res); |
4964 | 4964 | |
4965 | - $course_dir = $_course['path'] . '/upload/forum'; |
|
4965 | + $course_dir = $_course['path'].'/upload/forum'; |
|
4966 | 4966 | $sys_course_path = api_get_path(SYS_COURSE_PATH); |
4967 | - $updir = $sys_course_path . $course_dir; |
|
4967 | + $updir = $sys_course_path.$course_dir; |
|
4968 | 4968 | $my_path = isset($row['path']) ? $row['path'] : null; |
4969 | - $file = $updir . '/' . $my_path; |
|
4969 | + $file = $updir.'/'.$my_path; |
|
4970 | 4970 | if (Security::check_abs_path($file, $updir)) { |
4971 | 4971 | @unlink($file); |
4972 | 4972 | } |
@@ -5520,37 +5520,37 @@ discard block |
||
5520 | 5520 | $post_list = get_thread_user_post_limit($course_code, $thread['thread_id'], $user_id, 1); |
5521 | 5521 | $post_counter = count($post_list); |
5522 | 5522 | if (is_array($post_list) && count($post_list) > 0) { |
5523 | - $hand_forums.= '<div id="social-thread">'; |
|
5524 | - $hand_forums.= Display::return_icon('thread.png', get_lang('Thread'), '', ICON_SIZE_MEDIUM); |
|
5525 | - $hand_forums.= ' '.Security::remove_XSS($thread['thread_title'], STUDENT); |
|
5526 | - $hand_forums.= '</div>'; |
|
5523 | + $hand_forums .= '<div id="social-thread">'; |
|
5524 | + $hand_forums .= Display::return_icon('thread.png', get_lang('Thread'), '', ICON_SIZE_MEDIUM); |
|
5525 | + $hand_forums .= ' '.Security::remove_XSS($thread['thread_title'], STUDENT); |
|
5526 | + $hand_forums .= '</div>'; |
|
5527 | 5527 | |
5528 | 5528 | foreach ($post_list as $posts) { |
5529 | - $hand_forums.= '<div id="social-post">'; |
|
5530 | - $hand_forums.= '<strong>'.Security::remove_XSS($posts['post_title'], STUDENT).'</strong>'; |
|
5531 | - $hand_forums.= '<br / >'; |
|
5532 | - $hand_forums.= Security::remove_XSS($posts['post_text'], STUDENT); |
|
5533 | - $hand_forums.= '</div>'; |
|
5534 | - $hand_forums.= '<br / >'; |
|
5529 | + $hand_forums .= '<div id="social-post">'; |
|
5530 | + $hand_forums .= '<strong>'.Security::remove_XSS($posts['post_title'], STUDENT).'</strong>'; |
|
5531 | + $hand_forums .= '<br / >'; |
|
5532 | + $hand_forums .= Security::remove_XSS($posts['post_text'], STUDENT); |
|
5533 | + $hand_forums .= '</div>'; |
|
5534 | + $hand_forums .= '<br / >'; |
|
5535 | 5535 | } |
5536 | 5536 | } |
5537 | 5537 | } |
5538 | 5538 | $i++; |
5539 | 5539 | } |
5540 | - $forum_results .='<div id="social-forum">'; |
|
5541 | - $forum_results .='<div class="clear"></div><br />'; |
|
5542 | - $forum_results .='<div id="social-forum-title">'. |
|
5540 | + $forum_results .= '<div id="social-forum">'; |
|
5541 | + $forum_results .= '<div class="clear"></div><br />'; |
|
5542 | + $forum_results .= '<div id="social-forum-title">'. |
|
5543 | 5543 | Display::return_icon('forum.gif', get_lang('Forum')).' '.Security::remove_XSS($forum['forum_title'], STUDENT). |
5544 | 5544 | '<div style="float:right;margin-top:-35px"> |
5545 | 5545 | <a href="../forum/viewforum.php?'.api_get_cidreq_params($course_code).'&forum='.$forum['forum_id'].' " >'. |
5546 | 5546 | get_lang('SeeForum').' |
5547 | 5547 | </a> |
5548 | 5548 | </div></div>'; |
5549 | - $forum_results .='<br / >'; |
|
5549 | + $forum_results .= '<br / >'; |
|
5550 | 5550 | if ($post_counter > 0) { |
5551 | - $forum_results .=$hand_forums; |
|
5551 | + $forum_results .= $hand_forums; |
|
5552 | 5552 | } |
5553 | - $forum_results .='</div>'; |
|
5553 | + $forum_results .= '</div>'; |
|
5554 | 5554 | }$j++; |
5555 | 5555 | } |
5556 | 5556 | } |
@@ -5691,16 +5691,16 @@ discard block |
||
5691 | 5691 | $courseId = intval($courseId); |
5692 | 5692 | if (empty($courseId)) { |
5693 | 5693 | // $courseId can be null, use api method |
5694 | - $courseId= api_get_course_int_id(); |
|
5694 | + $courseId = api_get_course_int_id(); |
|
5695 | 5695 | } |
5696 | 5696 | /* |
5697 | 5697 | * Check if Attachment ID and Course ID are greater than zero |
5698 | 5698 | * and array of field values is not empty |
5699 | 5699 | */ |
5700 | 5700 | if ($id > 0 && $courseId > 0 && !empty($array) && is_array($array)) { |
5701 | - foreach($array as $key => &$item) { |
|
5701 | + foreach ($array as $key => &$item) { |
|
5702 | 5702 | $item = Database::escape_string($item); |
5703 | - $setString .= $key . ' = "' .$item . '", '; |
|
5703 | + $setString .= $key.' = "'.$item.'", '; |
|
5704 | 5704 | } |
5705 | 5705 | // Delete last comma |
5706 | 5706 | $setString = substr($setString, 0, strlen($setString) - 2); |
@@ -5760,10 +5760,10 @@ discard block |
||
5760 | 5760 | foreach ($uploadedFiles as $k => $uploadedFile) { |
5761 | 5761 | if (!empty($uploadedFile) && in_array($uploadedFile['id'], $attachIds)) { |
5762 | 5762 | // Buil html table including an input with attachmentID |
5763 | - $fileDataContent .= '<tr id="' . $uploadedFile['id'] . '" ><td>' . $uploadedFile['name'] . '</td><td>' . $uploadedFile['size'] . '</td><td> ' . $uploadedFile['result'] . |
|
5764 | - ' </td><td> <input style="width:90%;" type="text" value="' . $uploadedFile['comment'] . '" name="file_comments[]"> </td><td>' . |
|
5765 | - $uploadedFile['delete'] . '</td>' . |
|
5766 | - '<input type="hidden" value="' . $uploadedFile['id'] .'" name="file_ids[]">' . '</tr>'; |
|
5763 | + $fileDataContent .= '<tr id="'.$uploadedFile['id'].'" ><td>'.$uploadedFile['name'].'</td><td>'.$uploadedFile['size'].'</td><td> '.$uploadedFile['result']. |
|
5764 | + ' </td><td> <input style="width:90%;" type="text" value="'.$uploadedFile['comment'].'" name="file_comments[]"> </td><td>'. |
|
5765 | + $uploadedFile['delete'].'</td>'. |
|
5766 | + '<input type="hidden" value="'.$uploadedFile['id'].'" name="file_ids[]">'.'</tr>'; |
|
5767 | 5767 | } else { |
5768 | 5768 | /* |
5769 | 5769 | * If attachment data is empty, then delete it from $_SESSION |
@@ -5776,7 +5776,7 @@ discard block |
||
5776 | 5776 | $style = empty($fileDataContent) ? 'display: none;' : ''; |
5777 | 5777 | // Forum attachment Ajax table |
5778 | 5778 | $fileData = ' |
5779 | - <div class="control-group " style="'. $style . '"> |
|
5779 | + <div class="control-group " style="'. $style.'"> |
|
5780 | 5780 | <label class="control-label">'.get_lang('AttachmentList').'</label> |
5781 | 5781 | <div class="controls"> |
5782 | 5782 | <table id="attachmentFileList" class="files data_table span10"> |
@@ -5848,7 +5848,7 @@ discard block |
||
5848 | 5848 | // name contains an URL to download attachment file and its filename |
5849 | 5849 | $json['name'] = Display::url( |
5850 | 5850 | api_htmlentities($row['filename']), |
5851 | - api_get_path(WEB_CODE_PATH) . 'forum/download.php?file='.$row['path'].'&'.api_get_cidreq(), |
|
5851 | + api_get_path(WEB_CODE_PATH).'forum/download.php?file='.$row['path'].'&'.api_get_cidreq(), |
|
5852 | 5852 | array('target'=>'_blank', 'class' => 'attachFilename') |
5853 | 5853 | ); |
5854 | 5854 | $json['id'] = $row['iid']; |
@@ -5859,9 +5859,9 @@ discard block |
||
5859 | 5859 | if (!empty($row) && is_array($row)) { |
5860 | 5860 | // Set result as success and bring delete URL |
5861 | 5861 | $json['result'] = Display::return_icon('accept.png', get_lang('Uploaded')); |
5862 | - $url = api_get_path(WEB_CODE_PATH) . 'forum/viewthread.php?' . api_get_cidreq() . '&action=delete_attach&forum=' . $forumId . '&thread=' . $threadId.'&id_attach=' . $row['iid']; |
|
5862 | + $url = api_get_path(WEB_CODE_PATH).'forum/viewthread.php?'.api_get_cidreq().'&action=delete_attach&forum='.$forumId.'&thread='.$threadId.'&id_attach='.$row['iid']; |
|
5863 | 5863 | $json['delete'] = Display::url( |
5864 | - Display::return_icon('delete.png',get_lang('Delete'), array(), ICON_SIZE_SMALL), |
|
5864 | + Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL), |
|
5865 | 5865 | $url, |
5866 | 5866 | array('class' => 'deleteLink') |
5867 | 5867 | ); |
@@ -5950,7 +5950,7 @@ discard block |
||
5950 | 5950 | WHERE c_id = $courseId AND post_id = $postId"; |
5951 | 5951 | $result = Database::query($sql); |
5952 | 5952 | if ($result !== false && Database::num_rows($result) > 0) { |
5953 | - while ($row = Database::fetch_array($result,'ASSOC')) { |
|
5953 | + while ($row = Database::fetch_array($result, 'ASSOC')) { |
|
5954 | 5954 | $array[] = $row['id']; |
5955 | 5955 | } |
5956 | 5956 | } |
@@ -29,11 +29,11 @@ |
||
29 | 29 | krsort($langs, SORT_NUMERIC); |
30 | 30 | // Choosing the best match |
31 | 31 | foreach($langs as $weight => $codes) { |
32 | - foreach ($codes as $code) { |
|
33 | - if (in_array($code, $available_langs)) { |
|
34 | - return $code; |
|
35 | - } |
|
36 | - } |
|
32 | + foreach ($codes as $code) { |
|
33 | + if (in_array($code, $available_langs)) { |
|
34 | + return $code; |
|
35 | + } |
|
36 | + } |
|
37 | 37 | } |
38 | 38 | // No match |
39 | 39 | return null; |
@@ -28,7 +28,7 @@ |
||
28 | 28 | } |
29 | 29 | krsort($langs, SORT_NUMERIC); |
30 | 30 | // Choosing the best match |
31 | - foreach($langs as $weight => $codes) { |
|
31 | + foreach ($langs as $weight => $codes) { |
|
32 | 32 | foreach ($codes as $code) { |
33 | 33 | if (in_array($code, $available_langs)) { |
34 | 34 | return $code; |