You are here

function responsive_share_buttons_contextual_links_view_alter in Responsive Share Buttons 7

Same name and namespace in other branches
  1. 8 responsive_share_buttons.module \responsive_share_buttons_contextual_links_view_alter()

Implements hook_contextual_links_view_alter().

File

./responsive_share_buttons.module, line 86
Module to enable CSS responsive share buttons.

Code

function responsive_share_buttons_contextual_links_view_alter(&$element, $items) {
  $block = isset($element['#element']['#block']) ? $element['#element']['#block'] : NULL;
  if (is_object($block) && $block->module == 'responsive_share_buttons') {
    if ($block->delta == 'share' && user_access('configure responsive share buttons')) {
      $element['#links']['responsive_share_buttons'] = array(
        'title' => t('Configure responsive share buttons'),
        'href' => 'admin/config/user-interface/responsive_share_buttons',
        'query' => drupal_get_destination(),
        'attributes' => array(
          'title' => t('Configure the responsive share buttons links.'),
        ),
      );
    }
  }
}