Include the meta-robots, meta-keywords, and link-RSS tags, and the set MIME
authorBrion Vibber <brion@users.mediawiki.org>
Fri, 9 Apr 2004 04:53:52 +0000 (04:53 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Fri, 9 Apr 2004 04:53:52 +0000 (04:53 +0000)
type, in MonoBook output.

includes/OutputPage.php
includes/SkinPHPTal.php
templates/xhtml_slim.pt

index f42c9f8..ff75cbc 100644 (file)
@@ -602,6 +602,27 @@ class OutputPage {
                $ret .= "<html $xmlbits lang=\"$wgLanguageCode\" $rtl>\n";
                $ret .= "<head>\n<title>{$this->mHTMLtitle}</title>\n";
                array_push( $this->mMetatags, array( "http:Content-type", "$wgMimeType; charset={$wgOutputEncoding}" ) );
+               $ret .= $this->getHeadLinks();
+               global $wgStyleSheetPath;
+               if( $this->isPrintable() ) {
+                       $media = "";
+               } else {
+                       $media = "media='print'";
+               }
+               $printsheet = htmlspecialchars( "$wgStyleSheetPath/wikiprintable.css" );
+               $ret .= "<link rel='stylesheet' type='text/css' $media href='$printsheet' />\n";
+
+               $sk = $wgUser->getSkin();
+               $ret .= $sk->getHeadScripts();
+               $ret .= $sk->getUserStyles();
+
+               $ret .= "</head>\n";
+               return $ret;
+       }
+       
+       function getHeadLinks() {
+               global $wgRequest;
+               $ret = "";
                foreach ( $this->mMetatags as $tag ) {
                        if ( 0 == strcasecmp( "http:", substr( $tag[0], 0, 5 ) ) ) {
                                $a = "http-equiv";
@@ -631,20 +652,6 @@ class OutputPage {
                        $link = $wgRequest->escapeAppendQuery( "feed=rss" );
                        $ret .= "<link rel='alternate' type='application/rss+xml' title='RSS' href='$link' />\n";
                }
-               global $wgStyleSheetPath;
-               if( $this->isPrintable() ) {
-                       $media = "";
-               } else {
-                       $media = "media='print'";
-               }
-               $printsheet = htmlspecialchars( "$wgStyleSheetPath/wikiprintable.css" );
-               $ret .= "<link rel='stylesheet' type='text/css' $media href='$printsheet' />\n";
-
-               $sk = $wgUser->getSkin();
-               $ret .= $sk->getHeadScripts();
-               $ret .= $sk->getUserStyles();
-
-               $ret .= "</head>\n";
                return $ret;
        }
 }
index d1ab8d4..605bdd4 100644 (file)
@@ -62,7 +62,7 @@
                function outputPage( &$out ) {
                        global $wgTitle, $wgArticle, $wgUser, $wgLang, $wgOut;
                        global $wgScriptPath, $wgStyleSheetPath, $wgLanguageCode, $wgUseNewInterlanguage;
-                       global $wgOutputEncoding, $wgUseDatabaseMessages, $wgRequest;
+                       global $wgMimeType, $wgOutputEncoding, $wgUseDatabaseMessages, $wgRequest;
 
                        $this->thispage = $wgTitle->getPrefixedDbKey();
                        $this->loggedin = $wgUser->getID() != 0;
@@ -81,7 +81,9 @@
                        $tpl->setRef( "title", &$this->titletxt ); // ?
                        $tpl->setRef( "thispage", &$this->thispage );
                        $tpl->set( "subtitle", $out->getSubtitle() );
-                       $tpl->setRef( 'charset', $wgOutputEncoding);
+                       $tpl->setRef( 'mimetype', $wgMimeType );
+                       $tpl->setRef( 'charset', $wgOutputEncoding );
+                       $tpl->set( 'headlinks', $out->getHeadLinks() );
                        $tpl->setRef( 'skinname', $this->skinname );
                        $tpl->setRef( "loggedin", &$this->loggedin );
                        /* XXX currently unused, might get useful later
index fe96764..1bc23e6 100644 (file)
@@ -2,8 +2,8 @@
 
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="${lang}" lang="${lang}">
   <head>
-    <meta http-equiv="Content-Type" content="text/html; charset=${charset}" />
-
+    <meta http-equiv="Content-Type" content="${mimetype}; charset=${charset}" />
+       ${headlinks}
     <title tal:content="title">Exciting xhtml slimfast</title>
 
     <style type="text/css" media="screen">