You are here

function availability_calendars_options in Availability Calendars 6

Same name and namespace in other branches
  1. 5 availability_calendars.module \availability_calendars_options()
  2. 6.2 availability_calendars.inc \availability_calendars_options()
  3. 7.2 availability_calendars.inc \availability_calendars_options()

availability_calendars status options.

Return value

array

4 calls to availability_calendars_options()
availability_calendars_admin_settings in ./availability_calendars.module
Settings page callback.
availability_calendars_form_alter in ./availability_calendars.module
Implementation of hook_form_alter(). All form alterations needed for the calendars.
availability_calendars_node_edit_form in ./availability_calendars.module
Creates the node edit form.
theme_availability_calendars_month in ./availability_calendars.module
Implementation of hook_theme(). produces our calendars on the viewing of an availability_calendars enabled node.

File

./availability_calendars.module, line 664
Availability Calendars Module.

Code

function availability_calendars_options() {

  // TODO: make these configurable
  $settings = availability_calendar_getsettings();
  $statuses = array(
    'available' => t('Available'),
    'notavailable' => t('Fully booked'),
    'notavailableprov' => t('Provisionally booked'),
  );
  $ret = array();
  foreach ($statuses as $class => $label) {
    $ret['cal' . $class] = $label;
  }
  if ($settings->splitday === 1) {
    foreach ($statuses as $class => $label) {
      $sub = $statuses;
      unset($sub[$class]);
      foreach ($sub as $subclass => $sublabel) {
        $ret['calsplit cal-' . $class . '_' . $subclass] = t('@a (am)/@b (pm)', array(
          '@a' => $label,
          '@b' => $sublabel,
        ));
      }
    }
  }
  return $ret;
}