You are here

function hook_mongodb_block_ui_view in MongoDB 7

Process the mongodb_block_ui when enabled in a region, to view its contents.

Parameters

string $delta: Which mongodb_block_ui to return. This is a descriptive string used to identify mongodb_block_uis within each module and also within the theme system. The $delta for each mongodb_block_ui is defined within the array that your module returns when the hook_mongodb_block_ui_info() implementation is called.

Return value

array An array which must define a 'subject' element and a 'content' element defining the mongodb_block_ui indexed by $delta.

The functions mymodule_display_mongodb_block_ui_exciting and _amazing, as used in the example, should of course be defined somewhere in your module and return the content you want to display to your users. If the "content" element is empty, no mongodb_block_ui will be displayed even if "subject" is present.

For a detailed usage example, see mongodb_block_ui_example.module.

1 function implements hook_mongodb_block_ui_view()

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_view in mongodb_block_ui/tests/mongodb_block_ui_test.module
Implements hook_mongodb_block_ui_view().

File

mongodb_block_ui/mongodb_block_ui.api.php, line 145
Hooks provided by the Block module.

Code

function hook_mongodb_block_ui_view($delta = '') {
  switch ($delta) {
    case 'exciting':
      $mongodb_block_ui = array(
        'subject' => t('Default title of the exciting mongodb_block_ui'),
        'content' => mymodule_display_mongodb_block_ui_exciting(),
      );
      break;
    case 'amazing':
      $mongodb_block_ui = array(
        'subject' => t('Default title of the amazing mongodb_block_ui'),
        'content' => mymodule_display_mongodb_block_ui_amazing(),
      );
      break;
  }
  return $mongodb_block_ui;
}