You are here

function sms_gateways in SMS Framework 6

Same name and namespace in other branches
  1. 5 sms.module \sms_gateways()
  2. 6.2 sms.module \sms_gateways()
  3. 7 sms.module \sms_gateways()

Get a list of all gateways

Parameters

$op: The format in which to return the list. When set to 'gateway' or 'name', only the specified gateway is returned. When set to 'gateways' or 'names', all gateways are returned.

$gateway: A gateway identifier string that indicates the gateway to return. Leave at default value (NULL) to return all gateways.

Return value

Either an array of all gateways or a single gateway, in a variable format.

8 calls to sms_gateways()
sms_admin_default_form in ./sms.admin.inc
@file SMS Framework core module: Admin settings form functions
sms_admin_gateway_form in ./sms.admin.inc
sms_admin_gateway_title in ./sms.module
SMS gateway menutitle callback.
sms_clickatell_command in modules/sms_clickatell/sms_clickatell.module
Executes a command using the Clickatell API
sms_default_gateway in ./sms.module
Returns the current default gateway.

... See full list

File

./sms.module, line 240
The core of the SMS Framework. Provides gateway managment and API for sending and receiving SMS messages.

Code

function sms_gateways($op = 'gateways', $gateway = NULL) {
  list($_gateways, $_names) = _gateways_build();
  switch ($op) {
    case 'gateways':
      return $_gateways;
    case 'gateway':
      $return = $_gateways[$gateway];
      $return['identifier'] = $gateway;
      return $return;
    case 'names':
      return $_names;
    case 'name':
      return $_names[$gateway];
  }
}