MDL-23234 finally standardised use of settings.php across all plugins - the only partial exceptions now are report and local plugins

This commit is contained in:
Petr Skoda
2010-07-13 13:56:55 +00:00
parent bf36ee9b2b
commit dbf9e4bae3
47 changed files with 760 additions and 667 deletions
+16 -14
View File
@@ -1,18 +1,20 @@
<?php
require_once($CFG->dirroot.'/mod/assignment/lib.php');
defined('MOODLE_INTERNAL') || die;
if (isset($CFG->maxbytes)) {
$settings->add(new admin_setting_configselect('assignment_maxbytes', get_string('maximumsize', 'assignment'),
get_string('configmaxbytes', 'assignment'), 1048576, get_max_upload_sizes($CFG->maxbytes)));
if ($ADMIN->fulltree) {
require_once($CFG->dirroot.'/mod/assignment/lib.php');
if (isset($CFG->maxbytes)) {
$settings->add(new admin_setting_configselect('assignment_maxbytes', get_string('maximumsize', 'assignment'),
get_string('configmaxbytes', 'assignment'), 1048576, get_max_upload_sizes($CFG->maxbytes)));
}
$options = array(ASSIGNMENT_COUNT_WORDS => trim(get_string('numwords', '', '?')),
ASSIGNMENT_COUNT_LETTERS => trim(get_string('numletters', '', '?')));
$settings->add(new admin_setting_configselect('assignment_itemstocount', get_string('itemstocount', 'assignment'),
get_string('configitemstocount', 'assignment'), ASSIGNMENT_COUNT_WORDS, $options));
$settings->add(new admin_setting_configcheckbox('assignment_showrecentsubmissions', get_string('showrecentsubmissions', 'assignment'),
get_string('configshowrecentsubmissions', 'assignment'), 1));
}
$options = array(ASSIGNMENT_COUNT_WORDS => trim(get_string('numwords', '')),
ASSIGNMENT_COUNT_LETTERS => trim(get_string('numletters', '')));
$settings->add(new admin_setting_configselect('assignment_itemstocount', get_string('itemstocount', 'assignment'),
get_string('configitemstocount', 'assignment'), ASSIGNMENT_COUNT_WORDS, $options));
$settings->add(new admin_setting_configcheckbox('assignment_showrecentsubmissions', get_string('showrecentsubmissions', 'assignment'),
get_string('configshowrecentsubmissions', 'assignment'), 1));