You are here

function _signup_get_date_field_options in Signup 7

Same name and namespace in other branches
  1. 5.2 includes/date.inc \_signup_get_date_field_options()
  2. 6.2 includes/date.inc \_signup_get_date_field_options()
  3. 6 includes/date.inc \_signup_get_date_field_options()

Helper function for the date field select to build its options.

Parameters

string $type: Content type whose date fields should be listed.

Return value

array Associative array with all date fields of the given content type plus 'None' and an optional 'Not specified' if the user never selected a value.

1 call to _signup_get_date_field_options()
_signup_date_field_element in includes/date.inc
Create the FAPI form element for the signup date field.

File

includes/date.inc, line 274
Code to support using CCK date fields for time-based signup functionality.

Code

function _signup_get_date_field_options($type) {
  $options = array();

  // Add "Not specified" if the user never selected a field.
  if (variable_get('signup_date_field_' . $type, 0) == 0) {
    $options = array(
      0 => '<' . t('Not specified') . '>',
    );
  }

  // Add any date fields from this node type.
  $options += signup_field_names($type);

  // Always add 'None' as the final choice.
  $options += array(
    'none' => '<' . t('None') . '>',
  );
  return $options;
}