View source
<?php
define('SLACK_CODE_OK', 200);
define('SLACK_CODE_NOT_FOUND', 404);
define('SLACK_CODE_SERVER_ERROR', 500);
define('SLACK_DEFAULT_CHANNEL', '#general');
define('SLACK_DEFAULT_USERNAME', 'Slackbot');
require_once 'includes/slack.api.inc';
function slack_menu() {
$items = array();
$slack_module_url = 'admin/content/slack';
$items[$slack_module_url] = array(
'title' => 'Slack',
'description' => 'Configure slack module.',
'page callback' => 'system_admin_menu_block_page',
'access arguments' => array(
'access administration pages',
),
'file' => 'system.admin.inc',
'file path' => drupal_get_path('module', 'system'),
);
$items[$slack_module_url . '/config'] = array(
'title' => 'Configuration',
'description' => 'Adjust slack settings.',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'slack_configure_form',
),
'access arguments' => array(
'administer site configuration',
),
'type' => MENU_NORMAL_ITEM,
'file' => 'includes/pages/slack.admin.inc',
);
$items[$slack_module_url . '/test'] = array(
'title' => 'Send a message',
'description' => 'Allows to send a test message to the Slack.',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'slack_send_test_message_form',
),
'access arguments' => array(
'administer site configuration',
),
'type' => MENU_NORMAL_ITEM,
'file' => 'includes/pages/slack.pages.inc',
);
return $items;
}