-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUntitled-2.php
48 lines (45 loc) · 1.4 KB
/
Untitled-2.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
/**
* Alert formatter for award alerts.
*/
class Shinka_AwardAlert_AlertFormatter extends MybbStuff_MyAlerts_Formatter_AbstractFormatter
{
/**
* Format an alert into it's output string to be used in both the main alerts listing page and the popup.
*
* @param MybbStuff_MyAlerts_Entity_Alert $alert The alert to format.
*
* @return string The formatted alert string.
*/
public function formatAlert(MybbStuff_MyAlerts_Entity_Alert $alert, array $outputAlert)
{
return $this->lang->sprintf(
$this->lang->my_alert_type_lang_string,
$outputAlert['from_user'],
$outputAlert['dateline']
);
}
/**
* Init function called before running formatAlert(). Used to load language files and initialize other required
* resources.
*
* @return void
*/
public function init()
{
if (!$this->lang->my_custom_alert_type) {
$this->lang->load('my_custom_alert_type');
}
}
/**
* Build a link to an alert's content so that the system can redirect to it.
*
* @param MybbStuff_MyAlerts_Entity_Alert $alert The alert to build the link for.
*
* @return string The built alert, preferably an absolute link.
*/
public function buildShowLink(MybbStuff_MyAlerts_Entity_Alert $alert)
{
return get_profile_link($alert->getFromUserId());
}
}