2015-08-27 07:40:18 +08:00
|
|
|
<?php
|
2015-08-26 14:48:58 +08:00
|
|
|
/*
|
|
|
|
* This file is part of Flarum.
|
|
|
|
*
|
|
|
|
* (c) Toby Zerner <toby.zerner@gmail.com>
|
|
|
|
*
|
|
|
|
* For the full copyright and license information, please view the LICENSE
|
|
|
|
* file that was distributed with this source code.
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace Flarum\Events;
|
2015-07-18 21:29:47 +08:00
|
|
|
|
|
|
|
use Flarum\Support\ClientAction;
|
|
|
|
use Flarum\Support\ClientView;
|
|
|
|
|
2015-10-02 16:12:34 +08:00
|
|
|
abstract class BuildClientView
|
2015-07-18 21:29:47 +08:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @var ClientAction
|
|
|
|
*/
|
2015-07-20 16:38:28 +08:00
|
|
|
public $action;
|
2015-07-18 21:29:47 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @var ClientView
|
|
|
|
*/
|
2015-07-20 16:38:28 +08:00
|
|
|
public $view;
|
2015-07-18 21:29:47 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @var array
|
|
|
|
*/
|
2015-07-20 16:38:28 +08:00
|
|
|
public $keys;
|
2015-07-18 21:29:47 +08:00
|
|
|
|
2015-10-02 16:12:34 +08:00
|
|
|
public function assets($files)
|
2015-07-20 16:38:28 +08:00
|
|
|
{
|
2015-10-02 16:12:34 +08:00
|
|
|
$this->view->getAssets()->addFiles((array) $files);
|
2015-07-20 16:38:28 +08:00
|
|
|
}
|
|
|
|
|
2015-10-02 16:12:34 +08:00
|
|
|
public function bootstrapper($bootstrapper)
|
2015-07-20 16:38:28 +08:00
|
|
|
{
|
2015-10-02 16:12:34 +08:00
|
|
|
$this->view->addBootstrapper($bootstrapper);
|
2015-07-31 18:43:13 +08:00
|
|
|
}
|
2015-08-04 15:46:34 +08:00
|
|
|
|
2015-10-02 16:12:34 +08:00
|
|
|
public function translations(array $keys)
|
2015-08-04 15:46:34 +08:00
|
|
|
{
|
2015-10-02 16:12:34 +08:00
|
|
|
foreach ($keys as $key) {
|
|
|
|
$this->keys[] = $key;
|
2015-08-04 15:46:34 +08:00
|
|
|
}
|
|
|
|
}
|
2015-07-31 18:43:13 +08:00
|
|
|
}
|