You are here

function twitter_pull_block_data in Twitter Pull 7.2

Same name and namespace in other branches
  1. 6.2 twitter_pull.module \twitter_pull_block_data()
  2. 6 twitter_pull.module \twitter_pull_block_data()
  3. 7 twitter_pull.module \twitter_pull_block_data()
2 calls to twitter_pull_block_data()
twitter_pull_block_info in ./twitter_pull.module
twitter_pull_block_view in ./twitter_pull.module
Implementation of hook_block_view()

File

./twitter_pull.module, line 254
Twitter Pull module.

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->title !== FALSE ? $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;
      $block->lazy_load = empty($block->lazy_load) ? FALSE : $block->lazy_load;
    }
  }
  else {
    $data = array();
  }
  return $data;
}