This repository has been archived by the owner on Jun 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfarm_area.api.php
93 lines (83 loc) · 1.71 KB
/
farm_area.api.php
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
81
82
83
84
85
86
87
88
89
90
91
92
93
<?php
/**
* @file
* Hooks provided by farm_area.
*
* This file contains no working PHP code; it exists to provide additional
* documentation for doxygen as well as to document hooks in the standard
* Drupal manner.
*/
/**
* @defgroup farm_area Farm area module integrations.
*
* Module integrations with the farm_area module.
*/
/**
* @defgroup farm_area_hooks Farm area's hooks
* @{
* Hooks that can be implemented by other modules in order to extend farm_area.
*/
/**
* Defines farm area types.
*
* @return array
* Returns an array of farm area type information.
*/
function hook_farm_area_type_info() {
return array(
'building' => array(
'label' => t('Building'),
'weight' => 10,
),
);
}
/**
* Provide links for farm areas.
*
* @param int $id
* The area id that links are being generated for.
*
* @return array
* Returns an array of arrays to represent area links.
*/
function hook_farm_area_links($id) {
$path = 'farm/area/' . $id;
return array(
array(
'title' => t('Plantings'),
'href' => $path . '/plantings',
'weight' => 0,
),
array(
'title' => t('Animals'),
'href' => $path . '/animals',
'options' => array(
'fragment' => 'Animals',
),
'weight' => 20,
),
);
}
/**
* Provide details about farm areas.
*
* @param int $id
* The area id.
*
* @return array
* Returns a render array to add to the area's popup.
*/
function hook_farm_area_details($id) {
// Start a render array.
$output = array();
// Add "Hello world!" to area details.
$output[] = array(
'#type' => 'markup',
'#markup' => 'Hello world!',
);
// Return the render array.
return $output;
}
/**
* @}
*/