X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=plugins%2Faddlink_toolbar%2Faddlink_toolbar.php;h=80b1dd95bee836214e1c29f796b1f7a1e37a1721;hb=da950241f3381f6c40dbef2f3648179f5b658a07;hp=ddf50aaf3aba2b2eccd116030d355a7678f8914b;hpb=514185e14b09d1e37c41eb5d2720e3e45b12eea9;p=github%2Fshaarli%2FShaarli.git diff --git a/plugins/addlink_toolbar/addlink_toolbar.php b/plugins/addlink_toolbar/addlink_toolbar.php index ddf50aaf..80b1dd95 100644 --- a/plugins/addlink_toolbar/addlink_toolbar.php +++ b/plugins/addlink_toolbar/addlink_toolbar.php @@ -5,6 +5,8 @@ * Adds the addlink input on the linklist page. */ +use Shaarli\Render\TemplatePage; + /** * When linklist is displayed, add play videos to header's toolbar. * @@ -14,29 +16,38 @@ */ 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' => 'URI', - ), - array( + 'placeholder' => t('URI'), + ], + [ 'type' => 'submit', - 'value' => 'Add link', + 'value' => t('Add link'), 'class' => 'bigbutton', - ), - ), - ); + ], + ], + ]; $data['fields_toolbar'][] = $form; } return $data; } + +/** + * 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.'); +}