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 );
0 commit comments