You are here

function _signup_get_node_type_scheduler in Signup 7

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

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

Parameters

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

Return value

string '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_query in includes/scheduler.inc
Helper function to build the database query for the admin overview page.
signup_autoclose_sql in includes/scheduler.inc
@todo Please document this function.
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
@todo Please document this function.
_signup_get_node_scheduler in includes/scheduler.inc
Determine which scheduler backend to use for the given node.

File

includes/scheduler.inc, line 66
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';
}