Update TopicLabel.php

This commit is contained in:
Carlos Ferreira 2018-07-15 23:41:55 +02:00 committed by GitHub
parent 730d6f300f
commit ed70e61242
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,4 +1,5 @@
<?php
/**
* @link https://www.humhub.org/
* @copyright Copyright (c) 2018 HumHub GmbH & Co. KG
@ -8,7 +9,6 @@
namespace humhub\modules\topic\widgets;
use humhub\modules\content\models\ContentTag;
use humhub\modules\topic\models\Topic;
use humhub\widgets\Label;
@ -20,6 +20,7 @@ class TopicLabel extends Label
public static function forTopic(Topic $topic)
{
$link = Link::withAction('', 'topic.addTopic')->options(['data-topic-id' => $topic->id, 'data-topic-url' => $topic->getUrl()]);
return static::defaultType($topic->name)->sortOrder(20)->color($topic->color)->withLink($link)->icon('fa-star');
}
}