1
0
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:
Toby Zerner
2015-07-31 20:08:27 +09:30
parent 513d896f51
commit e204794b91
7 changed files with 92 additions and 39 deletions

View File

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