Remove ?>'s from files. They're pointless, and just asking for people to mess with...
[lhc/web/wiklou.git] / includes / OutputPage.php
index 458907f..3ea6e33 100644 (file)
@@ -54,6 +54,7 @@ class OutputPage {
                $this->mETag = false;
                $this->mRevisionId = null;
                $this->mNewSectionLink = false;
+               $this->mTemplateIds = array();
        }
        
        public function redirect( $url, $responsecode = '302' ) {
@@ -156,7 +157,11 @@ class OutputPage {
                        # Wed, 20 Aug 2003 06:51:19 GMT; length=5202
                        # this breaks strtotime().
                        $modsince = preg_replace( '/;.*$/', '', $_SERVER["HTTP_IF_MODIFIED_SINCE"] );
+                       
+                       wfSuppressWarnings(); // E_STRICT system time bitching
                        $modsinceTime = strtotime( $modsince );
+                       wfRestoreWarnings();
+                       
                        $ismodsince = wfTimestamp( TS_MW, $modsinceTime ? $modsinceTime : 1 );
                        wfDebug( "$fname: -- client send If-Modified-Since: " . $modsince . "\n", false );
                        wfDebug( "$fname: --  we might send Last-Modified : $lastmod\n", false );
@@ -376,14 +381,15 @@ class OutputPage {
                if ( $parserOutput->getCacheTime() == -1 ) {
                        $this->enableClientCache( false );
                }
-               if ( $parserOutput->mHTMLtitle != "" ) {
-                       $this->mPagetitle = $parserOutput->mHTMLtitle ;
-               }
-               if ( $parserOutput->mSubtitle != '' ) {
-                       $this->mSubtitle .= $parserOutput->mSubtitle ;
-               }
                $this->mNoGallery = $parserOutput->getNoGallery();
                $this->mHeadItems = array_merge( $this->mHeadItems, (array)$parserOutput->mHeadItems );
+               // Versioning...
+               $this->mTemplateIds += (array)$parserOutput->mTemplateIds;
+               
+               # Display title
+               if( ( $dt = $parserOutput->getDisplayTitle() ) !== false )
+                       $this->setPageTitle( $dt );
+               
                wfRunHooks( 'OutputPageParserOutput', array( &$this, $parserOutput ) );
        }
 
@@ -786,7 +792,11 @@ class OutputPage {
                        $msg = 'blockedtext';
                }
 
-               $this->addWikiText( wfMsg( $msg, $link, $reason, $ip, $name, $blockid, $blockExpiry ) );
+               /* $ip returns who *is* being blocked, $intended contains who was meant to be blocked.
+                * This could be a username, an ip range, or a single ip. */
+               $intended = $wgUser->mBlock->mAddress;
+
+               $this->addWikiText( wfMsg( $msg, $link, $reason, $ip, $name, $blockid, $blockExpiry, $intended ) );
                
                # Don't auto-return to special pages
                if( $return ) {
@@ -1246,11 +1256,16 @@ class OutputPage {
         * @param int $lag Slave lag
         */
        public function showLagWarning( $lag ) {
-               $message = $lag >= 30 ? 'lag-warn-high' : 'lag-warn-normal';
+               global $wgSlaveLagWarning, $wgSlaveLagCritical;
+               
+               if ($lag < $wgSlaveLagWarning)
+                       return;
+
+               $message = ($lag >= $wgSlaveLagCritical) ? 'lag-warn-high' : 'lag-warn-normal';
                $warning = wfMsgHtml( $message, htmlspecialchars( $lag ) );
                $this->addHtml( "<div class=\"mw-{$message}\">\n{$warning}\n</div>\n" );
        }
        
 }
 
-?>
\ No newline at end of file
+