From d24206d657caeb4298d1efab03bd8c6f317a758f Mon Sep 17 00:00:00 2001 From: jamiesensei Date: Sun, 12 Nov 2006 11:07:12 +0000 Subject: [PATCH] fixed problem with select box element for 'forum type' which must sometimes display option which is otherwise unselectable. --- mod/forum/mod_form.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/mod/forum/mod_form.php b/mod/forum/mod_form.php index 1093eea834..3b7ebf6490 100644 --- a/mod/forum/mod_form.php +++ b/mod/forum/mod_form.php @@ -131,8 +131,16 @@ class forum_mod_form extends moodleform_mod { function definition_after_data(){ $mform =& $this->_form; $type=&$mform->getElement('type'); - $typevalue=$mform->exportValue('type'); - if ($typevalue=='news' || $typevalue=='social'){ + $typevalue=$mform->getElementValue('type'); + //we don't want to have these appear as possible selections in the form but + //we want the form to display them if they are set. + if ($typevalue[0]=='news'){ + $type->addOption(get_string('namenews', 'forum'), 'news'); + $type->freeze(); + $type->setPersistantFreeze(true); + } + if ($typevalue[0]=='social'){ + $type->addOption(get_string('namesocial', 'forum'), 'social'); $type->freeze(); $type->setPersistantFreeze(true); } -- 2.39.5