You are here

function sms_actions_edit_command_form in SMS Framework 6

Same name and namespace in other branches
  1. 6.2 modules/sms_actions/sms_actions.module \sms_actions_edit_command_form()
  2. 7 modules/sms_actions/sms_actions.module \sms_actions_edit_command_form()
1 string reference to 'sms_actions_edit_command_form'
sms_actions_menu in modules/sms_actions/sms_actions.module
Implementation of hook_menu().

File

modules/sms_actions/sms_actions.module, line 358
Provides a "Send SMS" action and the ability to define custom triggers for incoming messages.

Code

function sms_actions_edit_command_form(&$form_state, $discriminator = NULL) {
  if (isset($discriminator)) {
    $command = sms_actions_command_load($discriminator);
  }

  // Check for confirmation forms.
  if (isset($form_state['confirm_delete'])) {
    return sms_actions_command_confirm_delete($form_state, $discriminator);
  }
  $form['discriminator'] = array(
    '#type' => 'textfield',
    '#title' => t('Discriminator'),
    '#description' => t('A keyword that will be used to idenifty incoming messages. The discriminator may consist only of lowercase letters, numbers, and dashes.'),
    '#size' => 40,
    '#maxlength' => 16,
    '#required' => TRUE,
    '#default_value' => $command->discriminator,
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Save command'),
  );
  if (isset($command)) {
    $form['old_discriminator'] = array(
      '#type' => 'value',
      '#value' => $command->discriminator,
    );
    $form['delete'] = array(
      '#type' => 'submit',
      '#value' => t('Delete'),
      '#weight' => 45,
    );
  }
  return $form;
}