You are here

function regcode_dynamic_handlers in Registration codes 6.2

Grab all available dynamic code handlers

3 calls to regcode_dynamic_handlers()
regcode_dynamic_create in regcode_dynamic/regcode_dynamic.module
Form: Create form for dynamic codes
regcode_dynamic_settings in regcode_dynamic/regcode_dynamic.module
Form: Settings form for dynamic codes
regcode_dynamic_user in regcode_dynamic/regcode_dynamic.module
Implementation of hook_user().

File

regcode_dynamic/regcode_dynamic.module, line 318
The dynamic code module creates codes on the fly as they are used.

Code

function regcode_dynamic_handlers($handler = NULL) {

  // Module defined handlers
  $handlers = array(
    'simple' => array(
      'title' => t('Simple handler'),
      'description' => t('This handler uses incremental numbers with a configurable offset. These numbers can be easily guessed if the pattern is known.'),
      'configuration' => 'regcode_dynamic_handler_simple',
      'validator' => 'regcode_dynamic_handler_simple_validate',
    ),
    'luhn' => array(
      'title' => t('Luhn handler (TODO)'),
      'description' => t('Uses the <a href="http://en.wikipedia.org/wiki/Luhn_algorithm">luhn algorithm</a> to validate registration codes.'),
      'configuration' => 'regcode_dynamic_handler_luhn',
      'validator' => 'regcode_dynamic_handler_luhn_validate',
    ),
  );

  // Check if we're loading a specific handler
  if ($handler !== NULL) {
    if (isset($handlers[$handler])) {
      return $handlers[$handler];
    }
    else {
      return FALSE;
    }
  }
  return $handlers;
}