MediaWiki
1.34.0
|
Helper functions for feeds. More...
Static Public Member Functions | |
static | applyDiffStyle ( $text) |
Hacky application of diff styles for the feeds. More... | |
static | checkFeedOutput ( $type) |
Check whether feeds can be used and that $type is a valid feed type. More... | |
static | formatDiff ( $row) |
Format a diff for the newsfeed. More... | |
static | formatDiffRow ( $title, $oldid, $newid, $timestamp, $comment, $actiontext='') |
Really format a diff for the newsfeed. More... | |
Static Protected Member Functions | |
static | getDiffLink (Title $title, $newid, $oldid=null) |
Generates a diff link. More... | |
Helper functions for feeds.
Definition at line 31 of file FeedUtils.php.
|
static |
Hacky application of diff styles for the feeds.
Might be 'cleaner' to use DOM or XSLT or something, but gack it's a pain in the ass.
string | $text | Diff's HTML output |
Definition at line 218 of file FeedUtils.php.
Referenced by formatDiffRow().
|
static |
Check whether feeds can be used and that $type is a valid feed type.
string | $type | Feed type, as requested by the user |
Definition at line 39 of file FeedUtils.php.
References $type, $wgFeed, $wgFeedClasses, and $wgOut.
Referenced by HistoryAction\feed().
|
static |
Format a diff for the newsfeed.
object | $row | Row from the recentchanges table, including fields as appropriate for CommentStore |
Definition at line 62 of file FeedUtils.php.
References formatDiffRow(), CommentStore\getStore(), Title\makeTitle(), LogFormatter\newFromRow(), RC_LOG, wfMessage(), and wfTimestamp().
Referenced by ChangesFeed\buildItems().
|
static |
Really format a diff for the newsfeed.
Title | $title | |
int | $oldid | Old revision's id |
int | $newid | New revision's id |
int | $timestamp | New revision's timestamp |
string | $comment | New revision's comment |
string | $actiontext | Text of the action; in case of log event |
Definition at line 91 of file FeedUtils.php.
References $context, $title, $wgFeedDiffCutoff, $wgLang, applyDiffStyle(), Linker\formatComment(), getDiffLink(), ContentHandler\getForTitle(), RequestContext\getMain(), Revision\newFromId(), and wfMessage().
Referenced by HistoryAction\feedItem(), and formatDiff().
|
staticprotected |
Generates a diff link.
Used when the full diff is not wanted for example when $wgFeedDiffCutoff is 0.
Title | $title | Title object: used to generate the diff URL |
int | $newid | Newid for this diff |
int | null | $oldid | Oldid for the diff. Null means it is a new article |
Definition at line 197 of file FeedUtils.php.
References $title, and wfMessage().
Referenced by formatDiffRow().