You are here

function theme_availability_calendar_months in Availability Calendars 7.5

Same name and namespace in other branches
  1. 7.3 availability_calendar.theme.inc \theme_availability_calendar_months()
  2. 7.4 availability_calendar.theme.inc \theme_availability_calendar_months()

Themes a number of months of an availability calendar field.

Parameters

array $variables:

Return value

string

2 theme calls to theme_availability_calendar_months()
theme_availability_calendar in ./availability_calendar.theme.inc
Themes the availability calendar field.
theme_availability_calendar_viewport in ./availability_calendar.theme.inc
Themes the availability calendar field in a viewport.

File

./availability_calendar.theme.inc, line 179

Code

function theme_availability_calendar_months($variables) {
  $year =& $variables['year'];
  $month =& $variables['month'];
  $months_to_render = $variables['settings']['show_number_of_months'];
  $output = '';
  for ($i = 0; $i < $months_to_render; $i++) {
    $output .= theme('availability_calendar_month', $variables);
    $month++;
    if ($month > 12) {
      $month = 1;
      $year++;
    }
  }
  return $output;
}