diff --git a/lib/blocklib.php b/lib/blocklib.php index 28fc6c71583..3d259c85d75 100644 --- a/lib/blocklib.php +++ b/lib/blocklib.php @@ -168,7 +168,7 @@ function blocks_remove_inappropriate($page) { } function blocks_name_allowed_in_format($name, $pageformat) { - + $accept = NULL; $depth = -1; if ($formats = block_method_result($name, 'applicable_formats')) { @@ -238,10 +238,10 @@ function blocks_have_content(&$pageblocks, $position) { continue; } if(!$obj->is_empty()) { - // cache rec and obj + // cache rec and obj // for blocks_print_group() $instance->rec = $record; - $instance->obj = $obj; + $instance->obj = $obj; return true; } } @@ -270,7 +270,7 @@ function blocks_print_group(&$page, &$pageblocks, $position) { $isediting = $page->user_is_editing(); foreach($pageblocks[$position] as $instance) { - + // $instance may have ->rec and ->obj // cached from when we walked $pageblocks // in blocks_have_content() @@ -289,7 +289,7 @@ function blocks_print_group(&$page, &$pageblocks, $position) { // Disabled by the admin continue; } - + if (empty($instance->obj)) { if (!$obj = block_instance($block->name, $instance)) { // Invalid block @@ -331,7 +331,7 @@ function blocks_print_group(&$page, &$pageblocks, $position) { } if (!empty($COURSE->javascriptportal) && (empty($instance->pinned) || !$instance->pinned)) { - $COURSE->javascriptportal->block_add('inst'.$instance->id, !$instance->visible); + $COURSE->javascriptportal->block_add('inst'.$instance->id, !$instance->visible); } } // End foreach @@ -345,13 +345,13 @@ function blocks_print_group(&$page, &$pageblocks, $position) { // for constant PAGE_MY_MOODLE include_once($CFG->dirroot.'/my/pagelib.php'); - + $coursecontext = get_context_instance(CONTEXT_COURSE, $COURSE->id); $myownblogpage = (isset($page->filtertype) && isset($page->filterselect) && $page->type=='blog-view' && $page->filtertype=='user' && $page->filterselect == $USER->id); - + $managecourseblocks = has_capability('moodle/site:manageblocks', $coursecontext); $editmymoodle = $page->type == PAGE_MY_MOODLE && has_capability('moodle/my:manageblocks', $coursecontext); - + if ($page->blocks_default_position() == $position && $page->user_is_editing() && ($managecourseblocks || $editmymoodle || $myownblogpage)) { @@ -470,12 +470,12 @@ function blocks_execute_action($page, &$pageblocks, $blockaction, $instanceorid, $block = blocks_get_record($instance->blockid); // Hacky hacky tricky stuff to get the original human readable block title, // even if the block has configured its title to be something else. - // Create the object WITHOUT instance data. + // Create the object WITHOUT instance data. $blockobject = block_instance($block->name); if ($blockobject === false) { break; } - + // First of all check to see if the block wants to be edited if(!$blockobject->user_can_edit()) { break; @@ -484,7 +484,7 @@ function blocks_execute_action($page, &$pageblocks, $blockaction, $instanceorid, // Now get the title and AFTER that load up the instance $blocktitle = $blockobject->get_title(); $blockobject->_load_instance($instance); - + optional_param('submitted', 0, PARAM_INT); // Define the data we're going to silently include in the instance config form here, @@ -514,7 +514,7 @@ function blocks_execute_action($page, &$pageblocks, $blockaction, $instanceorid, $page->print_header(get_string('pageheaderconfigablock', 'moodle'), array($strheading => '')); echo '