Permalink
Browse files

MDL-38611 page: Reformat settings form

  • Loading branch information...
1 parent 59ef4aa commit a59bbb6e12c1c4f5be135ceb516eec90e77b025b @FMCorz FMCorz committed Mar 26, 2013
Showing with 11 additions and 21 deletions.
  1. +1 −6 mod/page/mod_form.php
  2. +10 −15 mod/page/settings.php
View
7 mod/page/mod_form.php
@@ -55,7 +55,7 @@ function definition() {
$mform->addRule('page', get_string('required'), 'required', null, 'client');
//-------------------------------------------------------
- $mform->addElement('header', 'optionssection', get_string('optionsheader', 'page'));
+ $mform->addElement('header', 'appearancehdr', get_string('appearance'));
if ($this->current->instance) {
$options = resourcelib_get_displayoptions(explode(',', $config->displayoptions), $this->current->display);
@@ -70,7 +70,6 @@ function definition() {
} else {
$mform->addElement('select', 'display', get_string('displayselect', 'page'), $options);
$mform->setDefault('display', $config->display);
- $mform->setAdvanced('display', $config->display_adv);
}
if (array_key_exists(RESOURCELIB_DISPLAY_POPUP, $options)) {
@@ -80,23 +79,19 @@ function definition() {
}
$mform->setType('popupwidth', PARAM_INT);
$mform->setDefault('popupwidth', $config->popupwidth);
- $mform->setAdvanced('popupwidth', $config->popupwidth_adv);
$mform->addElement('text', 'popupheight', get_string('popupheight', 'page'), array('size'=>3));
if (count($options) > 1) {
$mform->disabledIf('popupheight', 'display', 'noteq', RESOURCELIB_DISPLAY_POPUP);
}
$mform->setType('popupheight', PARAM_INT);
$mform->setDefault('popupheight', $config->popupheight);
- $mform->setAdvanced('popupheight', $config->popupheight_adv);
}
$mform->addElement('advcheckbox', 'printheading', get_string('printheading', 'page'));
$mform->setDefault('printheading', $config->printheading);
- $mform->setAdvanced('printintro', $config->printheading_adv);
$mform->addElement('advcheckbox', 'printintro', get_string('printintro', 'page'));
$mform->setDefault('printintro', $config->printintro);
- $mform->setAdvanced('printintro', $config->printintro_adv);
// add legacy files flag only if used
if (isset($this->current->legacyfiles) and $this->current->legacyfiles != RESOURCELIB_LEGACYFILES_NO) {
View
25 mod/page/settings.php
@@ -42,19 +42,14 @@
//--- modedit defaults -----------------------------------------------------------------------------------
$settings->add(new admin_setting_heading('pagemodeditdefaults', get_string('modeditdefaults', 'admin'), get_string('condifmodeditdefaults', 'admin')));
- $settings->add(new admin_setting_configcheckbox_with_advanced('page/printheading',
- get_string('printheading', 'page'), get_string('printheadingexplain', 'page'),
- array('value'=>1, 'adv'=>false)));
- $settings->add(new admin_setting_configcheckbox_with_advanced('page/printintro',
- get_string('printintro', 'page'), get_string('printintroexplain', 'page'),
- array('value'=>0, 'adv'=>false)));
- $settings->add(new admin_setting_configselect_with_advanced('page/display',
- get_string('displayselect', 'page'), get_string('displayselectexplain', 'page'),
- array('value'=>RESOURCELIB_DISPLAY_OPEN, 'adv'=>true), $displayoptions));
- $settings->add(new admin_setting_configtext_with_advanced('page/popupwidth',
- get_string('popupwidth', 'page'), get_string('popupwidthexplain', 'page'),
- array('value'=>620, 'adv'=>true), PARAM_INT, 7));
- $settings->add(new admin_setting_configtext_with_advanced('page/popupheight',
- get_string('popupheight', 'page'), get_string('popupheightexplain', 'page'),
- array('value'=>450, 'adv'=>true), PARAM_INT, 7));
+ $settings->add(new admin_setting_configcheckbox('page/printheading',
+ get_string('printheading', 'page'), get_string('printheadingexplain', 'page'), 1));
+ $settings->add(new admin_setting_configcheckbox('page/printintro',
+ get_string('printintro', 'page'), get_string('printintroexplain', 'page'), 0));
+ $settings->add(new admin_setting_configselect('page/display',
+ get_string('displayselect', 'page'), get_string('displayselectexplain', 'page'), RESOURCELIB_DISPLAY_OPEN, $displayoptions));
+ $settings->add(new admin_setting_configtext('page/popupwidth',
+ get_string('popupwidth', 'page'), get_string('popupwidthexplain', 'page'), 620, PARAM_INT, 7));
+ $settings->add(new admin_setting_configtext('page/popupheight',
+ get_string('popupheight', 'page'), get_string('popupheightexplain', 'page'), 450, PARAM_INT, 7));
}

0 comments on commit a59bbb6

Please sign in to comment.