MDL-32094 fix various E_STRICT compatibility problems

This commit is contained in:
Petr Skoda 2012-03-18 18:37:24 +01:00
parent 0ed6f71232
commit f20edd5208
27 changed files with 53 additions and 42 deletions

View file

@ -226,10 +226,13 @@ class block_manager {
$pageformat = $this->page->pagetype;
foreach($allblocks as $block) {
if (!$bi = block_instance($block->name)) {
continue;
}
if ($block->visible &&
(block_method_result($block->name, 'instance_allow_multiple') || !$this->is_block_present($block->name)) &&
($bi->instance_allow_multiple() || !$this->is_block_present($block->name)) &&
blocks_name_allowed_in_format($block->name, $pageformat) &&
block_method_result($block->name, 'user_can_addto', $this->page)) {
$bi->user_can_addto($this->page)) {
$this->addableblocks[$block->name] = $block;
}
}
@ -1850,7 +1853,11 @@ function blocks_remove_inappropriate($course) {
function blocks_name_allowed_in_format($name, $pageformat) {
$accept = NULL;
$maxdepth = -1;
$formats = block_method_result($name, 'applicable_formats');
if (!$bi = block_instance($name)) {
return false;
}
$formats = $bi->applicable_formats();
if (!$formats) {
$formats = array();
}