You are here

function twitter_pull_block in Twitter Pull 6

Same name and namespace in other branches
  1. 6.2 twitter_pull.module \twitter_pull_block()

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 161

Code

function twitter_pull_block($op = 'list', $delta = 0, $edit = array()) {
  $info = twitter_pull_block_data();
  switch ($op) {
    case 'list':
      return array_map(create_function('$a', 'return array("info"=>$a->name);'), $info);
      break;
    case 'view':
      $b_info = $info["{$delta}"];
      $content = twitter_pull_render($b_info->tweetkey, $b_info->title, $b_info->number_of_items, $b_info->theme_key);
      return array(
        "subject" => "",
        "content" => $content,
      );
      break;
  }
}