Robert Vogel has submitted this change and it was merged.
Change subject: Pass context to HTMLForm, don't use HTMLForm::setTitle
..
Pass context to HTMLForm, don't use HTMLForm::setTitle
Change-Id: I3f060734f739d6897715078aa7f049c7102dfdd2
---
M specialpages/BibManagerCreate_body.php
M specialpages/BibManagerDelete_body.php
M specialpages/BibManagerEdit_body.php
M specialpages/BibManagerImport_body.php
M specialpages/BibManagerList_body.php
5 files changed, 19 insertions(+), 24 deletions(-)
Approvals:
Robert Vogel: Verified; Looks good to me, approved
diff --git a/specialpages/BibManagerCreate_body.php
b/specialpages/BibManagerCreate_body.php
index 58d4680..64dd160 100644
--- a/specialpages/BibManagerCreate_body.php
+++ b/specialpages/BibManagerCreate_body.php
@@ -50,7 +50,7 @@
wfRunHooks( 'BibManagerCreateBeforeTypeSelectFormCreate', array
( $this, $formDescriptor ) );
- $entryTypeSelectionForm = new HTMLForm( $formDescriptor );
+ $entryTypeSelectionForm = new HTMLForm( $formDescriptor,
$this-getContext() );
$entryTypeSelectionForm-setSubmitText( wfMsg(
'bm_select_entry_type_submit' ) );
$entryTypeSelectionForm-setSubmitId(
'bm_select_entry_type_submit' );
$entryTypeSelectionForm-setSubmitCallback( array ( $this,
'onSubmit' ) );
@@ -62,10 +62,9 @@
$importParams['bm_bibtexCitation'] = $citation;
}
- $entryTypeSelectionForm-setTitle( $this-getTitle() );
$entryTypeSelectionForm-addPostText(
wfMsg(
- 'bm_bibtex_string_import_link',
+ 'bm_bibtex_string_import_link',
SpecialPage::getTitleFor( 'BibManagerImport'
)-getLocalURL( $importParams )
)
);
@@ -85,7 +84,7 @@
global $wgOut, $wgRequest;
$citation = $wgRequest-getVal( 'bm_bibtexCitation' );
if ( !isset( $formData['bm_bibtexCitation'] ) !empty(
$citation ) ) {
- //This should not be necessary, but it seems the hidden
field from
+ //This should not be necessary, but it seems the hidden
field from
//the type selection form is not properly included in
$formData
$formData['bm_bibtexCitation'] = $citation;
}
@@ -94,4 +93,4 @@
);
return true;
}
-}
\ No newline at end of file
+}
diff --git a/specialpages/BibManagerDelete_body.php
b/specialpages/BibManagerDelete_body.php
index 85c263e..a6861e8 100644
--- a/specialpages/BibManagerDelete_body.php
+++ b/specialpages/BibManagerDelete_body.php
@@ -68,9 +68,8 @@
)
);
- $htmlForm = new HTMLForm( $formDescriptor, 'bm_delete' );
+ $htmlForm = new HTMLForm( $formDescriptor, $this-getContext(),
'bm_delete' );
$htmlForm-setSubmitText( wfMsg( 'bm_delete_submit' ) );
- $htmlForm-setTitle( $this-getTitle() );
$htmlForm-setSubmitCallback( array ( $this, 'formSubmit' ) );
//TODO: Add cancel button that returns user to the place he
came from. I.e. filtered overview
@@ -94,13 +93,13 @@
if ( $result === true ) {
$wgOut-addHtml( wfMsg( 'bm_success_save-complete' ) );
- $wgOut-addHtml(
- wfMsg(
- 'bm_success_link-to-list',
+ $wgOut-addHtml(
+ wfMsg(
+ 'bm_success_link-to-list',
SpecialPage::getTitleFor(
BibManagerList )-getLocalURL()
)
);
}
return $result;
}
-}
\ No newline at end of file
+}
diff --git a/specialpages/BibManagerEdit_body.php
b/specialpages/BibManagerEdit_body.php
index f248ad0..bfbaed5 100644
--- a/specialpages/BibManagerEdit_body.php
+++ b/specialpages/BibManagerEdit_body.php
@@ -101,9 +101,8 @@
wfRunHooks( 'BibManagerEditBeforeFormCreate', array ( $this,
$formDescriptor ) );
- $htmlForm = new HTMLForm( $formDescriptor, 'bm_edit' );
+ $htmlForm = new HTMLForm( $formDescriptor, $this-getContext(),
'bm_edit' );
$htmlForm-setSubmitText( wfMsg( 'bm_edit_submit' ) );
- $htmlForm-setTitle( $this-getTitle() );
$htmlForm-setSubmitCallback( array ( $this, 'submitForm' ) );
//TODO: Add cancel button that returns user to the place he
came from. I.e. filtered overview
@@ -117,11 +116,11 @@
* @global OutputPage $wgOut
*