From: Aaron Schulz Date: Mon, 5 Feb 2007 23:26:26 +0000 (+0000) Subject: * Add revText() to get non-public revision if user can, add rev_deleted constant... X-Git-Tag: 1.31.0-rc.0~54117 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/?a=commitdiff_plain;h=0e43acc71c9afa24dd3125513a96423c3aadeddd;p=lhc%2Fweb%2Fwiklou.git * Add revText() to get non-public revision if user can, add rev_deleted constant for later use. --- diff --git a/includes/Revision.php b/includes/Revision.php index 3e7e77e5d4..f5a84ca26b 100644 --- a/includes/Revision.php +++ b/includes/Revision.php @@ -7,10 +7,11 @@ * @todo document */ class Revision { - const DELETED_TEXT = 1; - const DELETED_COMMENT = 2; - const DELETED_USER = 4; - const DELETED_RESTRICTED = 8; + const DELETED_TEXT = 1; + const DELETED_COMMENT = 2; + const DELETED_USER = 4; + const DELETED_RESTRICTED = 8; + const DELETED_NAME = 16; /** * Load a page revision from a given revision ID number. @@ -457,6 +458,18 @@ class Revision { } return $this->mText; } + + /** + * Fetch revision text if it's available to THIS user + * @return string + */ + function revText() { + if( !$this->userCan( self::DELETED_TEXT ) ) { + return ""; + } else { + return $this->getRawText(); + } + } /** * @return string