abstract function outputPage( OutputPage $out = null );
/**
- * @param $data
+ * @param $data array
* @return string
*/
static function makeVariablesScript( $data ) {
}
}
+ /**
+ * Make a <script> tag containing global variables
+ *
+ * @deprecated in 1.19
+ * @param $unused Unused
+ * @return string HTML fragment
+ */
+ public static function makeGlobalVariablesScript( $unused ) {
+ global $wgOut;
+
+ wfDeprecated( __METHOD__, '1.19' );
+
+ return self::makeVariablesScript( $wgOut->getJSVars() );
+ }
+
/**
* Get the query to generate a dynamic stylesheet
*
protected function generateDebugHTML() {
global $wgShowDebug;
- $html = MWDebug::getDebugHTML();
+ $html = MWDebug::getDebugHTML( $this->getContext() );
if ( $wgShowDebug ) {
$listInternals = $this->formatDebugHTML( $this->getOutput()->mDebugtext );
}
/**
- * @param $debugText
+ * @param $debugText string
* @return string
*/
private function formatDebugHTML( $debugText ) {
}
/**
- * @param string $type
+ * @param $type string
* @return string
*/
function getCopyright( $type = 'detect' ) {
if ( $forContent ) {
$msg = $msgObj->inContentLanguage()->text();
if ( $this->getLanguage()->getCode() !== $wgContLang->getCode() ) {
- $msg = Html::rawElement( 'span', array( 'lang' => $wgContLang->getCode(), 'dir' => $wgContLang->getDir() ), $msg );
+ $msg = Html::rawElement( 'span', array( 'lang' => $wgContLang->getHtmlCode(), 'dir' => $wgContLang->getDir() ), $msg );
}
return $msg;
} else {
/**
* Get the timestamp of the latest revision, formatted in user language
*
- * @param $page WikiPage object. Used if we're working with the current revision
* @return String
*/
- protected function lastModified( $page ) {
- if ( !$this->isRevisionCurrent() ) {
+ protected function lastModified() {
+ $timestamp = $this->getOutput()->getRevisionTimestamp();
+
+ # No cached timestamp, load it from the database
+ if ( $timestamp === null ) {
$timestamp = Revision::getTimestampFromId( $this->getTitle(), $this->getRevisionId() );
- } else {
- $timestamp = $page->getTimestamp();
}
if ( $timestamp ) {
$mp = $this->msg( 'mainpage' )->escaped();
$mptitle = Title::newMainPage();
- $url = ( is_object( $mptitle ) ? $mptitle->escapeLocalURL() : '' );
+ $url = ( is_object( $mptitle ) ? htmlspecialchars( $mptitle->getLocalURL() ) : '' );
$logourl = $this->getLogo();
$s = "<a href='{$url}'><img{$a} src='{$logourl}' alt='[{$mp}]' /></a>";
}
/**
- * @param $id
+ * @param $id User|int
* @return bool
*/
function showEmailUser( $id ) {
}
/**
- * @param $name
+ * @param $name string
* @param $urlaction string
* @return String
*/
}
/**
- * @param $name
- * @param $subpage
+ * @param $name string
+ * @param $subpage string
* @param $urlaction string
* @return String
*/
}
/**
- * @param $name
+ * @param $name string
* @param $urlaction string
* @return String
*/
}
/**
- * @param $name
+ * @param $name string
* @param $urlaction string
* @return String
*/
* make sure we have some title to operate on
*
* @param $title Title
- * @param $name
+ * @param $name string
*/
static function checkTitle( &$title, $name ) {
if ( !is_object( $title ) ) {
}
$notice = Html::rawElement( 'div', array( 'id' => 'localNotice',
- 'lang' => $wgContLang->getCode(), 'dir' => $wgContLang->getDir() ), $notice );
+ 'lang' => $wgContLang->getHtmlCode(), 'dir' => $wgContLang->getDir() ), $notice );
wfProfileOut( __METHOD__ );
return $notice;
}