<?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)
*
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;
}
$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;
}
}
function view() {
- global $wgOut, $wgScript, $wgRequest;
+ global $wgOut, $wgRequest;
if( $wgRequest->isPathInfoBad() ) {
# Internet Explorer will ignore the Content-Type header if it
}
function getRawText() {
- global $wgUser, $wgOut, $wgRequest;
+ global $wgUser, $wgOut;
if( $this->mGen ) {
$sk = $wgUser->getSkin();
if( !StubObject::isRealObject( $wgOut ) )
$sk->initPage( $wgOut );
if( $this->mGen == 'css' ) {
return $sk->generateUserStylesheet();
- } else if( $this->mGen == 'js' ) {
- return $sk->generateUserJs();
}
} else {
return $this->getArticleText();