5 * Block related hook implementations for the AddThis-module.
9 * Implements hook_block_info().
11 function addthis_block_info() {
12 $block_info = array();
13 $block_info[AddThis
::BLOCK_NAME
] = array(
14 'info' => t('AddThis'),
15 'cache' => DRUPAL_NO_CACHE
,
21 * Implements hook_block_view().
23 * #block key allows alter hooks to react on this information. Someone might
24 * want to change this specific display.
26 function addthis_block_view($block_name = '') {
27 if ($block_name == AddThis
::BLOCK_NAME
) {
28 $widget_type = AddThis
::getInstance()->getBlockDisplayType();
29 $markup = AddThis
::getInstance()->getDisplayMarkup($widget_type, array('#block' => AddThis
::BLOCK_NAME
));
38 * Implements hook_block_configure().
40 function addthis_block_configure($delta = '') {
41 $form[AddThis
::BLOCK_WIDGET_TYPE_KEY
] = array(
43 '#title' => t('AddThis display type'),
44 '#options' => AddThis
::getInstance()->getDisplayTypes(),
45 '#default_value' => AddThis
::getInstance()->getBlockDisplayType(),
51 * Implements hook_block_save().
53 function addthis_block_save($delta = '', $edit = array()) {
54 variable_set(AddThis
::BLOCK_WIDGET_TYPE_KEY
, $edit[AddThis
::BLOCK_WIDGET_TYPE_KEY
]);