]> git.immae.eu Git - github/shaarli/Shaarli.git/commitdiff
Remove CSS call for addlink toolbar plugin 760/head
authorArthurHoaro <arthur@hoa.ro>
Sun, 15 Jan 2017 16:50:16 +0000 (17:50 +0100)
committerArthurHoaro <arthur@hoa.ro>
Sun, 15 Jan 2017 16:50:16 +0000 (17:50 +0100)
Fixes #724

plugins/addlink_toolbar/addlink_toolbar.php
tests/plugins/PluginAddlinkTest.php

index bf8a198a4ed41a44c86320c71117a525f085df7e..ddf50aaf3aba2b2eccd116030d355a7678f8914b 100644 (file)
@@ -40,19 +40,3 @@ function hook_addlink_toolbar_render_header($data)
 
     return $data;
 }
-
-/**
- * When link list is displayed, include markdown CSS.
- *
- * @param array $data - includes data.
- *
- * @return mixed - includes data with markdown CSS file added.
- */
-function hook_addlink_toolbar_render_includes($data)
-{
-    if ($data['_PAGE_'] == Router::$PAGE_LINKLIST && $data['_LOGGEDIN_'] === true) {
-        $data['css_files'][] = PluginManager::$PLUGINS_PATH . '/addlink_toolbar/addlink_toolbar.css';
-    }
-
-    return $data;
-}
index b77fe12a314bbb979b1cf806ef9c2c80ee126afd..b6239e7f2f09851e94caf0b3933e4c511c0157ca 100644 (file)
@@ -57,44 +57,4 @@ class PluginAddlinkTest extends PHPUnit_Framework_TestCase
         $this->assertEquals($str, $data[$str]);
         $this->assertArrayNotHasKey('fields_toolbar', $data);
     }
-
-    /**
-     * Test render_includes hook while logged in.
-     */
-    public function testAddlinkIncludesLoggedIn()
-    {
-        $str = 'stuff';
-        $data = array($str => $str);
-        $data['_PAGE_'] = Router::$PAGE_LINKLIST;
-        $data['_LOGGEDIN_'] = true;
-
-        $data = hook_addlink_toolbar_render_includes($data);
-        $this->assertEquals($str, $data[$str]);
-        $this->assertEquals(1, count($data['css_files']));
-
-        $str = 'stuff';
-        $data = array($str => $str);
-        $data['_PAGE_'] = $str;
-        $data['_LOGGEDIN_'] = true;
-
-        $data = hook_addlink_toolbar_render_includes($data);
-        $this->assertEquals($str, $data[$str]);
-        $this->assertArrayNotHasKey('css_files', $data);
-    }
-
-    /**
-     * Test render_includes hook.
-     * Should not affect css files while logged out.
-     */
-    public function testAddlinkIncludesLoggedOut()
-    {
-        $str = 'stuff';
-        $data = array($str => $str);
-        $data['_PAGE_'] = Router::$PAGE_LINKLIST;
-        $data['_LOGGEDIN_'] = false;
-
-        $data = hook_addlink_toolbar_render_includes($data);
-        $this->assertEquals($str, $data[$str]);
-        $this->assertArrayNotHasKey('css_files', $data);
-    }
 }