You are here

function twitter_pull_block_data in Twitter Pull 6

Same name and namespace in other branches
  1. 6.2 twitter_pull.module \twitter_pull_block_data()
  2. 7.2 twitter_pull.module \twitter_pull_block_data()
  3. 7 twitter_pull.module \twitter_pull_block_data()
1 call to twitter_pull_block_data()
twitter_pull_block in ./twitter_pull.module
Implementation of hook_block() Note we are getting info about blocks from the twitter_pull_block_data function if at some time this data is store in the db (currently it is just in code) then we would want to add the config options in a $op = configure

File

./twitter_pull.module, line 186

Code

function twitter_pull_block_data() {
  static $data;

  //-- Static cache;
  if (!empty($data)) {
    return $data;
  }
  $data = module_invoke_all('twitter_pull_blocks');
  drupal_alter('twitter_pull_data', $data);

  //-- Do some cleanup
  if (!empty($data) && is_array($data)) {
    foreach ($data as &$block) {

      //-- assign defaults
      $block->title = empty($block->title) ? $block->name : $block->title;
      $block->number_of_items = empty($block->number_of_items) ? 5 : $block->number_of_items;
      $block->theme_key = empty($block->theme_key) ? 'twitter_pull_listing' : $block->theme_key;
    }
  }
  else {
    $data = array();
  }
  return $data;
}