function sms_gateways in SMS Framework 7
Same name and namespace in other branches
- 5 sms.module \sms_gateways()
- 6.2 sms.module \sms_gateways()
- 6 sms.module \sms_gateways()
Gets a list of all gateways.
Parameters
string $op: (optional) 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. Defaults to 'gateways'.
string $gateway: (optional) A gateway identifier string that indicates the gateway to return. Leave at default value (NULL) to return all gateways.
Return value
array|string Either an array of all gateways or a single gateway, in a variable format.
9 calls to sms_gateways()
- SmsFrameworkWebTest::testGatewayConfiguration in tests/
sms.module.test - Tests configuring a specific gateway.
- SmsFrameworkWebTest::testGatewayInfoAlter in tests/
sms.module.test - SmsFrameworkWebTest::testGatewaysList in tests/
sms.module.test - Tests that the correct gateways list is obtained.
- sms_admin_default_form in ./
sms.admin.inc - Select default sms gateway form.
- sms_admin_gateway_form in ./
sms.admin.inc - Form builder for the sms gateway configuration form.
File
- ./
sms.module, line 392 - The core of the SMS Framework. Provides gateway management and API for sending and receiving SMS messages.
Code
function sms_gateways($op = 'gateways', $gateway = NULL) {
list($_gateways, $_names) = _gateways_build();
switch ($op) {
case 'gateway':
$return = $_gateways[$gateway];
$return['identifier'] = $gateway;
return $return;
case 'names':
return $_names;
case 'name':
return $_names[$gateway];
case 'gateways':
default:
return $_gateways;
}
}