You are here

function signup_field_names in Signup 7

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

@todo Please document this function.

See also

http://drupal.org/node/1354

2 calls to signup_field_names()
signup_date_field_check_config in includes/date.inc
Check that the date and signup configuration for a node type makes sense.
_signup_get_date_field_options in includes/date.inc
Helper function for the date field select to build its options.

File

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

Code

function signup_field_names($content_type = NULL) {
  $fields = array();

  /*$content_type_info = _content_type_info();
    if ($content_type_info['content types'][$content_type]) {
     foreach ($content_type_info['content types'][$content_type]['fields'] as $field) {
       if (in_array($field['type'], array('date', 'datestamp', 'datetime'))) {
         $fields[$field['field_name']] = $field['widget']['label'];
       }
     }
    }*/

  /* TODO: Test if this works, and if this is the optimum way of retrieving
   * this information.
   *
   * @see http://api.drupal.org/api/drupal/modules--field--field.info.inc/7
   */
  $content_type_info = field_info_instances('node');
  if ($content_type_info[$content_type]) {
    foreach ($content_type_info[$content_type] as $field_name => $field) {
      if ($field['widget']['module'] == 'date') {
        $fields[$field_name] = $field['label'];
      }
    }
  }
  return $fields;
}