1 |
efrain |
1 |
<?php
|
|
|
2 |
// This file is part of Moodle - http://moodle.org/
|
|
|
3 |
//
|
|
|
4 |
// Moodle is free software: you can redistribute it and/or modify
|
|
|
5 |
// it under the terms of the GNU General Public License as published by
|
|
|
6 |
// the Free Software Foundation, either version 3 of the License, or
|
|
|
7 |
// (at your option) any later version.
|
|
|
8 |
//
|
|
|
9 |
// Moodle is distributed in the hope that it will be useful,
|
|
|
10 |
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
11 |
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
12 |
// GNU General Public License for more details.
|
|
|
13 |
//
|
|
|
14 |
// You should have received a copy of the GNU General Public License
|
|
|
15 |
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
|
|
16 |
|
|
|
17 |
/**
|
|
|
18 |
* A login page layout for the space theme.
|
|
|
19 |
*
|
|
|
20 |
* @package theme_monocolor
|
|
|
21 |
* @copyright 2022 - 2023 Marcin Czaja (https://rosea.io)
|
|
|
22 |
* @license Commercial https://themeforest.net/licenses
|
|
|
23 |
*/
|
|
|
24 |
|
|
|
25 |
defined('MOODLE_INTERNAL') || die();
|
|
|
26 |
|
|
|
27 |
$siteurl = $CFG->wwwroot;
|
|
|
28 |
|
|
|
29 |
$loginlayout = theme_monocolor_get_setting('setloginlayout');
|
|
|
30 |
|
|
|
31 |
$loginlayout1 = false;
|
|
|
32 |
$extraclasses[] = 'rui-login-page';
|
|
|
33 |
|
|
|
34 |
$loginlayout = theme_monocolor_get_setting('setloginlayout');
|
|
|
35 |
if ($loginlayout == 1) {
|
|
|
36 |
$extraclasses[] = 'rui-login-layout-1';
|
|
|
37 |
$loginlayout1 = true;
|
|
|
38 |
}
|
|
|
39 |
if ($loginlayout == 2) {
|
|
|
40 |
$extraclasses[] = 'rui-login-layout-2';
|
|
|
41 |
}
|
|
|
42 |
if ($loginlayout == 3) {
|
|
|
43 |
$extraclasses[] = 'rui-login-layout-3';
|
|
|
44 |
}
|
|
|
45 |
if ($loginlayout == 4) {
|
|
|
46 |
$extraclasses[] = 'rui-login-layout-4';
|
|
|
47 |
}
|
|
|
48 |
if ($loginlayout == 5) {
|
|
|
49 |
$extraclasses[] = 'rui-login-layout-5';
|
|
|
50 |
}
|
|
|
51 |
|
|
|
52 |
if (theme_monocolor_get_setting('darkmodefirst') == '1') {
|
|
|
53 |
$extraclasses[] = 'theme-dark';
|
|
|
54 |
$darkmodetheme = false;
|
|
|
55 |
$darkmodeon = true;
|
|
|
56 |
}
|
|
|
57 |
|
|
|
58 |
$bodyattributes = $OUTPUT->body_attributes($extraclasses);
|
|
|
59 |
|
|
|
60 |
$templatecontext = [
|
|
|
61 |
'sitename' => format_string($SITE->shortname, true, ['context' => context_course::instance(SITEID), "escape" => false]),
|
|
|
62 |
'output' => $OUTPUT,
|
|
|
63 |
'bodyattributes' => $bodyattributes,
|
|
|
64 |
'siteurl' => $siteurl,
|
|
|
65 |
'loginlayout1' => $loginlayout1
|
|
|
66 |
];
|
|
|
67 |
|
|
|
68 |
$themesettings = new \theme_monocolor\util\theme_settings();
|
|
|
69 |
$templatecontext = array_merge($templatecontext, $themesettings->global_settings());
|
|
|
70 |
|
|
|
71 |
echo $OUTPUT->render_from_template('theme_monocolor/tmpl-login', $templatecontext);
|