Revert r35848 per Brion's WONTFIX of bug 14536: "This would just mean that there...
[lhc/web/wiklou.git] / includes / ParserOutput.php
index bed5683..f98d564 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /**
  * @todo document
- * @addtogroup Parser
+ * @ingroup Parser
  */
 class ParserOutput
 {
@@ -21,7 +21,7 @@ class ParserOutput
                $mNoGallery,        # No gallery on category page? (__NOGALLERY__)
                $mHeadItems,        # Items to put in the <head> section
                $mOutputHooks,      # Hook tags as per $wgParserOutputHooks
-               $mWarnings,         # Warning text to be returned to the user. Wikitext formatted.
+               $mWarnings,         # Warning text to be returned to the user. Wikitext formatted, in the key only
                $mSections,         # Table of contents
                $mProperties;       # Name/value pairs to be cached in the DB
 
@@ -68,7 +68,7 @@ class ParserOutput
        function getNoGallery()              { return $this->mNoGallery; }
        function getSubtitle()               { return $this->mSubtitle; }
        function getOutputHooks()            { return (array)$this->mOutputHooks; }
-       function getWarnings()               { return isset( $this->mWarnings ) ? $this->mWarnings : array(); }
+       function getWarnings()               { return array_keys( $this->mWarnings ); }
 
        function containsOldMagic()          { return $this->mContainsOldMagic; }
        function setText( $text )            { return wfSetVar( $this->mText, $text ); }
@@ -82,9 +82,9 @@ class ParserOutput
        function addCategory( $c, $sort )    { $this->mCategories[$c] = $sort; }
        function addLanguageLink( $t )       { $this->mLanguageLinks[] = $t; }
        function addExternalLink( $url )     { $this->mExternalLinks[$url] = 1; }
-       function addWarning( $s )            { $this->mWarnings[] = $s; }
+       function addWarning( $s )            { $this->mWarnings[$s] = 1; }
 
-       function addOutputHook( $hook, $data = false ) { 
+       function addOutputHook( $hook, $data = false ) {
                $this->mOutputHooks[] = array( $hook, $data );
        }
 
@@ -106,7 +106,7 @@ class ParserOutput
                }
                $this->mLinks[$ns][$dbk] = $id;
        }
-       
+
        function addImage( $name ) {
                $this->mImages[$name] = 1;
        }
@@ -143,8 +143,8 @@ class ParserOutput
        }
 
        /**
-        * Add some text to the <head>. 
-        * If $tag is set, the section with that tag will only be included once 
+        * Add some text to the <head>.
+        * If $tag is set, the section with that tag will only be included once
         * in a given page.
         */
        function addHeadItem( $section, $tag = false ) {
@@ -154,7 +154,7 @@ class ParserOutput
                        $this->mHeadItems[] = $section;
                }
        }
-       
+
        /**
         * Override the title to be used for display
         * -- this is assumed to have been validated
@@ -165,7 +165,7 @@ class ParserOutput
        public function setDisplayTitle( $text ) {
                $this->displayTitle = $text;
        }
-       
+
        /**
         * Get the title to be used for display
         *
@@ -174,14 +174,14 @@ class ParserOutput
        public function getDisplayTitle() {
                return $this->displayTitle;
        }
-       
+
        /**
         * Fairly generic flag setter thingy.
         */
        public function setFlag( $flag ) {
                $this->mFlags[$flag] = true;
        }
-       
+
        public function getFlag( $flag ) {
                return isset( $this->mFlags[$flag] );
        }
@@ -193,7 +193,7 @@ class ParserOutput
                $this->mProperties[$name] = $value;
        }
 
-       public function getProperty( $name ){ 
+       public function getProperty( $name ){
                return isset( $this->mProperties[$name] ) ? $this->mProperties[$name] : false;
        }
 
@@ -204,5 +204,3 @@ class ParserOutput
                return $this->mProperties;
        }
 }
-
-