diff --git a/mod/choice/mod_form.php b/mod/choice/mod_form.php index 587472e9fc6..9fc3741c267 100644 --- a/mod/choice/mod_form.php +++ b/mod/choice/mod_form.php @@ -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")); diff --git a/mod/data/mod_form.php b/mod/data/mod_form.php index be7af42ff18..68406806d4b 100644 --- a/mod/data/mod_form.php +++ b/mod/data/mod_form.php @@ -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')); diff --git a/mod/feedback/item/feedback_item_form_class.php b/mod/feedback/item/feedback_item_form_class.php index 6efb6682b28..be3db851a39 100644 --- a/mod/feedback/item/feedback_item_form_class.php +++ b/mod/feedback/item/feedback_item_form_class.php @@ -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', ''); diff --git a/mod/feedback/item/multichoice/multichoice_form.php b/mod/feedback/item/multichoice/multichoice_form.php index 15af8a3e778..9059ca38060 100644 --- a/mod/feedback/item/multichoice/multichoice_form.php +++ b/mod/feedback/item/multichoice/multichoice_form.php @@ -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', diff --git a/mod/feedback/item/multichoicerated/multichoicerated_form.php b/mod/feedback/item/multichoicerated/multichoicerated_form.php index 7e8b0fe76cf..0dcd0f218d2 100644 --- a/mod/feedback/item/multichoicerated/multichoicerated_form.php +++ b/mod/feedback/item/multichoicerated/multichoicerated_form.php @@ -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', diff --git a/mod/forum/mod_form.php b/mod/forum/mod_form.php index decea410987..85beb21d8b4 100644 --- a/mod/forum/mod_form.php +++ b/mod/forum/mod_form.php @@ -143,7 +143,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); } @@ -184,14 +184,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'); diff --git a/mod/glossary/edit_form.php b/mod/glossary/edit_form.php index 61151e3cf30..f6253b0a78a 100644 --- a/mod/glossary/edit_form.php +++ b/mod/glossary/edit_form.php @@ -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); } diff --git a/mod/glossary/mod_form.php b/mod/glossary/mod_form.php index 468d5d728e0..b92ba453051 100644 --- a/mod/glossary/mod_form.php +++ b/mod/glossary/mod_form.php @@ -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); } //------------------------------------------------------------------------------- diff --git a/mod/lesson/mod_form.php b/mod/lesson/mod_form.php index e87bff4d8f9..21c56464a22 100644 --- a/mod/lesson/mod_form.php +++ b/mod/lesson/mod_form.php @@ -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--) { diff --git a/mod/lti/mod_form.php b/mod/lti/mod_form.php index 8ce399d86f1..163e923c6b5 100644 --- a/mod/lti/mod_form.php +++ b/mod/lti/mod_form.php @@ -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')); diff --git a/mod/page/mod_form.php b/mod/page/mod_form.php index b8ff4ab05a3..ad87aec0beb 100644 --- a/mod/page/mod_form.php +++ b/mod/page/mod_form.php @@ -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); diff --git a/mod/quiz/mod_form.php b/mod/quiz/mod_form.php index 27eec4a77c7..fda0558604c 100644 --- a/mod/quiz/mod_form.php +++ b/mod/quiz/mod_form.php @@ -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. diff --git a/mod/resource/mod_form.php b/mod/resource/mod_form.php index 5599b58883a..37f2c480f1d 100644 --- a/mod/resource/mod_form.php +++ b/mod/resource/mod_form.php @@ -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); } diff --git a/mod/scorm/mod_form.php b/mod/scorm/mod_form.php index a84fbb09ef2..b772c935fc7 100644 --- a/mod/scorm/mod_form.php +++ b/mod/scorm/mod_form.php @@ -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'), '
', 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); diff --git a/mod/url/mod_form.php b/mod/url/mod_form.php index 5fb483d0b4a..2328ccae4af 100644 --- a/mod/url/mod_form.php +++ b/mod/url/mod_form.php @@ -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); } diff --git a/mod/workshop/mod_form.php b/mod/workshop/mod_form.php index 7ee8cdcd1a9..a13766c1d06 100644 --- a/mod/workshop/mod_form.php +++ b/mod/workshop/mod_form.php @@ -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');