* @return Return the text of this revision
*/
function getContent( $noredir ) {
- global $wgRequest, $wgUser;
+ global $wgRequest, $wgUser, $wgOut;
# Get variables from query string :P
$action = $wgRequest->getText( 'action', 'view' );
if ( 0 == $this->getID() ) {
if ( 'edit' == $action ) {
- wfProfileOut( $fname );
+ wfProfileOut( $fname );
# Should we put something in the textarea?
# if &preload=Pagename is set, we try to get
# the revision text and put it in.
if($preload) {
$preloadTitle=Title::newFromText($preload);
- if($preloadTitle->userCanRead()) {
+ if(isset($preloadTitle) && $preloadTitle->userCanRead()) {
$rev=Revision::newFromTitle($preloadTitle);
if($rev) {
return $rev->getText();
# Don't preload anything.
# We used to put MediaWiki:Newarticletext here.
# This is now shown above the edit box instead.
- return '';
+ return '';
}
wfProfileOut( $fname );
-
+ $wgOut->setRobotpolicy( 'noindex,nofollow' );
return wfMsg( 'noarticletext' );
} else {
$this->loadContent( $noredir );
wfProfileOut( $fname );
}
+ function render() {
+ global $wgOut;
+
+ $wgOut->setArticleBodyOnly(true);
+ $this->view();
+ }
+
/**
* Insert a new empty page record for this article.
* This *must* be followed up by creating a revision