* In EditPage.php: don't add the separator if getCancelLink() returns an empty string
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Tue, 12 Jul 2011 15:38:07 +0000 (15:38 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Tue, 12 Jul 2011 15:38:07 +0000 (15:38 +0000)
* In TalkHere extension: override getCancelLink() instead of having mangleEditForm() hack

includes/EditPage.php

index a17b4b1..16fd9fa 100644 (file)
@@ -1924,12 +1924,14 @@ HTML
                $wgOut->addHTML( implode( $this->getEditButtons( $tabindex ), "\n" ) . "\n" );
 
                $cancel = $this->getCancelLink();
-               $separator = wfMsgExt( 'pipe-separator' , 'escapenoentities' );
+               if ( $cancel !== '' ) {
+                       $cancel .= wfMsgExt( 'pipe-separator' , 'escapenoentities' );
+               }
                $edithelpurl = Skin::makeInternalOrExternalUrl( wfMsgForContent( 'edithelppage' ) );
                $edithelp = '<a target="helpwindow" href="'.$edithelpurl.'">'.
                        htmlspecialchars( wfMsg( 'edithelp' ) ).'</a> '.
                        htmlspecialchars( wfMsg( 'newwindow' ) );
-               $wgOut->addHTML( "      <span class='editHelp'>{$cancel}{$separator}{$edithelp}</span>\n" );
+               $wgOut->addHTML( "      <span class='editHelp'>{$cancel}{$edithelp}</span>\n" );
                $wgOut->addHTML( "</div><!-- editButtons -->\n</div><!-- editOptions -->\n" );
        }