You are here

function sms_admin_default_form in SMS Framework 7

Same name and namespace in other branches
  1. 5 sms.module \sms_admin_default_form()
  2. 6.2 sms.admin.inc \sms_admin_default_form()
  3. 6 sms.admin.inc \sms_admin_default_form()

Select default sms gateway form.

1 string reference to 'sms_admin_default_form'
sms_menu in ./sms.module
Implements hook_menu().

File

./sms.admin.inc, line 11
The admin sms functions.

Code

function sms_admin_default_form($form, &$form_state) {
  $gateways = sms_gateways();
  foreach ($gateways as $identifier => $gateway) {
    $active = $identifier == variable_get('sms_default_gateway', 'log');
    $options[$identifier] = '';
    $form[$gateway['name']]['id'] = array(
      '#markup' => $identifier,
    );
    if (isset($gateway['configure form']) and function_exists($gateway['configure form'])) {
      $form[$gateway['name']]['configure'] = array(
        '#markup' => l(t('configure'), 'admin/smsframework/gateways/' . $identifier),
      );
    }
    else {
      $form[$gateway['name']]['configure'] = array(
        '#markup' => t('No configuration options'),
      );
    }
  }
  $form['default'] = array(
    '#type' => 'radios',
    '#options' => $options,
    '#default_value' => variable_get('sms_default_gateway', 'log'),
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Set default gateway'),
  );
  return $form;
}