You are here

function _signup_get_node_type_scheduler in Signup 6.2

Same name and namespace in other branches
  1. 5.2 includes/scheduler.inc \_signup_get_node_type_scheduler()
  2. 6 includes/scheduler.inc \_signup_get_node_type_scheduler()
  3. 7 includes/scheduler.inc \_signup_get_node_type_scheduler()

Determine which scheduler backend to use for the given node type.

Parameters

$type: Machine-readable name of the node type to test.

Return value

'event' to use the event.module, 'date' for the date.module, or 'none' if the node type is untimed.

5 calls to _signup_get_node_type_scheduler()
signup_admin_sql in includes/scheduler.inc
signup_autoclose_sql in includes/scheduler.inc
signup_date_field_check_config in includes/date.inc
Check that the date and signup configuration for a node type makes sense.
signup_reminder_sql in includes/scheduler.inc
_signup_get_node_scheduler in includes/scheduler.inc
Determine which scheduler backend to use for the given node.

File

includes/scheduler.inc, line 68
Code necessary to determine which scheduler backend(s) to use.

Code

function _signup_get_node_type_scheduler($type) {
  if (module_exists('event') && variable_get('event_nodeapi_' . $type, 'never') != 'never') {
    return 'event';
  }
  if (module_exists('date')) {
    $date_field = variable_get('signup_date_field_' . $type, 0);
    if (!empty($date_field) && $date_field != 'none') {
      return 'date';
    }
  }
  return 'none';
}