diff --git a/site_map.module b/site_map.module index e510f34..a6f1b39 100644 --- a/site_map.module +++ b/site_map.module @@ -49,7 +49,7 @@ function site_map_theme() { 'file' => 'site_map.theme.inc', ), 'site_map_feed_icon' => array( - 'variables' => array('url' => NULL, 'type' => 'node'), + 'variables' => array('url' => NULL, 'name' => NULL, 'type' => 'node'), 'file' => 'site_map.theme.inc', ), 'site_map_menu_link' => array( @@ -190,9 +190,9 @@ function _site_map_front_page() { $output = l(t('Front page of %sn', array('%sn' => variable_get('site_name', 'Drupal'))), '', array('html' => TRUE)); if (variable_get('site_map_show_rss_links', 1) != 0) { - $rss_link = theme('site_map_feed_icon', array('url' => variable_get('site_map_rss_front', 'rss.xml'))); + $rss_link = theme('site_map_feed_icon', array('url' => variable_get('site_map_rss_front', 'rss.xml'), 'name' => 'front page')); if (module_exists('commentrss') && variable_get('commentrss_site', COMMENTRSS_SITE_FRONT_PAGE)) { - $rss_link .= ' ' . theme('site_map_feed_icon', array('url' => 'crss', 'type' => 'comment')); + $rss_link .= ' ' . theme('site_map_feed_icon', array('url' => 'crss', 'name' => 'front page comments', 'type' => 'comment')); } if (variable_get('site_map_show_rss_links', 1) == 1) { $output .= ' ' . $rss_link; @@ -232,7 +232,7 @@ function _site_map_blogs() { $blog_link = l(t('All blogs'), 'blog'); if (variable_get('site_map_show_rss_links', 1) != 0) { - $rss_link = theme('site_map_feed_icon', array('url' => 'blog/feed')); + $rss_link = theme('site_map_feed_icon', array('url' => 'blog/feed', 'name' => 'all blogs')); if (variable_get('site_map_show_rss_links', 1) == 1) { $blog_link .= ' ' . $rss_link; } @@ -260,7 +260,7 @@ function _site_map_blogs() { '@num_items' => $blog->numitems, )); if (variable_get('site_map_show_rss_links', 1) != 0) { - $rss_link = theme('site_map_feed_icon', array('url' => "blog/$blog->uid/feed")); + $rss_link = theme('site_map_feed_icon', array('url' => "blog/$blog->uid/feed", 'name' => $blog->name . '\'s blog')); if (variable_get('site_map_show_rss_links', 1) == 1) { $blog_item .= ' ' . $rss_link; } @@ -300,7 +300,7 @@ function _site_map_audio() { $title = t('Audio'); $output = l(t('Audio content'), 'audio'); if (variable_get('site_map_show_rss_links', 1) != 0) { - $rss_link = theme('site_map_feed_icon', array('url' => 'audio/feed')); + $rss_link = theme('site_map_feed_icon', array('url' => 'audio/feed', 'name' => 'audio content')); if (variable_get('site_map_show_rss_links', 1) == 1) { $output .= ' ' . $rss_link; } @@ -340,7 +340,7 @@ function _site_map_video() { $title = t('Video'); $output = l(t('Video content'), 'video'); if (variable_get('site_map_show_rss_links', 1) != 0) { - $rss_link = theme('site_map_feed_icon', array('url' => 'video/feed')); + $rss_link = theme('site_map_feed_icon', array('url' => 'video/feed', 'name' => 'video content')); if (variable_get('site_map_show_rss_links', 1) == 1) { $output .= ' ' . $rss_link; } @@ -550,7 +550,7 @@ function _site_map_taxonomy_tree($vid, $name = NULL, $description = NULL) { $threshold = variable_get('site_map_term_threshold', 0); $forum_link = FALSE; } - $title .= (module_exists('commentrss') && variable_get('commentrss_term', FALSE) ? ' ' . theme('site_map_feed_icon', array('url' => "crss/vocab/$vid", 'type' => 'comment')) : ''); + $title .= (module_exists('commentrss') && variable_get('commentrss_term', FALSE) ? ' ' . theme('site_map_feed_icon', array('url' => "crss/vocab/$vid", 'name' => check_plain($name), 'type' => 'comment')) : ''); $last_depth = -1; @@ -596,13 +596,13 @@ function _site_map_taxonomy_tree($vid, $name = NULL, $description = NULL) { $term_item .= check_plain($term->name); } if (variable_get('site_map_show_count', 1)) { - $term_item .= " ($term->count)"; + $term_item .= ' (' . $term->count . ')'; } if (variable_get('site_map_show_rss_links', 1) != 0) { - $rss_link = theme('site_map_feed_icon', array('url' => 'taxonomy/term/' . $term->tid . '/feed')); + $rss_link = theme('site_map_feed_icon', array('url' => 'taxonomy/term/' . $term->tid . '/feed', 'name' => $term->name)); if (module_exists('commentrss') && variable_get('commentrss_term', FALSE)) { - $rss_link .= ' ' . theme('site_map_feed_icon', array('url' => "crss/term/$term->tid", 'type' => 'comment')); + $rss_link .= ' ' . theme('site_map_feed_icon', array('url' => "crss/term/$term->tid", 'type' => 'comment', 'name' => $term->name . ' comments')); } if (variable_get('site_map_show_rss_links', 1) == 1) { $term_item .= ' ' . $rss_link; diff --git a/site_map.theme.inc b/site_map.theme.inc index 1f5791b..2a0c7ae 100644 --- a/site_map.theme.inc +++ b/site_map.theme.inc @@ -68,6 +68,7 @@ function theme_site_map_box($variables) { * @param 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 string @@ -80,8 +81,7 @@ function theme_site_map_feed_icon($variables) { case 'node': $output = theme('image', array( 'path' => drupal_get_path('module', 'site_map') . '/feed-small.png', - 'title' => t('Syndicate content'), - 'alt' => t('Syndicate content'), + 'alt' => t('Syndicated feed icon'), ) ); break; @@ -89,15 +89,14 @@ function theme_site_map_feed_icon($variables) { case 'comment': $output = theme('image', array( 'path' => drupal_get_path('module', 'site_map') . '/feed-small-comment.png', - 'title' => t('Syndicate comments'), - 'alt' => t('Syndicate comments'), + 'alt' => t('Syndicated feed icon'), ) ); break; } if (!empty($variables['url'])) { - $output = l($output, $variables['url'], array('attributes' => array('class' => 'feed-link'), 'html' => TRUE)); + $output = l($output, $variables['url'], array('attributes' => array('class' => array('feed-link'), 'title' => t('Syndicated feed for') . ' ' . $variables['name']), 'html' => TRUE)); } return $output;