Newer
Older
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<?php
// $Id$
/**
* @author gtaylor
* @file
* Link general node distribution functionality to services module.
*/
/**
* Implementation of hook_help().
*/
function disrtibutor_service_help($path, $arg) {
switch ($path) {
case 'admin/help#services_distributor':
return '<p>'. t('Provides node distribution methods to services applications. Requires services.module.') .'</p>';
case 'admin/modules#description':
return t('Provides node distribution methods to services applications. Requires services.module.');
}
}
/**
* Implementation of hook_perm().
*/
function distributor_service_perm() {
return array(
'get any node distribution data',
);
}
/**
* Implementation of hook_service().
*/
function distributor_service_service() {
return array(
// node.getType
array(
'#method' => 'node.getType',
'#callback' => 'distributor_service_get_type',
'#access callback' => 'distributor_service_get_access',
'#file' => array('file' => 'inc', 'module' => 'distributor_service'),
'#args' => array(
array(
'#name' => 'type',
'#type' => 'string',
'#description' => t('A node type.')
),
),
'#return' => 'boolean',
'#help' => t('Returns a boolean.')
),
// node.getAllTypes
array(
'#method' => 'node.getAllTypes',
'#callback' => 'distributor_service_get_all_types',
'#access callback' => 'distributor_service_get_access',
'#file' => array('file' => 'inc', 'module' => 'distributor_service'),
'#args' => array(),
'#return' => 'array',
'#help' => t('Obtain whether or not nodes are flagged as distributable pieces of content.')
),
// node.deleteDistributedNode
array(
'#method' => 'node.deleteDistributedNode',
'#callback' => 'distributor_service_delete_node',
'#access callback' => 'distributor_service_get_access',
'#file' => array('file' => 'inc', 'module' => 'distributor_service'),
'#args' => array(
array(
'#name' => 'nid',
'#type' => 'int',
'#description' => t('A node id.')
),
),
'#return' => 'boolean',
'#help' => t('Returns a boolean.')),
);
}