\n";
+ "\n";
}
$parserOptions = ParserOptions::newFromUser( $wgUser );
$parserOptions->setUseCategoryMagic( false );
$parserOptions->setEditSection( false );
$parserOptions->setEditSectionOnRightClick( false );
- # don't parse user css/js, show message about preview
- # XXX: stupid php bug won't let us use $wgTitle->isCssJsSubpage() here
+# don't parse user css/js, show message about preview
+# XXX: stupid php bug won't let us use $wgTitle->isCssJsSubpage() here
if ( $isCssJsSubpage ) {
if(preg_match("/\\.css$/", $wgTitle->getText() ) ) {
$previewtext = wfMsg('usercsspreview');
@@ -384,7 +384,7 @@ class EditPage {
$wgOut->addHTML( $parserOutput->mText );
} else {
$parserOutput = $wgParser->parse( $this->mArticle->preSaveTransform( $this->textbox1 ) ."\n\n",
- $wgTitle, $parserOptions );
+ $wgTitle, $parserOptions );
$previewHTML = $parserOutput->mText;
if($wgUser->getOption("previewontop")) {
@@ -397,21 +397,39 @@ class EditPage {
}
}
- # if this is a comment, show a subject line at the top, which is also the edit summary.
- # Otherwise, show a summary field at the bottom
+# if this is a comment, show a subject line at the top, which is also the edit summary.
+# Otherwise, show a summary field at the bottom
$summarytext = htmlspecialchars( $wgLang->recodeForEdit( $this->summary ) ); # FIXME
- if( $this->section == "new" ) {
- $commentsubject="{$subject}: ";
- $editsummary = "";
- } else {
- $commentsubject = "";
- $editsummary="{$summary}: ";
- }
+ if( $this->section == "new" ) {
+ $commentsubject="{$subject}: ";
+ $editsummary = "";
+ } else {
+ $commentsubject = "";
+ $editsummary="{$summary}: ";
+ }
if( !$this->preview ) {
- # Don't select the edit box on preview; this interferes with seeing what's going on.
+ # Don't select the edit box on preview; this interferes with seeing what's going on.
$wgOut->setOnloadHandler( "document.editform.wpTextbox1.focus()" );
}
+ # Prepare a list of templates used by this page
+ $db =& wfGetDB( DB_SLAVE );
+ $cur = $db->tableName( 'cur' );
+ $links = $db->tableName( 'links' );
+ $id = $this->mTitle->getArticleID();
+ $sql = "SELECT cur_namespace,cur_title,cur_id ".
+ "FROM $cur,$links WHERE l_to=cur_id AND l_from={$id} and cur_namespace=".NS_TEMPLATE;
+ $res = $db->query( $sql, "EditPage::editform" );
+
+ if ( $db->numRows( $res ) ) {
+ $templates = ' '. wfMsg( 'templatesused' ) . '