1
0
mirror of https://github.com/flarum/core.git synced 2025-08-11 10:55:47 +02:00

Expand reason descriptions and add configurable link to community guidelines

This commit is contained in:
Toby Zerner
2015-11-04 12:59:29 +10:30
parent 39b8f0ad7a
commit 379b1f0831
5 changed files with 67 additions and 7 deletions

View File

@@ -19,10 +19,24 @@ use Flarum\Event\ConfigureModelDates;
use Flarum\Event\PrepareApiAttributes;
use Flarum\Flags\Api\Controller;
use Flarum\Flags\Flag;
use Flarum\Settings\SettingsRepositoryInterface;
use Illuminate\Contracts\Events\Dispatcher;
class AddFlagsApi
{
/**
* @var SettingsRepositoryInterface
*/
protected $settings;
/**
* @param SettingsRepositoryInterface $settings
*/
public function __construct(SettingsRepositoryInterface $settings)
{
$this->settings = $settings;
}
/**
* @param Dispatcher $events
*/
@@ -54,6 +68,8 @@ class AddFlagsApi
if ($event->attributes['canViewFlags']) {
$event->attributes['flagsCount'] = (int) $this->getFlagsCount($event->actor);
}
$event->attributes['guidelinesUrl'] = $this->settings->get('flarum-flags.guidelines_url');
}
if ($event->isSerializer(CurrentUserSerializer::class)) {