add notification for Character titles

This commit is contained in:
oliver 2016-03-26 17:52:16 +01:00
parent f886d4139d
commit 0729c79a7d
3 changed files with 20 additions and 1 deletions

View file

@ -65,7 +65,7 @@
$character['id']
);
// Add notifications
// Add notification
$this->Notification->addNotification(
\hhu\z\controllers\components\NotificationComponent::TYPE_ACHIEVEMENT,
$achievement['title'],
@ -130,6 +130,14 @@
$character['id']
);
// Add notification
$this->Notification->addNotification(
\hhu\z\controllers\components\NotificationComponent::TYPE_CHARACTERTITLE,
($character['gender'] === 1)
? $title['title_male']
: $title['title_female']
);
// Redirect
$this->redirect(
$this->linker->link(

View file

@ -31,6 +31,12 @@
* @var string
*/
const TYPE_CHARACTERGROUPSACHIEVEMENT = 'charactergroupsachievement';
/**
* Type: Character title
*
* @var string
*/
const TYPE_CHARACTERTITLE = 'charactertitle';
/**
* Type: Level-up
*

View file

@ -98,6 +98,11 @@
<p class="fwb"><?=$notification['message']?></p>
<?php endif ?>
</li>
<?php elseif($notification['type'] == \hhu\z\controllers\components\NotificationComponent::TYPE_CHARACTERTITLE) : ?>
<li class="cf">
<p class="announce"><i class="fa fa-trophy fa-fw"></i><?=_('Charactertitle')?>:<i class="fa fa-times fa-fw"></i></p>
<p class="fwb"><?=$notification['message']?></p>
</li>
<?php else : ?>
<li class="cf">
<img src="<?=$linker->link(array('grafics','lvlup.jpg'))?>">