You are here

function twitter_actions_set_status_action_form in Twitter 6.5

Same name and namespace in other branches
  1. 6.2 twitter_actions/twitter_actions.module \twitter_actions_set_status_action_form()
  2. 6.3 twitter_actions/twitter_actions.module \twitter_actions_set_status_action_form()
  3. 6.4 twitter_actions/twitter_actions.module \twitter_actions_set_status_action_form()
  4. 7.6 twitter_actions/twitter_actions.module \twitter_actions_set_status_action_form()
  5. 7.3 twitter_actions/twitter_actions.module \twitter_actions_set_status_action_form()
  6. 7.4 twitter_actions/twitter_actions.module \twitter_actions_set_status_action_form()
  7. 7.5 twitter_actions/twitter_actions.module \twitter_actions_set_status_action_form()

Return a form definition so the Send email action can be configured.

Parameters

array $context: Default values (if we are editing an existing action instance).

Return value

Form definition.

File

twitter_actions/twitter_actions.module, line 34
Exposes Drupal actions for sending Twitter messages.

Code

function twitter_actions_set_status_action_form($context = array()) {

  // Set default values for form.
  $context += array(
    'account_id' => -1,
    'screen_name' => '',
    'message' => '',
  );
  $options = twitter_actions_account_options();
  $form['screen_name'] = array(
    '#type' => 'select',
    '#title' => t('Twitter account name'),
    '#description' => t('Twitter account which will be used. ' . 'By selecting [current user] the rule will check if the user ' . 'has authenticated a Twitter account to use.'),
    '#options' => $options,
    '#default_value' => isset($context['screen_name']) ? $context['screen_name'] : '',
    '#description' => t('The Twitter account which will be used to post to Twitter. It can be ' . 'added by editing a user account.'),
    '#required' => TRUE,
  );
  $form['message'] = array(
    '#type' => 'textarea',
    '#title' => t('Message'),
    '#default_value' => isset($context['message']) ? $context['message'] : '',
    '#cols' => '80',
    '#rows' => '3',
    '#description' => t('The message that should be sent. You may include the following variables: ' . '%site_name, %username, %node_url, %node_type, %title, %summary, %body, ' . '%tinyurl. Not all variables will be available in all contexts.'),
    '#required' => TRUE,
  );
  if (module_exists('token')) {
    $form['token_help'] = array(
      '#title' => t('Extra replacement tokens'),
      '#type' => 'fieldset',
      '#collapsible' => TRUE,
      '#collapsed' => TRUE,
      '#description' => t('Prefer raw-text replacements for text to avoid problems with HTML entities!'),
    );
    $form['token_help']['help'] = array(
      '#value' => theme('token_help', 'node'),
    );
  }
  return $form;
}