|
MediaWiki master
|
Helper functions for feeds. More...
Static Public Member Functions | |
| static | applyDiffStyle ( $text) |
| Hacky application of diff styles for the feeds. | |
| static | checkFeedOutput ( $type, $output=null) |
| Check whether feeds can be used and that $type is a valid feed type. | |
| static | formatDiff ( $row, $formattedComment=null) |
| Format a diff for the newsfeed. | |
| static | formatDiffRow ( $title, $oldid, $newid, $timestamp, $comment, $actiontext='') |
| Really format a diff for the newsfeed. | |
| static | formatDiffRow2 ( $title, $oldid, $newid, $timestamp, $formattedComment, $actiontext='') |
| Really really format a diff for the newsfeed. | |
Static Protected Member Functions | |
| static | getDiffLink (Title $title, $newid, $oldid=null) |
| Generates a diff link. | |
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 280 of file FeedUtils.php.
Referenced by MediaWiki\Feed\FeedUtils\formatDiffRow2().
|
static |
Check whether feeds can be used and that $type is a valid feed type.
| string | $type | Feed type, as requested by the user |
| OutputPage | null | $output | Null falls back to $wgOut |
Definition at line 41 of file FeedUtils.php.
References $wgOut, MediaWiki\MainConfigNames\Feed, MediaWiki\MainConfigNames\FeedClasses, and MediaWiki\MediaWikiServices\getInstance().
|
static |
Format a diff for the newsfeed.
| \\stdClass | $row | Row from the recentchanges table, including fields as appropriate for CommentStore |
| string | null | $formattedComment | rc_comment in HTML format, or null to format it on demand. |
Definition at line 72 of file FeedUtils.php.
References MediaWiki\Feed\FeedUtils\formatDiffRow2(), MediaWiki\MediaWikiServices\getInstance(), MediaWiki\Deferred\LinksUpdate\CategoryLinksTable\makeTitle(), wfMessage(), and wfTimestamp().
|
static |
Really format a diff for the newsfeed.
| Title | $title | |
| int | $oldid | Old revision's id |
| int | $newid | New revision's id |
| string | $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 108 of file FeedUtils.php.
References MediaWiki\Feed\FeedUtils\formatDiffRow2(), and MediaWiki\MediaWikiServices\getInstance().
|
static |
Really really format a diff for the newsfeed.
Same as formatDiffRow() except with preformatted comments.
| Title | $title | |
| int | null | $oldid | Old revision's id |
| int | $newid | New revision's id |
| string | $timestamp | New revision's timestamp |
| string | $formattedComment | New revision's comment in HTML format |
| string | $actiontext | Text of the action; in case of log event |
Definition at line 129 of file FeedUtils.php.
References MediaWiki\Feed\FeedUtils\applyDiffStyle(), MediaWiki\Html\element(), MediaWiki\MainConfigNames\FeedDiffCutoff, MediaWiki\Feed\FeedUtils\getDiffLink(), MediaWiki\MediaWikiServices\getInstance(), and wfMessage().
Referenced by MediaWiki\Feed\FeedUtils\formatDiff(), and MediaWiki\Feed\FeedUtils\formatDiffRow().
|
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 259 of file FeedUtils.php.
References MediaWiki\Html\element(), MediaWiki\Title\Title\getFullURL(), and wfMessage().
Referenced by MediaWiki\Feed\FeedUtils\formatDiffRow2().