Revision dd1c109a
Added by Andreas Kohlbecker over 9 years ago
7.x/modules/cdm_dataportal/cdm_dataportal.api.php | ||
---|---|---|
10 | 10 |
* @{ |
11 | 11 |
*/ |
12 | 12 |
|
13 |
/** |
|
14 |
* Alter the feature toc items. |
|
15 |
* |
|
16 |
* Modules implementing this hook can add, remove or modify |
|
17 |
* the items in the table of contents of features. |
|
18 |
* |
|
19 |
* the items array is an array suitable for theme_item_list(). |
|
20 |
* |
|
21 |
*/ |
|
22 |
function hook_cdm_feature_node_toc_items_alter($items) { |
|
23 |
|
|
24 |
// NOTE: drupal_get_query_parameters has no internal static cache variable |
|
25 |
$http_request_params = drupal_get_query_parameters(); |
|
26 |
|
|
27 |
$items[] = array( |
|
28 |
// a html link element as item: |
|
29 |
l( |
|
30 |
theme('cdm_feature_name', array('feature_name' => 'My new feature item')), |
|
31 |
$_GET['q'], |
|
32 |
array( |
|
33 |
'attributes' => array('class' => array('toc')), |
|
34 |
'fragment' => generalizeString('My new feature item'), |
|
35 |
'query' => $http_request_params |
|
36 |
) |
|
37 |
) |
|
38 |
); |
|
39 |
|
|
40 |
return $items; |
|
41 |
} |
|
42 | 13 |
|
43 | 14 |
/** |
44 | 15 |
* @} End of "addtogroup hooks". |
Also available in: Unified diff
more flexible table of content creation, hook_cdm_feature_node_toc_items_alter() no longer needed