Skip to content

Commit

Permalink
One-line-setup function for using blocks in a page.
Browse files Browse the repository at this point in the history
  • Loading branch information
defacer committed Mar 2, 2005
1 parent 262771e commit ec79d3e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/blocklib.php
Expand Up @@ -312,6 +312,13 @@ function blocks_find_instance($instanceid, $blocksarray) {
return false;
}

// Simple entry point for anyone that wants to use blocks
function blocks_setup(&$PAGE) {
$pageblocks = blocks_get_by_page($PAGE);
blocks_execute_url_action($PAGE, $pageblocks);
return $pageblocks;
}

function blocks_execute_action($page, &$pageblocks, $blockaction, $instanceorid) {
global $CFG;

Expand Down

0 comments on commit ec79d3e

Please sign in to comment.