Skip to content

Commit

Permalink
Remove mentions of context->
Browse files Browse the repository at this point in the history
  • Loading branch information
AgentIsai authored Oct 21, 2024
1 parent a8606f4 commit f3eaedb
Showing 1 changed file with 21 additions and 7 deletions.
28 changes: 21 additions & 7 deletions includes/Specials/SpecialManageWiki.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,17 @@ public function execute( $par ) {

if ( !$this->getContext()->getUser()->isAllowed( 'managewiki-' . $module ) ) {
$out->setPageTitle( $this->msg( 'managewiki-link-' . $module . '-view' )->text() );
$out->addHTML(
Html::errorBox( $this->context->msg( 'managewiki-error-nopermission' )->escaped() )
);
$out->addWikiMsg( "managewiki-header-{$module}-view", $wiki );
if ( $module !== 'permissions' || $module !== 'namespaces' ) ) {
$out->addHTML(
Html::errorBox( $this->msg( 'managewiki-error-nopermission' )->escaped() )
);
$out->addWikiMsg( "managewiki-header-{$module}-view" );
}
} else {
$out->setPageTitle( $this->msg( 'managewiki-link-' . $module )->text() );
$out->addWikiMsg( "managewiki-header-{$module}", $wiki );
if ( $module !== 'permissions' || $module !== 'namespaces' ) ) {
$out->addWikiMsg( "managewiki-header-{$module}" );
}
}

$additional = $par[1] ?? '';
Expand All @@ -75,11 +79,11 @@ public function execute( $par ) {
$dbName = $par[1] ?? $this->config->get( 'DBname' );
if ( !$this->getContext()->getUser()->isAllowed( 'managewiki-' . $module ) && WikiMap::isCurrentWikiId( $this->config->get( 'CreateWikiGlobalWiki' ) ) ) {
$out->addHTML(
Html::errorBox( $this->context->msg( 'managewiki-error-nopermission-remote' )->escaped() )
Html::errorBox( $this->msg( 'managewiki-error-nopermission-remote' )->escaped() )
);
} elseif ( !$this->getContext()->getUser()->isAllowed( 'managewiki-' . $module ) && !WikiMap::isCurrentWikiId( $this->config->get( 'CreateWikiGlobalWiki' ) ) ) {
$out->addHTML(
Html::errorBox( $this->context->msg( 'managewiki-error-nopermission' )->escaped() )
Html::errorBox( $this->msg( 'managewiki-error-nopermission' )->escaped() )
);
}
$this->showWikiForm( strtolower( $dbName ), 'core', '', '' );
Expand Down Expand Up @@ -183,6 +187,16 @@ public function showWikiForm( $wiki, $module, $special, $filtered ) {
$formFactory = new ManageWikiFormFactory();
$htmlForm = $formFactory->getForm( $wiki, $remoteWiki, $this->getContext(), $this->config, $module, strtolower( $special ), $filtered );

if ( !$this->getContext()->getUser()->isAllowed( 'managewiki-' . $module ) && WikiMap::isCurrentWikiId( $this->config->get( 'CreateWikiGlobalWiki' ) ) ) {
$out->addHTML(
Html::errorBox( $this->msg( 'managewiki-error-nopermission-remote' )->escaped() )
);
} elseif ( !$this->getContext()->getUser()->isAllowed( 'managewiki-' . $module ) && !WikiMap::isCurrentWikiId( $this->config->get( 'CreateWikiGlobalWiki' ) ) ) {
$out->addHTML(
Html::errorBox( $this->msg( 'managewiki-error-nopermission' )->escaped() )
);
}

$out->addHTML( new FieldLayout(
new SearchInputWidget( [
'placeholder' => $this->msg( 'managewiki-search' )->text(),
Expand Down

0 comments on commit f3eaedb

Please sign in to comment.