Add EditPageBeforeEditChecks hook for bug 16713
authorAaron Schulz <aaron@users.mediawiki.org>
Sat, 20 Dec 2008 01:15:40 +0000 (01:15 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Sat, 20 Dec 2008 01:15:40 +0000 (01:15 +0000)
docs/hooks.txt
includes/EditPage.php

index efb095c..c9daed9 100644 (file)
@@ -622,6 +622,12 @@ sections.
 'EditPageBeforeEditButtons':  allows modifying the edit buttons below the textarea in the edit form
 &$editpage: The current EditPage object
 &$buttons: Array of edit buttons "Save", "Preview", "Live", and "Diff"
+&$tabindex: HTML tabindex of the last edit check/button
+
+'EditPageBeforeEditChecks':  allows modifying the edit checks below the textarea in the edit form
+&$editpage: The current EditPage object
+&$checks: Array of edit checks like "watch this page"/"minor edit"
+&$tabindex: HTML tabindex of the last edit check/button
 
 'EditSectionLink': Do not use, use DoEditSectionLink instead.
 $skin: Skin rendering the UI
index 3852f17..4161acb 100644 (file)
@@ -104,6 +104,10 @@ class EditPage {
                $this->editFormTextAfterTools =
                $this->editFormTextBottom = "";
        }
+       
+       function getArticle() {
+               return $this->mArticle;
+       }
 
        /**
         * Fetch initial editing page content.
@@ -2081,6 +2085,7 @@ END
                                Xml::check( 'wpWatchthis', $checked['watch'], $attribs ) .
                                "&nbsp;<label for='wpWatchthis'".$skin->tooltip('watch', 'withaccess').">{$watchLabel}</label>";
                }
+               wfRunHooks( 'EditPageBeforeEditChecks', array( &$this, &$checkboxes, &$tabindex ) );
                return $checkboxes;
        }
 
@@ -2158,7 +2163,7 @@ END
                );
                $buttons['diff'] = Xml::element('input', $temp, '');
 
-               wfRunHooks( 'EditPageBeforeEditButtons', array( &$this, &$buttons ) );
+               wfRunHooks( 'EditPageBeforeEditButtons', array( &$this, &$buttons, &$tabindex ) );
                return $buttons;
        }