Go to the documentation of this file.
34 parent::__construct(
'Recentchangeslinked' );
38 $opts = parent::getDefaultOptions();
39 $opts->add(
'target',
'' );
40 $opts->add(
'showlinkedto',
false );
46 $opts[
'target'] = $par;
55 $target = $opts[
'target'];
56 $showlinkedto = $opts[
'showlinkedto'];
59 if ( $target ===
'' ) {
65 $outputPage->addHTML(
'<div class="errorbox">' . $this->
msg(
'allpagesbadtitle' )
66 ->parse() .
'</div>' );
71 $outputPage->setPageTitle( $this->
msg(
'recentchangeslinked-title',
$title->getPrefixedText() ) );
83 $id =
$title->getArticleID();
84 $ns =
$title->getNamespace();
85 $dbkey =
$title->getDBkey();
91 $uid = $this->
getUser()->getId();
92 if ( $uid && $this->
getUser()->isAllowed(
'viewmywatchlist' ) ) {
94 $select[] =
'wl_user';
95 $join_conds[
'watchlist'] = [
'LEFT JOIN', [
98 'wl_namespace=rc_namespace'
101 if ( $this->
getUser()->isAllowed(
'rollback' ) ) {
103 $join_conds[
'page'] = [
'LEFT JOIN',
'rc_cur_id=page_id' ];
104 $select[] =
'page_latest';
124 $link_tables = [
'categorylinks' ];
125 $showlinkedto =
true;
128 $link_tables = [
'pagelinks',
'templatelinks' ];
130 if ( $ns ==
NS_FILE || !$showlinkedto ) {
131 $link_tables[] =
'imagelinks';
135 if ( $id == 0 && !$showlinkedto ) {
142 'templatelinks' =>
'tl',
143 'categorylinks' =>
'cl',
149 foreach ( $link_tables
as $link_table ) {
150 $pfx = $prefix[$link_table];
154 if ( $link_table ==
'imagelinks' ) {
156 } elseif ( $link_table ==
'categorylinks' ) {
162 if ( $showlinkedto ) {
165 if ( $ns != $link_ns ) {
168 $subconds = [
"{$pfx}_to" => $dbkey ];
170 $subconds = [
"{$pfx}_namespace" => $ns,
"{$pfx}_title" => $dbkey ];
172 $subjoin =
"rc_cur_id = {$pfx}_from";
175 $subconds = [
"{$pfx}_from" => $id ];
176 if ( $link_table ==
'imagelinks' || $link_table ==
'categorylinks' ) {
177 $subconds[
"rc_namespace"] = $link_ns;
178 $subjoin =
"rc_title = {$pfx}_to";
180 $subjoin = [
"rc_namespace = {$pfx}_namespace",
"rc_title = {$pfx}_title" ];
184 if (
$dbr->unionSupportsOrderAndLimit() ) {
185 $order = [
'ORDER BY' =>
'rc_timestamp DESC' ];
191 array_merge(
$tables, [ $link_table ] ),
195 $order + $query_options,
196 $join_conds + [ $link_table => [
'INNER JOIN', $subjoin ] ]
199 if (
$dbr->unionSupportsOrderAndLimit() ) {
206 if (
count( $subsql ) == 0 ) {
209 if (
count( $subsql ) == 1 &&
$dbr->unionSupportsOrderAndLimit() ) {
213 $sql =
$dbr->unionQueries( $subsql,
false ) .
' ORDER BY rc_timestamp DESC';
214 $sql =
$dbr->limitResult( $sql,
$limit,
false );
217 $res =
$dbr->query( $sql, __METHOD__ );
219 if (
$res->numRows() == 0 ) {
220 $this->mResultEmpty =
true;
229 $this->
getOutput()->addBacklinkSubtitle( $target );
230 $this->
getSkin()->setRelevantTitle( $target );
241 $extraOpts = parent::getExtraOptions( $opts );
243 $opts->consumeValues( [
'showlinkedto',
'target' ] );
245 $extraOpts[
'target'] = [ $this->
msg(
'recentchangeslinked-page' )->escaped(),
246 Xml::input(
'target', 40, str_replace(
'_',
' ', $opts[
'target'] ) ) .
247 Xml::check(
'showlinkedto', $opts[
'showlinkedto'], [
'id' =>
'showlinkedto' ] ) .
' ' .
258 if ( $this->rclTargetTitle ===
null ) {
260 if ( isset( $opts[
'target'] ) && $opts[
'target'] !==
'' ) {
263 $this->rclTargetTitle =
false;
getExtraOptions( $opts)
Get options to be displayed in a form.
static newFromText( $text, $defaultNamespace=NS_MAIN)
Create a new Title from text, such as what one would find in a link.
parseParameters( $par, FormOptions $opts)
Process $par and put options found in $opts.
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist Do not use this to implement individual filters if they are compatible with the ChangesListFilter and ChangesListFilterGroup structure use sub classes of those in conjunction with the ChangesListSpecialPageStructuredFilters hook This hook can be used to implement filters that do not implement that or custom behavior that is not an individual filter e g Watchlist & $tables
getOutput()
Get the OutputPage being used for this instance.
This is to display changes made to all articles linked in an article.
static label( $label, $id, $attribs=[])
Convenience function to build an HTML form label.
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
setTopText(FormOptions $opts)
Send the text to be displayed above the options.
getSkin()
Shortcut to get the skin being used for this instance.
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
null for the 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
addHelpLink( $to, $overrideBaseUrl=false)
Adds help link with an icon via page indicators.
prefixSearchString( $search, $limit, $offset)
Perform a regular substring search for prefixSearchSubpages.
namespace and then decline to actually register it file or subcat img or subcat $title
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database object.
static check( $name, $checked=false, $attribs=[])
Convenience function to build an HTML checkbox.
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist Do not use this to implement individual filters if they are compatible with the ChangesListFilter and ChangesListFilterGroup structure use sub classes of those in conjunction with the ChangesListSpecialPageStructuredFilters hook This hook can be used to implement filters that do not implement that or custom behavior that is not an individual filter e g Watchlist and Watchlist you will want to construct new ChangesListBooleanFilter or ChangesListStringOptionsFilter objects When constructing you specify which group they belong to You can reuse existing or create your you must register them with $special registerFilterGroup 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 please use GetContentModels hook to make them known to core 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
getUser()
Shortcut to get the User executing this instance.
prefixSearchSubpages( $search, $limit, $offset)
Return an array of subpages beginning with $search that this special page will accept.
msg()
Wrapper around wfMessage that sets the current context.
runMainQueryHook(&$tables, &$fields, &$conds, &$query_options, &$join_conds, $opts)
doMainQuery( $tables, $select, $conds, $query_options, $join_conds, FormOptions $opts)
Process the query.Array of tables; see IDatabase::select $table Array of fields; see IDatabase::selec...
A special page that lists last changes made to the wiki.
Represents a title within MediaWiki.
getDefaultOptions()
Get a FormOptions object containing the default options.
static selectFields()
Return the list of recentchanges fields that should be selected to create a new recentchanges object.
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 input( $name, $size=false, $value=false, $attribs=[])
Convenience function to build an HTML text input field.
bool Title $rclTargetTitle
getOptions()
Get the current FormOptions for this request.