diff --git a/app/Services/Hook.php b/app/Services/Hook.php index 3ff9d8d8..ba6e46d8 100644 --- a/app/Services/Hook.php +++ b/app/Services/Hook.php @@ -53,9 +53,6 @@ class Hook }); } - /** - * Add routes. A router instance will be passed to the given callback. - */ public static function addRoute(Closure $callback): void { Event::listen(Events\ConfigureRoutes::class, function ($event) use ($callback) { @@ -63,28 +60,6 @@ class Hook }); } - public static function registerPluginTransScripts(string $name, $pages = ['*']): void - { - Event::listen(Events\RenderingFooter::class, function ($event) use ($name, $pages) { - foreach ($pages as $pattern) { - if (!request()->is($pattern)) { - continue; - } - - // We will determine current locale in the event callback, - // otherwise the locale is not properly detected. - $basepath = config('plugins.url') ?: url('plugins').'/'.$name.'/'; - $relative = 'lang/'.config('app.locale').'/locale.js'; - - $event->addContent( - '' - ); - - return; - } - }); - } - public static function addStyleFileToPage($urls, $pages = ['*']): void { Event::listen(Events\RenderingHeader::class, function ($event) use ($urls, $pages) { diff --git a/tests/ServicesTest/HookTest.php b/tests/ServicesTest/HookTest.php index c7b56b51..8d69a215 100644 --- a/tests/ServicesTest/HookTest.php +++ b/tests/ServicesTest/HookTest.php @@ -44,13 +44,6 @@ class HookTest extends TestCase $this->get('/test-hook')->assertSuccessful(); } - public function testRegisterPluginTransScripts() - { - Hook::registerPluginTransScripts('fake-plugin-with-i18n', ['/']); - $this->get('/')->assertSee('fake-plugin-with-i18n/lang/en/locale.js'); - $this->get('/skinlib')->assertDontSee('fake-plugin-with-i18n/lang/en/locale.js'); - } - public function testAddStyleFileToPage() { Hook::addStyleFileToPage('/style/all');