X-Git-Url: https://git.cyclocoop.org/%242?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialTags.php;h=110fb1ff042f04e61bb466058717446ad8367b54;hb=28484682ae2d263d96fadc6643f62f653cbcad2b;hp=fd2d46a24b1e982282098475bfdf30baa9d70bdb;hpb=0770f85a0a293e6c7af6f1d3d3a1dbd2d13c1e09;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialTags.php b/includes/specials/SpecialTags.php index fd2d46a24b..110fb1ff04 100644 --- a/includes/specials/SpecialTags.php +++ b/includes/specials/SpecialTags.php @@ -136,7 +136,7 @@ class SpecialTags extends SpecialPage { } // Write the headers - $html = Xml::tags( 'tr', null, Xml::tags( 'th', null, $this->msg( 'tags-tag' )->parse() ) . + $thead = Xml::tags( 'tr', null, Xml::tags( 'th', null, $this->msg( 'tags-tag' )->parse() ) . Xml::tags( 'th', null, $this->msg( 'tags-display-header' )->parse() ) . Xml::tags( 'th', null, $this->msg( 'tags-description-header' )->parse() ) . Xml::tags( 'th', null, $this->msg( 'tags-source-header' )->parse() ) . @@ -148,26 +148,30 @@ class SpecialTags extends SpecialPage { '' ) ); + $tbody = ''; // Used in #doTagRow() $this->softwareActivatedTags = array_fill_keys( ChangeTags::listSoftwareActivatedTags(), true ); // Insert tags that have been applied at least once foreach ( $tagStats as $tag => $hitcount ) { - $html .= $this->doTagRow( $tag, $hitcount, $userCanManage, + $tbody .= $this->doTagRow( $tag, $hitcount, $userCanManage, $userCanDelete, $userCanEditInterface ); } // Insert tags defined somewhere but never applied foreach ( $definedTags as $tag ) { if ( !isset( $tagStats[$tag] ) ) { - $html .= $this->doTagRow( $tag, 0, $userCanManage, $userCanDelete, $userCanEditInterface ); + $tbody .= $this->doTagRow( $tag, 0, $userCanManage, $userCanDelete, $userCanEditInterface ); } } + $out->addModuleStyles( 'jquery.tablesorter.styles' ); + $out->addModules( 'jquery.tablesorter' ); $out->addHTML( Xml::tags( 'table', [ 'class' => 'mw-datatable sortable mw-tags-table' ], - $html + Xml::tags( 'thead', null, $thead ) . + Xml::tags( 'tbody', null, $tbody ) ) ); } @@ -233,10 +237,8 @@ class SpecialTags extends SpecialPage { // add raw $hitcount for sorting, because tags-hitcount contains numbers and letters $newRow .= Xml::tags( 'td', [ 'data-sort-value' => $hitcount ], $hitcountLabel ); - // actions $actionLinks = []; - // delete if ( $showDeleteActions && ChangeTags::canDeleteTag( $tag )->isOK() ) { $actionLinks[] = $linkRenderer->makeKnownLink( $this->getPageTitle( 'delete' ), @@ -246,7 +248,6 @@ class SpecialTags extends SpecialPage { } if ( $showManageActions ) { // we've already checked that the user had the requisite userright - // activate if ( ChangeTags::canActivateTag( $tag )->isOK() ) { $actionLinks[] = $linkRenderer->makeKnownLink( $this->getPageTitle( 'activate' ), @@ -255,7 +256,6 @@ class SpecialTags extends SpecialPage { [ 'tag' => $tag ] ); } - // deactivate if ( ChangeTags::canDeactivateTag( $tag )->isOK() ) { $actionLinks[] = $linkRenderer->makeKnownLink( $this->getPageTitle( 'deactivate' ),