Skip to content

Commit

Permalink
Add Main handler
Browse files Browse the repository at this point in the history
  • Loading branch information
Universal-Omega authored Feb 29, 2024
1 parent 3b8dd69 commit beeb4a8
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions includes/Hooks/Handlers/Main.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

namespace Miraheze\DataDump\Hooks\Handlers;

use MediaWiki\Hook\SidebarBeforeOutputHook;
use MediaWiki\SpecialPage\SpecialPage;
use Skin;

class Main implements SidebarBeforeOutputHook {

/**
* @param Skin $skin
* @param array &$sidebar
*/
public function onSidebarBeforeOutput( $skin, &$sidebar ): void {
if ( isset( $sidebar['managewiki-sidebar-header'] ) ) {
$sidebar['managewiki-sidebar-header'][] = [
'text' => $skin->msg( 'datadump-link' )->text(),
'id' => 'datadumplink',
'href' => htmlspecialchars( SpecialPage::getTitleFor( 'DataDump' )->getFullURL() )
];
}
}
}

0 comments on commit beeb4a8

Please sign in to comment.