1
0
mirror of https://github.com/moodle/moodle.git synced 2025-04-25 10:26:17 +02:00

MDL-38855 blocks: Fix missing setType calls

This commit is contained in:
David Monllao 2013-04-03 10:48:32 +08:00
parent 29c1fb339d
commit 238a6572c9

@ -89,6 +89,7 @@ class block_edit_form extends moodleform {
$parentcontext = context::instance_by_id($this->block->instance->parentcontextid);
$mform->addElement('hidden', 'bui_parentcontextid', $parentcontext->id);
$mform->setType('bui_parentcontextid', PARAM_INT);
$mform->addElement('static', 'bui_homecontext', get_string('createdat', 'block'), print_context_name($parentcontext));
$mform->addHelpButton('bui_homecontext', 'createdat', 'block');
@ -114,6 +115,7 @@ class block_edit_form extends moodleform {
// Let the form to know about that, can be useful later
$mform->addElement('hidden', 'bui_editingatfrontpage', (int)$editingatfrontpage);
$mform->setType('bui_editingatfrontpage', PARAM_INT);
// Front page, show the page-contexts element and set $pagetypelist to 'any page' (*)
// as unique option. Processign the form will do any change if needed
@ -145,6 +147,7 @@ class block_edit_form extends moodleform {
$contextoptions[BUI_CONTEXTS_CURRENT_SUBS] = get_string('showoncontextandsubs', 'block', $parentcontextname);
$mform->addElement('select', 'bui_contexts', get_string('contexts', 'block'), $contextoptions);
}
$mform->setType('bui_contexts', PARAM_INT);
// Generate pagetype patterns by callbacks if necessary (has not been set specifically)
if (empty($pagetypelist)) {
@ -175,6 +178,7 @@ class block_edit_form extends moodleform {
$values = array_keys($pagetypelist);
$value = array_pop($values);
$mform->addElement('hidden', 'bui_pagetypepattern', $value);
$mform->setType('bui_pagetypepattern', PARAM_RAW);
// Now we are really hiding a lot (both page-contexts and page-type-patterns),
// specially in some systemcontext pages having only one option (my/user...)
// so, until it's decided if we are going to add the 'bring-back' pattern to
@ -199,6 +203,7 @@ class block_edit_form extends moodleform {
if ($this->page->subpage) {
if ($parentcontext->contextlevel == CONTEXT_USER) {
$mform->addElement('hidden', 'bui_subpagepattern', '%@NULL@%');
$mform->setType('bui_subpagepattern', PARAM_RAW);
} else {
$subpageoptions = array(
'%@NULL@%' => get_string('anypagematchingtheabove', 'block'),