MDL-23395, go straight to page editing page when title is not empyt and forceformat is set

This commit is contained in:
Dongsheng Cai
2010-11-08 06:33:00 +00:00
parent ae671b6c67
commit 97f2eb45a1
4 changed files with 24 additions and 19 deletions
+13 -11
View File
@@ -44,19 +44,21 @@ class mod_wiki_create_form extends moodleform {
}
$mform->addElement('text', 'pagetitle', get_string('newpagetitle', 'wiki'), $textoptions);
$mform->addElement('static', 'format', get_string('format', 'wiki'));
$mform->addHelpButton('format', 'format', 'wiki');
foreach ($formats as $format) {
if ($format == $defaultformat) {
$attr = array('checked'=>'checked');
}else if (!empty($forceformat)){
if ($forceformat) {
$mform->addElement('hidden', 'pageformat', $defaultformat);
} else {
$mform->addElement('static', 'format', get_string('format', 'wiki'));
$mform->addHelpButton('format', 'format', 'wiki');
foreach ($formats as $format) {
if ($format == $defaultformat) {
$attr = array('checked'=>'checked');
}else if (!empty($forceformat)){
$attr = array('disabled'=>'disabled');
} else {
$attr = array();
} else {
$attr = array();
}
$mform->addElement('radio', 'pageformat', '', get_string('format'.$format, 'wiki'), $format, $attr);
}
$mform->addElement('radio', 'pageformat', '', get_string('format'.$format, 'wiki'), $format, $attr);
}
//hiddens