(bug 8628) Add user-aware block list link to Special:Blockip
authorRob Church <robchurch@users.mediawiki.org>
Mon, 15 Jan 2007 06:45:46 +0000 (06:45 +0000)
committerRob Church <robchurch@users.mediawiki.org>
Mon, 15 Jan 2007 06:45:46 +0000 (06:45 +0000)
RELEASE-NOTES
includes/DefaultSettings.php
includes/SpecialBlockip.php
languages/messages/MessagesEn.php
skins/common/common.css
skins/monobook/main.css

index ee949ff..bf69b6b 100644 (file)
@@ -71,6 +71,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 8407) Disallow indexing of "printable" versions
 * (bug 8522) Provide a "delete" link on Special:Brokenredirects for users with
   the appropriate permission
+* (bug 8628) Add user-aware block list link to Special:Blockip
 
 == Languages updated ==
 
index 2587413..254fead 100644 (file)
@@ -1105,7 +1105,7 @@ $wgCacheEpoch = '20030516000000';
  * to ensure that client-side caches don't keep obsolete copies of global
  * styles.
  */
-$wgStyleVersion = '48';
+$wgStyleVersion = '49';
 
 
 # Server-side caching:
index f303294..e7626f0 100644 (file)
@@ -170,7 +170,7 @@ class IPBlockForm {
        <input type='hidden' name='wpEditToken' value=\"{$token}\" />
 </form>\n" );
 
-               $wgOut->addHtml( $this->getUnblockLink() );
+               $wgOut->addHtml( $this->getConvenienceLinks() );
 
                $user = User::newFromName( $this->BlockAddress );
                if( is_object( $user ) ) {
@@ -312,25 +312,53 @@ class IPBlockForm {
                return implode( ',', $flags );
        }
        
+       /**
+        * Builds unblock and block list links
+        *
+        * @return string
+        */
+       private function getConvenienceLinks() {
+               global $wgUser;
+               $skin = $wgUser->getSkin();
+               $links[] = $this->getUnblockLink( $skin );
+               $links[] = $this->getBlockListLink( $skin );
+               return '<p class="mw-ipb-conveniencelinks">' . implode( ' | ', $links ) . '</p>';
+       }
+       
        /**
         * Build a convenient link to unblock the given username or IP
         * address, if available; otherwise link to a blank unblock
         * form
         *
+        * @param $skin Skin to use
         * @return string
         */
-       private function getUnblockLink() {
-               global $wgUser;
+       private function getUnblockLink( $skin ) {
                $list = SpecialPage::getTitleFor( 'Ipblocklist' );
-               $skin = $wgUser->getSkin();
                if( $this->BlockAddress ) {
                        $addr = htmlspecialchars( $this->BlockAddress );
-                       $link = $skin->makeKnownLinkObj( $list, wfMsgHtml( 'ipb-unblock-addr', $addr ),
+                       return $skin->makeKnownLinkObj( $list, wfMsgHtml( 'ipb-unblock-addr', $addr ),
                                'action=unblock&ip=' . $this->BlockAddress );
                } else {
-                       $link = $skin->makeKnownLinkObj( $list, wfMsgHtml( 'ipb-unblock' ),     'action=unblock' );
+                       return $skin->makeKnownLinkObj( $list, wfMsgHtml( 'ipb-unblock' ),      'action=unblock' );
+               }
+       }
+       
+       /**
+        * Build a convenience link to the block list
+        *
+        * @param $skin Skin to use
+        * @return string
+        */
+       private function getBlockListLink( $skin ) {
+               $list = SpecialPage::getTitleFor( 'Ipblocklist' );
+               if( $this->BlockAddress ) {
+                       $addr = htmlspecialchars( $this->BlockAddress );
+                       return $skin->makeKnownLinkObj( $list, wfMsgHtml( 'ipb-blocklist-addr', $addr ),
+                               'ip=' . $this->BlockAddress );
+               } else {
+                       return $skin->makeKnownLinkObj( $list, wfMsgHtml( 'ipb-blocklist' ) );
                }
-               return '<p class="mw-ipb-unblocklink">' . $link . '</p>';
        }
        
 }
index 0bc4ba8..f379b44 100644 (file)
@@ -1855,6 +1855,8 @@ pages that were vandalized).",
 <br />See [[{{ns:Special}}:Ipblocklist|IP block list]] to review blocks.',
 'ipb-unblock-addr' => 'Unblock $1',
 'ipb-unblock' => 'Unblock a username or IP address',
+'ipb-blocklist-addr' => 'View existing blocks for $1',
+'ipb-blocklist' => 'View existing blocks',
 'unblockip'            => 'Unblock user',
 'unblockiptext'        => 'Use the form below to restore write access
 to a previously blocked IP address or username.',
index 9a8abd9..46f6588 100644 (file)
@@ -453,8 +453,8 @@ table.multipageimage td {
 
 .templatesUsed { margin-top: 1em; }
 
-/* "unblock" link on Special:Ipblocklist */
-p.mw-ipb-unblocklink {
+/* Convenience links on Special:Ipblocklist */
+p.mw-ipb-conveniencelinks {
        font-size: 90%;
        float: right;
 }
index 06e2304..517765c 100644 (file)
@@ -1603,8 +1603,8 @@ tr.sv-space td { display: none; }
        margin: 0.1em 0;
 }
 
-/* "unblock" link on Special:Ipblocklist */
-p.mw-ipb-unblocklink {
+/* Convenience links on Special:Ipblocklist */
+p.mw-ipb-conveniencelinks {
        font-size: 90%;
        float: right;
 }