dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
merged master
[lhc/web/wiklou.git]
/
includes
/
specials
/
SpecialRecentchangeslinked.php
diff --git
a/includes/specials/SpecialRecentchangeslinked.php
b/includes/specials/SpecialRecentchangeslinked.php
index
000ef3e
..
862736d
100644
(file)
--- a/
includes/specials/SpecialRecentchangeslinked.php
+++ b/
includes/specials/SpecialRecentchangeslinked.php
@@
-54,8
+54,9
@@
class SpecialRecentchangeslinked extends SpecialRecentChanges {
public function getFeedObject( $feedFormat ){
$feed = new ChangesFeed( $feedFormat, false );
$feedObj = $feed->getFeedObject(
public function getFeedObject( $feedFormat ){
$feed = new ChangesFeed( $feedFormat, false );
$feedObj = $feed->getFeedObject(
- wfMsgForContent( 'recentchangeslinked-title', $this->getTargetTitle()->getPrefixedText() ),
- wfMsgForContent( 'recentchangeslinked-feed' ),
+ $this->msg( 'recentchangeslinked-title', $this->getTargetTitle()->getPrefixedText() )
+ ->inContentLanguage()->text(),
+ $this->msg( 'recentchangeslinked-feed' )->inContentLanguage()->text(),
$this->getTitle()->getFullUrl()
);
return array( $feed, $feedObj );
$this->getTitle()->getFullUrl()
);
return array( $feed, $feedObj );
@@
-69,13
+70,14
@@
class SpecialRecentchangeslinked extends SpecialRecentChanges {
if ( $target === '' ) {
return false;
}
if ( $target === '' ) {
return false;
}
+ $outputPage = $this->getOutput();
$title = Title::newFromURL( $target );
if( !$title || $title->getInterwiki() != '' ){
$title = Title::newFromURL( $target );
if( !$title || $title->getInterwiki() != '' ){
- $
this->getOutput()
->wrapWikiMsg( "<div class=\"errorbox\">\n$1\n</div><br style=\"clear: both\" />", 'allpagesbadtitle' );
+ $
outputPage
->wrapWikiMsg( "<div class=\"errorbox\">\n$1\n</div><br style=\"clear: both\" />", 'allpagesbadtitle' );
return false;
}
return false;
}
- $
this->getOutput()
->setPageTitle( $this->msg( 'recentchangeslinked-title', $title->getPrefixedText() ) );
+ $
outputPage
->setPageTitle( $this->msg( 'recentchangeslinked-title', $title->getPrefixedText() ) );
/*
* Ordinary links are in the pagelinks table, while transclusions are
/*
* Ordinary links are in the pagelinks table, while transclusions are
@@
-87,7
+89,7
@@
class SpecialRecentchangeslinked extends SpecialRecentChanges {
*/
$dbr = wfGetDB( DB_SLAVE, 'recentchangeslinked' );
*/
$dbr = wfGetDB( DB_SLAVE, 'recentchangeslinked' );
- $id = $title->getArticleI
d
();
+ $id = $title->getArticleI
D
();
$ns = $title->getNamespace();
$dbkey = $title->getDBkey();
$ns = $title->getNamespace();
$dbkey = $title->getDBkey();
@@
-108,13
+110,18
@@
class SpecialRecentchangeslinked extends SpecialRecentChanges {
$join_conds['page'] = array('LEFT JOIN', 'rc_cur_id=page_id');
$select[] = 'page_latest';
}
$join_conds['page'] = array('LEFT JOIN', 'rc_cur_id=page_id');
$select[] = 'page_latest';
}
- if ( !$this->including() ) { // bug 23293
- ChangeTags::modifyDisplayQuery( $tables, $select, $conds, $join_conds,
- $query_options, $opts['tagfilter'] );
- }
+ ChangeTags::modifyDisplayQuery(
+ $tables,
+ $select,
+ $conds,
+ $join_conds,
+ $query_options,
+ $opts['tagfilter']
+ );
- if ( !wfRunHooks( 'SpecialRecentChangesQuery', array( &$conds, &$tables, &$join_conds, $opts, &$query_options, &$select ) ) )
+ if ( !wfRunHooks( 'SpecialRecentChangesQuery', array( &$conds, &$tables, &$join_conds, $opts, &$query_options, &$select ) ) )
{
return false;
return false;
+ }
if( $ns == NS_CATEGORY && !$showlinkedto ) {
// special handling for categories
if( $ns == NS_CATEGORY && !$showlinkedto ) {
// special handling for categories
@@
-125,11
+132,14
@@
class SpecialRecentchangeslinked extends SpecialRecentChanges {
// for now, always join on these tables; really should be configurable as in whatlinkshere
$link_tables = array( 'pagelinks', 'templatelinks' );
// imagelinks only contains links to pages in NS_FILE
// for now, always join on these tables; really should be configurable as in whatlinkshere
$link_tables = array( 'pagelinks', 'templatelinks' );
// imagelinks only contains links to pages in NS_FILE
- if( $ns == NS_FILE || !$showlinkedto ) $link_tables[] = 'imagelinks';
+ if( $ns == NS_FILE || !$showlinkedto ) {
+ $link_tables[] = 'imagelinks';
+ }
}
}
- if( $id == 0 && !$showlinkedto )
+ if( $id == 0 && !$showlinkedto )
{
return false; // nonexistent pages can't link to any pages
return false; // nonexistent pages can't link to any pages
+ }
// field name prefixes for all the various tables we might want to join with
$prefix = array( 'pagelinks' => 'pl', 'templatelinks' => 'tl', 'categorylinks' => 'cl', 'imagelinks' => 'il' );
// field name prefixes for all the various tables we might want to join with
$prefix = array( 'pagelinks' => 'pl', 'templatelinks' => 'tl', 'categorylinks' => 'cl', 'imagelinks' => 'il' );
@@
-140,14
+150,20
@@
class SpecialRecentchangeslinked extends SpecialRecentChanges {
$pfx = $prefix[$link_table];
// imagelinks and categorylinks tables have no xx_namespace field, and have xx_to instead of xx_title
$pfx = $prefix[$link_table];
// imagelinks and categorylinks tables have no xx_namespace field, and have xx_to instead of xx_title
- if( $link_table == 'imagelinks' ) $link_ns = NS_FILE;
- elseif( $link_table == 'categorylinks' ) $link_ns = NS_CATEGORY;
- else $link_ns = 0;
+ if( $link_table == 'imagelinks' ) {
+ $link_ns = NS_FILE;
+ } elseif( $link_table == 'categorylinks' ) {
+ $link_ns = NS_CATEGORY;
+ } else {
+ $link_ns = 0;
+ }
if( $showlinkedto ) {
// find changes to pages linking to this page
if( $link_ns ) {
if( $showlinkedto ) {
// find changes to pages linking to this page
if( $link_ns ) {
- if( $ns != $link_ns ) continue; // should never happen, but check anyway
+ if( $ns != $link_ns ) {
+ continue;
+ } // should never happen, but check anyway
$subconds = array( "{$pfx}_to" => $dbkey );
} else {
$subconds = array( "{$pfx}_namespace" => $ns, "{$pfx}_title" => $dbkey );
$subconds = array( "{$pfx}_to" => $dbkey );
} else {
$subconds = array( "{$pfx}_namespace" => $ns, "{$pfx}_title" => $dbkey );
@@
-164,11
+180,11
@@
class SpecialRecentchangeslinked extends SpecialRecentChanges {
}
}
}
}
- if( $dbr->unionSupportsOrderAndLimit())
+ if( $dbr->unionSupportsOrderAndLimit())
{
$order = array( 'ORDER BY' => 'rc_timestamp DESC' );
$order = array( 'ORDER BY' => 'rc_timestamp DESC' );
- else
+ } else {
$order = array();
$order = array();
-
+ }
$query = $dbr->selectSQLText(
array_merge( $tables, array( $link_table ) ),
$query = $dbr->selectSQLText(
array_merge( $tables, array( $link_table ) ),
@@
-185,11
+201,12
@@
class SpecialRecentchangeslinked extends SpecialRecentChanges {
$subsql[] = $query;
}
$subsql[] = $query;
}
- if( count($subsql) == 0 )
+ if( count($subsql) == 0 )
{
return false; // should never happen
return false; // should never happen
- if( count($subsql) == 1 && $dbr->unionSupportsOrderAndLimit() )
+ }
+ if( count($subsql) == 1 && $dbr->unionSupportsOrderAndLimit() ) {
$sql = $subsql[0];
$sql = $subsql[0];
- else {
+
}
else {
// need to resort and relimit after union
$sql = $dbr->unionQueries($subsql, false).' ORDER BY rc_timestamp DESC';
$sql = $dbr->limitResult($sql, $limit, false);
// need to resort and relimit after union
$sql = $dbr->unionQueries($subsql, false).' ORDER BY rc_timestamp DESC';
$sql = $dbr->limitResult($sql, $limit, false);
@@
-197,23
+214,29
@@
class SpecialRecentchangeslinked extends SpecialRecentChanges {
$res = $dbr->query( $sql, __METHOD__ );
$res = $dbr->query( $sql, __METHOD__ );
- if( $res->numRows() == 0 )
+ if( $res->numRows() == 0 )
{
$this->mResultEmpty = true;
$this->mResultEmpty = true;
+ }
return $res;
}
return $res;
}
+ /**
+ * @param $opts FormOptions
+ * @return array
+ */
function getExtraOptions( $opts ){
$opts->consumeValues( array( 'showlinkedto', 'target', 'tagfilter' ) );
$extraOpts = array();
$extraOpts['namespace'] = $this->namespaceFilterForm( $opts );
function getExtraOptions( $opts ){
$opts->consumeValues( array( 'showlinkedto', 'target', 'tagfilter' ) );
$extraOpts = array();
$extraOpts['namespace'] = $this->namespaceFilterForm( $opts );
- $extraOpts['target'] = array(
wfMsgHtml( 'recentchangeslinked-page'
),
+ $extraOpts['target'] = array(
$this->msg( 'recentchangeslinked-page' )->escaped(
),
Xml::input( 'target', 40, str_replace('_',' ',$opts['target']) ) .
Xml::check( 'showlinkedto', $opts['showlinkedto'], array('id' => 'showlinkedto') ) . ' ' .
Xml::input( 'target', 40, str_replace('_',' ',$opts['target']) ) .
Xml::check( 'showlinkedto', $opts['showlinkedto'], array('id' => 'showlinkedto') ) . ' ' .
- Xml::label(
wfMsg("recentchangeslinked-to"
), 'showlinkedto' ) );
+ Xml::label(
$this->msg( 'recentchangeslinked-to' )->text(
), 'showlinkedto' ) );
$tagFilter = ChangeTags::buildTagFilterSelector( $opts['tagfilter'] );
$tagFilter = ChangeTags::buildTagFilterSelector( $opts['tagfilter'] );
- if ($tagFilter)
+ if ($tagFilter)
{
$extraOpts['tagfilter'] = $tagFilter;
$extraOpts['tagfilter'] = $tagFilter;
+ }
return $extraOpts;
}
return $extraOpts;
}
@@
-235,8
+258,7
@@
class SpecialRecentchangeslinked extends SpecialRecentChanges {
function setTopText( FormOptions $opts ) {
$target = $this->getTargetTitle();
if( $target ) {
function setTopText( FormOptions $opts ) {
$target = $this->getTargetTitle();
if( $target ) {
- $this->getOutput()->setSubtitle( wfMsg( 'recentchangeslinked-backlink', Linker::link( $target,
- $target->getPrefixedText(), array(), array( 'redirect' => 'no' ) ) ) );
+ $this->getOutput()->addBacklinkSubtitle( $target );
}
}
}
}