[L6] Temporarily hack around theme system to maintain views without having to edit tons of code
This commit is contained in:
parent
0d6cf54314
commit
a9976c723e
5 changed files with 43 additions and 63 deletions
16
app/Extensions/Facades/Theme.php
Normal file
16
app/Extensions/Facades/Theme.php
Normal file
|
@ -0,0 +1,16 @@
|
|||
<?php
|
||||
|
||||
namespace Pterodactyl\Extensions\Facades;
|
||||
|
||||
use Illuminate\Support\Facades\Facade;
|
||||
|
||||
class Theme extends Facade
|
||||
{
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
protected static function getFacadeAccessor()
|
||||
{
|
||||
return 'extensions.themes';
|
||||
}
|
||||
}
|
21
app/Extensions/Themes/Theme.php
Normal file
21
app/Extensions/Themes/Theme.php
Normal file
|
@ -0,0 +1,21 @@
|
|||
<?php
|
||||
|
||||
namespace Pterodactyl\Extensions\Themes;
|
||||
|
||||
class Theme
|
||||
{
|
||||
public function js($path)
|
||||
{
|
||||
return sprintf('<script src="%s"></script>' . PHP_EOL, $this->getUrl($path));
|
||||
}
|
||||
|
||||
public function css($path)
|
||||
{
|
||||
return sprintf('<link media="all" type="text/css" rel="stylesheet" href="%s"/>' . PHP_EOL, $this->getUrl($path));
|
||||
}
|
||||
|
||||
protected function getUrl($path)
|
||||
{
|
||||
return '/themes/pterodactyl/' . ltrim($path, '/');
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue