$lb->execute();
$sk =& $wgUser->getSkin();
- foreach ( $categories as $category => $arbitrary ) {
+ foreach ( $categories as $category => $unused ) {
$title = Title::makeTitleSafe( NS_CATEGORY, $category );
$text = $wgContLang->convertHtml( $title->getText() );
$this->mCategoryLinks[] = $sk->makeLinkObj( $title, $text );
public function output() {
global $wgUser, $wgOutputEncoding, $wgRequest;
global $wgContLanguageCode, $wgDebugRedirects, $wgMimeType;
- global $wgJsMimeType, $wgStylePath, $wgUseAjax, $wgAjaxSearch, $wgScriptPath, $wgServer;
+ global $wgJsMimeType, $wgStylePath, $wgUseAjax, $wgAjaxSearch, $wgServer;
global $wgStyleVersion;
if( $this->mDoNothing ){
*/
public function readOnlyPage( $source = null, $protected = false ) {
global $wgUser, $wgReadOnlyFile, $wgReadOnly, $wgTitle;
+ $skin = $wgUser->getSkin();
$this->setRobotpolicy( 'noindex,nofollow' );
$this->setArticleRelated( false );
if( $protected ) {
- $skin = $wgUser->getSkin();
$this->setPageTitle( wfMsg( 'viewsource' ) );
$this->setSubtitle( wfMsg( 'viewsourcefor', $skin->makeKnownLinkObj( $wgTitle ) ) );
htmlspecialchars( $source ) . "\n</textarea>";
$this->addHTML( $text );
}
- $this->formatTemplates();
+ $article = new Article($wgTitle);
+ $this->addHTML( $skin->formatTemplates($article->getUsedTemplates()) );
$this->returnToMain( false );
}
if ( !is_array( $links2d ) ) {
return;
}
- foreach ( $links2d as $ns => $dbkeys ) {
- foreach( $dbkeys as $dbkey => $id ) {
+ foreach ( $links2d as $dbkeys ) {
+ foreach( $dbkeys as $dbkey => $unused ) {
$this->addKeyword( $dbkey );
if ( ++$count > 10 ) {
break 2;
public function showNewSectionLink() {
return $this->mNewSectionLink;
}
-
- /**
- * Outputs the "templates used on this page" list.
- *
- * Stolen from EditPage::formatTemplates. Should be merged, but there are
- * slightly fiddly bits involving previews and so on that will have to be
- * dealt with, so I'll just copy it for now because I'm lazy.
- *
- * @return nothing
- */
- function formatTemplates() {
- global $wgUser, $wgTitle;
- wfProfileIn( __METHOD__ );
-
- $sk =& $wgUser->getSkin();
-
- $outText = '';
- $article = new Article($wgTitle);
- $templates = $article->getUsedTemplates();
- if ( count( $templates ) > 0 ) {
- # Do a batch existence check
- $batch = new LinkBatch;
- foreach( $templates as $title ) {
- $batch->addObj( $title );
- }
- $batch->execute();
-
- # Construct the HTML
- $outText = '<div class="mw-templatesUsedExplanation">' .
- wfMsgExt( 'templatesused', array( 'parse' ) ) .
- '</div><ul>';
- foreach ( $templates as $titleObj ) {
- $outText .= '<li>' . $sk->makeLinkObj( $titleObj ) . '</li>';
- }
- $outText .= '</ul>';
- }
- wfProfileOut( __METHOD__ );
- $this->addHTML($outText);
- }
}
?>