-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathslack.module
42 lines (39 loc) · 1.38 KB
/
slack.module
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
define('SLACK_CODE_OK', 200);
define('SLACK_CODE_NOT_FOUND', 404);
define('SLACK_CODE_SERVER_ERROR', 500);
require_once 'includes/slack.api.inc';
/**
* Implements hook_menu().
*/
function slack_menu() {
$items = array();
$slack_module_url = 'admin/config/services/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;
}