* Add new editFormPageTop placeholder for text injection
authorAryeh Gregor <simetrical@users.mediawiki.org>
Sun, 26 Nov 2006 13:58:40 +0000 (13:58 +0000)
committerAryeh Gregor <simetrical@users.mediawiki.org>
Sun, 26 Nov 2006 13:58:40 +0000 (13:58 +0000)
* Use that instead of editFormTextTop for undo failure, so it displays above the preview if applicable
* <strong class="error"> for undo failure
* Explicitly declare $editFormX as public

includes/EditPage.php

index 38439fb..482b415 100644 (file)
@@ -43,10 +43,11 @@ class EditPage {
 
        # Placeholders for text injection by hooks (must be HTML)
        # extensions should take care to _append_ to the present value
-       var $editFormTextTop;
-       var $editFormTextAfterWarn;
-       var $editFormTextAfterTools;
-       var $editFormTextBottom;
+       public $editFormPageTop; // Before even the preview
+       public $editFormTextTop;
+       public $editFormTextAfterWarn;
+       public $editFormTextAfterTools;
+       public $editFormTextBottom;
 
        /**
         * @todo document
@@ -58,9 +59,10 @@ class EditPage {
                $this->mTitle =& $wgTitle;
 
                # Placeholders for text injection by hooks (empty per default)
-               $this->editFormTextTop = "";
-               $this->editFormTextAfterWarn = "";
-               $this->editFormTextAfterTools = "";
+               $this->editFormPageTop =
+               $this->editFormTextTop =
+               $this->editFormTextAfterWarn =
+               $this->editFormTextAfterTools =
                $this->editFormTextBottom = "";
        }
        
@@ -115,8 +117,8 @@ class EditPage {
                                                $text = $currev_text;
 
                                                #Give a warning
-                                               $this->editFormTextTop = "<h2>" . wfMsg('undofailed') . "</h2>\n" .
-                                                                       '<p>'.wfMsg('explainundofailed').'</p>';
+                                               $this->editFormPageTop .= "<h2>" . wfMsg('undofailed') . "</h2>\n" .
+                                                                       '<p><strong class="error">'.wfMsg('explainundofailed').'</strong></p>';
                                        }
                                }
                        }
@@ -1047,6 +1049,8 @@ class EditPage {
 
                $checkboxhtml = $minoredithtml . $watchhtml;
 
+               $wgOut->addHTML( $this->editFormPageTop );
+
                if ( $wgUser->getOption( 'previewontop' ) ) {
 
                        if ( 'preview' == $this->formtype ) {