Added fname parameter to the query() call
[lhc/web/wiklou.git] / includes / RawPage.php
index 34aa9fe..3787617 100644 (file)
@@ -1,8 +1,11 @@
 <?php
 /**
- * Copyright (C) 2004 Gabriel Wicke <wicke@wikidev.net>
+ * Raw page text accessor
+ *
+ * Copyright © 2004 Gabriel Wicke <wicke@wikidev.net>
  * http://wikidev.net/
- * Based on PageHistory and SpecialExport
+ *
+ * Based on HistoryPage and SpecialExport
  *
  * License: GPL (http://www.gnu.org/copyleft/gpl.html)
  *
@@ -20,15 +23,15 @@ class RawPage {
        var $mSmaxage, $mMaxage;
        var $mContentType, $mExpandTemplates;
 
-       function __construct( &$article, $request = false ) {
+       function __construct( Article $article, $request = false ) {
                global $wgRequest, $wgInputEncoding, $wgSquidMaxage, $wgJsMimeType, $wgGroupPermissions;
 
                $allowedCTypes = array('text/x-wiki', $wgJsMimeType, 'text/css', 'application/x-zope-edit');
-               $this->mArticle =& $article;
-               $this->mTitle =& $article->mTitle;
+               $this->mArticle = $article;
+               $this->mTitle = $article->mTitle;
 
                if( $request === false ) {
-                       $this->mRequest =& $wgRequest;
+                       $this->mRequest = $wgRequest;
                } else {
                        $this->mRequest = $request;
                }
@@ -75,10 +78,6 @@ class RawPage {
                        $this->mGen = $gen;
                        if( is_null( $smaxage ) ) $smaxage = $wgSquidMaxage;
                        if($ctype == '') $ctype = 'text/css';
-               } elseif( $gen == 'js' ) {
-                       $this->mGen = $gen;
-                       if( is_null( $smaxage ) ) $smaxage = $wgSquidMaxage;
-                       if($ctype == '') $ctype = $wgJsMimeType;
                } else {
                        $this->mGen = false;
                }
@@ -109,7 +108,7 @@ class RawPage {
        }
 
        function view() {
-               global $wgOut, $wgScript, $wgRequest;
+               global $wgOut, $wgRequest;
 
                if( $wgRequest->isPathInfoBad() ) {
                        # Internet Explorer will ignore the Content-Type header if it
@@ -158,7 +157,7 @@ class RawPage {
        }
 
        function getRawText() {
-               global $wgUser, $wgOut, $wgRequest;
+               global $wgUser, $wgOut;
                if( $this->mGen ) {
                        $sk = $wgUser->getSkin();
                        if( !StubObject::isRealObject( $wgOut ) )
@@ -166,8 +165,6 @@ class RawPage {
                        $sk->initPage( $wgOut );
                        if( $this->mGen == 'css' ) {
                                return $sk->generateUserStylesheet();
-                       } else if( $this->mGen == 'js' ) {
-                               return $sk->generateUserJs();
                        }
                } else {
                        return $this->getArticleText();