* Make Special:Whatlinkshere visible to Special:SpecialPages
* Move 2 messages in language (maintenance) files to a more generic place as they are no longer used by Special:Whatlinkshere but by other special pages furthermore
* Kill whitespaces
against the previous revision, whether currently deleted or live.
* Added accesskey and tooltip for the "Go" button, and tooltip for the "Search"
button.
against the previous revision, whether currently deleted or live.
* Added accesskey and tooltip for the "Go" button, and tooltip for the "Search"
button.
+* (bug 11649) Show input form when Special:Whatlinkshere has no parameters
=== Bug fixes in 1.12 ===
=== Bug fixes in 1.12 ===
'Specialpages' => array( 'UnlistedSpecialPage', 'Specialpages' ),
'Contributions' => array( 'SpecialPage', 'Contributions' ),
'Emailuser' => array( 'UnlistedSpecialPage', 'Emailuser' ),
'Specialpages' => array( 'UnlistedSpecialPage', 'Specialpages' ),
'Contributions' => array( 'SpecialPage', 'Contributions' ),
'Emailuser' => array( 'UnlistedSpecialPage', 'Emailuser' ),
- 'Whatlinkshere' => array( 'UnlistedSpecialPage', 'Whatlinkshere' ),
+ 'Whatlinkshere' => array( 'SpecialPage', 'Whatlinkshere' ),
'Recentchangeslinked' => array( 'UnlistedSpecialPage', 'Recentchangeslinked' ),
'Movepage' => array( 'UnlistedSpecialPage', 'Movepage' ),
'Blockme' => array( 'UnlistedSpecialPage', 'Blockme' ),
'Recentchangeslinked' => array( 'UnlistedSpecialPage', 'Recentchangeslinked' ),
'Movepage' => array( 'UnlistedSpecialPage', 'Movepage' ),
'Blockme' => array( 'UnlistedSpecialPage', 'Blockme' ),
$targetString = isset($this->par) ? $this->par : $this->request->getVal( 'target' );
$targetString = isset($this->par) ? $this->par : $this->request->getVal( 'target' );
- if (is_null($targetString)) {
- $wgOut->showErrorPage( 'notargettitle', 'notargettext' );
+ if ( is_null( $targetString ) ) {
+ $wgOut->addHTML( $this->whatlinkshereForm() );
return;
}
$this->target = Title::newFromURL( $targetString );
if( !$this->target ) {
return;
}
$this->target = Title::newFromURL( $targetString );
if( !$this->target ) {
- $wgOut->showErrorPage( 'notargettitle', 'notargettext' );
+ $wgOut->addHTML( $this->whatlinkshereForm() );
return;
}
$this->selfTitle = Title::makeTitleSafe( NS_SPECIAL,
'Whatlinkshere/' . $this->target->getPrefixedDBkey() );
return;
}
$this->selfTitle = Title::makeTitleSafe( NS_SPECIAL,
'Whatlinkshere/' . $this->target->getPrefixedDBkey() );
$wgOut->setPageTitle( wfMsg( 'whatlinkshere-title', $this->target->getPrefixedText() ) );
$wgOut->setSubtitle( wfMsg( 'linklistsub' ) );
$wgOut->setPageTitle( wfMsg( 'whatlinkshere-title', $this->target->getPrefixedText() ) );
$wgOut->setSubtitle( wfMsg( 'linklistsub' ) );
// Read an extra row as an at-end check
$queryLimit = $limit + 1;
// Read an extra row as an at-end check
$queryLimit = $limit + 1;
// enforce join order, sometimes namespace selector may
// trigger filesorts which are far less efficient than scanning many entries
$options[] = 'STRAIGHT_JOIN';
// enforce join order, sometimes namespace selector may
// trigger filesorts which are far less efficient than scanning many entries
$options[] = 'STRAIGHT_JOIN';
$options['LIMIT'] = $queryLimit;
$fields = array( 'page_id', 'page_namespace', 'page_title', 'page_is_redirect' );
$options['ORDER BY'] = 'pl_from';
$plRes = $dbr->select( array( 'pagelinks', 'page' ), $fields,
$plConds, $fname, $options );
$options['LIMIT'] = $queryLimit;
$fields = array( 'page_id', 'page_namespace', 'page_title', 'page_is_redirect' );
$options['ORDER BY'] = 'pl_from';
$plRes = $dbr->select( array( 'pagelinks', 'page' ), $fields,
$plConds, $fname, $options );
$options['ORDER BY'] = 'tl_from';
$tlRes = $dbr->select( array( 'templatelinks', 'page' ), $fields,
$tlConds, $fname, $options );
$options['ORDER BY'] = 'tl_from';
$tlRes = $dbr->select( array( 'templatelinks', 'page' ), $fields,
$tlConds, $fname, $options );
if ( !$dbr->numRows( $plRes ) && !$dbr->numRows( $tlRes ) ) {
if ( !$dbr->numRows( $plRes ) && !$dbr->numRows( $tlRes ) ) {
- if ( 0 == $level && !isset( $this->namespace ) ) {
- // really no links to here
- $wgOut->addWikiText( wfMsg( 'nolinkshere', $this->target->getPrefixedText() ) );
- } elseif ( 0 == $level && isset( $this->namespace ) ) {
- // no links from requested namespace to here
$options = array(); // reinitialize for a further namespace search
$options = array(); // reinitialize for a further namespace search
+ // really no links to here
$options['namespace'] = $this->namespace;
$options['target'] = $this->target->getPrefixedText();
list( $options['limit'], $options['offset']) = wfCheckLimits();
$wgOut->addHTML( $this->whatlinkshereForm( $options ) );
$options['namespace'] = $this->namespace;
$options['target'] = $this->target->getPrefixedText();
list( $options['limit'], $options['offset']) = wfCheckLimits();
$wgOut->addHTML( $this->whatlinkshereForm( $options ) );
- $wgOut->addWikiText( wfMsg( 'nolinkshere-ns', $this->target->getPrefixedText() ) );
+ $errMsg = isset( $this->namespace ) ? 'nolinkshere-ns' : 'nolinkshere';
+ $wgOut->addWikiText( wfMsg( $errMsg, $this->target->getPrefixedText() ) );
return $this->makeSelfLink( $fmtLimit, $query );
}
return $this->makeSelfLink( $fmtLimit, $query );
}
- function whatlinkshereForm( $options ) {
+ function whatlinkshereForm( $options = array( 'target' => '', 'namespace' => '' ) ) {
global $wgScript, $wgTitle;
$options['title'] = $wgTitle->getPrefixedText();
$f = Xml::openElement( 'form', array( 'method' => 'get', 'action' => "$wgScript" ) ) .
global $wgScript, $wgTitle;
$options['title'] = $wgTitle->getPrefixedText();
$f = Xml::openElement( 'form', array( 'method' => 'get', 'action' => "$wgScript" ) ) .
- '<fieldset>' .
- Xml::element( 'legend', array(), wfMsg( 'whatlinkshere' ) );
+ Xml::openElement( 'fieldset' ) .
+ Xml::element( 'legend', array(), wfMsg( 'whatlinkshere' ) ) .
+ Xml::inputLabel( wfMsg( 'whatlinkshere-page' ), 'target', 'mw-whatlinkshere-target', 40, $options['target'] ) . ' ';
foreach ( $options as $name => $value ) {
foreach ( $options as $name => $value ) {
- if( $name === 'namespace') continue;
+ if( $name === 'namespace' || $name === 'target' )
+ continue;
$f .= "\t" . Xml::hidden( $name, $value ). "\n";
}
$f .= Xml::label( wfMsg( 'namespace' ), 'namespace' ) . ' ' .
Xml::namespaceSelector( $options['namespace'], '' ) .
Xml::submitButton( wfMsg( 'allpagessubmit' ) ) .
$f .= "\t" . Xml::hidden( $name, $value ). "\n";
}
$f .= Xml::label( wfMsg( 'namespace' ), 'namespace' ) . ' ' .
Xml::namespaceSelector( $options['namespace'], '' ) .
Xml::submitButton( wfMsg( 'allpagessubmit' ) ) .
+ Xml::closeElement( 'fieldset' ) .
Xml::closeElement( 'form' ) . "\n";
return $f;
Xml::closeElement( 'form' ) . "\n";
return $f;
'movethispage' => 'Seite verschieben',
'unusedimagestext' => '<p>Bitte beachte, dass andere Webseiten dieses Bild mit einer direkten URL verlinken können. Diese wird nicht als Verwendung erkannt, so dass das Bild hier aufgeführt wird.</p>',
'unusedcategoriestext' => 'Diese Spezialseite zeigt alle Kategorien, die selber keiner Kategorie zugewiesen wurden.',
'movethispage' => 'Seite verschieben',
'unusedimagestext' => '<p>Bitte beachte, dass andere Webseiten dieses Bild mit einer direkten URL verlinken können. Diese wird nicht als Verwendung erkannt, so dass das Bild hier aufgeführt wird.</p>',
'unusedcategoriestext' => 'Diese Spezialseite zeigt alle Kategorien, die selber keiner Kategorie zugewiesen wurden.',
+'notargettitle' => 'Keine Seite angegeben',
+'notargettext' => 'Du hast nicht angegeben, auf welche Seite diese Funktion angewendet werden soll.',
# Book sources
'booksources' => 'ISBN-Suche',
# Book sources
'booksources' => 'ISBN-Suche',
'sp-newimages-showfrom' => 'Zeige neue Dateien ab $1',
# What links here
'sp-newimages-showfrom' => 'Zeige neue Dateien ab $1',
# What links here
-'whatlinkshere' => 'Links auf diese Seite',
+'whatlinkshere' => 'Linkliste',
'whatlinkshere-title' => 'Seiten, die auf „$1“ verlinken',
'whatlinkshere-summary' => 'Diese Spezialseite listet alle internen Links auf eine bestimmte Seite auf. Die möglichen Zusätze „(Vorlageneinbindung)“ und „(Weiterleitungsseite)“ zeigen jeweils an, dass die Seite nicht durch einen normalen Wikilink eingebunden ist. ',
'whatlinkshere-title' => 'Seiten, die auf „$1“ verlinken',
'whatlinkshere-summary' => 'Diese Spezialseite listet alle internen Links auf eine bestimmte Seite auf. Die möglichen Zusätze „(Vorlageneinbindung)“ und „(Weiterleitungsseite)“ zeigen jeweils an, dass die Seite nicht durch einen normalen Wikilink eingebunden ist. ',
-'notargettitle' => 'Keine Seite angegeben',
-'notargettext' => 'Du hast nicht angegeben, auf welche Seite diese Funktion angewendet werden soll.',
+'whatlinkshere-page' => 'Seite:',
'linklistsub' => '(Linkliste)',
'linkshere' => "Die folgenden Seiten verlinken auf '''„[[:$1]]“''':",
'nolinkshere' => "Keine Seite verlinkt auf '''„[[:$1]]“'''.",
'linklistsub' => '(Linkliste)',
'linkshere' => "Die folgenden Seiten verlinken auf '''„[[:$1]]“''':",
'nolinkshere' => "Keine Seite verlinkt auf '''„[[:$1]]“'''.",
a direct URL, and so may still be listed here despite being
in active use.</p>',
'unusedcategoriestext' => 'The following category pages exist although no other article or category make use of them.',
a direct URL, and so may still be listed here despite being
in active use.</p>',
'unusedcategoriestext' => 'The following category pages exist although no other article or category make use of them.',
+'notargettitle' => 'No target',
+'notargettext' => 'You have not specified a target page or user to perform this function on.',
# Book sources
'booksources' => 'Book sources',
# Book sources
'booksources' => 'Book sources',
# What links here
'whatlinkshere' => 'What links here',
# What links here
'whatlinkshere' => 'What links here',
-'whatlinkshere-title' => 'Pages that link to $1',
+'whatlinkshere-title' => 'Pages that link to $1',
'whatlinkshere-summary' => '', # only translate this message to other languages if you have to change it
'whatlinkshere-barrow' => '<', # only translate this message to other languages if you have to change it
'whatlinkshere-summary' => '', # only translate this message to other languages if you have to change it
'whatlinkshere-barrow' => '<', # only translate this message to other languages if you have to change it
-'notargettitle' => 'No target',
-'notargettext' => 'You have not specified a target page or user to perform this function on.',
+'whatlinkshere-page' => 'Page:',
'linklistsub' => '(List of links)',
'linkshere' => "The following pages link to '''[[:$1]]''':",
'nolinkshere' => "No pages link to '''[[:$1]]'''.",
'linklistsub' => '(List of links)',
'linkshere' => "The following pages link to '''[[:$1]]''':",
'nolinkshere' => "No pages link to '''[[:$1]]'''.",
'movethispage',
'unusedimagestext',
'unusedcategoriestext',
'movethispage',
'unusedimagestext',
'unusedcategoriestext',
+ 'notargettitle',
+ 'notargettext',
),
'booksources' => array(
'booksources',
),
'booksources' => array(
'booksources',
'whatlinkshere',
'whatlinkshere-title',
'whatlinkshere-summary',
'whatlinkshere',
'whatlinkshere-title',
'whatlinkshere-summary',
- 'notargettitle',
- 'notargettext',
'linklistsub',
'linkshere',
'nolinkshere',
'linklistsub',
'linkshere',
'nolinkshere',