Mailing List Archive

SVN: [46270] trunk/phase3/includes
Revision: 46270
Author: mrzman
Date: 2009-01-26 18:02:13 +0000 (Mon, 26 Jan 2009)

Log Message:
-----------
add mIsPreview and mIsSectionPreview to parserOptions, set in EditPage. patch by Brad Jorsch on bug 16854 (changes to Cite in next commit)

Modified Paths:
--------------
trunk/phase3/includes/EditPage.php
trunk/phase3/includes/parser/ParserOptions.php

Modified: trunk/phase3/includes/EditPage.php
===================================================================
--- trunk/phase3/includes/EditPage.php 2009-01-26 17:48:05 UTC (rev 46269)
+++ trunk/phase3/includes/EditPage.php 2009-01-26 18:02:13 UTC (rev 46270)
@@ -1660,6 +1660,8 @@

$parserOptions = ParserOptions::newFromUser( $wgUser );
$parserOptions->setEditSection( false );
+ $parserOptions->setIsPreview( true );
+ $parserOptions->setIsSectionPreview( !is_null($this->section) && $this->section !== '' );

global $wgRawHtml;
if ( $wgRawHtml && !$this->mTokenOk ) {

Modified: trunk/phase3/includes/parser/ParserOptions.php
===================================================================
--- trunk/phase3/includes/parser/ParserOptions.php 2009-01-26 17:48:05 UTC (rev 46269)
+++ trunk/phase3/includes/parser/ParserOptions.php 2009-01-26 18:02:13 UTC (rev 46270)
@@ -33,6 +33,8 @@
var $mExternalLinkTarget; # Target attribute for external links

var $mUser; # Stored user object, just used to initialise the skin
+ var $mIsPreview; # Parsing the page for a "preview" operation
+ var $mIsSectionPreview; # Parsing the page for a "preview" operation on a single section

function getUseTeX() { return $this->mUseTeX; }
function getUseDynamicDates() { return $this->mUseDynamicDates; }
@@ -54,6 +56,8 @@
function getEnableLimitReport() { return $this->mEnableLimitReport; }
function getCleanSignatures() { return $this->mCleanSignatures; }
function getExternalLinkTarget() { return $this->mExternalLinkTarget; }
+ function getIsPreview() { return $this->mIsPreview; }
+ function getIsSectionPreview() { return $this->mIsSectionPreview; }

function getSkin() {
if ( !isset( $this->mSkin ) ) {
@@ -99,6 +103,8 @@
function setTimestamp( $x ) { return wfSetVar( $this->mTimestamp, $x ); }
function setCleanSignatures( $x ) { return wfSetVar( $this->mCleanSignatures, $x ); }
function setExternalLinkTarget( $x ) { return wfSetVar( $this->mExternalLinkTarget, $x ); }
+ function setIsPreview( $x ) { return wfSetVar( $this->mIsPreview, $x ); }
+ function setIsSectionPreview( $x ) { return wfSetVar( $this->mIsSectionPreview, $x ); }

function __construct( $user = null ) {
$this->initialiseFromUser( $user );
@@ -156,6 +162,8 @@
$this->mEnableLimitReport = false;
$this->mCleanSignatures = $wgCleanSignatures;
$this->mExternalLinkTarget = $wgExternalLinkTarget;
+ $this->mIsPreview = false;
+ $this->mIsSectionPreview = false;
wfProfileOut( $fname );
}
}



_______________________________________________
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs