* Adds the addlink input on the linklist page.
*/
-use Shaarli\Router;
+use Shaarli\Render\TemplatePage;
/**
* When linklist is displayed, add play videos to header's toolbar.
*/
function hook_addlink_toolbar_render_header($data)
{
- if ($data['_PAGE_'] == Router::$PAGE_LINKLIST && $data['_LOGGEDIN_'] === true) {
- $form = array(
- 'attr' => array(
+ if ($data['_PAGE_'] == TemplatePage::LINKLIST && $data['_LOGGEDIN_'] === true) {
+ $form = [
+ 'attr' => [
'method' => 'GET',
- 'action' => '',
+ 'action' => $data['_BASE_PATH_'] . '/admin/shaare',
'name' => 'addform',
'class' => 'addform',
- ),
- 'inputs' => array(
- array(
+ ],
+ 'inputs' => [
+ [
'type' => 'text',
'name' => 'post',
'placeholder' => t('URI'),
- ),
- array(
+ ],
+ [
'type' => 'submit',
'value' => t('Add link'),
'class' => 'bigbutton',
- ),
- ),
- );
+ ],
+ ],
+ ];
$data['fields_toolbar'][] = $form;
}