You are here

function template_preprocess_calendar_mini in Calendar 8

Same name and namespace in other branches
  1. 6.2 theme/theme.inc \template_preprocess_calendar_mini()
  2. 6.2 calendar_multiday/theme/theme.inc \template_preprocess_calendar_mini()
  3. 7.3 theme/theme.inc \template_preprocess_calendar_mini()
  4. 7 theme/theme.inc \template_preprocess_calendar_mini()
  5. 7 calendar_multiday/theme/theme.inc \template_preprocess_calendar_mini()
  6. 7.2 theme/theme.inc \template_preprocess_calendar_mini()
  7. 7.2 calendar_multiday/theme/theme.inc \template_preprocess_calendar_mini()

Display a mini month view.

File

./calendar.theme.inc, line 74
Theme functions for the Calendar module.

Code

function template_preprocess_calendar_mini(&$vars) {

  // Add in all the $vars added by the main calendar preprocessor.
  template_preprocess_calendar_month($vars);
  $date = $vars['date'];
  $view = $vars['view'];

  // Make sure that the calendar title links go to the month view,
  // not the year view (if this is embedded in a year display).
  $full_date_arg = str_replace('-', '', $date);
  $view->override_path = CalendarHelper::getURLForGranularity($view, 'month', [
    $full_date_arg,
  ]);
  $vars['view'] = $view;
}