You are here

function slack_send_test_message_form in Slack 7

Same name and namespace in other branches
  1. 6 includes/pages/slack.pages.inc \slack_send_test_message_form()

Slack test message form.

1 string reference to 'slack_send_test_message_form'
slack_menu in ./slack.module
Implements hook_menu().

File

includes/pages/slack.pages.inc, line 11
Slack module page functions.

Code

function slack_send_test_message_form($form, &$form_state) {
  $form['slack_test_channel'] = array(
    '#type' => 'textfield',
    '#title' => t('Channel'),
    '#default_value' => variable_get('slack_channel'),
  );
  $form['slack_attachments'] = array(
    '#type' => 'fieldset',
    '#title' => t('Attachment options'),
    '#collapsible' => TRUE,
    '#collapsed' => !variable_get('slack_attachment_enabled'),
  );
  $form['slack_attachments']['slack_attachment_enabled'] = array(
    '#type' => 'checkbox',
    '#title' => t('Enable attachment'),
    '#default_value' => variable_get('slack_attachment_enabled'),
  );
  $form['slack_attachments']['slack_test_color'] = array(
    '#type' => 'textfield',
    '#title' => t('Color'),
    '#default_value' => variable_get('slack_attachment_color'),
  );
  $form['slack_attachments']['slack_test_pretext'] = array(
    '#type' => 'textarea',
    '#title' => t('Message pretext'),
    '#default_value' => variable_get('slack_attachment_pretext'),
  );
  $form['slack_attachments']['slack_test_attachment_text'] = array(
    '#type' => 'textarea',
    '#title' => t('Attachment text'),
    '#default_value' => variable_get('slack_attachment_text'),
  );
  $form['slack_attachments']['slack_test_title'] = array(
    '#type' => 'textfield',
    '#title' => t('Message title'),
    '#default_value' => variable_get('slack_attachment_title'),
  );
  $form['slack_attachments']['slack_test_title_link'] = array(
    '#type' => 'textfield',
    '#title' => t('Message title link'),
    '#default_value' => variable_get('slack_attachment_title_link'),
  );
  $form['slack_attachments']['slack_test_image_url'] = array(
    '#type' => 'textfield',
    '#title' => t('Image link'),
    '#default_value' => variable_get('slack_attachment_image_url'),
  );
  $form['slack_attachments']['slack_test_author_name'] = array(
    '#type' => 'textfield',
    '#title' => t('Attachment author name'),
    '#default_value' => variable_get('slack_attachment_author_name'),
  );
  $form['slack_attachments']['slack_test_author_link'] = array(
    '#type' => 'textfield',
    '#title' => t('Attachment author link'),
    '#default_value' => variable_get('slack_attachment_author_link'),
  );
  $form['slack_attachments']['slack_test_author_icon'] = array(
    '#type' => 'textfield',
    '#title' => t('Attachment author icon'),
    '#default_value' => variable_get('slack_attachment_author_icon'),
  );
  $form['slack_attachments']['slack_test_footer'] = array(
    '#type' => 'textfield',
    '#title' => t('Attachment footer'),
    '#default_value' => variable_get('slack_attachment_footer'),
  );
  $form['slack_attachments']['slack_test_footer_icon'] = array(
    '#type' => 'textfield',
    '#title' => t('Attachment footer icon'),
    '#default_value' => variable_get('slack_attachment_footer_icon'),
  );
  $form['slack_attachments']['slack_test_ts'] = array(
    '#type' => 'textfield',
    '#title' => t('Attachment time stamp'),
    '#default_value' => variable_get('slack_attachment_ts'),
  );
  $form['slack_attachments']['slack_attachment_mrkdwn'] = array(
    '#type' => 'checkboxes',
    '#title' => t('Send message with markdown'),
    '#description' => t('Allow to send messages, based on markdown syntax like (*) for bold and (_) for italics.'),
    '#default_value' => variable_get('slack_attachment_mrkdwn'),
    '#options' => array(
      'text' => t('Text'),
      'pretext' => t('Pretext'),
      'fields' => t('Fields'),
    ),
  );
  $form['slack_test_message'] = array(
    '#type' => 'textarea',
    '#title' => t('Message'),
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#validate' => array(
      'slack_validate_test_message',
    ),
    '#value' => t('Send message'),
  );
  return $form;
}