You are here

function hook_mongodb_block_ui_view_MODULE_DELTA_alter in MongoDB 7

Perform alterations to a specific mongodb_block_ui.

Modules can implement hook_mongodb_block_ui_view_MODULE_DELTA_alter() to modify a specific mongodb_block_ui, rather than implementing hook_mongodb_block_ui_view_alter().

Note that this hook fires before hook_mongodb_block_ui_view_alter(). Therefore, all implementations of hook_mongodb_block_ui_view_MODULE_DELTA_alter() will run before all implementations of hook_mongodb_block_ui_view_alter(), regardless of the module order.

Parameters

array $data: An array of data, as returned from the hook_mongodb_block_ui_view() implementation of the module that defined the mongodb_block_ui:

  • subject: The localized title of the mongodb_block_ui.
  • content: Either a string or a renderable array representing the content of the mongodb_block_ui. You should check that the content is an array before trying to modify parts of the renderable structure.

object $mongodb_block_ui: The mongodb_block_ui object, as loaded from the database, having the main properties:

  • module: The name of the module that defined the mongodb_block_ui.
  • delta: The identifier for the mongodb_block_ui within that module, as defined within hook_mongodb_block_ui_info().

See also

hook_mongodb_block_ui_view_alter()

hook_mongodb_block_ui_view()

File

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

Code

function hook_mongodb_block_ui_view_MODULE_DELTA_alter(array &$data, $mongodb_block_ui) {

  // This code will only run for a specific mongodb_block_ui. For example, if
  // MODULE_DELTA in the function definition above is set to
  // "mymodule_somedelta", the code will only run on the "somedelta"
  // mongodb_block_ui provided by the "mymodule" module.
  // Change the title of the "somedelta" mongodb_block_ui provided by the
  // "mymodule" module.
  $data['subject'] = t('New title of the mongodb_block_ui');
}