X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialTags.php;h=47bed626428a45e08ad74501eda620d21bdd5ca1;hb=f82b0e76306a9feca014e563a5fac0688cf876dc;hp=2139949958de3476c0252320a5a08616dbe5828c;hpb=19fe074b654f874d7cdfb1d2622f2489b8bdfaa0;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialTags.php b/includes/specials/SpecialTags.php index 2139949958..47bed62642 100644 --- a/includes/specials/SpecialTags.php +++ b/includes/specials/SpecialTags.php @@ -128,8 +128,7 @@ class SpecialTags extends SpecialPage { ChangeTags::listExtensionDefinedTags(), true ); // List all defined tags, even if they were never applied - $definedTags = array_keys( array_merge( - $this->explicitlyDefinedTags, $this->extensionDefinedTags ) ); + $definedTags = array_keys( $this->explicitlyDefinedTags + $this->extensionDefinedTags ); // Show header only if there exists atleast one tag if ( !$tagStats && !$definedTags ) { @@ -143,7 +142,7 @@ class SpecialTags extends SpecialPage { Xml::tags( 'th', null, $this->msg( 'tags-source-header' )->parse() ) . Xml::tags( 'th', null, $this->msg( 'tags-active-header' )->parse() ) . Xml::tags( 'th', null, $this->msg( 'tags-hitcount-header' )->parse() ) . - ( $userCanManage ? + ( ( $userCanManage || $userCanDelete ) ? Xml::tags( 'th', [ 'class' => 'unsortable' ], $this->msg( 'tags-actions-header' )->parse() ) : '' ) @@ -176,12 +175,13 @@ class SpecialTags extends SpecialPage { $newRow = ''; $newRow .= Xml::tags( 'td', null, Xml::element( 'code', null, $tag ) ); + $linkRenderer = $this->getLinkRenderer(); $disp = ChangeTags::tagDescription( $tag ); if ( $showEditLinks ) { $disp .= ' '; - $editLink = Linker::link( + $editLink = $linkRenderer->makeLink( $this->msg( "tag-$tag" )->inContentLanguage()->getTitle(), - $this->msg( 'tags-edit' )->escaped() + $this->msg( 'tags-edit' )->text() ); $disp .= $this->msg( 'parentheses' )->rawParams( $editLink )->escaped(); } @@ -191,9 +191,9 @@ class SpecialTags extends SpecialPage { $desc = !$msg->exists() ? '' : $msg->parse(); if ( $showEditLinks ) { $desc .= ' '; - $editDescLink = Linker::link( + $editDescLink = $linkRenderer->makeLink( $this->msg( "tag-$tag-description" )->inContentLanguage()->getTitle(), - $this->msg( 'tags-edit' )->escaped() + $this->msg( 'tags-edit' )->text() ); $desc .= $this->msg( 'parentheses' )->rawParams( $editDescLink )->escaped(); } @@ -217,14 +217,16 @@ class SpecialTags extends SpecialPage { $activeMsg = ( $isActive ? 'tags-active-yes' : 'tags-active-no' ); $newRow .= Xml::tags( 'td', null, $this->msg( $activeMsg )->escaped() ); - $hitcountLabel = $this->msg( 'tags-hitcount' )->numParams( $hitcount )->escaped(); + $hitcountLabelMsg = $this->msg( 'tags-hitcount' )->numParams( $hitcount ); if ( $this->getConfig()->get( 'UseTagFilter' ) ) { - $hitcountLabel = Linker::link( + $hitcountLabel = $linkRenderer->makeLink( SpecialPage::getTitleFor( 'Recentchanges' ), - $hitcountLabel, + $hitcountLabelMsg->text(), [], [ 'tagfilter' => $tag ] ); + } else { + $hitcountLabel = $hitcountLabelMsg->escaped(); } // add raw $hitcount for sorting, because tags-hitcount contains numbers and letters @@ -235,8 +237,9 @@ class SpecialTags extends SpecialPage { // delete if ( $showDeleteActions && ChangeTags::canDeleteTag( $tag )->isOK() ) { - $actionLinks[] = Linker::linkKnown( $this->getPageTitle( 'delete' ), - $this->msg( 'tags-delete' )->escaped(), + $actionLinks[] = $linkRenderer->makeKnownLink( + $this->getPageTitle( 'delete' ), + $this->msg( 'tags-delete' )->text(), [], [ 'tag' => $tag ] ); } @@ -245,23 +248,25 @@ class SpecialTags extends SpecialPage { // activate if ( ChangeTags::canActivateTag( $tag )->isOK() ) { - $actionLinks[] = Linker::linkKnown( $this->getPageTitle( 'activate' ), - $this->msg( 'tags-activate' )->escaped(), + $actionLinks[] = $linkRenderer->makeKnownLink( + $this->getPageTitle( 'activate' ), + $this->msg( 'tags-activate' )->text(), [], [ 'tag' => $tag ] ); } // deactivate if ( ChangeTags::canDeactivateTag( $tag )->isOK() ) { - $actionLinks[] = Linker::linkKnown( $this->getPageTitle( 'deactivate' ), - $this->msg( 'tags-deactivate' )->escaped(), + $actionLinks[] = $linkRenderer->makeKnownLink( + $this->getPageTitle( 'deactivate' ), + $this->msg( 'tags-deactivate' )->text(), [], [ 'tag' => $tag ] ); } } - if ( $actionLinks ) { + if ( $showDeleteActions || $showManageActions ) { $newRow .= Xml::tags( 'td', null, $this->getLanguage()->pipeList( $actionLinks ) ); }