You are here

function simple_adsense_block_view in Simple AdSense 7

Implements hook_block_view().

@delta.

File

./simple_adsense.module, line 69
Module file for Simple AdSense.

Code

function simple_adsense_block_view($delta = '') {
  $block = array();
  $client = variable_get("simple_adsense_client", NULL);
  $slots = variable_get("simple_adsense_slots", NULL);
  if (isset($client) && isset($slots)) {
    foreach ($slots as $key => $value) {
      if ($delta == "simple_adsense_slot" . $key) {
        $block['subject'] = '<none>';
        $block['content'] = array(
          '#theme' => 'ad_unit',
          '#slot' => $value,
          '#client' => "ca-" . $client,
        );
      }
    }
  }
  return $block;
}