41 if ( !$config->get(
'Feed' ) ) {
45 $feedClasses = $config->get(
'FeedClasses' );
46 if ( !isset( $feedClasses[
$params[
'feedformat']] ) ) {
50 if ( $params[
'showsizediff'] && $this->
getConfig()->
get(
'MiserMode' ) ) {
54 $msg =
wfMessage(
'Contributions' )->inContentLanguage()->text();
55 $feedTitle = $config->get(
'Sitename' ) .
' - ' . $msg .
56 ' [' . $config->get(
'LanguageCode' ) .
']';
57 $feedUrl = SpecialPage::getTitleFor(
'Contributions',
$params[
'user'] )->getFullURL();
59 $target =
$params[
'user'] ==
'newbies'
61 : Title::makeTitleSafe( NS_USER,
$params[
'user'] )->getText();
63 $feed =
new $feedClasses[
$params[
'feedformat']] (
65 htmlspecialchars( $msg ),
76 'namespace' =>
$params[
'namespace'],
79 'tagFilter' =>
$params[
'tagfilter'],
80 'deletedOnly' =>
$params[
'deletedonly'],
81 'topOnly' =>
$params[
'toponly'],
82 'newOnly' =>
$params[
'newonly'],
83 'hideMinor' =>
$params[
'hideminor'],
84 'showSizeDiff' =>
$params[
'showsizediff'],
87 $feedLimit = $this->
getConfig()->get(
'FeedLimit' );
88 if ( $pager->getLimit() > $feedLimit ) {
89 $pager->setLimit( $feedLimit );
93 if ( $pager->getNumRows() > 0 ) {
95 $limit = $pager->getLimit();
96 foreach ( $pager->mResult as $row ) {
98 if ( ++$count > $limit ) {
102 if ( $item !==
null ) {
103 $feedItems[] = $item;
116 $hookResult = Hooks::run(
117 'ApiFeedContributions::feedItem',
121 if ( $feedItem instanceof
FeedItem ) {
124 } elseif ( !$hookResult ) {
129 $title = Title::makeTitle( intval( $row->page_namespace ), $row->page_title );
130 if ( $title && $title->userCan(
'read', $this->getUser() ) ) {
131 $date = $row->rev_timestamp;
132 $comments = $title->getTalkPage()->getFullURL();
133 $revision = Revision::newFromRow( $row );
136 $title->getPrefixedText(),
137 $this->feedItemDesc( $revision ),
138 $title->getFullURL( [
'diff' => $revision->getId() ] ),
140 $this->feedItemAuthor( $revision ),
153 return $revision->getUserText();
162 $msg =
wfMessage(
'colon-separator' )->inContentLanguage()->text();
163 $content = $revision->getContent();
167 $html = nl2br( htmlspecialchars( $content->getNativeData() ) );
176 return '<p>' . htmlspecialchars( $revision->getUserText() ) . $msg .
178 "</p>\n<hr />\n<div>" .
$html .
'</div>';
185 $feedFormatNames = array_keys( $this->
getConfig()->
get(
'FeedClasses' ) );
210 'deletedonly' =>
false,
213 'hideminor' =>
false,
219 if ( $this->
getConfig()->
get(
'MiserMode' ) ) {
228 'action=feedcontributions&user=Example'
229 =>
'apihelp-feedcontributions-example-simple',
This abstract class implements many basic API functions, and is the base of all API classes.
const PARAM_REQUIRED
(boolean) Is the parameter required?
dieWithError( $msg, $code=null, $data=null, $httpCode=null)
Abort execution with an error.
getMain()
Get the main module.
const PARAM_TYPE
(string|string[]) Either an array of allowed value strings, or a string type as described below.
const PARAM_DFLT
(null|boolean|integer|string) Default value of the parameter.
extractRequestParams( $parseLimit=true)
Using getAllowedParams(), this function makes an array of the values provided by the user,...
getResult()
Get the result object.
const PARAM_HELP_MSG
(string|array|Message) Specify an alternative i18n documentation message for this parameter.
const PARAM_ISMULTI
(boolean) Accept multiple pipe-separated values for this parameter (e.g.
getAllowedParams()
Returns an array of allowed parameters (parameter name) => (default value) or (parameter name) => (ar...
getCustomPrinter()
This module uses a custom feed wrapper printer.
execute()
Evaluates the parameters, performs the requested query, and sets up the result.
getExamplesMessages()
Returns usage examples for this module.
feedItemAuthor( $revision)
getContext()
Get the base IContextSource object.
A base class for basic support for outputting syndication feeds in RSS and other formats.
static stripComment( $text)
Quickie hack... strip out wikilinks to more legible form from the comment.
Content object implementation for representing flat text.
either a unescaped string or a HtmlArmor object after in associative array form externallinks including delete and has completed for all link tables whether this was an auto creation default is conds Array Extra conditions for the No matching items in log is displayed if loglist is empty msgKey Array If you want a nice box with a set this to the key of the message First element is the message additional optional elements are parameters for the key that are processed with wfMessage() -> params() ->parseAsBlock() - offset Set to overwrite offset parameter in $wgRequest set to '' to unset offset - wrap String Wrap the message in html(usually something like "<div ...>$1</div>"). - flags Integer display flags(NO_ACTION_LINK, NO_EXTRA_USER_LINKS) 'LogException':Called before an exception(or PHP error) is logged. This is meant for integration with external error aggregation services
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses & $ret
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return an< a > element with HTML attributes $attribs and contents $html will be returned If you return $ret will be returned and may include noclasses & $html