- $this->mTitle = $article->mTitle;
- $this->mApplicableTypes = $this->mTitle->exists() ? $wgRestrictionTypes : array('create');
-
- $this->mCascade = $this->mTitle->areRestrictionsCascading();
-
- // The form will be available in read-only to show levels.
- $this->mPermErrors = $this->mTitle->getUserPermissionsErrors('protect',$wgUser);
- $this->disabled = wfReadOnly() || $this->mPermErrors != array();
+ $this->mTitle = $article->getTitle();
+ $this->mApplicableTypes = $this->mTitle->getRestrictionTypes();
+
+ // Check if the form should be disabled.
+ // If it is, the form will be available in read-only to show levels.
+ $this->mPermErrors = $this->mTitle->getUserPermissionsErrors( 'protect', $wgUser );
+ if ( wfReadOnly() ) {
+ $this->mPermErrors[] = array( 'readonlytext', wfReadOnlyReason() );
+ }
+ $this->disabled = $this->mPermErrors != array();