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