You are here

function webform_options_days in Webform 7.4

Same name and namespace in other branches
  1. 6.3 includes/webform.options.inc \webform_options_days()
  2. 7.3 includes/webform.options.inc \webform_options_days()

Implements callback_webform_options().

Option list containing the days of the week.

2 string references to 'webform_options_days'
hook_webform_select_options_info in ./webform.api.php
Define callbacks that can be used as select list options.
_webform_options_info in includes/webform.options.inc
Implements hook_webform_select_options_info().

File

includes/webform.options.inc, line 42
A collection of built-in select list options for Webform.

Code

function webform_options_days($component, $flat, $arguments) {
  $days = array(
    'sunday' => t('Sunday'),
    'monday' => t('Monday'),
    'tuesday' => t('Tuesday'),
    'wednesday' => t('Wednesday'),
    'thursday' => t('Thursday'),
    'friday' => t('Friday'),
    'saturday' => t('Saturday'),
  );

  // Order according to site settings for first day.
  if ($first_day = variable_get('date_first_day', 0)) {
    $week = array_splice($days, $first_day);
    $days = array_merge($week, $days);
  }
  return $days;
}