Merge "Changed "archived (revisions)" to "deleted (revisions)""
[lhc/web/wiklou.git] / includes / parser / ParserOutput.php
index a8db1c9..15321c2 100644 (file)
@@ -49,7 +49,8 @@ class ParserOutput extends CacheTime {
                $mProperties = array(),       # Name/value pairs to be cached in the DB
                $mTOCHTML = '',               # HTML of the TOC
                $mTimestamp,                  # Timestamp of the revision
-               $mTOCEnabled = true;          # Whether TOC should be shown, can't override __NOTOC__
+               $mTOCEnabled = true,          # Whether TOC should be shown, can't override __NOTOC__
+               $mEnableOOUI = false;         # Whether OOUI should be enabled
        private $mIndexPolicy = '';       # 'index' or 'noindex'?  Any other value will result in no change.
        private $mAccessedOptions = array(); # List of ParserOptions (stored in the keys)
        private $mExtensionData = array(); # extra data used by extensions
@@ -103,7 +104,7 @@ class ParserOutput extends CacheTime {
                        $text = str_replace( array( Parser::TOC_START, Parser::TOC_END ), '', $text );
                } else {
                        $text = preg_replace(
-                               '#' . preg_quote( Parser::TOC_START ) . '.*?' . preg_quote( Parser::TOC_END ) . '#s',
+                               '#' . preg_quote( Parser::TOC_START, '#' ) . '.*?' . preg_quote( Parser::TOC_END, '#' ) . '#s',
                                '',
                                $text
                        );
@@ -232,6 +233,10 @@ class ParserOutput extends CacheTime {
                return $this->mTOCEnabled;
        }
 
+       public function getEnableOOUI() {
+               return $this->mEnableOOUI;
+       }
+
        public function setText( $text ) {
                return wfSetVar( $this->mText, $text );
        }
@@ -283,6 +288,17 @@ class ParserOutput extends CacheTime {
                $this->mIndicators[$id] = $content;
        }
 
+       /**
+        * Enables OOUI, if true, in any OutputPage instance this ParserOutput
+        * object is added to.
+        *
+        * @since 1.26
+        * @param bool $enable If OOUI should be enabled or not
+        */
+       public function setEnableOOUI( $enable = false ) {
+               $this->mEnableOOUI = $enable;
+       }
+
        public function addLanguageLink( $t ) {
                $this->mLanguageLinks[] = $t;
        }