You are here

function _office_hours_field_formatter_defaults in Office Hours 7

3 calls to _office_hours_field_formatter_defaults()
office_hours_field_formatter_info in includes/office_hours.formatter.inc
Implements hook_field_formatter_info().
office_hours_field_formatter_settings_form in includes/office_hours.formatter.inc
Implements hook_field_formatter_settings_form().
office_hours_field_formatter_view in includes/office_hours.formatter.inc
Implements hook_field_formatter_view().

File

includes/office_hours.formatter.inc, line 453
Implements the office_hours formatter.

Code

function _office_hours_field_formatter_defaults($settings = array()) {

  // Assure all values are set. Append with missing values.
  $settings += array(
    'daysformat' => 'long',
    'hoursformat' => 0,
    // '12'/'24'/'HH:mm',
    'compress' => FALSE,
    'grouped' => FALSE,
    'showclosed' => 'all',
    'closedformat' => 'Closed',
    // The html-string for closed/empty days.
    'separator_days' => '<br />',
    'separator_grouped_days' => ' - ',
    'separator_day_hours' => ': ',
    'separator_hours_hours' => '-',
    'separator_more_hours' => ', ',
    'current_status' => array(
      'position' => 'hide',
      'open_text' => 'Currently open!',
      'closed_text' => 'Currently closed',
    ),
    'timezone_field' => '',
    'date_first_day' => variable_get('date_first_day', 0),
  );

  // Conversion from (old) checkbox to (new) selectlist.
  $settings['showclosed'] = $settings['showclosed'] == '1' ? 'all' : $settings['showclosed'];
  $settings['showclosed'] = $settings['showclosed'] == '0' ? 'open' : $settings['showclosed'];
  return $settings;
}