You are here

function tweet_block in Tweet 6.4

Same name and namespace in other branches
  1. 6.3 tweet.module \tweet_block()

Implementation of hook_block().

File

./tweet.module, line 66
Builds links to post pages to Twitter API sites.

Code

function tweet_block($op = 'list', $delta = 0, $edit = NULL) {
  if ($op == 'list') {
    $block['tweet']['info'] = t('Tweet link');
    return $block;
  }
  elseif ($op == 'view' && $delta == 'tweet') {
    $block['subject'] = t('Tweet this');
    $links = array();
    foreach (tweet_sites(TRUE) as $site => $info) {
      $links[$site] = tweet_to_twitter($site);
    }
    $block['content'] = theme('item_list', $links);
    return $block;
  }
}