Browse Source

Merge pull request #760 from ArthurHoaro/plugins/addlink-css-404

Remove CSS call for addlink toolbar plugin
ArthurHoaro 7 years ago
parent
commit
514185e14b
2 changed files with 0 additions and 56 deletions
  1. 0 16
      plugins/addlink_toolbar/addlink_toolbar.php
  2. 0 40
      tests/plugins/PluginAddlinkTest.php

+ 0 - 16
plugins/addlink_toolbar/addlink_toolbar.php

@@ -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;
-}

+ 0 - 40
tests/plugins/PluginAddlinkTest.php

@@ -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);
-    }
 }