}
}
- /**
- * Show a read-only error
- * Parameters are the same as OutputPage:readOnlyPage()
- * Redirect to the article page if redlink=1
- * @deprecated since 1.19; use displayPermissionsError() instead
- */
- function readOnlyPage( $source = null, $protected = false, $reasons = array(), $action = null ) {
- wfDeprecated( __METHOD__, '1.19' );
-
- global $wgRequest, $wgOut;
- if ( $wgRequest->getBool( 'redlink' ) ) {
- // The edit page was reached via a red link.
- // Redirect to the article page and let them click the edit tab if
- // they really want a permission error.
- $wgOut->redirect( $this->mTitle->getFullURL() );
- } else {
- $wgOut->readOnlyPage( $source, $protected, $reasons, $action );
- }
- }
-
/**
* Should we show a preview when the edit form is first shown?
*
return true;
}
- /**
- * Fetch initial editing page content.
- *
- * @param string|bool $def_text
- * @return string|bool String on success, $def_text for invalid sections
- * @private
- * @deprecated since 1.21, get WikiPage::getContent() instead.
- */
- function getContent( $def_text = false ) {
- ContentHandler::deprecated( __METHOD__, '1.21' );
-
- if ( $def_text !== null && $def_text !== false && $def_text !== '' ) {
- $def_content = $this->toEditContent( $def_text );
- } else {
- $def_content = false;
- }
-
- $content = $this->getContentObject( $def_content );
-
- // Note: EditPage should only be used with text based content anyway.
- return $this->toEditText( $content );
- }
-
/**
* @param Content|null $def_content The default value to return
*
}
}
- /**
- * Use this method before edit() to preload some text into the edit box
- *
- * @param string $text
- * @deprecated since 1.21, use setPreloadedContent() instead.
- */
- public function setPreloadedText( $text ) {
- ContentHandler::deprecated( __METHOD__, "1.21" );
-
- $content = $this->toEditContent( $text );
-
- $this->setPreloadedContent( $content );
- }
-
/**
* Use this method before edit() to preload some content into the edit box
*
$this->mPreloadContent = $content;
}
- /**
- * Get the contents to be preloaded into the box, either set by
- * an earlier setPreloadText() or by loading the given page.
- *
- * @param string $preload Representing the title to preload from.
- *
- * @return string
- *
- * @deprecated since 1.21, use getPreloadedContent() instead
- */
- protected function getPreloadedText( $preload ) {
- ContentHandler::deprecated( __METHOD__, "1.21" );
-
- $content = $this->getPreloadedContent( $preload );
- $text = $this->toEditText( $content );
-
- return $text;
- }
-
/**
* Get the contents to be preloaded into the box, either set by
* an earlier setPreloadText() or by loading the given page.
}
}
- /**
- * Attempts to merge text content with base and current revisions
- *
- * @param string $editText
- *
- * @return bool
- * @deprecated since 1.21, use mergeChangesIntoContent() instead
- */
- function mergeChangesInto( &$editText ) {
- ContentHandler::deprecated( __METHOD__, "1.21" );
-
- $editContent = $this->toEditContent( $editText );
-
- $ok = $this->mergeChangesIntoContent( $editContent );
-
- if ( $ok ) {
- $editText = $this->toEditText( $editContent );
- return true;
- }
- return false;
- }
-
/**
* Attempts to do 3-way merge of edit content with a base revision
* and current content, in case of edit conflict, in whichever way appropriate
$wgOut->addHTML( $this->editFormTextBeforeContent );
- if ( !$this->isCssJsSubpage && $showToolbar && $wgUser->getOption( 'showtoolbar' ) ) {
+ if ( $this->contentModel === CONTENT_MODEL_WIKITEXT &&
+ $showToolbar && $wgUser->getOption( 'showtoolbar' ) )
+ {
$wgOut->addHTML( EditPage::getEditToolbar() );
}
echo $s;
}
- /**
- * Call the stock "user is blocked" page
- *
- * @deprecated since 1.19; throw an exception directly instead
- */
- function blockedPage() {
- wfDeprecated( __METHOD__, '1.19' );
- global $wgUser;
-
- throw new UserBlockedError( $wgUser->getBlock() );
- }
-
- /**
- * Produce the stock "please login to edit pages" page
- *
- * @deprecated since 1.19; throw an exception directly instead
- */
- function userNotLoggedInPage() {
- wfDeprecated( __METHOD__, '1.19' );
- throw new PermissionsError( 'edit' );
- }
-
- /**
- * Show an error page saying to the user that he has insufficient permissions
- * to create a new page
- *
- * @deprecated since 1.19; throw an exception directly instead
- */
- function noCreatePermission() {
- wfDeprecated( __METHOD__, '1.19' );
- $permission = $this->mTitle->isTalkPage() ? 'createtalk' : 'createpage';
- throw new PermissionsError( $permission );
- }
-
/**
* Creates a basic error page which informs the user that
* they have attempted to edit a nonexistent section.