blocks MDL-19010 Slight reordering of logic to allow titles to be changed by block get_contents (credit to tim)

This commit is contained in:
moodler 2009-07-31 04:17:09 +00:00
parent 2c78f462ed
commit e54f4a78cc

View file

@ -356,6 +356,15 @@ class block_base {
$bc->blockinstanceid = $this->instance->id;
$bc->blockpositionid = $this->instance->blockpositionid;
if ($this->instance->visible) {
$bc->content = $this->formatted_contents($output);
if (!empty($this->content->footer)) {
$bc->footer = $this->content->footer;
}
} else {
$bc->add_class('invisible');
}
$attributes = $this->html_attributes();
if (isset($attributes['id'])) {
$bc->id = $attributes['id'];
@ -371,15 +380,6 @@ class block_base {
$bc->title = $this->title;
}
if ($this->instance->visible) {
$bc->content = $this->formatted_contents($output);
if (!empty($this->content->footer)) {
$bc->footer = $this->content->footer;
}
} else {
$bc->add_class('invisible');
}
if ($this->page->user_is_editing()) {
$bc->controls = $this->page->blocks->edit_controls($this);
}