]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - plugins/addlink_toolbar/addlink_toolbar.php
Apply PHP Code Beautifier on source code for linter automatic fixes
[github/shaarli/Shaarli.git] / plugins / addlink_toolbar / addlink_toolbar.php
index bf8a198a4ed41a44c86320c71117a525f085df7e..80b1dd95bee836214e1c29f796b1f7a1e37a1721 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) {
-        $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;
     }
 
@@ -42,17 +44,10 @@ function hook_addlink_toolbar_render_header($data)
 }
 
 /**
- * When link list is displayed, include markdown CSS.
- *
- * @param array $data - includes data.
- *
- * @return mixed - includes data with markdown CSS file added.
+ * This function is never called, but contains translation calls for GNU gettext extraction.
  */
-function hook_addlink_toolbar_render_includes($data)
+function addlink_toolbar_dummy_translation()
 {
-    if ($data['_PAGE_'] == Router::$PAGE_LINKLIST && $data['_LOGGEDIN_'] === true) {
-        $data['css_files'][] = PluginManager::$PLUGINS_PATH . '/addlink_toolbar/addlink_toolbar.css';
-    }
-
-    return $data;
+    // meta
+    t('Adds the addlink input on the linklist page.');
 }