Show blockedtext message in edit notices

Depends on If5b7ef401 in oojs-ui

Bug: 52004
Change-Id: Icf672dfec4f57bef3e485428d07759ab51470999
This commit is contained in:
Krenair 2014-03-17 21:22:41 +00:00 committed by Roan Kattouw
parent 7821eb7bd3
commit aec9279d84

View file

@ -354,6 +354,13 @@ class ApiVisualEditor extends ApiBase {
} }
} }
if ( $user->isBlockedFrom( $page ) && $user->getBlock()->prevents( 'edit' ) !== false ) {
$notices[] = call_user_func_array(
array( $this, 'msg' ),
$user->getBlock()->getPermissionsError( $this->getContext() )
)->parseAsBlock();
}
// HACK: Build a fake EditPage so we can get checkboxes from it // HACK: Build a fake EditPage so we can get checkboxes from it
$article = new Article( $page ); // Deliberately omitting ,0 so oldid comes from request $article = new Article( $page ); // Deliberately omitting ,0 so oldid comes from request
$ep = new EditPage( $article ); $ep = new EditPage( $article );