You are here

function share42_block_view in Share42 - social sharing buttons 7

Same name and namespace in other branches
  1. 7.2 share42.module \share42_block_view()

Implements hook_block_view().

File

./share42.module, line 82
Main file for the Share42 module.

Code

function share42_block_view($delta = '') {
  if ($delta == 'share42') {
    $block = array();
    $block['subject'] = '';
    $block['content'] = array(
      '#theme' => 'html_tag',
      '#tag' => 'div',
      '#attributes' => array(
        'class' => 'share42init',
        'data-url' => url(current_path(), array(
          'absolute' => TRUE,
        )),
        'data-title' => drupal_get_title(),
        'data-path' => base_path() . _share42_library_path() . '/',
        'data-top1' => variable_get('share42_top1', 200),
        'data-top2' => variable_get('share42_top2', 50),
        'data-margin' => variable_get('share42_margin', -70),
      ),
      '#value' => '',
      //so it renders the div correctly
      '#attached' => array(
        'js' => array(
          _share42_library_path() . '/share42.js' => array(
            'scope' => 'footer',
          ),
        ),
        'css' => array(
          drupal_get_path('module', 'share42') . '/css/share42.css',
        ),
      ),
    );
    return $block;
  }
}