* New WikiSyntax: -- turns into &emdash; or – depending on context
* (bug 15) Allow editors to view diff of their change before actually submitting an edit
* (bug 190) Hide your own edits on the watchlist
+* (bug 1739) Magic keyword {{REVISIONID}} give you the article or diff database
+~ revision id, useful for proper citation.
* ...and more!
Need to merge:
var $mId, $mTable;
var $mForUpdate;
var $mOldId;
+ var $mRevIdFetched;
/**#@-*/
/**
$this->mTouched = '19700101000000';
$this->mForUpdate = false;
$this->mIsRedirect = false;
+ $this->mRevIdFetched = false;
}
/**
$this->mComment = $revision->getComment();
$this->mTimestamp = wfTimestamp( TS_MW, $revision->getTimestamp() );
+ $this->mRevIdFetched = $revision->getID();
$this->mContentLoaded = true;
+
return $this->mContent;
}
$this->loadLastEdit();
return $this->mMinorEdit;
}
+
+ function getRevIdFetched() {
+ $this->loadLastEdit();
+ return $this->mRevIdFetched;
+ }
function getContributors($limit = 0, $offset = 0) {
$fname = 'Article::getContributors';
*/
$wgMagicFound = false;
-
+/** Actual keyword to be used is set in Language.php */
define('MAG_REDIRECT', 0);
define('MAG_NOTOC', 1);
define('MAG_START', 2);
define('MAG_NOCONTENTCONVERT', 37);
define('MAG_CURRENTWEEK', 38);
define('MAG_CURRENTDOW', 39);
+define('MAG_REVISIONID', 40);
$wgVariableIDs = array(
MAG_CURRENTMONTH,
MAG_PAGENAMEE,
MAG_NAMESPACE,
MAG_CURRENTWEEK,
- MAG_CURRENTDOW
+ MAG_CURRENTDOW,
+ MAG_REVISIONID,
);
/**
* @access private
*/
function getVariableValue( $index ) {
- global $wgContLang, $wgSitename, $wgServer;
+ global $wgContLang, $wgSitename, $wgServer, $wgArticle;
/**
* Some of these require message or data lookups and can be
return $this->mTitle->getText();
case MAG_PAGENAMEE:
return $this->mTitle->getPartialURL();
+ case MAG_REVISIONID:
+ return $wgArticle->getRevIdFetched();
case MAG_NAMESPACE:
# return Namespace::getCanonicalName($this->mTitle->getNamespace());
return $wgContLang->getNsText($this->mTitle->getNamespace()); # Patch by Dori
MAG_NOCONTENTCONVERT => array( 0, '__NOCONTENTCONVERT__', '__NOCC__'),
MAG_CURRENTWEEK => array( 1, 'CURRENTWEEK' ),
MAG_CURRENTDOW => array( 1, 'CURRENTDOW' ),
+ MAG_REVISIONID => array( 1, 'REVISIONID' ),
);
#-------------------------------------------------------------------