You are here

function theme_availability_calendar_viewport_button in Availability Calendars 7.3

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

Themes a button to scroll an availability calendar field within its viewport.

Parameters

array $variables:

Return value

string

1 theme call to theme_availability_calendar_viewport_button()
theme_availability_calendar_viewport in ./availability_calendar.theme.inc
Themes the availability calendar field in a viewport.

File

./availability_calendar.theme.inc, line 81

Code

function theme_availability_calendar_viewport_button($variables) {
  $direction = $variables['direction'] === 'forward' ? 'forward' : 'backward';
  $months = (int) $variables['scroll'];
  $button_text = $direction === 'forward' ? format_plural($months, 'Next month', 'Next @count months') : format_plural($months, 'Previous month', 'Previous @count months');
  $output = "<a class=\"cal-{$direction}\">{$button_text}</a>";
  return $output;
}