mirror of
https://github.com/flarum/core.git
synced 2025-10-12 15:34:26 +02:00
Allow custom variables to be set on the client app
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
<?php namespace Flarum\Admin\Actions;
|
||||
|
||||
use Flarum\Support\ClientAction as BaseClientAction;
|
||||
use Psr\Http\Message\ServerRequestInterface as Request;
|
||||
use Flarum\Core\Groups\Permission;
|
||||
|
||||
class ClientAction extends BaseClientAction
|
||||
{
|
||||
@@ -20,4 +22,18 @@ class ClientAction extends BaseClientAction
|
||||
protected $translationKeys = [
|
||||
|
||||
];
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function render(Request $request, array $routeParams = [])
|
||||
{
|
||||
$view = parent::render($request, $routeParams);
|
||||
|
||||
$view->setVariable('config', $this->settings->all());
|
||||
$view->setVariable('locales', app('flarum.localeManager')->getLocales());
|
||||
$view->setVariable('permissions', Permission::map());
|
||||
|
||||
return $view;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user