You are here

slack.admin.inc in Slack 6

Same filename and directory in other branches
  1. 7 includes/pages/slack.admin.inc

Slack integration module admin functions.

File

includes/pages/slack.admin.inc
View source
<?php

/**
 * @file
 * Slack integration module admin functions.
 */

/**
 * Slack module admin form.
 */
function slack_configure_form(&$form_state) {
  $form['slack_webhook_url'] = array(
    '#type' => 'textfield',
    '#title' => t('Webhook URL'),
    '#description' => t('Enter your Webhook URL from an Incoming WebHooks integration. It looks like https://hooks.slack.com/services/XXXXXXXXX/YYYYYYYYY/ZZZZZZZZZZZZZZZZZZZZZZZZ'),
    '#default_value' => slack_get_default_webhook_url(),
    '#required' => TRUE,
  );
  $form['slack_channel'] = array(
    '#type' => 'textfield',
    '#title' => t('Default channel'),
    '#description' => t('Enter your channel name with # symbol, for example #general (or @username for a private message or a private group name).'),
    '#default_value' => variable_get('slack_channel', SLACK_DEFAULT_CHANNEL),
  );
  $form['slack_username'] = array(
    '#type' => 'textfield',
    '#title' => t('Default username'),
    '#description' => t('What would you like to name your Slack bot?'),
    '#default_value' => variable_get('slack_username', SLACK_DEFAULT_USERNAME),
  );
  return system_settings_form($form);
}

Functions

Namesort descending Description
slack_configure_form Slack module admin form.