|
176 | 176 | FROM auth WHERE auth_default <> 0
|
177 | 177 | ORDER BY auth_default DESC, auth_id");
|
178 | 178 | foreach ($q as $l) {
|
179 |
| - if($l->auth_name == 'eclass' && $l->auth_default == 2){ |
| 179 | + if ($l->auth_name == 'eclass' && $l->auth_default == 2) { |
180 | 180 | $primary_method = 2;
|
181 |
| - }elseif($l->auth_name == 'cas' && $l->auth_default == 2){ |
| 181 | + } elseif ($l->auth_name == 'cas' && $l->auth_default == 2) { |
182 | 182 | $primary_method = 3;
|
183 |
| - }elseif($l->auth_name == 'shibboleth' && $l->auth_default == 2){ |
| 183 | + } elseif ($l->auth_name == 'shibboleth' && $l->auth_default == 2) { |
184 | 184 | $primary_method = 4;
|
185 | 185 | }
|
186 | 186 | if (in_array($l->auth_name, $extAuthMethods)) {
|
187 | 187 | $authNameDefault = '';
|
188 |
| - if(!empty($l->auth_title)){ |
| 188 | + if (!empty($l->auth_title)) { |
189 | 189 | $authNameDefault = getSerializedMessage($l->auth_title);
|
190 |
| - }else{ |
| 190 | + } else { |
191 | 191 | $authNameDefault = $langEnter;
|
192 | 192 | }
|
193 | 193 | $authLinks[] = array(
|
|
197 | 197 | 'nameAuth' => $l->auth_name,
|
198 | 198 | 'showTitle' => true,
|
199 | 199 | 'class' => 'login-option login-option-sso',
|
200 |
| - 'title' => empty($l->auth_title)? "$langLogInWith {$l->auth_name}": q(getSerializedMessage($l->auth_title)), |
201 |
| - 'html' => "<div class='form-wrapper form-edit wrapper-sso w-100'><a class='btn submitAdminBtnDefault sso-btn d-inline-flex' href='" . $urlServer . ($l->auth_name == 'cas'? 'modules/auth/cas.php': 'secure/') . "'>$authNameDefault</a></div>"); |
202 |
| - $data['auth_url'] = $urlServer . ($l->auth_name == 'cas'? 'modules/auth/cas.php': 'secure/'); |
| 200 | + 'title' => empty($l->auth_title) ? "$langLogInWith {$l->auth_name}" : q(getSerializedMessage($l->auth_title)), |
| 201 | + 'html' => "<div class='form-wrapper form-edit wrapper-sso w-100'><a class='btn submitAdminBtnDefault sso-btn d-inline-flex' href='" . $urlServer . ($l->auth_name == 'cas' ? 'modules/auth/cas.php' : 'secure/') . "'>$authNameDefault</a></div>"); |
| 202 | + $data['auth_url'] = $urlServer . ($l->auth_name == 'cas' ? 'modules/auth/cas.php' : 'secure/'); |
203 | 203 | $data['auth_title'] = $authNameDefault;
|
204 | 204 | } elseif (in_array($l->auth_name, $hybridAuthMethods)) {
|
205 | 205 | $hybridProviders[] = $l->auth_name;
|
|
215 | 215 | $hybridLinkId = count($authLinks) - 1;
|
216 | 216 | }
|
217 | 217 | } elseif (!$loginFormEnabled) {
|
218 |
| - $autofocus = count($authLinks)? '' : 'autofocus' ; |
| 218 | + $autofocus = count($authLinks) ? '' : 'autofocus'; |
219 | 219 | $loginFormEnabled = true;
|
220 | 220 | $authLinks[] = array(
|
221 | 221 | 'authId' => $l->auth_id,
|
|
224 | 224 | 'nameAuth' => $l->auth_name,
|
225 | 225 | 'showTitle' => false,
|
226 | 226 | 'class' => 'login-option',
|
227 |
| - 'title' => empty($l->auth_title)? "$langLogInWith {$l->auth_name}": q(getSerializedMessage($l->auth_title)), |
| 227 | + 'title' => empty($l->auth_title) ? "$langLogInWith {$l->auth_name}" : q(getSerializedMessage($l->auth_title)), |
228 | 228 | 'html' => " <div class='col-12'><div class='form-wrapper form-edit'><form action='$urlServer' method='post'>
|
229 | 229 | <div class='form-group text-start'>
|
230 | 230 | <label for='uname' class='form-label'>$langUsername</label>
|
|
258 | 258 | $authLinks[$hybridLinkId]['html'] .= '<br>';
|
259 | 259 | }
|
260 | 260 | $provider_link = $provider;
|
261 |
| - if($provider_link == 'live'){ |
| 261 | + if ($provider_link == 'live') { |
262 | 262 | $provider_link = 'microsoft';
|
263 | 263 | }
|
264 | 264 | $authLinks[$hybridLinkId]['html'] .=
|
|
289 | 289 |
|
290 | 290 | }
|
291 | 291 |
|
292 |
| - $data['total_collaboration_courses'] = Database::get()->querySingle("SELECT COUNT(*) AS total FROM course WHERE is_collaborative = ?d",1)->total; |
| 292 | + $data['total_collaboration_courses'] = Database::get()->querySingle("SELECT COUNT(*) AS total FROM course WHERE is_collaborative = ?d", 1)->total; |
293 | 293 |
|
294 | 294 | $data['popular_courses'] = Database::get()->queryArray('SELECT * FROM `course`
|
295 | 295 | WHERE `popular_course` = ?d AND `visible` != ?d AND lang=?s', 1, 3, $language);
|
|
303 | 303 | AND (NOW() <= `end` or `end` IS null)
|
304 | 304 | ORDER BY `order` DESC", $language);
|
305 | 305 |
|
306 |
| - $data['texts'] = Database::get()->queryArray("SELECT * FROM `homepageTexts` WHERE `lang` = ?s AND `type` = ?d ORDER BY `order` ASC",$language,1); |
307 |
| - $data['testimonials'] = Database::get()->queryArray("SELECT * FROM `homepageTexts` WHERE `lang` = ?s AND `type` = ?d ORDER BY `order` ASC",$language,2); |
| 306 | + $data['texts'] = Database::get()->queryArray("SELECT * FROM `homepageTexts` WHERE `lang` = ?s AND `type` = ?d ORDER BY `order` ASC", $language, 1); |
| 307 | + $data['testimonials'] = Database::get()->queryArray("SELECT * FROM `homepageTexts` WHERE `lang` = ?s AND `type` = ?d ORDER BY `order` ASC", $language, 2); |
308 | 308 |
|
309 | 309 | $data['auth_enabled_method'] = 0;
|
310 |
| - $active_method = Database::get()->queryArray("SELECT * FROM auth WHERE auth_default = ?d OR auth_default = ?d",1,2); |
311 |
| - if(count($active_method) > 0){ |
| 310 | + $active_method = Database::get()->queryArray("SELECT * FROM auth WHERE auth_default = ?d OR auth_default = ?d", 1, 2); |
| 311 | + if (count($active_method) > 0) { |
312 | 312 | $data['auth_enabled_method'] = 1;
|
313 | 313 | }
|
314 | 314 |
|
315 | 315 | //priorities
|
316 | 316 | $priority_order = 0;
|
317 | 317 | $priorities = Database::get()->queryArray("SELECT `title` FROM `homepagePriorities` ORDER BY `order` ASC");
|
318 |
| - if(count($priorities) > 0){ |
319 |
| - foreach($priorities as $p){ |
320 |
| - if($p->title == 'announcements'){ |
| 318 | + if (count($priorities) > 0) { |
| 319 | + foreach ($priorities as $p) { |
| 320 | + if ($p->title == 'announcements') { |
321 | 321 | $data['announcements_priority'] = $priority_order;
|
322 |
| - }elseif($p->title == 'popular_courses'){ |
| 322 | + } elseif ($p->title == 'popular_courses') { |
323 | 323 | $data['popular_courses_priority'] = $priority_order;
|
324 |
| - }elseif($p->title == 'texts'){ |
| 324 | + } elseif ($p->title == 'texts') { |
325 | 325 | $data['texts_priority'] = $priority_order;
|
326 |
| - }elseif($p->title == 'testimonials'){ |
| 326 | + } elseif ($p->title == 'testimonials') { |
327 | 327 | $data['testimonials_priority'] = $priority_order;
|
328 |
| - }elseif($p->title == 'statistics'){ |
| 328 | + } elseif ($p->title == 'statistics') { |
329 | 329 | $data['statistics_priority'] = $priority_order;
|
330 |
| - }else{ |
| 330 | + } else { |
331 | 331 | $data['open_courses_priority'] = $priority_order;
|
332 | 332 | }
|
333 | 333 | $priority_order++;
|
|
357 | 357 |
|
358 | 358 | $data['display_login_form'] = $display_login_form = get_config('display_login_form');
|
359 | 359 |
|
| 360 | + if (!get_config('dont_display_statistics')) { |
| 361 | + $digit_separator = '.'; |
| 362 | + if (isset($_GET['localize']) and $_GET['localize'] != 'el') { |
| 363 | + $digit_separator = ','; |
| 364 | + } |
| 365 | + $data['digit_separator'] = $digit_separator; |
| 366 | + } |
| 367 | + |
360 | 368 | view('home.index', $data);
|
361 | 369 | }
|
0 commit comments