You are here

function site_map_block in Site map 5

Same name and namespace in other branches
  1. 6.2 site_map.module \site_map_block()
  2. 6 site_map.module \site_map_block()

Implementation of hook_block().

File

./site_map.module, line 208
Original author: Nic Ivy Now maintained by by Fredrik Jonsson fredrik at combonet dot se

Code

function site_map_block($op = 'list', $delta = 0) {
  if ($op == 'list') {
    $blocks[0]['info'] = t('Syndicate (site map)');
    return $blocks;
  }
  else {
    if ($op == 'view') {
      if (user_access('access content')) {
        $block['subject'] = t('Syndicate');
        if (arg(0) == 'blog') {
          $uid = arg(1);
          $feedurl = is_numeric($uid) ? "blog/{$uid}/feed" : 'blog/feed';
        }
        else {
          $feedurl = 'rss.xml';
        }
        $block['content'] = theme('feed_icon', url($feedurl));
        $block['content'] .= '<div class="more-link">' . l(t('more'), 'sitemap', array(
          'title' => t('View the site map to see more RSS feeds.'),
        )) . "</div>\n";
        return $block;
      }
    }
  }
}