MDL-35603 backup: fix coding style issues
[moodle.git] / mod / url / settings.php
blobf56967c50e82c8f5673f3fc1fa6c2c8e42a639a8
1 <?php
3 // This file is part of Moodle - http://moodle.org/
4 //
5 // Moodle is free software: you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation, either version 3 of the License, or
8 // (at your option) any later version.
9 //
10 // Moodle is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with Moodle. If not, see <http://www.gnu.org/licenses/>.
18 /**
19 * Url module admin settings and defaults
21 * @package mod
22 * @subpackage url
23 * @copyright 2009 Petr Skoda {@link http://skodak.org}
24 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
27 defined('MOODLE_INTERNAL') || die;
29 if ($ADMIN->fulltree) {
30 require_once("$CFG->libdir/resourcelib.php");
32 $displayoptions = resourcelib_get_displayoptions(array(RESOURCELIB_DISPLAY_AUTO,
33 RESOURCELIB_DISPLAY_EMBED,
34 RESOURCELIB_DISPLAY_FRAME,
35 RESOURCELIB_DISPLAY_OPEN,
36 RESOURCELIB_DISPLAY_NEW,
37 RESOURCELIB_DISPLAY_POPUP,
38 ));
39 $defaultdisplayoptions = array(RESOURCELIB_DISPLAY_AUTO,
40 RESOURCELIB_DISPLAY_EMBED,
41 RESOURCELIB_DISPLAY_OPEN,
42 RESOURCELIB_DISPLAY_POPUP,
45 //--- general settings -----------------------------------------------------------------------------------
46 $settings->add(new admin_setting_configtext('url/framesize',
47 get_string('framesize', 'url'), get_string('configframesize', 'url'), 130, PARAM_INT));
48 $settings->add(new admin_setting_configcheckbox('url/requiremodintro',
49 get_string('requiremodintro', 'admin'), get_string('configrequiremodintro', 'admin'), 1));
50 $settings->add(new admin_setting_configpasswordunmask('url/secretphrase', get_string('password'),
51 get_string('configsecretphrase', 'url'), ''));
52 $settings->add(new admin_setting_configcheckbox('url/rolesinparams',
53 get_string('rolesinparams', 'url'), get_string('configrolesinparams', 'url'), false));
54 $settings->add(new admin_setting_configmultiselect('url/displayoptions',
55 get_string('displayoptions', 'url'), get_string('configdisplayoptions', 'url'),
56 $defaultdisplayoptions, $displayoptions));
58 //--- modedit defaults -----------------------------------------------------------------------------------
59 $settings->add(new admin_setting_heading('urlmodeditdefaults', get_string('modeditdefaults', 'admin'), get_string('condifmodeditdefaults', 'admin')));
61 $settings->add(new admin_setting_configcheckbox_with_advanced('url/printheading',
62 get_string('printheading', 'url'), get_string('printheadingexplain', 'url'),
63 array('value'=>0, 'adv'=>false)));
64 $settings->add(new admin_setting_configcheckbox_with_advanced('url/printintro',
65 get_string('printintro', 'url'), get_string('printintroexplain', 'url'),
66 array('value'=>1, 'adv'=>false)));
67 $settings->add(new admin_setting_configselect_with_advanced('url/display',
68 get_string('displayselect', 'url'), get_string('displayselectexplain', 'url'),
69 array('value'=>RESOURCELIB_DISPLAY_AUTO, 'adv'=>false), $displayoptions));
70 $settings->add(new admin_setting_configtext_with_advanced('url/popupwidth',
71 get_string('popupwidth', 'url'), get_string('popupwidthexplain', 'url'),
72 array('value'=>620, 'adv'=>true), PARAM_INT, 7));
73 $settings->add(new admin_setting_configtext_with_advanced('url/popupheight',
74 get_string('popupheight', 'url'), get_string('popupheightexplain', 'url'),
75 array('value'=>450, 'adv'=>true), PARAM_INT, 7));