mirror of
https://github.com/moodle/moodle.git
synced 2025-04-14 04:52:36 +02:00
Merge branch 'MDL-64906_hideif_mod' of git://github.com/davosmith/moodle
This commit is contained in:
commit
f50b98dbe4
@ -1139,6 +1139,16 @@ abstract class moodleform {
|
||||
$params = array_merge(array($realelementname), $params);
|
||||
call_user_func_array(array(&$mform, 'disabledIf'), $params);
|
||||
break;
|
||||
case 'hideif' :
|
||||
foreach ($namecloned as $num => $name){
|
||||
if ($params[0] == $name){
|
||||
$params[0] = $params[0]."[$i]";
|
||||
break;
|
||||
}
|
||||
}
|
||||
$params = array_merge(array($realelementname), $params);
|
||||
call_user_func_array(array(&$mform, 'hideIf'), $params);
|
||||
break;
|
||||
case 'rule' :
|
||||
if (is_string($params)){
|
||||
$params = array(null, $params, null, 'client');
|
||||
|
@ -58,7 +58,7 @@ class mod_choice_mod_form extends moodleform_mod {
|
||||
|
||||
$repeateloptions = array();
|
||||
$repeateloptions['limit']['default'] = 0;
|
||||
$repeateloptions['limit']['disabledif'] = array('limitanswers', 'eq', 0);
|
||||
$repeateloptions['limit']['hideif'] = array('limitanswers', 'eq', 0);
|
||||
$repeateloptions['limit']['rule'] = 'numeric';
|
||||
$repeateloptions['limit']['type'] = PARAM_INT;
|
||||
|
||||
@ -93,7 +93,7 @@ class mod_choice_mod_form extends moodleform_mod {
|
||||
$mform->addElement('select', 'showresults', get_string("publish", "choice"), $CHOICE_SHOWRESULTS);
|
||||
|
||||
$mform->addElement('select', 'publish', get_string("privacy", "choice"), $CHOICE_PUBLISH);
|
||||
$mform->disabledIf('publish', 'showresults', 'eq', 0);
|
||||
$mform->hideIf('publish', 'showresults', 'eq', 0);
|
||||
|
||||
$mform->addElement('selectyesno', 'showunanswered', get_string("showunanswered", "choice"));
|
||||
|
||||
|
@ -35,7 +35,7 @@ class mod_data_mod_form extends moodleform_mod {
|
||||
$mform->addElement('selectyesno', 'manageapproved', get_string('manageapproved', 'data'));
|
||||
$mform->addHelpButton('manageapproved', 'manageapproved', 'data');
|
||||
$mform->setDefault('manageapproved', 1);
|
||||
$mform->disabledIf('manageapproved', 'approval', 'eq', 0);
|
||||
$mform->hideIf('manageapproved', 'approval', 'eq', 0);
|
||||
|
||||
$mform->addElement('selectyesno', 'comments', get_string('allowcomments', 'data'));
|
||||
|
||||
|
@ -49,7 +49,7 @@ abstract class feedback_item_form extends moodleform {
|
||||
'dependvalue',
|
||||
get_string('dependvalue', 'feedback'),
|
||||
array('size'=>FEEDBACK_ITEM_LABEL_TEXTBOX_SIZE, 'maxlength'=>255));
|
||||
$mform->disabledIf('dependvalue', 'dependitem', 'eq', '0');
|
||||
$mform->hideIf('dependvalue', 'dependitem', 'eq', '0');
|
||||
} else {
|
||||
$mform->addElement('hidden', 'dependitem', 0);
|
||||
$mform->addElement('hidden', 'dependvalue', '');
|
||||
|
@ -55,12 +55,12 @@ class feedback_multichoice_form extends feedback_item_form {
|
||||
get_string('adjustment', 'feedback').' ',
|
||||
array(0 => get_string('vertical', 'feedback'),
|
||||
1 => get_string('horizontal', 'feedback')));
|
||||
$mform->disabledIf('horizontal', 'subtype', 'eq', 'd');
|
||||
$mform->hideIf('horizontal', 'subtype', 'eq', 'd');
|
||||
|
||||
$mform->addElement('selectyesno',
|
||||
'hidenoselect',
|
||||
get_string('hide_no_select_option', 'feedback'));
|
||||
$mform->disabledIf('hidenoselect', 'subtype', 'ne', 'r');
|
||||
$mform->hideIf('hidenoselect', 'subtype', 'ne', 'r');
|
||||
|
||||
$mform->addElement('selectyesno',
|
||||
'ignoreempty',
|
||||
|
@ -54,12 +54,12 @@ class feedback_multichoicerated_form extends feedback_item_form {
|
||||
get_string('adjustment', 'feedback').' ',
|
||||
array(0 => get_string('vertical', 'feedback'),
|
||||
1 => get_string('horizontal', 'feedback')));
|
||||
$mform->disabledIf('horizontal', 'subtype', 'eq', 'd');
|
||||
$mform->hideIf('horizontal', 'subtype', 'eq', 'd');
|
||||
|
||||
$mform->addElement('selectyesno',
|
||||
'hidenoselect',
|
||||
get_string('hide_no_select_option', 'feedback'));
|
||||
$mform->disabledIf('hidenoselect', 'subtype', 'eq', 'd');
|
||||
$mform->hideIf('hidenoselect', 'subtype', 'eq', 'd');
|
||||
|
||||
$mform->addElement('selectyesno',
|
||||
'ignoreempty',
|
||||
|
@ -44,7 +44,6 @@ Feature: Test creating different types of feedback questions for anonymous feedb
|
||||
| Question | this is a multiple choice 2 |
|
||||
| Label | multichoice2 |
|
||||
| Multiple choice type | Multiple choice - multiple answers |
|
||||
| Hide the "Not selected" option | Yes |
|
||||
| Multiple choice values | option d\noption e\noption f |
|
||||
And I add a "Multiple choice" question to the feedback with:
|
||||
| Question | this is a multiple choice 3 |
|
||||
|
@ -48,7 +48,6 @@ Feature: Test creating different types of feedback questions for non-anonymous f
|
||||
| Question | this is a multiple choice 2 |
|
||||
| Label | multichoice2 |
|
||||
| Multiple choice type | Multiple choice - multiple answers |
|
||||
| Hide the "Not selected" option | Yes |
|
||||
| Multiple choice values | option d\noption e\noption f |
|
||||
And I add a "Multiple choice" question to the feedback with:
|
||||
| Question | this is a multiple choice 3 |
|
||||
|
@ -153,7 +153,7 @@ class mod_forum_mod_form extends moodleform_mod {
|
||||
$choices[50] = '50';
|
||||
$mform->addElement('select', 'rssarticles', get_string('rssarticles'), $choices);
|
||||
$mform->addHelpButton('rssarticles', 'rssarticles', 'forum');
|
||||
$mform->disabledIf('rssarticles', 'rsstype', 'eq', '0');
|
||||
$mform->hideIf('rssarticles', 'rsstype', 'eq', '0');
|
||||
if (isset($CFG->forum_rssarticles)) {
|
||||
$mform->setDefault('rssarticles', $CFG->forum_rssarticles);
|
||||
}
|
||||
@ -194,14 +194,14 @@ class mod_forum_mod_form extends moodleform_mod {
|
||||
$mform->setDefault('blockafter', '0');
|
||||
$mform->addRule('blockafter', null, 'numeric', null, 'client');
|
||||
$mform->addHelpButton('blockafter', 'blockafter', 'forum');
|
||||
$mform->disabledIf('blockafter', 'blockperiod', 'eq', 0);
|
||||
$mform->hideIf('blockafter', 'blockperiod', 'eq', 0);
|
||||
|
||||
$mform->addElement('text', 'warnafter', get_string('warnafter', 'forum'));
|
||||
$mform->setType('warnafter', PARAM_INT);
|
||||
$mform->setDefault('warnafter', '0');
|
||||
$mform->addRule('warnafter', null, 'numeric', null, 'client');
|
||||
$mform->addHelpButton('warnafter', 'warnafter', 'forum');
|
||||
$mform->disabledIf('warnafter', 'blockperiod', 'eq', 0);
|
||||
$mform->hideIf('warnafter', 'blockperiod', 'eq', 0);
|
||||
|
||||
$coursecontext = context_course::instance($COURSE->id);
|
||||
plagiarism_get_form_elements_module($mform, $coursecontext, 'mod_forum');
|
||||
|
@ -69,12 +69,12 @@ class mod_glossary_entry_form extends moodleform {
|
||||
|
||||
$mform->addElement('checkbox', 'casesensitive', get_string('casesensitive', 'glossary'));
|
||||
$mform->addHelpButton('casesensitive', 'casesensitive', 'glossary');
|
||||
$mform->disabledIf('casesensitive', 'usedynalink');
|
||||
$mform->hideIf('casesensitive', 'usedynalink');
|
||||
$mform->setDefault('casesensitive', $CFG->glossary_casesensitive);
|
||||
|
||||
$mform->addElement('checkbox', 'fullmatch', get_string('fullmatch', 'glossary'));
|
||||
$mform->addHelpButton('fullmatch', 'fullmatch', 'glossary');
|
||||
$mform->disabledIf('fullmatch', 'usedynalink');
|
||||
$mform->hideIf('fullmatch', 'usedynalink');
|
||||
$mform->setDefault('fullmatch', $CFG->glossary_fullmatch);
|
||||
}
|
||||
|
||||
|
@ -130,7 +130,7 @@ class mod_glossary_mod_form extends moodleform_mod {
|
||||
$choices[50] = '50';
|
||||
$mform->addElement('select', 'rssarticles', get_string('rssarticles'), $choices);
|
||||
$mform->addHelpButton('rssarticles', 'rssarticles', 'glossary');
|
||||
$mform->disabledIf('rssarticles', 'rsstype', 'eq', 0);
|
||||
$mform->hideIf('rssarticles', 'rsstype', 'eq', 0);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
|
@ -201,8 +201,8 @@ class mod_lesson_mod_form extends moodleform_mod {
|
||||
$mform->setDefault('password', '');
|
||||
$mform->setAdvanced('password', $lessonconfig->password_adv);
|
||||
$mform->setType('password', PARAM_RAW);
|
||||
$mform->disabledIf('password', 'usepassword', 'eq', 0);
|
||||
$mform->disabledIf('passwordunmask', 'usepassword', 'eq', 0);
|
||||
$mform->hideIf('password', 'usepassword', 'eq', 0);
|
||||
$mform->hideIf('passwordunmask', 'usepassword', 'eq', 0);
|
||||
|
||||
// Dependent on.
|
||||
if ($this->current && isset($this->current->dependency) && $this->current->dependency) {
|
||||
@ -332,7 +332,7 @@ class mod_lesson_mod_form extends moodleform_mod {
|
||||
$mform->addHelpButton('usemaxgrade', 'handlingofretakes', 'lesson');
|
||||
$mform->setDefault('usemaxgrade', $lessonconfig->handlingofretakes);
|
||||
$mform->setAdvanced('usemaxgrade', $lessonconfig->handlingofretakes_adv);
|
||||
$mform->disabledIf('usemaxgrade', 'retake', 'eq', '0');
|
||||
$mform->hideIf('usemaxgrade', 'retake', 'eq', '0');
|
||||
|
||||
$numbers = array();
|
||||
for ($i = 100; $i >= 0; $i--) {
|
||||
|
@ -158,13 +158,13 @@ class mod_lti_mod_form extends moodleform_mod {
|
||||
$mform->addElement('text', 'toolurl', get_string('launch_url', 'lti'), array('size' => '64'));
|
||||
$mform->setType('toolurl', PARAM_URL);
|
||||
$mform->addHelpButton('toolurl', 'launch_url', 'lti');
|
||||
$mform->disabledIf('toolurl', 'typeid', 'in', $noncontentitemtypes);
|
||||
$mform->hideIf('toolurl', 'typeid', 'in', $noncontentitemtypes);
|
||||
|
||||
$mform->addElement('text', 'securetoolurl', get_string('secure_launch_url', 'lti'), array('size' => '64'));
|
||||
$mform->setType('securetoolurl', PARAM_URL);
|
||||
$mform->setAdvanced('securetoolurl');
|
||||
$mform->addHelpButton('securetoolurl', 'secure_launch_url', 'lti');
|
||||
$mform->disabledIf('securetoolurl', 'typeid', 'in', $noncontentitemtypes);
|
||||
$mform->hideIf('securetoolurl', 'typeid', 'in', $noncontentitemtypes);
|
||||
|
||||
$mform->addElement('hidden', 'urlmatchedtypeid', '', array( 'id' => 'id_urlmatchedtypeid' ));
|
||||
$mform->setType('urlmatchedtypeid', PARAM_INT);
|
||||
@ -186,13 +186,13 @@ class mod_lti_mod_form extends moodleform_mod {
|
||||
$mform->setAdvanced('resourcekey');
|
||||
$mform->addHelpButton('resourcekey', 'resourcekey', 'lti');
|
||||
$mform->setForceLtr('resourcekey');
|
||||
$mform->disabledIf('resourcekey', 'typeid', 'in', $noncontentitemtypes);
|
||||
$mform->hideIf('resourcekey', 'typeid', 'in', $noncontentitemtypes);
|
||||
|
||||
$mform->addElement('passwordunmask', 'password', get_string('password', 'lti'));
|
||||
$mform->setType('password', PARAM_TEXT);
|
||||
$mform->setAdvanced('password');
|
||||
$mform->addHelpButton('password', 'password', 'lti');
|
||||
$mform->disabledIf('password', 'typeid', 'in', $noncontentitemtypes);
|
||||
$mform->hideIf('password', 'typeid', 'in', $noncontentitemtypes);
|
||||
|
||||
$mform->addElement('textarea', 'instructorcustomparameters', get_string('custom', 'lti'), array('rows' => 4, 'cols' => 60));
|
||||
$mform->setType('instructorcustomparameters', PARAM_TEXT);
|
||||
@ -204,13 +204,13 @@ class mod_lti_mod_form extends moodleform_mod {
|
||||
$mform->setType('icon', PARAM_URL);
|
||||
$mform->setAdvanced('icon');
|
||||
$mform->addHelpButton('icon', 'icon_url', 'lti');
|
||||
$mform->disabledIf('icon', 'typeid', 'in', $noncontentitemtypes);
|
||||
$mform->hideIf('icon', 'typeid', 'in', $noncontentitemtypes);
|
||||
|
||||
$mform->addElement('text', 'secureicon', get_string('secure_icon_url', 'lti'), array('size' => '64'));
|
||||
$mform->setType('secureicon', PARAM_URL);
|
||||
$mform->setAdvanced('secureicon');
|
||||
$mform->addHelpButton('secureicon', 'secure_icon_url', 'lti');
|
||||
$mform->disabledIf('secureicon', 'typeid', 'in', $noncontentitemtypes);
|
||||
$mform->hideIf('secureicon', 'typeid', 'in', $noncontentitemtypes);
|
||||
|
||||
// Add privacy preferences fieldset where users choose whether to send their data.
|
||||
$mform->addElement('header', 'privacy', get_string('privacy', 'lti'));
|
||||
|
@ -75,14 +75,14 @@ class mod_page_mod_form extends moodleform_mod {
|
||||
if (array_key_exists(RESOURCELIB_DISPLAY_POPUP, $options)) {
|
||||
$mform->addElement('text', 'popupwidth', get_string('popupwidth', 'page'), array('size'=>3));
|
||||
if (count($options) > 1) {
|
||||
$mform->disabledIf('popupwidth', 'display', 'noteq', RESOURCELIB_DISPLAY_POPUP);
|
||||
$mform->hideIf('popupwidth', 'display', 'noteq', RESOURCELIB_DISPLAY_POPUP);
|
||||
}
|
||||
$mform->setType('popupwidth', PARAM_INT);
|
||||
$mform->setDefault('popupwidth', $config->popupwidth);
|
||||
|
||||
$mform->addElement('text', 'popupheight', get_string('popupheight', 'page'), array('size'=>3));
|
||||
if (count($options) > 1) {
|
||||
$mform->disabledIf('popupheight', 'display', 'noteq', RESOURCELIB_DISPLAY_POPUP);
|
||||
$mform->hideIf('popupheight', 'display', 'noteq', RESOURCELIB_DISPLAY_POPUP);
|
||||
}
|
||||
$mform->setType('popupheight', PARAM_INT);
|
||||
$mform->setDefault('popupheight', $config->popupheight);
|
||||
|
@ -113,7 +113,7 @@ class mod_quiz_mod_form extends moodleform_mod {
|
||||
$mform->addHelpButton('graceperiod', 'graceperiod', 'quiz');
|
||||
$mform->setAdvanced('graceperiod', $quizconfig->graceperiod_adv);
|
||||
$mform->setDefault('graceperiod', $quizconfig->graceperiod);
|
||||
$mform->disabledIf('graceperiod', 'overduehandling', 'neq', 'graceperiod');
|
||||
$mform->hideIf('graceperiod', 'overduehandling', 'neq', 'graceperiod');
|
||||
|
||||
// -------------------------------------------------------------------------------
|
||||
// Grade settings.
|
||||
@ -145,7 +145,7 @@ class mod_quiz_mod_form extends moodleform_mod {
|
||||
$mform->setAdvanced('grademethod', $quizconfig->grademethod_adv);
|
||||
$mform->setDefault('grademethod', $quizconfig->grademethod);
|
||||
if ($this->get_max_attempts_for_any_override() < 2) {
|
||||
$mform->disabledIf('grademethod', 'attempts', 'eq', 1);
|
||||
$mform->hideIf('grademethod', 'attempts', 'eq', 1);
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------------
|
||||
@ -202,7 +202,7 @@ class mod_quiz_mod_form extends moodleform_mod {
|
||||
$mform->setDefault('canredoquestions', $quizconfig->canredoquestions);
|
||||
foreach ($behaviours as $behaviour => $notused) {
|
||||
if (!question_engine::can_questions_finish_during_the_attempt($behaviour)) {
|
||||
$mform->disabledIf('canredoquestions', 'preferredbehaviour', 'eq', $behaviour);
|
||||
$mform->hideIf('canredoquestions', 'preferredbehaviour', 'eq', $behaviour);
|
||||
}
|
||||
}
|
||||
|
||||
@ -213,7 +213,7 @@ class mod_quiz_mod_form extends moodleform_mod {
|
||||
$mform->setAdvanced('attemptonlast', $quizconfig->attemptonlast_adv);
|
||||
$mform->setDefault('attemptonlast', $quizconfig->attemptonlast);
|
||||
if ($this->get_max_attempts_for_any_override() < 2) {
|
||||
$mform->disabledIf('attemptonlast', 'attempts', 'eq', 1);
|
||||
$mform->hideIf('attemptonlast', 'attempts', 'eq', 1);
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------------
|
||||
@ -308,7 +308,7 @@ class mod_quiz_mod_form extends moodleform_mod {
|
||||
$mform->setAdvanced('delay1', $quizconfig->delay1_adv);
|
||||
$mform->setDefault('delay1', $quizconfig->delay1);
|
||||
if ($this->get_max_attempts_for_any_override() < 2) {
|
||||
$mform->disabledIf('delay1', 'attempts', 'eq', 1);
|
||||
$mform->hideIf('delay1', 'attempts', 'eq', 1);
|
||||
}
|
||||
|
||||
$mform->addElement('duration', 'delay2', get_string('delaylater', 'quiz'),
|
||||
@ -317,8 +317,8 @@ class mod_quiz_mod_form extends moodleform_mod {
|
||||
$mform->setAdvanced('delay2', $quizconfig->delay2_adv);
|
||||
$mform->setDefault('delay2', $quizconfig->delay2);
|
||||
if ($this->get_max_attempts_for_any_override() < 3) {
|
||||
$mform->disabledIf('delay2', 'attempts', 'eq', 1);
|
||||
$mform->disabledIf('delay2', 'attempts', 'eq', 2);
|
||||
$mform->hideIf('delay2', 'attempts', 'eq', 1);
|
||||
$mform->hideIf('delay2', 'attempts', 'eq', 2);
|
||||
}
|
||||
|
||||
// Browser security choices.
|
||||
|
@ -108,7 +108,7 @@ class mod_resource_mod_form extends moodleform_mod {
|
||||
if (array_key_exists(RESOURCELIB_DISPLAY_POPUP, $options)) {
|
||||
$mform->addElement('text', 'popupwidth', get_string('popupwidth', 'resource'), array('size'=>3));
|
||||
if (count($options) > 1) {
|
||||
$mform->disabledIf('popupwidth', 'display', 'noteq', RESOURCELIB_DISPLAY_POPUP);
|
||||
$mform->hideIf('popupwidth', 'display', 'noteq', RESOURCELIB_DISPLAY_POPUP);
|
||||
}
|
||||
$mform->setType('popupwidth', PARAM_INT);
|
||||
$mform->setDefault('popupwidth', $config->popupwidth);
|
||||
@ -116,7 +116,7 @@ class mod_resource_mod_form extends moodleform_mod {
|
||||
|
||||
$mform->addElement('text', 'popupheight', get_string('popupheight', 'resource'), array('size'=>3));
|
||||
if (count($options) > 1) {
|
||||
$mform->disabledIf('popupheight', 'display', 'noteq', RESOURCELIB_DISPLAY_POPUP);
|
||||
$mform->hideIf('popupheight', 'display', 'noteq', RESOURCELIB_DISPLAY_POPUP);
|
||||
}
|
||||
$mform->setType('popupheight', PARAM_INT);
|
||||
$mform->setDefault('popupheight', $config->popupheight);
|
||||
@ -127,10 +127,10 @@ class mod_resource_mod_form extends moodleform_mod {
|
||||
array_key_exists(RESOURCELIB_DISPLAY_EMBED, $options) or
|
||||
array_key_exists(RESOURCELIB_DISPLAY_FRAME, $options)) {
|
||||
$mform->addElement('checkbox', 'printintro', get_string('printintro', 'resource'));
|
||||
$mform->disabledIf('printintro', 'display', 'eq', RESOURCELIB_DISPLAY_POPUP);
|
||||
$mform->disabledIf('printintro', 'display', 'eq', RESOURCELIB_DISPLAY_DOWNLOAD);
|
||||
$mform->disabledIf('printintro', 'display', 'eq', RESOURCELIB_DISPLAY_OPEN);
|
||||
$mform->disabledIf('printintro', 'display', 'eq', RESOURCELIB_DISPLAY_NEW);
|
||||
$mform->hideIf('printintro', 'display', 'eq', RESOURCELIB_DISPLAY_POPUP);
|
||||
$mform->hideIf('printintro', 'display', 'eq', RESOURCELIB_DISPLAY_DOWNLOAD);
|
||||
$mform->hideIf('printintro', 'display', 'eq', RESOURCELIB_DISPLAY_OPEN);
|
||||
$mform->hideIf('printintro', 'display', 'eq', RESOURCELIB_DISPLAY_NEW);
|
||||
$mform->setDefault('printintro', $config->printintro);
|
||||
}
|
||||
|
||||
|
@ -75,7 +75,7 @@ class mod_scorm_mod_form extends moodleform_mod {
|
||||
$mform->addElement('text', 'packageurl', get_string('packageurl', 'scorm'), array('size' => 60));
|
||||
$mform->setType('packageurl', PARAM_RAW);
|
||||
$mform->addHelpButton('packageurl', 'packageurl', 'scorm');
|
||||
$mform->disabledIf('packageurl', 'scormtype', 'eq', SCORM_TYPE_LOCAL);
|
||||
$mform->hideIf('packageurl', 'scormtype', 'eq', SCORM_TYPE_LOCAL);
|
||||
} else {
|
||||
$mform->addElement('hidden', 'scormtype', SCORM_TYPE_LOCAL);
|
||||
$mform->setType('scormtype', PARAM_ALPHA);
|
||||
@ -90,7 +90,7 @@ class mod_scorm_mod_form extends moodleform_mod {
|
||||
|
||||
$mform->addElement('filemanager', 'packagefile', get_string('package', 'scorm'), null, $filemanageroptions);
|
||||
$mform->addHelpButton('packagefile', 'package', 'scorm');
|
||||
$mform->disabledIf('packagefile', 'scormtype', 'noteq', SCORM_TYPE_LOCAL);
|
||||
$mform->hideIf('packagefile', 'scormtype', 'noteq', SCORM_TYPE_LOCAL);
|
||||
|
||||
// Update packages timing.
|
||||
$mform->addElement('select', 'updatefreq', get_string('updatefreq', 'scorm'), scorm_get_updatefreq_array());
|
||||
@ -111,14 +111,14 @@ class mod_scorm_mod_form extends moodleform_mod {
|
||||
$mform->setDefault('width', $cfgscorm->framewidth);
|
||||
$mform->setType('width', PARAM_INT);
|
||||
$mform->setAdvanced('width', $cfgscorm->framewidth_adv);
|
||||
$mform->disabledIf('width', 'popup', 'eq', 0);
|
||||
$mform->hideIf('width', 'popup', 'eq', 0);
|
||||
|
||||
// Height.
|
||||
$mform->addElement('text', 'height', get_string('height', 'scorm'), 'maxlength="5" size="5"');
|
||||
$mform->setDefault('height', $cfgscorm->frameheight);
|
||||
$mform->setType('height', PARAM_INT);
|
||||
$mform->setAdvanced('height', $cfgscorm->frameheight_adv);
|
||||
$mform->disabledIf('height', 'popup', 'eq', 0);
|
||||
$mform->hideIf('height', 'popup', 'eq', 0);
|
||||
|
||||
// Window Options.
|
||||
$winoptgrp = array();
|
||||
@ -127,7 +127,7 @@ class mod_scorm_mod_form extends moodleform_mod {
|
||||
$mform->setDefault($key, $value);
|
||||
}
|
||||
$mform->addGroup($winoptgrp, 'winoptgrp', get_string('options', 'scorm'), '<br />', false);
|
||||
$mform->disabledIf('winoptgrp', 'popup', 'eq', 0);
|
||||
$mform->hideIf('winoptgrp', 'popup', 'eq', 0);
|
||||
$mform->setAdvanced('winoptgrp', $cfgscorm->winoptgrp_adv);
|
||||
|
||||
// Display activity name.
|
||||
@ -166,23 +166,23 @@ class mod_scorm_mod_form extends moodleform_mod {
|
||||
$mform->addHelpButton('nav', 'nav', 'scorm');
|
||||
$mform->setDefault('nav', $cfgscorm->nav);
|
||||
$mform->setAdvanced('nav', $cfgscorm->nav_adv);
|
||||
$mform->disabledIf('nav', 'hidetoc', 'noteq', SCORM_TOC_SIDE);
|
||||
$mform->hideIf('nav', 'hidetoc', 'noteq', SCORM_TOC_SIDE);
|
||||
|
||||
// Navigation panel position from left.
|
||||
$mform->addElement('text', 'navpositionleft', get_string('fromleft', 'scorm'), 'maxlength="5" size="5"');
|
||||
$mform->setDefault('navpositionleft', $cfgscorm->navpositionleft);
|
||||
$mform->setType('navpositionleft', PARAM_INT);
|
||||
$mform->setAdvanced('navpositionleft', $cfgscorm->navpositionleft_adv);
|
||||
$mform->disabledIf('navpositionleft', 'hidetoc', 'noteq', SCORM_TOC_SIDE);
|
||||
$mform->disabledIf('navpositionleft', 'nav', 'noteq', SCORM_NAV_FLOATING);
|
||||
$mform->hideIf('navpositionleft', 'hidetoc', 'noteq', SCORM_TOC_SIDE);
|
||||
$mform->hideIf('navpositionleft', 'nav', 'noteq', SCORM_NAV_FLOATING);
|
||||
|
||||
// Navigation panel position from top.
|
||||
$mform->addElement('text', 'navpositiontop', get_string('fromtop', 'scorm'), 'maxlength="5" size="5"');
|
||||
$mform->setDefault('navpositiontop', $cfgscorm->navpositiontop);
|
||||
$mform->setType('navpositiontop', PARAM_INT);
|
||||
$mform->setAdvanced('navpositiontop', $cfgscorm->navpositiontop_adv);
|
||||
$mform->disabledIf('navpositiontop', 'hidetoc', 'noteq', SCORM_TOC_SIDE);
|
||||
$mform->disabledIf('navpositiontop', 'nav', 'noteq', SCORM_NAV_FLOATING);
|
||||
$mform->hideIf('navpositiontop', 'hidetoc', 'noteq', SCORM_TOC_SIDE);
|
||||
$mform->hideIf('navpositiontop', 'nav', 'noteq', SCORM_NAV_FLOATING);
|
||||
|
||||
// Display attempt status.
|
||||
$mform->addElement('select', 'displayattemptstatus', get_string('displayattemptstatus', 'scorm'),
|
||||
@ -211,7 +211,7 @@ class mod_scorm_mod_form extends moodleform_mod {
|
||||
}
|
||||
$mform->addElement('select', 'maxgrade', get_string('maximumgrade'), $grades);
|
||||
$mform->setDefault('maxgrade', $cfgscorm->maxgrade);
|
||||
$mform->disabledIf('maxgrade', 'grademethod', 'eq', GRADESCOES);
|
||||
$mform->hideIf('maxgrade', 'grademethod', 'eq', GRADESCOES);
|
||||
|
||||
// Attempts management.
|
||||
$mform->addElement('header', 'attemptsmanagementhdr', get_string('attemptsmanagement', 'scorm'));
|
||||
@ -223,7 +223,7 @@ class mod_scorm_mod_form extends moodleform_mod {
|
||||
|
||||
// What Grade.
|
||||
$mform->addElement('select', 'whatgrade', get_string('whatgrade', 'scorm'), scorm_get_what_grade_array());
|
||||
$mform->disabledIf('whatgrade', 'maxattempt', 'eq', 1);
|
||||
$mform->hideIf('whatgrade', 'maxattempt', 'eq', 1);
|
||||
$mform->addHelpButton('whatgrade', 'whatgrade', 'scorm');
|
||||
$mform->setDefault('whatgrade', $cfgscorm->whatgrade);
|
||||
|
||||
|
@ -75,14 +75,14 @@ class mod_url_mod_form extends moodleform_mod {
|
||||
if (array_key_exists(RESOURCELIB_DISPLAY_POPUP, $options)) {
|
||||
$mform->addElement('text', 'popupwidth', get_string('popupwidth', 'url'), array('size'=>3));
|
||||
if (count($options) > 1) {
|
||||
$mform->disabledIf('popupwidth', 'display', 'noteq', RESOURCELIB_DISPLAY_POPUP);
|
||||
$mform->hideIf('popupwidth', 'display', 'noteq', RESOURCELIB_DISPLAY_POPUP);
|
||||
}
|
||||
$mform->setType('popupwidth', PARAM_INT);
|
||||
$mform->setDefault('popupwidth', $config->popupwidth);
|
||||
|
||||
$mform->addElement('text', 'popupheight', get_string('popupheight', 'url'), array('size'=>3));
|
||||
if (count($options) > 1) {
|
||||
$mform->disabledIf('popupheight', 'display', 'noteq', RESOURCELIB_DISPLAY_POPUP);
|
||||
$mform->hideIf('popupheight', 'display', 'noteq', RESOURCELIB_DISPLAY_POPUP);
|
||||
}
|
||||
$mform->setType('popupheight', PARAM_INT);
|
||||
$mform->setDefault('popupheight', $config->popupheight);
|
||||
@ -92,9 +92,9 @@ class mod_url_mod_form extends moodleform_mod {
|
||||
array_key_exists(RESOURCELIB_DISPLAY_EMBED, $options) or
|
||||
array_key_exists(RESOURCELIB_DISPLAY_FRAME, $options)) {
|
||||
$mform->addElement('checkbox', 'printintro', get_string('printintro', 'url'));
|
||||
$mform->disabledIf('printintro', 'display', 'eq', RESOURCELIB_DISPLAY_POPUP);
|
||||
$mform->disabledIf('printintro', 'display', 'eq', RESOURCELIB_DISPLAY_OPEN);
|
||||
$mform->disabledIf('printintro', 'display', 'eq', RESOURCELIB_DISPLAY_NEW);
|
||||
$mform->hideIf('printintro', 'display', 'eq', RESOURCELIB_DISPLAY_POPUP);
|
||||
$mform->hideIf('printintro', 'display', 'eq', RESOURCELIB_DISPLAY_OPEN);
|
||||
$mform->hideIf('printintro', 'display', 'eq', RESOURCELIB_DISPLAY_NEW);
|
||||
$mform->setDefault('printintro', $config->printintro);
|
||||
}
|
||||
|
||||
|
@ -151,17 +151,17 @@ class mod_workshop_mod_form extends moodleform_mod {
|
||||
$label = get_string('nattachments', 'workshop');
|
||||
$mform->addElement('select', 'nattachments', $label, $options);
|
||||
$mform->setDefault('nattachments', 1);
|
||||
$mform->disabledIf('nattachments', 'submissiontypefileavailable');
|
||||
$mform->hideIf('nattachments', 'submissiontypefileavailable');
|
||||
|
||||
$label = get_string('allowedfiletypesforsubmission', 'workshop');
|
||||
$mform->addElement('filetypes', 'submissionfiletypes', $label);
|
||||
$mform->addHelpButton('submissionfiletypes', 'allowedfiletypesforsubmission', 'workshop');
|
||||
$mform->disabledIf('submissionfiletypes', 'submissiontypefileavailable');
|
||||
$mform->hideIf('submissionfiletypes', 'submissiontypefileavailable');
|
||||
|
||||
$options = get_max_upload_sizes($CFG->maxbytes, $this->course->maxbytes, 0, $workshopconfig->maxbytes);
|
||||
$mform->addElement('select', 'maxbytes', get_string('maxbytes', 'workshop'), $options);
|
||||
$mform->setDefault('maxbytes', $workshopconfig->maxbytes);
|
||||
$mform->disabledIf('maxbytes', 'submissiontypefileavailable');
|
||||
$mform->hideIf('maxbytes', 'submissiontypefileavailable');
|
||||
|
||||
$label = get_string('latesubmissions', 'workshop');
|
||||
$text = get_string('latesubmissions_desc', 'workshop');
|
||||
@ -196,18 +196,18 @@ class mod_workshop_mod_form extends moodleform_mod {
|
||||
}
|
||||
$mform->addElement('select', 'overallfeedbackfiles', get_string('overallfeedbackfiles', 'workshop'), $options);
|
||||
$mform->setDefault('overallfeedbackfiles', 0);
|
||||
$mform->disabledIf('overallfeedbackfiles', 'overallfeedbackmode', 'eq', 0);
|
||||
$mform->hideIf('overallfeedbackfiles', 'overallfeedbackmode', 'eq', 0);
|
||||
|
||||
$label = get_string('allowedfiletypesforoverallfeedback', 'workshop');
|
||||
$mform->addElement('filetypes', 'overallfeedbackfiletypes', $label);
|
||||
$mform->addHelpButton('overallfeedbackfiletypes', 'allowedfiletypesforoverallfeedback', 'workshop');
|
||||
$mform->disabledIf('overallfeedbackfiletypes', 'overallfeedbackfiles', 'eq', 0);
|
||||
$mform->hideIf('overallfeedbackfiletypes', 'overallfeedbackfiles', 'eq', 0);
|
||||
|
||||
$options = get_max_upload_sizes($CFG->maxbytes, $this->course->maxbytes);
|
||||
$mform->addElement('select', 'overallfeedbackmaxbytes', get_string('overallfeedbackmaxbytes', 'workshop'), $options);
|
||||
$mform->setDefault('overallfeedbackmaxbytes', $workshopconfig->maxbytes);
|
||||
$mform->disabledIf('overallfeedbackmaxbytes', 'overallfeedbackmode', 'eq', 0);
|
||||
$mform->disabledIf('overallfeedbackmaxbytes', 'overallfeedbackfiles', 'eq', 0);
|
||||
$mform->hideIf('overallfeedbackmaxbytes', 'overallfeedbackmode', 'eq', 0);
|
||||
$mform->hideIf('overallfeedbackmaxbytes', 'overallfeedbackfiles', 'eq', 0);
|
||||
|
||||
$label = get_string('conclusion', 'workshop');
|
||||
$mform->addElement('editor', 'conclusioneditor', $label, null,
|
||||
@ -226,7 +226,7 @@ class mod_workshop_mod_form extends moodleform_mod {
|
||||
$options = workshop::available_example_modes_list();
|
||||
$mform->addElement('select', 'examplesmode', $label, $options);
|
||||
$mform->setDefault('examplesmode', $workshopconfig->examplesmode);
|
||||
$mform->disabledIf('examplesmode', 'useexamples');
|
||||
$mform->hideIf('examplesmode', 'useexamples');
|
||||
|
||||
// Availability ---------------------------------------------------------------
|
||||
$mform->addElement('header', 'accesscontrol', get_string('availability', 'core'));
|
||||
@ -239,7 +239,7 @@ class mod_workshop_mod_form extends moodleform_mod {
|
||||
|
||||
$label = get_string('submissionendswitch', 'mod_workshop');
|
||||
$mform->addElement('checkbox', 'phaseswitchassessment', $label);
|
||||
$mform->disabledIf('phaseswitchassessment', 'submissionend[enabled]');
|
||||
$mform->hideIf('phaseswitchassessment', 'submissionend[enabled]');
|
||||
$mform->addHelpButton('phaseswitchassessment', 'submissionendswitch', 'mod_workshop');
|
||||
|
||||
$label = get_string('assessmentstart', 'workshop');
|
||||
|
Loading…
x
Reference in New Issue
Block a user