X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=plugins%2Faddlink_toolbar%2Faddlink_toolbar.php;h=80b1dd95bee836214e1c29f796b1f7a1e37a1721;hb=bd11879018416d2c5d87728bb0be6ee0cf54451a;hp=8bf4ed46d6cd5afded8fd8d551361b0e93bcef76;hpb=a932f486f20f3daf8ad657d8d39a6d6c316e66eb;p=github%2Fshaarli%2FShaarli.git diff --git a/plugins/addlink_toolbar/addlink_toolbar.php b/plugins/addlink_toolbar/addlink_toolbar.php index 8bf4ed46..80b1dd95 100644 --- a/plugins/addlink_toolbar/addlink_toolbar.php +++ b/plugins/addlink_toolbar/addlink_toolbar.php @@ -5,7 +5,7 @@ * 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. @@ -16,27 +16,27 @@ use Shaarli\Router; */ 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; }