MDL-49006 admin: activity descriptions shouldn't be required by default
[moodle.git] / mod / url / settings.php
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.
14 //
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
20  *
21  * @package    mod_url
22  * @copyright  2009 Petr Skoda  {@link http://skodak.org}
23  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
24  */
26 defined('MOODLE_INTERNAL') || die;
28 if ($ADMIN->fulltree) {
29     require_once("$CFG->libdir/resourcelib.php");
31     $displayoptions = resourcelib_get_displayoptions(array(RESOURCELIB_DISPLAY_AUTO,
32                                                            RESOURCELIB_DISPLAY_EMBED,
33                                                            RESOURCELIB_DISPLAY_FRAME,
34                                                            RESOURCELIB_DISPLAY_OPEN,
35                                                            RESOURCELIB_DISPLAY_NEW,
36                                                            RESOURCELIB_DISPLAY_POPUP,
37                                                           ));
38     $defaultdisplayoptions = array(RESOURCELIB_DISPLAY_AUTO,
39                                    RESOURCELIB_DISPLAY_EMBED,
40                                    RESOURCELIB_DISPLAY_OPEN,
41                                    RESOURCELIB_DISPLAY_POPUP,
42                                   );
44     //--- general settings -----------------------------------------------------------------------------------
45     $settings->add(new admin_setting_configtext('url/framesize',
46         get_string('framesize', 'url'), get_string('configframesize', 'url'), 130, PARAM_INT));
47     $settings->add(new admin_setting_configcheckbox('url/requiremodintro',
48         get_string('requiremodintro', 'admin'), get_string('configrequiremodintro', 'admin'), 0));
49     $settings->add(new admin_setting_configpasswordunmask('url/secretphrase', get_string('password'),
50         get_string('configsecretphrase', 'url'), ''));
51     $settings->add(new admin_setting_configcheckbox('url/rolesinparams',
52         get_string('rolesinparams', 'url'), get_string('configrolesinparams', 'url'), false));
53     $settings->add(new admin_setting_configmultiselect('url/displayoptions',
54         get_string('displayoptions', 'url'), get_string('configdisplayoptions', 'url'),
55         $defaultdisplayoptions, $displayoptions));
57     //--- modedit defaults -----------------------------------------------------------------------------------
58     $settings->add(new admin_setting_heading('urlmodeditdefaults', get_string('modeditdefaults', 'admin'), get_string('condifmodeditdefaults', 'admin')));
60     $settings->add(new admin_setting_configcheckbox('url/printintro',
61         get_string('printintro', 'url'), get_string('printintroexplain', 'url'), 1));
62     $settings->add(new admin_setting_configselect('url/display',
63         get_string('displayselect', 'url'), get_string('displayselectexplain', 'url'), RESOURCELIB_DISPLAY_AUTO, $displayoptions));
64     $settings->add(new admin_setting_configtext('url/popupwidth',
65         get_string('popupwidth', 'url'), get_string('popupwidthexplain', 'url'), 620, PARAM_INT, 7));
66     $settings->add(new admin_setting_configtext('url/popupheight',
67         get_string('popupheight', 'url'), get_string('popupheightexplain', 'url'), 450, PARAM_INT, 7));
68 }