You are here

function site_map_block_view in Site map 7

Implements hook_block_view().

File

./site_map.module, line 166
site_map.module

Code

function site_map_block_view($delta = '') {
  if (user_access('access content')) {
    switch ($delta) {
      case 'syndicate':
        $block['subject'] = t('Syndicate');
        if (arg(0) == 'blog') {
          $uid = arg(1);
          $feedurl = is_numeric($uid) ? "blog/{$uid}/feed" : 'blog/feed';
        }
        else {
          $feedurl = variable_get('site_map_rss_front', 'rss.xml');
        }
        $block['content'] = theme('feed_icon', array(
          'url' => $feedurl,
          'title' => t('Syndicate'),
        ));
        $block['content'] .= theme('more_link', array(
          'url' => 'sitemap',
          'title' => t('View the site map to see more RSS feeds.'),
        ));
        break;
      case 'site_map':
        $block['subject'] = _site_map_title();
        $block['content'] = site_map_content();
        break;
    }
    return $block;
  }
}