mirror of
https://github.com/StarCitizenTools/mediawiki-skins-Citizen.git
synced 2024-11-24 14:34:09 +00:00
Merge pull request #242 from StarCitizenTools/dev
feat: move some toolbox links into the drawer (#241)
This commit is contained in:
commit
db5ded1059
|
@ -334,7 +334,6 @@ class SkinCitizen extends SkinMustache {
|
|||
|
||||
switch ( $name ) {
|
||||
case 'SEARCH':
|
||||
break;
|
||||
case 'TOOLBOX':
|
||||
break;
|
||||
case 'LANGUAGES':
|
||||
|
@ -371,10 +370,15 @@ class SkinCitizen extends SkinMustache {
|
|||
}
|
||||
|
||||
$firstPortal = $props[0] ?? null;
|
||||
|
||||
if ( $firstPortal ) {
|
||||
$firstPortal[ 'class' ] .= ' portal-first';
|
||||
// Hide label for first portal
|
||||
$firstPortal[ 'label-class' ] .= 'screen-reader-text';
|
||||
|
||||
if ( isset( $firstPortal['html-items'] ) ) {
|
||||
$this->addToolboxLinksToDrawer( $firstPortal['html-items'] );
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
|
@ -385,6 +389,44 @@ class SkinCitizen extends SkinMustache {
|
|||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*
|
||||
* Manually disable links to upload and speacial pages
|
||||
* as they are moved from the toolbox to the drawer
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function buildNavUrls() {
|
||||
$urls = parent::buildNavUrls();
|
||||
|
||||
$urls['upload'] = false;
|
||||
$urls['specialpages'] = false;
|
||||
|
||||
return $urls;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a link to special pages and the upload form to the first portal in the drawer
|
||||
*
|
||||
* @param string &$htmlItems
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
private function addToolboxLinksToDrawer( &$htmlItems ) {
|
||||
// First add a link to special pages
|
||||
$htmlItems .= $this->makeListItem( 'specialpages', [
|
||||
'href' => self::makeSpecialUrl( 'specialpages' ),
|
||||
'id' => 't-specialpages'
|
||||
] );
|
||||
|
||||
// Then add a link to the upload form
|
||||
$htmlItems .= $this->makeListItem( 'upload', [
|
||||
'href' => self::makeSpecialUrl( 'upload' ),
|
||||
'id' => 't-upload'
|
||||
] );
|
||||
}
|
||||
|
||||
/**
|
||||
* Build Personal Tools menu
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue