You are here

function signup_date_field in Signup 7

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

@todo Please document this function.

See also

http://drupal.org/node/1354

8 calls to signup_date_field()
signup_content_type_fields in includes/date.inc
Returns a list of all cck fields that have been set for use in signups
signup_date_field_check_config in includes/date.inc
Check that the date and signup configuration for a node type makes sense.
_signup_date_admin_query in includes/date.inc
Alters the SQL query for the admin overview page.
_signup_date_autoclose_sql in includes/date.inc
_signup_date_format_date in includes/date.inc

... See full list

File

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

Code

function signup_date_field($content_type) {
  $field_name = variable_get('signup_date_field_' . $content_type, 0);
  if ($field_name === 0 || $field_name == '0') {

    // PHP is completely evil and 'none' == 0 is TRUE, hence the extra checks.
    return FALSE;
  }
  if ($field_name == 'none') {
    return 'none';
  }
  $field = field_info_field($field_name);
  if (empty($field)) {
    return array();
  }

  // Store the database table for this field.
  // @TODO: this probably could be done in a much, much more elegant and robust fashion....
  if (!isset($field['database'])) {
    $field['database'] = array(
      'table' => 'field_data_' . $field_name,
    );
  }
  return $field;
}