Fix stray $1 in some Special:Tags error messages
[lhc/web/wiklou.git] / includes / specials / SpecialTags.php
index a6847e1..0cef7b0 100644 (file)
@@ -100,7 +100,7 @@ class SpecialTags extends SpecialPage {
                        $form = new HTMLForm( $fields, $this->getContext() );
                        $form->setAction( $this->getPageTitle( 'create' )->getLocalURL() );
                        $form->setWrapperLegendMsg( 'tags-create-heading' );
-                       $form->setHeaderText( $this->msg( 'tags-create-explanation' )->plain() );
+                       $form->setHeaderText( $this->msg( 'tags-create-explanation' )->parseAsBlock() );
                        $form->setSubmitCallback( array( $this, 'processCreateTagForm' ) );
                        $form->setSubmitTextMsg( 'tags-create-submit' );
                        $form->show();
@@ -216,15 +216,17 @@ class SpecialTags extends SpecialPage {
                $newRow .= Xml::tags( 'td', null, $this->msg( $activeMsg )->escaped() );
 
                $hitcountLabel = $this->msg( 'tags-hitcount' )->numParams( $hitcount )->escaped();
-               $hitcountLink = Linker::link(
-                       SpecialPage::getTitleFor( 'Recentchanges' ),
-                       $hitcountLabel,
-                       array(),
-                       array( 'tagfilter' => $tag )
-               );
+               if ( $this->getConfig()->get( 'UseTagFilter' ) ) {
+                       $hitcountLabel = Linker::link(
+                               SpecialPage::getTitleFor( 'Recentchanges' ),
+                               $hitcountLabel,
+                               array(),
+                               array( 'tagfilter' => $tag )
+                       );
+               }
 
                // add raw $hitcount for sorting, because tags-hitcount contains numbers and letters
-               $newRow .= Xml::tags( 'td', array( 'data-sort-value' => $hitcount ), $hitcountLink );
+               $newRow .= Xml::tags( 'td', array( 'data-sort-value' => $hitcount ), $hitcountLabel );
 
                // actions
                if ( $showActions ) { // we've already checked that the user had the requisite userright
@@ -390,7 +392,7 @@ class SpecialTags extends SpecialPage {
                $func = $activate ? 'canActivateTag' : 'canDeactivateTag';
                $result = ChangeTags::$func( $tag, $user );
                if ( !$result->isGood() ) {
-                       $out->wrapWikiMsg( "<div class=\"error\">\n$1" . $result->getWikiText() .
+                       $out->addWikiText( "<div class=\"error\">\n" . $result->getWikiText() .
                                "\n</div>" );
                        if ( !$result->isOK() ) {
                                return;
@@ -449,6 +451,20 @@ class SpecialTags extends SpecialPage {
                }
        }
 
+       /**
+        * Return an array of subpages that this special page will accept.
+        *
+        * @return string[] subpages
+        */
+       public function getSubpagesForPrefixSearch() {
+               return array(
+                       'delete',
+                       'activate',
+                       'deactivate',
+                       'create',
+               );
+       }
+
        protected function getGroupName() {
                return 'changes';
        }