mirror of
https://github.com/flarum/framework.git
synced 2025-05-14 10:12:39 +08:00
Clean up some old code
This commit is contained in:
parent
32beab9238
commit
555bb18acd
@ -4,9 +4,8 @@ use Dflydev\FigCookies\FigRequestCookies;
|
|||||||
use Flarum\Api\Client;
|
use Flarum\Api\Client;
|
||||||
use Flarum\Support\Actor;
|
use Flarum\Support\Actor;
|
||||||
use Flarum\Support\HtmlAction;
|
use Flarum\Support\HtmlAction;
|
||||||
use Session;
|
|
||||||
use Config;
|
|
||||||
use Psr\Http\Message\ServerRequestInterface as Request;
|
use Psr\Http\Message\ServerRequestInterface as Request;
|
||||||
|
use Flarum\Core;
|
||||||
|
|
||||||
class IndexAction extends HtmlAction
|
class IndexAction extends HtmlAction
|
||||||
{
|
{
|
||||||
@ -25,7 +24,6 @@ class IndexAction extends HtmlAction
|
|||||||
$config = app('db')->table('config')->whereIn('key', ['base_url', 'api_url', 'forum_title', 'welcome_title', 'welcome_message'])->lists('value', 'key');
|
$config = app('db')->table('config')->whereIn('key', ['base_url', 'api_url', 'forum_title', 'welcome_title', 'welcome_message'])->lists('value', 'key');
|
||||||
$data = [];
|
$data = [];
|
||||||
$session = [];
|
$session = [];
|
||||||
$alert = Session::get('alert');
|
|
||||||
|
|
||||||
if (($user = $this->actor->getUser()) && $user->exists) {
|
if (($user = $this->actor->getUser()) && $user->exists) {
|
||||||
$session = [
|
$session = [
|
||||||
@ -42,12 +40,11 @@ class IndexAction extends HtmlAction
|
|||||||
}
|
}
|
||||||
|
|
||||||
$view = view('flarum.admin::index')
|
$view = view('flarum.admin::index')
|
||||||
->with('title', 'Administration - '.Config::get('flarum::forum_title', 'Flarum Demo Forum'))
|
->with('title', 'Administration - '.Core::config('forum_title'))
|
||||||
->with('config', $config)
|
->with('config', $config)
|
||||||
->with('layout', 'flarum.admin::admin')
|
->with('layout', 'flarum.admin::admin')
|
||||||
->with('data', $data)
|
->with('data', $data)
|
||||||
->with('session', $session)
|
->with('session', $session);
|
||||||
->with('alert', $alert);
|
|
||||||
|
|
||||||
$assetManager = app('flarum.admin.assetManager');
|
$assetManager = app('flarum.admin.assetManager');
|
||||||
$root = __DIR__.'/../../..';
|
$root = __DIR__.'/../../..';
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
use Flarum\Http\RouteCollection;
|
use Flarum\Http\RouteCollection;
|
||||||
use Flarum\Http\UrlGenerator;
|
use Flarum\Http\UrlGenerator;
|
||||||
use Flarum\Support\AssetManager;
|
|
||||||
use Illuminate\Support\ServiceProvider;
|
use Illuminate\Support\ServiceProvider;
|
||||||
use Psr\Http\Message\ServerRequestInterface;
|
use Psr\Http\Message\ServerRequestInterface;
|
||||||
|
|
||||||
@ -15,10 +14,6 @@ class AdminServiceProvider extends ServiceProvider
|
|||||||
*/
|
*/
|
||||||
public function register()
|
public function register()
|
||||||
{
|
{
|
||||||
$this->app->singleton('flarum.admin.assetManager', function () {
|
|
||||||
return new AssetManager($this->app->make('files'), public_path('assets'), 'admin');
|
|
||||||
});
|
|
||||||
|
|
||||||
$this->app->singleton(
|
$this->app->singleton(
|
||||||
'Flarum\Http\UrlGeneratorInterface',
|
'Flarum\Http\UrlGeneratorInterface',
|
||||||
function () {
|
function () {
|
||||||
|
@ -14,10 +14,6 @@ class ForumServiceProvider extends ServiceProvider
|
|||||||
*/
|
*/
|
||||||
public function register()
|
public function register()
|
||||||
{
|
{
|
||||||
$this->app->singleton('flarum.forum.assetManager', function ($app) {
|
|
||||||
return new AssetManager($app['files'], $app['path.public'].'/assets', 'forum');
|
|
||||||
});
|
|
||||||
|
|
||||||
$this->app->singleton(
|
$this->app->singleton(
|
||||||
'Flarum\Http\UrlGeneratorInterface',
|
'Flarum\Http\UrlGeneratorInterface',
|
||||||
function () {
|
function () {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user