You are here

slack.install in Slack 7

Install, update and uninstall functions for the Slack module.

File

slack.install
View source
<?php

/**
 * @file
 * Install, update and uninstall functions for the Slack module.
 */

/**
 * Implements hook_install().
 */
function slack_install() {
  variable_set('slack_webhook_url', '');
  variable_set('slack_icon_type', 'none');
  variable_set('slack_attachment_mrkdwn', array(
    'text' => '0',
    'pretext' => '0',
    'fields' => '0',
  ));
  variable_set('slack_file_types', array(
    'spaces' => '0',
    'snippets' => '0',
    'images' => '0',
    'gdocs' => '0',
    'zips' => '0',
    'pdfs' => '0',
  ));
  variable_set('slack_files_age_number', '1');
  variable_set('slack_files_age_unit', 'month');
}

/**
 * Implements hook_uninstall().
 */
function slack_uninstall() {
  variable_del('slack_webhook_url');
  variable_del('slack_channel');
  variable_del('slack_username');
  variable_del('slack_icon_url');
  variable_del('slack_icon_emoji');
  variable_del('slack_icon_type');
  variable_del('slack_enabled_attachment');
  variable_del('slack_attachment_pretext');
  variable_del('slack_attachment_color');
  variable_del('slack_attachment_title');
  variable_del('slack_attachment_title_link');
  variable_del('slack_attachment_image_url');
  variable_del('slack_attachment_author_name');
  variable_del('slack_attachment_author_link');
  variable_del('slack_attachment_author_icon');
  variable_del('slack_attachment_footer');
  variable_del('slack_attachment_footer_icon');
  variable_del('slack_attachment_ts');
  variable_del('slack_attachment_mrkdwn');
  variable_del('slack_token');
  variable_del('slack_file_types');
  variable_del('slack_files_age_number');
  variable_del('slack_files_age_unit');
}

Functions

Namesort descending Description
slack_install Implements hook_install().
slack_uninstall Implements hook_uninstall().