Skip to content

Commit 9b7abf6

Browse files
author
Rafael Becerra
committed
INT-17917: New login settings added for Snap
1 parent 178c627 commit 9b7abf6

File tree

4 files changed

+56
-33
lines changed

4 files changed

+56
-33
lines changed

lang/en/theme_snap.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,3 +408,4 @@
408408
$string['courselimitstrwarning'] = 'If more than {$a} courses are listed progress bar will not be displayed';
409409
$string['tilesformatcoursehomealttext'] = 'Course home';
410410
$string['editmodetiles'] = 'Edit content';
411+
$string['loginsetting'] = 'Login page';

settings.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,5 @@
4040
require('settings/categories_color_settings.php');
4141
require('settings/profile_based_branding.php');
4242
require('settings/snap_hvp_settings.php');
43-
}
43+
require('settings/login_settings.php');
44+
}

settings/login_settings.php

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
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+
defined('MOODLE_INTERNAL') || die;// Main settings.
18+
19+
$snapsettings = new admin_settingpage('themesnaplogin', get_string('loginsetting', 'theme_snap'));
20+
21+
// Alternative login Settings.
22+
$name = 'theme_snap/alternativeloginoptionsheading';
23+
$title = new lang_string('alternativeloginoptions', 'theme_snap');
24+
$description = '';
25+
$setting = new admin_setting_heading($name, $title, $description);
26+
$snapsettings->add($setting);
27+
28+
// Enable login options display.
29+
$name = 'theme_snap/enabledlogin';
30+
$title = new lang_string('enabledlogin', 'theme_snap');
31+
$description = new lang_string('enabledlogindesc', 'theme_snap');
32+
$default = '0';
33+
$enabledloginchoices = [
34+
\theme_snap\output\core_renderer::ENABLED_LOGIN_BOTH => new lang_string('bothlogin', 'theme_snap'),
35+
\theme_snap\output\core_renderer::ENABLED_LOGIN_MOODLE => new lang_string('moodlelogin', 'theme_snap'),
36+
\theme_snap\output\core_renderer::ENABLED_LOGIN_ALTERNATIVE => new lang_string('alternativelogin', 'theme_snap')
37+
];
38+
$setting = new admin_setting_configselect($name, $title, $description, $default, $enabledloginchoices);
39+
$snapsettings->add($setting);
40+
41+
// Enabled login options order.
42+
$name = 'theme_snap/enabledloginorder';
43+
$title = new lang_string('enabledloginorder', 'theme_snap');
44+
$description = new lang_string('enabledloginorderdesc', 'theme_snap');
45+
$default = '0';
46+
$enabledloginchoices = [
47+
\theme_snap\output\core_renderer::ORDER_LOGIN_MOODLE_FIRST => new lang_string('moodleloginfirst', 'theme_snap'),
48+
\theme_snap\output\core_renderer::ORDER_LOGIN_ALTERNATIVE_FIRST => new lang_string('alternativeloginfirst', 'theme_snap')
49+
];
50+
$setting = new admin_setting_configselect($name, $title, $description, $default, $enabledloginchoices);
51+
$snapsettings->add($setting);
52+
53+
$settings->add($snapsettings);

settings/snap_basics.php

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -110,36 +110,4 @@
110110
$setting->set_updatedcallback('theme_reset_all_caches');
111111
$snapsettings->add($setting);
112112

113-
// Alternative login Settings.
114-
$name = 'theme_snap/alternativeloginoptionsheading';
115-
$title = new lang_string('alternativeloginoptions', 'theme_snap');
116-
$description = '';
117-
$setting = new admin_setting_heading($name, $title, $description);
118-
$snapsettings->add($setting);
119-
120-
// Enable login options display.
121-
$name = 'theme_snap/enabledlogin';
122-
$title = new lang_string('enabledlogin', 'theme_snap');
123-
$description = new lang_string('enabledlogindesc', 'theme_snap');
124-
$default = '0';
125-
$enabledloginchoices = [
126-
\theme_snap\output\core_renderer::ENABLED_LOGIN_BOTH => new lang_string('bothlogin', 'theme_snap'),
127-
\theme_snap\output\core_renderer::ENABLED_LOGIN_MOODLE => new lang_string('moodlelogin', 'theme_snap'),
128-
\theme_snap\output\core_renderer::ENABLED_LOGIN_ALTERNATIVE => new lang_string('alternativelogin', 'theme_snap')
129-
];
130-
$setting = new admin_setting_configselect($name, $title, $description, $default, $enabledloginchoices);
131-
$snapsettings->add($setting);
132-
133-
// Enabled login options order.
134-
$name = 'theme_snap/enabledloginorder';
135-
$title = new lang_string('enabledloginorder', 'theme_snap');
136-
$description = new lang_string('enabledloginorderdesc', 'theme_snap');
137-
$default = '0';
138-
$enabledloginchoices = [
139-
\theme_snap\output\core_renderer::ORDER_LOGIN_MOODLE_FIRST => new lang_string('moodleloginfirst', 'theme_snap'),
140-
\theme_snap\output\core_renderer::ORDER_LOGIN_ALTERNATIVE_FIRST => new lang_string('alternativeloginfirst', 'theme_snap')
141-
];
142-
$setting = new admin_setting_configselect($name, $title, $description, $default, $enabledloginchoices);
143-
$snapsettings->add($setting);
144-
145113
$settings->add($snapsettings);

0 commit comments

Comments
 (0)