Add a more descriptive message to the links-to-image section for the case that more...
authorRaimond Spekking <raymond@users.mediawiki.org>
Thu, 7 Aug 2008 18:46:18 +0000 (18:46 +0000)
committerRaimond Spekking <raymond@users.mediawiki.org>
Thu, 7 Aug 2008 18:46:18 +0000 (18:46 +0000)
Ths existing link to Whatlinkshere at the end of the list is easily be overseen if not scrolled to the bottom.
Fixes the (cosmetic) bug that the list shows 101 entries instead of 100.
Question: Should we make the hardcoded limit of 100 configurable via DefaultSettings?

includes/ImagePage.php
languages/messages/MessagesEn.php
maintenance/language/messages.inc

index a526ba9..ae0c8c9 100644 (file)
@@ -645,10 +645,16 @@ EOT
                        $wgOut->addWikiMsg( 'nolinkstoimage' );
                        $wgOut->addHTML( "</div>\n" );
                        return;
+               } elseif ( $count <= $limit - 1 ) {
+                       $wgOut->addHTML( "<div id='mw-imagepage-section-linkstoimage'>\n" );
+                       $wgOut->addWikiMsg( 'linkstoimage', $count );
+                       $wgOut->addHTML( "<ul class='mw-imagepage-linktoimage'>\n" );
+               } else {
+                       // More links than the limit. Add a link to [[Special:Whatlinkshere]]
+                       $wgOut->addHTML( "<div id='mw-imagepage-section-linkstoimage'>\n" );
+                       $wgOut->addWikiMsg( 'linkstoimage-more', $limit, $this->mTitle->getPrefixedDBkey() );
+                       $wgOut->addHTML( "<ul class='mw-imagepage-linktoimage'>\n" );
                }
-               $wgOut->addHTML( "<div id='mw-imagepage-section-linkstoimage'>\n" );
-               $wgOut->addWikiMsg( 'linkstoimage', $count );
-               $wgOut->addHTML( "<ul class='mw-imagepage-linktoimage'>\n" );
 
                $sk = $wgUser->getSkin();
                $count = 0;
index c7cbd1d..985eddb 100644 (file)
@@ -1762,6 +1762,9 @@ A click on a column header changes the sorting.',
 'filehist-comment'               => 'Comment',
 'imagelinks'                     => 'Links',
 'linkstoimage'                   => 'The following {{PLURAL:$1|page links|$1 pages link}} to this file:',
+'linkstoimage-more'              => 'More than $1 {{PLURAL:$2|page links|pages link}} to this file.
+The following list shows the {{PLURAL:$1|first page link|first $1 page links}} to this file only.
+For a full list follow [[Special:Whatlinkshere/$2|this link]].',
 'nolinkstoimage'                 => 'There are no pages that link to this file.',
 'morelinkstoimage'               => 'View [[Special:Whatlinkshere/$1|more links]] to this file.',
 'redirectstofile'                => 'The following {{PLURAL:$1|file redirects|$1 files redirect}} to this file:',
index 0968352..b91c812 100644 (file)
@@ -1057,6 +1057,7 @@ $wgMessageStructure = array(
                'filehist-comment',
                'imagelinks',
                'linkstoimage',
+               'linkstoimage-more',
                'nolinkstoimage',
                'morelinkstoimage',
                'redirectstofile',