Archived
1
0

Initial commit as of 2018-10-16

This commit is contained in:
Marcel
2018-10-16 18:28:42 +02:00
commit 29d7c2ffdc
3601 changed files with 358427 additions and 0 deletions

View File

@@ -0,0 +1,46 @@
<?php
namespace Notification\Admin;
use Notification;
require_once 'Notification.php';
class NewFeedbackNotification extends \Notification
{
public function __construct(array $data)
{
$data['type'] = 'admin.feedback';
parent::__construct($data);
}
public function getNotificationLink()
{
return '/admin/feedback';
}
public function getNotificationImage()
{
return $this->sender->getProfilePicture();
}
public function messageForNotification(Notification $notification)
{
return ['line' => 'admin.feedback.single', 'attributes' => [$this->sender->getName()]];
}
public function messageForNotifications(array $notifications, $realCount = 0)
{
if ($realCount === 0) {
$realCount = count($notifications);
}
if ($realCount < 5) {
$names = $this->manyNames($notifications);
return ['line' => 'admin.feedback.multiple', 'attributes' => [$names]];
} else {
$names = $this->manyNamesCutoff($notifications, $realCount);
return ['line' => 'admin.feedback.many', 'attributes' => [$names]];
}
}
}