function hook_mongodb_block_ui_info in MongoDB 7
Define all mongodb_block_uis provided by the module.
Any module can export a mongodb_block_ui (or mongodb_block_uis) to be displayed by defining the _mongodb_block_ui hook. This hook is called by theme.inc to display a mongodb_block_ui, and also by mongodb_block_ui.module to procure the list of available mongodb_block_uis.
Return value
array An associative array whose keys define the $delta for each mongodb_block_ui and whose values contain the mongodb_block_ui descriptions. Each mongodb_block_ui description is itself an associative array, with the following key-value pairs:
- 'info': (required) The human-readable name of the mongodb_block_ui.
- 'cache': A bitmask of flags describing how the mongodb_block_ui should
behave with respect to mongodb_block_ui caching. The following shortcut
bitmasks are provided as constants in common.inc:
- DRUPAL_CACHE_PER_ROLE (default): The mongodb_block_ui can change depending on the roles the user viewing the page belongs to.
- DRUPAL_CACHE_PER_USER: The mongodb_block_ui can change depending on the user viewing the page. This setting can be resource-consuming for sites with large number of users, and should only be used when DRUPAL_CACHE_PER_ROLE is not sufficient.
- DRUPAL_CACHE_PER_PAGE: The mongodb_block_ui can change depending on the page being viewed.
- DRUPAL_CACHE_GLOBAL: The mongodb_block_ui is the same for every user on every page where it is visible.
- DRUPAL_NO_CACHE: The mongodb_block_ui should not get cached.
- 'weight', 'status', 'region', 'visibility', 'pages': You can give your mongodb_block_uis an explicit weight, enable them, limit them to given pages, etc. These settings will be registered when the mongodb_block_ui is first loaded at admin/mongodb_block_ui, and from there can be changed manually via mongodb_block_ui administration. Note that if you set a region that isn't available in a given theme, the mongodb_block_ui will be registered instead to that theme's default region (the first item in the _regions array).
After completing your mongodb_block_uis, do not forget to enable them in the mongodb_block_ui admin menu.
For a detailed usage example, see mongodb_block_ui_example.module.
1 function implements hook_mongodb_block_ui_info()
Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.
- mongodb_block_ui_test_mongodb_block_ui_info in mongodb_block_ui/
tests/ mongodb_block_ui_test.module - Implements hook_mongodb_block_ui_info().
File
- mongodb_block_ui/
mongodb_block_ui.api.php, line 55 - Hooks provided by the Block module.
Code
function hook_mongodb_block_ui_info() {
$mongodb_block_uis['exciting'] = array(
'info' => t('An exciting mongodb_block_ui provided by Mymodule.'),
'weight' => 0,
'status' => 1,
'region' => 'sidebar_first',
);
$mongodb_block_uis['amazing'] = array(
'info' => t('An amazing mongodb_block_ui provided by Mymodule.'),
'cache' => DRUPAL_CACHE_PER_ROLE | DRUPAL_CACHE_PER_PAGE,
);
return $mongodb_block_uis;
}