PHRAS-3668 subtitle notification (#4416)

* subtitle notification

* fix notif
This commit is contained in:
Aina Sitraka
2023-11-22 14:15:30 +03:00
committed by GitHub
parent ab26d4936a
commit 1ccba2d9a0
15 changed files with 251 additions and 71 deletions

View File

@@ -47,6 +47,7 @@ class eventsmanager_broker
'eventsmanager_notify_push',
'eventsmanager_notify_basketwip',
'eventsmanager_notify_register',
'eventsmanager_notify_subtitle',
'eventsmanager_notify_uploadquarantine',
'eventsmanager_notify_validate',
'eventsmanager_notify_validationdone',

View File

@@ -0,0 +1,69 @@
<?php
/*
* This file is part of Phraseanet
*
* (c) 2005-2023 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Alchemy\Phrasea\Model\Entities\User;
class eventsmanager_notify_subtitle extends eventsmanager_notifyAbstract
{
/**
*
* @return string
*/
public function icon_url()
{
return null;
}
/**
*
* @param Array $data
* @param boolean $unread
* @return Array
*/
public function datas(array $data, $unread)
{
$text = $this->app->trans($data['translateMessage'], ['%title%' => $data['title'], '%langues%' => $data['langues']]);
return [
'text' => $text,
'class' => ($unread == 1 ? 'reload_baskets' : '')
];
}
/**
*
* @return string
*/
public function get_name()
{
return $this->app->trans('notification:: subtitle');
}
/**
*
* @return string
*/
public function get_description()
{
return $this->app->trans('notification:: Receive notification when subtitle generated');
}
/**
* @param integer $usr_id The id of the user to check
*
* @return boolean
*/
public function is_available(User $user)
{
return true;
}
}