Files
Phraseanet/lib/classes/eventsmanager/notify/subtitle.php
Aina Sitraka 1ccba2d9a0 PHRAS-3668 subtitle notification (#4416)
* subtitle notification

* fix notif
2023-11-22 12:15:30 +01:00

70 lines
1.3 KiB
PHP

<?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;
}
}