You are here

function addthis_block_view in AddThis 7.4

Same name and namespace in other branches
  1. 7.2 addthis.module \addthis_block_view()

Implements hook_block_view().

#block key allows alter hooks to react on this information. Someone might want to change this specific display.

File

includes/addthis.block.inc, line 26
Block related hook implementations for the AddThis-module.

Code

function addthis_block_view($block_name = '') {
  if ($block_name == AddThis::BLOCK_NAME) {
    $widget_type = AddThis::getInstance()
      ->getBlockDisplayType();
    $widget_settings = AddThis::getInstance()
      ->getBlockDisplaySettings();
    $block_options = array(
      '#block' => AddThis::BLOCK_NAME,
      '#display' => array(
        'settings' => $widget_settings,
      ),
    );
    $markup = AddThis::getInstance()
      ->getDisplayMarkup($widget_type, $block_options);
    return array(
      'subject' => '',
      'content' => $markup,
    );
  }
}