]>
Commit | Line | Data |
---|---|---|
1 | <?php | |
2 | ||
3 | /** | |
4 | * Plugin addlink_toolbar. | |
5 | * Adds the addlink input on the linklist page. | |
6 | */ | |
7 | ||
8 | /** | |
9 | * When linklist is displayed, add play videos to header's toolbar. | |
10 | * | |
11 | * @param array $data - header data. | |
12 | * | |
13 | * @return mixed - header data with addlink toolbar item. | |
14 | */ | |
15 | function hook_addlink_toolbar_render_header($data) | |
16 | { | |
17 | if ($data['_PAGE_'] == Router::$PAGE_LINKLIST && $data['_LOGGEDIN_'] === true) { | |
18 | $form = array( | |
19 | 'attr' => array( | |
20 | 'method' => 'GET', | |
21 | 'action' => '', | |
22 | 'name' => 'addform', | |
23 | 'class' => 'addform', | |
24 | ), | |
25 | 'inputs' => array( | |
26 | array( | |
27 | 'type' => 'text', | |
28 | 'name' => 'post', | |
29 | 'placeholder' => t('URI'), | |
30 | ), | |
31 | array( | |
32 | 'type' => 'submit', | |
33 | 'value' => t('Add link'), | |
34 | 'class' => 'bigbutton', | |
35 | ), | |
36 | ), | |
37 | ); | |
38 | $data['fields_toolbar'][] = $form; | |
39 | } | |
40 | ||
41 | return $data; | |
42 | } | |
43 | ||
44 | /** | |
45 | * This function is never called, but contains translation calls for GNU gettext extraction. | |
46 | */ | |
47 | function addlink_toolbar_dummy_translation() | |
48 | { | |
49 | // meta | |
50 | t('Adds the addlink input on the linklist page.'); | |
51 | } |