Skip to content

Commit

Permalink
Use central wiki terminology
Browse files Browse the repository at this point in the history
  • Loading branch information
Universal-Omega authored Nov 19, 2024
1 parent 3f77e5f commit d5c1ab7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@
"managewiki-success": "Your changes have been saved.",
"managewiki-toggle-forcesidebar": "Force the display of ManageWiki links in the sidebar.",
"managewiki-unavailable": "Unavailable",
"managewiki-unavailable-notglobalwiki": "This page is unavailable on this wiki. Please visit your farm's central wiki to use this page.",
"managewiki-unavailable-notcentralwiki": "This page is unavailable on this wiki. Please visit your farm's central wiki to use this page.",
"managewiki-warning-changes": "You've made changes to ManageWiki that have not been saved yet.\nIf you leave this page without clicking \"$1\" your ManageWiki changes will not be updated.",
"managewiki": "Manage a wiki",
"managewikidefaultpermissions": "Manage default permissions for new wikis",
Expand Down
18 changes: 9 additions & 9 deletions includes/Specials/SpecialManageWikiDefaultPermissions.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@ public function getDescription() {
public function execute( $par ) {
$this->setHeaders();
$out = $this->getOutput();
$globalwiki = $this->config->get( 'CreateWikiGlobalWiki' );
$centralWiki = $this->config->get( 'CreateWikiGlobalWiki' );

if ( !ManageWiki::checkSetup( 'permissions' ) ) {
throw new ErrorPageError( 'managewiki-unavailable', 'managewiki-disabled', [ '1' => 'permissions' ] );
}

if ( $par != '' && ( $globalwiki == $this->config->get( 'DBname' ) ) ) {
if ( $par != '' && ( $centralWiki == $this->config->get( 'DBname' ) ) ) {
$this->getOutput()->addBacklinkSubtitle( $this->getPageTitle() );
$this->buildGroupView( $par );
} else {
Expand All @@ -66,12 +66,12 @@ public function execute( $par ) {

public function buildMainView() {
$canModify = $this->canModify();
$globalwiki = $this->config->get( 'CreateWikiGlobalWiki' );
$centralWiki = $this->config->get( 'CreateWikiGlobalWiki' );

$out = $this->getOutput();
$out->addModules( [ 'mediawiki.special.userrights' ] );

if ( $globalwiki == $this->config->get( 'DBname' ) ) {
if ( $centralWiki == $this->config->get( 'DBname' ) ) {
$language = RequestContext::getMain()->getLanguage();
$mwPermissions = new ManageWikiPermissions( 'default' );
$groups = array_keys( $mwPermissions->list() );
Expand Down Expand Up @@ -116,11 +116,11 @@ public function buildMainView() {
$createForm->setWrapperLegendMsg( 'managewiki-permissions-create-header' );
$createForm->setMethod( 'post' )->setFormIdentifier( 'createForm' )->setSubmitCallback( [ $this, 'onSubmitRedirectToPermissionsPage' ] )->prepareForm()->show();
}
} elseif ( !( $globalwiki == $this->config->get( 'DBname' ) ) && !$canModify ) {
throw new ErrorPageError( 'managewiki-unavailable', 'managewiki-unavailable-notglobalwiki' );
} elseif ( !( $centralWiki == $this->config->get( 'DBname' ) ) && !$canModify ) {
throw new ErrorPageError( 'managewiki-unavailable', 'managewiki-unavailable-notcentralwiki' );
}

if ( !( $globalwiki == $this->config->get( 'DBname' ) ) && $canModify ) {
if ( !( $centralWiki == $this->config->get( 'DBname' ) ) && $canModify ) {
$out->setPageTitle( $this->msg( 'managewiki-permissions-resetgroups-title' )->plain() );

$resetPermissionsDescriptor = [];
Expand Down Expand Up @@ -308,10 +308,10 @@ public function buildGroupView( $group ) {
}

public function isListed() {
$globalwiki = $this->config->get( 'CreateWikiGlobalWiki' );
$centralWiki = $this->config->get( 'CreateWikiGlobalWiki' );

// Only appear on the central wiki or if the user can reset permissions on this wiki
return $globalwiki == $this->config->get( 'DBname' ) || $this->canModify();
return $centralWiki == $this->config->get( 'DBname' ) || $this->canModify();
}

protected function getGroupName() {
Expand Down

0 comments on commit d5c1ab7

Please sign in to comment.