-
Notifications
You must be signed in to change notification settings - Fork 3
/
on_the_web.api.php
48 lines (44 loc) · 1.08 KB
/
on_the_web.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
<?php
/**
* @file
* API documentation for On The Web.
*/
/**
* Alter the services returned by on_the_web_get_services().
*
* This alter function can be used to:
* - Change the order of links in the list of services.
* - Add additional services.
*
* @see on_the_web_get_services().
*/
function hook_on_the_web_get_services_alter(&$services) {
// Pull out facebook and put it back at the beginning.
$face = $services['facebook'];
unset($services['facebook']);
$services = array('facebook' => $face)+$services;
// Add an additional service.
$services['viemo'] = array(
'name' => 'Viemo'
'fa-icon' => 'fa-vimeo-square',
);
}
/**
* Alter the links displayedby on_the_web_display_block().
*
* This alter function can be used to:
* - Change how the links are rendered.
*
* @see on_the_web_display_block().
*/
function hook_on_the_web_links_alter(&$links) {
// Turn the links into an item-list.
$items = array();
foreach ($links as $link) {
$items[] = backdrop_render($link);
}
$links = array(
'#theme' => 'item_list',
'#items' => $items,
);
}