You are here

function theme_calendar_arg_title in Calendar 5.2

Same name and namespace in other branches
  1. 5 calendar.theme \theme_calendar_arg_title()

Theme the calendar title and breadcrumbs Arguments are evaluated in year, month, day or year, week order so you can track previous values in the session.

Parameters

string $field_type - 'YEAR', 'MONTH', 'DAY', 'WEEK':

integer $value - the current number for the field type as selected in the view argument.:

Return value

string formatted title

2 theme calls to theme_calendar_arg_title()
calendar_handler_arg_type in ./calendar.module
Custom views handler for all calendar arguments.
theme_calendar_page_title in ./calendar.theme
Theme the calendar page title.

File

./calendar.theme, line 236

Code

function theme_calendar_arg_title($field_type, $value, $query) {
  $value = intval(check_plain($value));
  if (empty($value)) {
    return '';
  }
  else {
    $view = $GLOBALS['current_view'];
    switch (strtoupper($field_type)) {
      case 'YEAR':
        $view->year = $value;
        return $view->year;
      case 'MONTH':
        return date_format_date($view->min_date, 'custom', 'F');
      case 'DAY':
        return date_format_date($view->min_date, 'custom', 'l, F j Y');
      case 'WEEK':
        return t('Week of @date', array(
          '@date' => date_format($view->min_date, 'F j'),
        ));
    }
  }
  return $value;
}