You are here

function theme_archive_navigation in Archive 7.2

Same name and namespace in other branches
  1. 5 archive.inc \theme_archive_navigation()
  2. 6 archive.pages.inc \theme_archive_navigation()
  3. 7 archive.pages.inc \theme_archive_navigation()

Theme the archive navigation with years, months and dates by default.

1 theme call to theme_archive_navigation()
archive_page in ./archive.pages.inc
Fetch nodes for the selected date, or current date if none selected.

File

./archive.pages.inc, line 256
Pages for the archive module.

Code

function theme_archive_navigation($variables) {
  $output = "<div id=\"archive-container\"><dl><dt>" . t('Date') . "</dt><dd>\n";
  $output .= theme('archive_navigation_years', array(
    'type' => $variables['type'],
    'date' => $variables['date'],
  ));
  if (_archive_validate_date($variables['date']->year)) {
    $output .= theme('archive_navigation_months', array(
      'type' => $variables['type'],
      'date' => $variables['date'],
    ));
  }
  if (_archive_validate_date($variables['date']->year, $variables['date']->month)) {
    $output .= theme('archive_navigation_days', array(
      'type' => $variables['type'],
      'date' => $variables['date'],
    ));
  }
  $output .= "</dd>";

  // Only display node type filter if more than one node type represented
  if (sizeof(_archive_node_types($variables['date'])) > 1) {
    $output .= "<dt>" . t('Type') . "</dt><dd>\n";
    $output .= theme('archive_navigation_node_types', array(
      'type' => $variables['type'],
      'date' => $variables['date'],
    ));
    $output .= "</dd>";
  }
  $output .= "</dl></div>\n";
  return $output;
}