forked from bibsdb/ims
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ims.module
59 lines (51 loc) · 1.31 KB
/
ims.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?php
/**
* @file
* Provide placement information from the IMS service.
*/
/**
* Implements hook_menu().
*/
function ims_menu() {
$items = array();
$items['admin/config/ding/provider/ims'] = array(
'title' => 'IMS provider',
'description' => 'Settings for the IMS service.',
'page callback' => 'drupal_get_form',
'page arguments' => array('ims_admin_settings_form'),
'access arguments' => array('administer site configuration'),
'file' => 'ims.admin.inc',
'type' => MENU_LOCAL_TASK,
);
return $items;
}
/**
* Implements hook_ding_provider().
*/
function ims_ding_provider() {
return array(
'title' => 'IMS: Ding provider',
'provides' => array(
'availability' => array(
'prefix' => 'availability',
'file' => 'inc/ims.availability.inc',
),
),
);
}
/**
* Fetch placement information from IMS service.
*
* @param array $provider_ids
* Array of ting object ids (faust).
*
* @return array
* Placements info.
*/
function ims_placements(array $provider_ids) {
// Call the IMS Webservice.
$service = new ImsService(variable_get('ims_wsdl_url'), variable_get('ims_username'), variable_get('ims_password'));
// Retrieve placements for multiple ting object ids.
$retrieved = $service->getByFaustNumber($provider_ids);
return $retrieved;
}