-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
595 additions
and
185 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?php | ||
|
||
/** | ||
* Alert formatter for my custom alert type. | ||
*/ | ||
class WikiCustomAlertFormatter 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->wiki_watching_alert_string); | ||
} | ||
|
||
/** | ||
* Init function called before running formatAlert(). Used to load language files and initialize other required | ||
* resources. | ||
* | ||
* @return void | ||
*/ | ||
public function init() | ||
{ | ||
if (!$this->lang->wiki) { | ||
$this->lang->load('wiki'); | ||
} | ||
} | ||
|
||
/** | ||
* 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 "wiki.php?action=view&id=" . $alert->getObjectId(); | ||
} | ||
} |
Oops, something went wrong.