mirror of
https://github.com/StarCitizenTools/mediawiki-skins-Citizen.git
synced 2024-09-23 18:28:58 +00:00
feat(core): ✨ only add upload link when it is enabled
Citizen should not add upload link to drawer when $wgEnableUploads is false.
This commit is contained in:
parent
dc57449041
commit
8c4bd54d32
|
@ -103,18 +103,22 @@ final class Drawer extends Partial {
|
|||
'id' => 't-specialpages'
|
||||
] );
|
||||
|
||||
|
||||
// Upload file
|
||||
if ( ExtensionRegistry::getInstance()->isLoaded( 'Upload Wizard' ) ) {
|
||||
// Link to Upload Wizard if present
|
||||
$uploadHref = SpecialPage::getTitleFor( 'UploadWizard' )->getLocalURL();
|
||||
} else {
|
||||
// Link to old upload form
|
||||
$uploadHref = Skin::makeSpecialUrl( 'Upload' );
|
||||
// Only add upload file link when $wgEnableUploads is true
|
||||
if ( $this->getConfigValue( 'EnableUploads' ) === true ) {
|
||||
if ( ExtensionRegistry::getInstance()->isLoaded( 'Upload Wizard' ) ) {
|
||||
// Link to Upload Wizard if present
|
||||
$uploadHref = SpecialPage::getTitleFor( 'UploadWizard' )->getLocalURL();
|
||||
} else {
|
||||
// Link to old upload form
|
||||
$uploadHref = Skin::makeSpecialUrl( 'Upload' );
|
||||
}
|
||||
$html .= $skin->makeListItem( 'upload', [
|
||||
'href' => $uploadHref,
|
||||
'id' => 't-upload'
|
||||
] );
|
||||
}
|
||||
$html .= $skin->makeListItem( 'upload', [
|
||||
'href' => $uploadHref,
|
||||
'id' => 't-upload'
|
||||
] );
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue