function _block_load_blocks
Loads blocks' information from the database.
Return value
An array of blocks grouped by region.
1 call to _block_load_blocks()
- block_list in modules/
block/ block.module - Returns all blocks in the specified region for the current user.
File
-
modules/
block/ block.module, line 732
Code
function _block_load_blocks() {
global $theme_key;
$query = db_select('block', 'b');
$result = $query->fields('b')
->condition('b.theme', $theme_key)
->condition('b.status', 1)
->orderBy('b.region')
->orderBy('b.weight')
->orderBy('b.module')
->addTag('block_load')
->addTag('translatable')
->execute();
$block_info = $result->fetchAllAssoc('bid');
// Allow modules to modify the block list.
drupal_alter('block_list', $block_info);
$blocks = array();
foreach ($block_info as $block) {
$blocks[$block->region]["{$block->module}_{$block->delta}"] = $block;
}
return $blocks;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.