function views_add_block_contextual_links

cis7 views.module views_add_block_contextual_links(&$block, $view, $display_id, $block_type = 'block')
cle7 views.module views_add_block_contextual_links(&$block, $view, $display_id, $block_type = 'block')
elmsmedia7 views.module views_add_block_contextual_links(&$block, $view, $display_id, $block_type = 'block')
icor7 views.module views_add_block_contextual_links(&$block, $view, $display_id, $block_type = 'block')
meedjum_blog7 views.module views_add_block_contextual_links(&$block, $view, $display_id, $block_type = 'block')
mooc7 views.module views_add_block_contextual_links(&$block, $view, $display_id, $block_type = 'block')

Converts Views block content to a renderable array with contextual links.

Parameters

$block: An array representing the block, with the same structure as the return value of hook_block_view(). This will be modified so as to force $block['content'] to be a renderable array, containing the optional '#contextual_links' property (if there are any contextual links associated with the block).

$view: The view that was used to generate the block content.

$display_id: The ID of the display within the view that was used to generate the block content.

$block_type: The type of the block. If it's block it's a regular views display, but 'special_block_-exp' exist as well.

1 call to views_add_block_contextual_links()
views_block_view in sites/all/modules/ulmus/views/views.module
Implement hook_block_view().

File

sites/all/modules/ulmus/views/views.module, line 734
Primarily Drupal hooks and global API functions to manipulate views.

Code

function views_add_block_contextual_links(&$block, $view, $display_id, $block_type = 'block') {
  // Do not add contextual links to an empty block.
  if (!empty($block['content'])) {
    // Contextual links only work on blocks whose content is a renderable
    // array, so if the block contains a string of already-rendered markup,
    // convert it to an array.
    if (is_string($block['content'])) {
      $block['content'] = array('#markup' => $block['content']);
    }
    // Add the contextual links.
    views_add_contextual_links($block['content'], $block_type, $view, $display_id);
  }
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.