You are here

function regcode_get_fields in Registration codes 7

Same name and namespace in other branches
  1. 5.3 regcode_api.inc.php \regcode_get_fields()
  2. 6.2 regcode.module \regcode_get_fields()
  3. 6 regcode.api.php \regcode_get_fields()
  4. 7.2 regcode.module \regcode_get_fields()

Get the exposed regcode fields.

@todo Make use of the entity API.

Return value

array List of fields and their descriptions.

1 call to regcode_get_fields()
regcode_ie_admin_import in regcode_ie/regcode_ie.module
Import registration codes form.

File

./regcode.module, line 286
Main functionality and hooks of regcode module.

Code

function regcode_get_fields() {

  // Core exposed fields.
  $fields = array(
    'begins' => array(
      'description' => t('When code should be active from'),
      'title' => t('Begins'),
    ),
    'expires' => array(
      'description' => t('When code should expire'),
      'title' => t('Expires'),
    ),
    'code' => array(
      'description' => t('The registration code'),
      'title' => t('Code'),
    ),
    'is_active' => array(
      'description' => t('Whether the code is active'),
      'title' => t('Enabled'),
    ),
    'maxuses' => array(
      'description' => t('Maximum times the code can be used'),
      'title' => t('Max'),
    ),
    'uses' => array(
      'description' => t('Number of times the code has been used'),
      'title' => t('Uses'),
    ),
  );

  // Load contributed fields.
  $contrib = module_invoke_all('regcode_fields');
  if (is_array($contrib)) {
    $fields += $contrib;
  }
  return $fields;
}