mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
Merge branch 'MDL-39367-master-int' of git://github.com/FMCorz/moodle
This commit is contained in:
commit
d773056669
2 changed files with 28 additions and 41 deletions
|
@ -70,8 +70,15 @@ class mod_resource_mod_form extends moodleform_mod {
|
||||||
|
|
||||||
$mform->addElement('filemanager', 'files', get_string('selectfiles'), null, $filemanager_options);
|
$mform->addElement('filemanager', 'files', get_string('selectfiles'), null, $filemanager_options);
|
||||||
|
|
||||||
|
// add legacy files flag only if used
|
||||||
|
if (isset($this->current->legacyfiles) and $this->current->legacyfiles != RESOURCELIB_LEGACYFILES_NO) {
|
||||||
|
$options = array(RESOURCELIB_LEGACYFILES_DONE => get_string('legacyfilesdone', 'resource'),
|
||||||
|
RESOURCELIB_LEGACYFILES_ACTIVE => get_string('legacyfilesactive', 'resource'));
|
||||||
|
$mform->addElement('select', 'legacyfiles', get_string('legacyfiles', 'resource'), $options);
|
||||||
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------
|
//-------------------------------------------------------
|
||||||
$mform->addElement('header', 'optionssection', get_string('optionsheader', 'resource'));
|
$mform->addElement('header', 'optionssection', get_string('appearance'));
|
||||||
|
|
||||||
if ($this->current->instance) {
|
if ($this->current->instance) {
|
||||||
$options = resourcelib_get_displayoptions(explode(',', $config->displayoptions), $this->current->display);
|
$options = resourcelib_get_displayoptions(explode(',', $config->displayoptions), $this->current->display);
|
||||||
|
@ -87,17 +94,14 @@ class mod_resource_mod_form extends moodleform_mod {
|
||||||
} else {
|
} else {
|
||||||
$mform->addElement('select', 'display', get_string('displayselect', 'resource'), $options);
|
$mform->addElement('select', 'display', get_string('displayselect', 'resource'), $options);
|
||||||
$mform->setDefault('display', $config->display);
|
$mform->setDefault('display', $config->display);
|
||||||
$mform->setAdvanced('display', $config->display_adv);
|
|
||||||
$mform->addHelpButton('display', 'displayselect', 'resource');
|
$mform->addHelpButton('display', 'displayselect', 'resource');
|
||||||
}
|
}
|
||||||
|
|
||||||
$mform->addElement('checkbox', 'showsize', get_string('showsize', 'resource'));
|
$mform->addElement('checkbox', 'showsize', get_string('showsize', 'resource'));
|
||||||
$mform->setDefault('showsize', $config->showsize);
|
$mform->setDefault('showsize', $config->showsize);
|
||||||
$mform->setAdvanced('showsize', $config->showsize_adv);
|
|
||||||
$mform->addHelpButton('showsize', 'showsize', 'resource');
|
$mform->addHelpButton('showsize', 'showsize', 'resource');
|
||||||
$mform->addElement('checkbox', 'showtype', get_string('showtype', 'resource'));
|
$mform->addElement('checkbox', 'showtype', get_string('showtype', 'resource'));
|
||||||
$mform->setDefault('showtype', $config->showtype);
|
$mform->setDefault('showtype', $config->showtype);
|
||||||
$mform->setAdvanced('showtype', $config->showtype_adv);
|
|
||||||
$mform->addHelpButton('showtype', 'showtype', 'resource');
|
$mform->addHelpButton('showtype', 'showtype', 'resource');
|
||||||
|
|
||||||
if (array_key_exists(RESOURCELIB_DISPLAY_POPUP, $options)) {
|
if (array_key_exists(RESOURCELIB_DISPLAY_POPUP, $options)) {
|
||||||
|
@ -107,7 +111,7 @@ class mod_resource_mod_form extends moodleform_mod {
|
||||||
}
|
}
|
||||||
$mform->setType('popupwidth', PARAM_INT);
|
$mform->setType('popupwidth', PARAM_INT);
|
||||||
$mform->setDefault('popupwidth', $config->popupwidth);
|
$mform->setDefault('popupwidth', $config->popupwidth);
|
||||||
$mform->setAdvanced('popupwidth', $config->popupwidth_adv);
|
$mform->setAdvanced('popupwidth', true);
|
||||||
|
|
||||||
$mform->addElement('text', 'popupheight', get_string('popupheight', 'resource'), array('size'=>3));
|
$mform->addElement('text', 'popupheight', get_string('popupheight', 'resource'), array('size'=>3));
|
||||||
if (count($options) > 1) {
|
if (count($options) > 1) {
|
||||||
|
@ -115,7 +119,7 @@ class mod_resource_mod_form extends moodleform_mod {
|
||||||
}
|
}
|
||||||
$mform->setType('popupheight', PARAM_INT);
|
$mform->setType('popupheight', PARAM_INT);
|
||||||
$mform->setDefault('popupheight', $config->popupheight);
|
$mform->setDefault('popupheight', $config->popupheight);
|
||||||
$mform->setAdvanced('popupheight', $config->popupheight_adv);
|
$mform->setAdvanced('popupheight', true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (array_key_exists(RESOURCELIB_DISPLAY_AUTO, $options) or
|
if (array_key_exists(RESOURCELIB_DISPLAY_AUTO, $options) or
|
||||||
|
@ -127,7 +131,6 @@ class mod_resource_mod_form extends moodleform_mod {
|
||||||
$mform->disabledIf('printheading', 'display', 'eq', RESOURCELIB_DISPLAY_OPEN);
|
$mform->disabledIf('printheading', 'display', 'eq', RESOURCELIB_DISPLAY_OPEN);
|
||||||
$mform->disabledIf('printheading', 'display', 'eq', RESOURCELIB_DISPLAY_NEW);
|
$mform->disabledIf('printheading', 'display', 'eq', RESOURCELIB_DISPLAY_NEW);
|
||||||
$mform->setDefault('printheading', $config->printheading);
|
$mform->setDefault('printheading', $config->printheading);
|
||||||
$mform->setAdvanced('printheading', $config->printheading_adv);
|
|
||||||
|
|
||||||
$mform->addElement('checkbox', 'printintro', get_string('printintro', 'resource'));
|
$mform->addElement('checkbox', 'printintro', get_string('printintro', 'resource'));
|
||||||
$mform->disabledIf('printintro', 'display', 'eq', RESOURCELIB_DISPLAY_POPUP);
|
$mform->disabledIf('printintro', 'display', 'eq', RESOURCELIB_DISPLAY_POPUP);
|
||||||
|
@ -135,21 +138,12 @@ class mod_resource_mod_form extends moodleform_mod {
|
||||||
$mform->disabledIf('printintro', 'display', 'eq', RESOURCELIB_DISPLAY_OPEN);
|
$mform->disabledIf('printintro', 'display', 'eq', RESOURCELIB_DISPLAY_OPEN);
|
||||||
$mform->disabledIf('printintro', 'display', 'eq', RESOURCELIB_DISPLAY_NEW);
|
$mform->disabledIf('printintro', 'display', 'eq', RESOURCELIB_DISPLAY_NEW);
|
||||||
$mform->setDefault('printintro', $config->printintro);
|
$mform->setDefault('printintro', $config->printintro);
|
||||||
$mform->setAdvanced('printintro', $config->printintro_adv);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$options = array('0' => get_string('none'), '1' => get_string('allfiles'), '2' => get_string('htmlfilesonly'));
|
$options = array('0' => get_string('none'), '1' => get_string('allfiles'), '2' => get_string('htmlfilesonly'));
|
||||||
$mform->addElement('select', 'filterfiles', get_string('filterfiles', 'resource'), $options);
|
$mform->addElement('select', 'filterfiles', get_string('filterfiles', 'resource'), $options);
|
||||||
$mform->setDefault('filterfiles', $config->filterfiles);
|
$mform->setDefault('filterfiles', $config->filterfiles);
|
||||||
$mform->setAdvanced('filterfiles', $config->filterfiles_adv);
|
$mform->setAdvanced('filterfiles', true);
|
||||||
|
|
||||||
// add legacy files flag only if used
|
|
||||||
if (isset($this->current->legacyfiles) and $this->current->legacyfiles != RESOURCELIB_LEGACYFILES_NO) {
|
|
||||||
$options = array(RESOURCELIB_LEGACYFILES_DONE => get_string('legacyfilesdone', 'resource'),
|
|
||||||
RESOURCELIB_LEGACYFILES_ACTIVE => get_string('legacyfilesactive', 'resource'));
|
|
||||||
$mform->addElement('select', 'legacyfiles', get_string('legacyfiles', 'resource'), $options);
|
|
||||||
$mform->setAdvanced('legacyfiles', 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
//-------------------------------------------------------
|
//-------------------------------------------------------
|
||||||
$this->standard_coursemodule_elements();
|
$this->standard_coursemodule_elements();
|
||||||
|
|
|
@ -56,29 +56,22 @@ if ($ADMIN->fulltree) {
|
||||||
//--- modedit defaults -----------------------------------------------------------------------------------
|
//--- modedit defaults -----------------------------------------------------------------------------------
|
||||||
$settings->add(new admin_setting_heading('resourcemodeditdefaults', get_string('modeditdefaults', 'admin'), get_string('condifmodeditdefaults', 'admin')));
|
$settings->add(new admin_setting_heading('resourcemodeditdefaults', get_string('modeditdefaults', 'admin'), get_string('condifmodeditdefaults', 'admin')));
|
||||||
|
|
||||||
$settings->add(new admin_setting_configcheckbox_with_advanced('resource/printheading',
|
$settings->add(new admin_setting_configcheckbox('resource/printheading',
|
||||||
get_string('printheading', 'resource'), get_string('printheadingexplain', 'resource'),
|
get_string('printheading', 'resource'), get_string('printheadingexplain', 'resource'), 0));
|
||||||
array('value'=>0, 'adv'=>false)));
|
$settings->add(new admin_setting_configcheckbox('resource/printintro',
|
||||||
$settings->add(new admin_setting_configcheckbox_with_advanced('resource/printintro',
|
get_string('printintro', 'resource'), get_string('printintroexplain', 'resource'), 1));
|
||||||
get_string('printintro', 'resource'), get_string('printintroexplain', 'resource'),
|
$settings->add(new admin_setting_configselect('resource/display',
|
||||||
array('value'=>1, 'adv'=>false)));
|
get_string('displayselect', 'resource'), get_string('displayselectexplain', 'resource'), RESOURCELIB_DISPLAY_AUTO,
|
||||||
$settings->add(new admin_setting_configselect_with_advanced('resource/display',
|
$displayoptions));
|
||||||
get_string('displayselect', 'resource'), get_string('displayselectexplain', 'resource'),
|
$settings->add(new admin_setting_configcheckbox('resource/showsize',
|
||||||
array('value'=>RESOURCELIB_DISPLAY_AUTO, 'adv'=>false), $displayoptions));
|
get_string('showsize', 'resource'), get_string('showsize_desc', 'resource'), 0));
|
||||||
$settings->add(new admin_setting_configcheckbox_with_advanced('resource/showsize',
|
$settings->add(new admin_setting_configcheckbox('resource/showtype',
|
||||||
get_string('showsize', 'resource'), get_string('showsize_desc', 'resource'),
|
get_string('showtype', 'resource'), get_string('showtype_desc', 'resource'), 0));
|
||||||
array('value'=>0, 'adv'=>false)));
|
$settings->add(new admin_setting_configtext('resource/popupwidth',
|
||||||
$settings->add(new admin_setting_configcheckbox_with_advanced('resource/showtype',
|
get_string('popupwidth', 'resource'), get_string('popupwidthexplain', 'resource'), 620, PARAM_INT, 7));
|
||||||
get_string('showtype', 'resource'), get_string('showtype_desc', 'resource'),
|
$settings->add(new admin_setting_configtext('resource/popupheight',
|
||||||
array('value'=>0, 'adv'=>false)));
|
get_string('popupheight', 'resource'), get_string('popupheightexplain', 'resource'), 450, PARAM_INT, 7));
|
||||||
$settings->add(new admin_setting_configtext_with_advanced('resource/popupwidth',
|
|
||||||
get_string('popupwidth', 'resource'), get_string('popupwidthexplain', 'resource'),
|
|
||||||
array('value'=>620, 'adv'=>true), PARAM_INT, 7));
|
|
||||||
$settings->add(new admin_setting_configtext_with_advanced('resource/popupheight',
|
|
||||||
get_string('popupheight', 'resource'), get_string('popupheightexplain', 'resource'),
|
|
||||||
array('value'=>450, 'adv'=>true), PARAM_INT, 7));
|
|
||||||
$options = array('0' => get_string('none'), '1' => get_string('allfiles'), '2' => get_string('htmlfilesonly'));
|
$options = array('0' => get_string('none'), '1' => get_string('allfiles'), '2' => get_string('htmlfilesonly'));
|
||||||
$settings->add(new admin_setting_configselect_with_advanced('resource/filterfiles',
|
$settings->add(new admin_setting_configselect('resource/filterfiles',
|
||||||
get_string('filterfiles', 'resource'), get_string('filterfilesexplain', 'resource'),
|
get_string('filterfiles', 'resource'), get_string('filterfilesexplain', 'resource'), 0, $options));
|
||||||
array('value'=>0, 'adv'=>true), $options));
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue