function theme_archive_navigation_years in Archive 6
Same name and namespace in other branches
- 5 archive.inc \theme_archive_navigation_years()
- 7.2 archive.pages.inc \theme_archive_navigation_years()
- 7 archive.pages.inc \theme_archive_navigation_years()
Theme the list of years for the archive navigation.
1 theme call to theme_archive_navigation_years()
- theme_archive_navigation in ./
archive.pages.inc - Theme the archive navigation with years, months and dates by default.
File
- ./
archive.pages.inc, line 262
Code
function theme_archive_navigation_years($type, $date) {
$output = "<ul id=\"archive-years\">\n";
$all_count = 0;
foreach ($date->years as $year_count) {
$all_count += $year_count;
}
$output .= '<li' . ($date->year ? '' : ' class="selected"') . '>' . l(t('All'), _archive_url($type), array(
'attributes' => array(
'title' => format_plural($all_count, '1 post', '@count posts'),
),
)) . "</li>\n";
foreach ($date->years as $year => $year_count) {
$class = '';
if ($year == $date->year) {
$class = ' class="selected"';
}
$output .= '<li' . $class . '>' . l($year, _archive_url($type, $year), array(
'attributes' => array(
'title' => format_plural($year_count, '1 post', '@count posts'),
),
)) . "</li>\n";
}
$output .= "</ul>\n";
return $output;
}