34 parent::__construct(
'Recentchangeslinked' );
38 $opts = parent::getDefaultOptions();
39 $opts->add(
'target',
'' );
40 $opts->add(
'showlinkedto',
false );
46 $opts[
'target'] = $par;
50 $target = $opts[
'target'];
51 $showlinkedto = $opts[
'showlinkedto'];
54 if ( $target ===
'' ) {
60 $outputPage->addHTML(
'<div class="errorbox">' . $this->
msg(
'allpagesbadtitle' )
61 ->parse() .
'</div>' );
66 $outputPage->setPageTitle( $this->
msg(
'recentchangeslinked-title',
$title->getPrefixedText() ) );
78 $id =
$title->getArticleID();
79 $ns =
$title->getNamespace();
80 $dbkey =
$title->getDBkey();
88 $uid = $this->
getUser()->getId();
89 if ( $uid && $this->
getUser()->isAllowed(
'viewmywatchlist' ) ) {
91 $select[] =
'wl_user';
92 $join_conds[
'watchlist'] = [
'LEFT JOIN', [
95 'wl_namespace=rc_namespace'
98 if ( $this->
getUser()->isAllowed(
'rollback' ) ) {
100 $join_conds[
'page'] = [
'LEFT JOIN',
'rc_cur_id=page_id' ];
101 $select[] =
'page_latest';
121 $link_tables = [
'categorylinks' ];
122 $showlinkedto =
true;
125 $link_tables = [
'pagelinks',
'templatelinks' ];
127 if ( $ns ==
NS_FILE || !$showlinkedto ) {
128 $link_tables[] =
'imagelinks';
132 if ( $id == 0 && !$showlinkedto ) {
139 'templatelinks' =>
'tl',
140 'categorylinks' =>
'cl',
146 foreach ( $link_tables
as $link_table ) {
147 $pfx = $prefix[$link_table];
151 if ( $link_table ==
'imagelinks' ) {
153 } elseif ( $link_table ==
'categorylinks' ) {
159 if ( $showlinkedto ) {
162 if ( $ns != $link_ns ) {
165 $subconds = [
"{$pfx}_to" => $dbkey ];
167 $subconds = [
"{$pfx}_namespace" => $ns,
"{$pfx}_title" => $dbkey ];
169 $subjoin =
"rc_cur_id = {$pfx}_from";
172 $subconds = [
"{$pfx}_from" => $id ];
173 if ( $link_table ==
'imagelinks' || $link_table ==
'categorylinks' ) {
174 $subconds[
"rc_namespace"] = $link_ns;
175 $subjoin =
"rc_title = {$pfx}_to";
177 $subjoin = [
"rc_namespace = {$pfx}_namespace",
"rc_title = {$pfx}_title" ];
181 if (
$dbr->unionSupportsOrderAndLimit() ) {
182 $order = [
'ORDER BY' =>
'rc_timestamp DESC' ];
188 array_merge(
$tables, [ $link_table ] ),
192 $order + $query_options,
193 $join_conds + [ $link_table => [
'INNER JOIN', $subjoin ] ]
196 if (
$dbr->unionSupportsOrderAndLimit() ) {
203 if ( count( $subsql ) == 0 ) {
206 if ( count( $subsql ) == 1 &&
$dbr->unionSupportsOrderAndLimit() ) {
210 $sql =
$dbr->unionQueries( $subsql,
false ) .
' ORDER BY rc_timestamp DESC';
211 $sql =
$dbr->limitResult( $sql,
$limit,
false );
214 $res =
$dbr->query( $sql, __METHOD__ );
216 if (
$res->numRows() == 0 ) {
217 $this->mResultEmpty =
true;
226 $this->
getOutput()->addBacklinkSubtitle( $target );
227 $this->
getSkin()->setRelevantTitle( $target );
238 $extraOpts = parent::getExtraOptions( $opts );
240 $opts->consumeValues( [
'showlinkedto',
'target' ] );
242 $extraOpts[
'target'] = [ $this->
msg(
'recentchangeslinked-page' )->escaped(),
243 Xml::input(
'target', 40, str_replace(
'_',
' ', $opts[
'target'] ) ) .
244 Xml::check(
'showlinkedto', $opts[
'showlinkedto'], [
'id' =>
'showlinkedto' ] ) .
' ' .
255 if ( $this->rclTargetTitle === null ) {
257 if ( isset( $opts[
'target'] ) && $opts[
'target'] !==
'' ) {
260 $this->rclTargetTitle =
false;
wfGetDB($db, $groups=[], $wiki=false)
Get a Database object.
null for the local wiki Added should default to null in handler for backwards compatibility add a value to it if you want to add a cookie that have to vary cache options can modify $query
doMainQuery($conds, $opts)
static input($name, $size=false, $value=false, $attribs=[])
Convenience function to build an HTML text input field.
A special page that lists last changes made to the wiki.
msg()
Wrapper around wfMessage that sets the current context.
getOutput()
Get the OutputPage being used for this instance.
static check($name, $checked=false, $attribs=[])
Convenience function to build an HTML checkbox.
static newFromText($text, $defaultNamespace=NS_MAIN)
Create a new Title from text, such as what one would find in a link.
getOptions()
Get the current FormOptions for this request.
addHelpLink($to, $overrideBaseUrl=false)
Adds help link with an icon via page indicators.
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist e g Watchlist & $tables
static label($label, $id, $attribs=[])
Convenience function to build an HTML form label.
parseParameters($par, FormOptions $opts)
getExtraOptions($opts)
Get options to be displayed in a form.
getSkin()
Shortcut to get the skin being used for this instance.
namespace and then decline to actually register it file or subcat img or subcat $title
design txt This is a brief overview of the new design More thorough and up to date information is available on the documentation wiki at etc Handles the details of getting and saving to the user table of the and dealing with sessions and cookies OutputPage Encapsulates the entire HTML page that will be sent in response to any server request It is used by calling its functions to add text
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
static selectFields()
Return the list of recentchanges fields that should be selected to create a new recentchanges object...
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
getUser()
Shortcut to get the User executing this instance.
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist e g Watchlist removed from all revisions and log entries to which it was applied This gives extensions a chance to take it off their books as the deletion has already been partly carried out by this point or something similar the user will be unable to create the tag set and then return false from the hook function Ensure you consume the ChangeTagAfterDelete hook to carry out custom deletion actions as context called by AbstractContent::getParserOutput May be used to override the normal model specific rendering of page content as context as context the output can only depend on parameters provided to this hook not on global state indicating whether full HTML should be generated If generation of HTML may be but other information should still be present in the ParserOutput object to manipulate or replace but no entry for that model exists in $wgContentHandlers if desired whether it is OK to use $contentModel on $title Handler functions that modify $ok should generally return false to prevent further hooks from further modifying $ok inclusive $limit
bool Title $rclTargetTitle
This is to display changes made to all articles linked in an article.
runMainQueryHook(&$tables, &$fields, &$conds, &$query_options, &$join_conds, $opts)
prefixSearchSubpages($search, $limit, $offset)
Return an array of subpages beginning with $search that this special page will accept.
prefixSearchString($search, $limit, $offset)
Perform a regular substring search for prefixSearchSubpages.
setTopText(FormOptions $opts)