You are here

function twitter_actions_set_status_action_form in Twitter 7.5

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

Returns a form definition so the Twitter 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 44
Exposes Drupal actions for sending Twitter messages.

Code

function twitter_actions_set_status_action_form($context) {
  $options = twitter_actions_account_options();

  // Set default values for form.
  $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'] : '',
    '#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,
  );
  return $form;
}