]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - plugins/addlink_toolbar/addlink_toolbar.php
Merge pull request #1523 from ArthurHoaro/fix/default-colors-generation
[github/shaarli/Shaarli.git] / plugins / addlink_toolbar / addlink_toolbar.php
index ddf50aaf3aba2b2eccd116030d355a7678f8914b..ab6ed6de0cc34f2eca752ea293c90b1b45655a4b 100644 (file)
@@ -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.
  *
  */
 function hook_addlink_toolbar_render_header($data)
 {
-    if ($data['_PAGE_'] == Router::$PAGE_LINKLIST && $data['_LOGGEDIN_'] === true) {
+    if ($data['_PAGE_'] == TemplatePage::LINKLIST && $data['_LOGGEDIN_'] === true) {
         $form = array(
             'attr' => array(
                 'method' => 'GET',
-                'action' => '',
+                'action' => $data['_BASE_PATH_'] . '/admin/shaare',
                 'name'   => 'addform',
                 'class'  => 'addform',
             ),
@@ -26,11 +28,11 @@ function hook_addlink_toolbar_render_header($data)
                 array(
                     'type' => 'text',
                     'name' => 'post',
-                    'placeholder' => 'URI',
+                    'placeholder' => t('URI'),
                 ),
                 array(
                     'type' => 'submit',
-                    'value' => 'Add link',
+                    'value' => t('Add link'),
                     'class' => 'bigbutton',
                 ),
             ),
@@ -40,3 +42,12 @@ function hook_addlink_toolbar_render_header($data)
 
     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.');
+}