You are here

function theme_site_map_feed_icon in Site map 7

Same name and namespace in other branches
  1. 5 site_map.module \theme_site_map_feed_icon()
  2. 6.2 site_map.theme.inc \theme_site_map_feed_icon()
  3. 6 site_map.module \theme_site_map_feed_icon()

Returns HTML for a feed icon with link.

@codingStandardsIgnoreStart

Parameters

array $variables: An associative array containing:

  • url: The url of the feed.
  • name: The name of the feed.
  • type: The type of feed icon.

Return value

string Constructs and returns html with feed image icon.

6 theme calls to theme_site_map_feed_icon()
theme_site_map_rss_legend in includes/site_map.theme.inc
Returns HTML for a site map feed icon legend.
_site_map_audio in ./site_map.module
Render the latest maps for audio.
_site_map_blogs in ./site_map.module
Render the latest blogs.
_site_map_front_page in ./site_map.module
Menu callback for the site map front page.
_site_map_taxonomy_tree in ./site_map.module
Render the taxonomy tree.

... See full list

File

includes/site_map.theme.inc, line 79
site_map.theme.inc

Code

function theme_site_map_feed_icon($variables) {

  // @codingStandardsIgnoreEnd
  $output = '';
  switch ($variables['type']) {
    case 'node':
      $output = theme('image', array(
        'path' => drupal_get_path('module', 'site_map') . '/images/feed-small.png',
        'alt' => t('Syndicated feed icon'),
      ));
      break;
    case 'comment':
      $output = theme('image', array(
        'path' => drupal_get_path('module', 'site_map') . '/images/feed-small-comment.png',
        'alt' => t('Syndicated feed icon'),
      ));
      break;
  }
  if (!empty($variables['url'])) {
    $output = l($output, $variables['url'], array(
      'attributes' => array(
        'class' => array(
          'feed-link',
        ),
        'title' => t('Syndicated feed for') . ' ' . $variables['name'],
      ),
      'html' => TRUE,
    ));
  }
  return $output;
}