You are here

function dfp_block_view in Doubleclick for Publishers (DFP) 7.2

Same name and namespace in other branches
  1. 7 dfp.module \dfp_block_view()

Implements hook_block_view().

File

./dfp.module, line 145

Code

function dfp_block_view($delta) {
  $block = array();

  // If this is 32, this should be an md5 hash.
  if (drupal_strlen($delta) == 32) {
    $hashes = variable_get('dfp_block_hashes', array());
    if (!empty($hashes[$delta])) {
      $delta = $hashes[$delta];
    }
  }
  $tag = dfp_tag_load($delta);
  if (empty($tag->disabled)) {
    $block['content'] = dfp_tag($delta);
    $block['content']['#contextual_links'] = array(
      'dfp' => array(
        'admin/structure/dfp_ads/list',
        array(
          $delta,
          'edit',
        ),
      ),
    );
  }
  return $block;
}