2015-10-15 12:25:38 +02:00
|
|
|
<?php
|
|
|
|
|
2015-11-08 12:40:14 +01:00
|
|
|
/**
|
|
|
|
* Plugin addlink_toolbar.
|
|
|
|
* Adds the addlink input on the linklist page.
|
|
|
|
*/
|
|
|
|
|
2018-12-04 00:02:17 +01:00
|
|
|
use Shaarli\Router;
|
|
|
|
|
2015-10-15 12:25:38 +02:00
|
|
|
/**
|
|
|
|
* When linklist is displayed, add play videos to header's toolbar.
|
|
|
|
*
|
|
|
|
* @param array $data - header data.
|
2015-11-08 12:40:14 +01:00
|
|
|
*
|
2015-10-15 12:25:38 +02:00
|
|
|
* @return mixed - header data with addlink toolbar item.
|
|
|
|
*/
|
2015-11-08 12:40:14 +01:00
|
|
|
function hook_addlink_toolbar_render_header($data)
|
|
|
|
{
|
2015-10-15 12:25:38 +02:00
|
|
|
if ($data['_PAGE_'] == Router::$PAGE_LINKLIST && $data['_LOGGEDIN_'] === true) {
|
2016-12-01 11:38:21 +01:00
|
|
|
$form = array(
|
|
|
|
'attr' => array(
|
|
|
|
'method' => 'GET',
|
|
|
|
'action' => '',
|
|
|
|
'name' => 'addform',
|
|
|
|
'class' => 'addform',
|
|
|
|
),
|
|
|
|
'inputs' => array(
|
|
|
|
array(
|
|
|
|
'type' => 'text',
|
|
|
|
'name' => 'post',
|
2017-05-09 18:12:15 +02:00
|
|
|
'placeholder' => t('URI'),
|
2016-12-01 11:38:21 +01:00
|
|
|
),
|
|
|
|
array(
|
|
|
|
'type' => 'submit',
|
2017-05-09 18:12:15 +02:00
|
|
|
'value' => t('Add link'),
|
2016-12-01 11:38:21 +01:00
|
|
|
'class' => 'bigbutton',
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
$data['fields_toolbar'][] = $form;
|
2015-10-15 12:25:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return $data;
|
|
|
|
}
|
2017-05-09 18:12:15 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* This function is never called, but contains translation calls for GNU gettext extraction.
|
|
|
|
*/
|
|
|
|
function addlink_toolbar_dummy_translation()
|
|
|
|
{
|
|
|
|
// meta
|
|
|
|
t('Adds the addlink input on the linklist page.');
|
|
|
|
}
|