Jforrester has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/345630 )
Change subject: Switch from deprecated EditPageBeforeEditChecks to
EditPageGetCheckboxesDefinition
......................................................................
Switch from deprecated EditPageBeforeEditChecks to
EditPageGetCheckboxesDefinition
Bug: T161811
Change-Id: Iab8b22e4928612e525a899003f0384e14e55b815
---
M classes/Hooks.php
M extension.json
2 files changed, 11 insertions(+), 17 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/LiquidThreads
refs/changes/30/345630/1
diff --git a/classes/Hooks.php b/classes/Hooks.php
index 18aebbc..196ad16 100644
--- a/classes/Hooks.php
+++ b/classes/Hooks.php
@@ -307,9 +307,10 @@
}
/**
+ * Handle EditPageGetCheckboxesDefinition hook
+ *
* @param $editPage EditPage
* @param $checkboxes
- * @param $tabIndex
* @return bool
*/
static function editCheckboxes( $editPage, &$checkboxes, &$tabIndex ) {
@@ -326,21 +327,14 @@
if ( $title->getNamespace() == NS_LQT_THREAD && self::$editType
!= 'new' &&
$wgLiquidThreadsShowBumpCheckbox )
{
- $label = wfMessage( 'lqt-edit-bump' )->parse();
- $tooltip = wfMessage( 'lqt-edit-bump-tooltip' )->text();
-
- $checked = ! $wgRequest->wasPosted() ||
- $wgRequest->getBool( 'wpBumpThread' );
-
- $html =
- Xml::check( 'wpBumpThread', $checked, array(
- 'title' => $tooltip, 'id' =>
'wpBumpThread'
- ) );
-
- $html .= Xml::tags( 'label', array( 'for' =>
'wpBumpThread',
- 'title' => $tooltip ), $label );
-
- $checkboxes['bump'] = $html;
+ $checkboxes['bump'] = [
+ 'id' => 'wpBumpThread',
+ 'label-message' => 'lqt-edit-bump',
+ 'tooltip' => 'lqt-edit-bump-tooltip',
+ 'label-id' => 'wpBumpThread-label',
+ 'legacy-name' => 'bump',
+ 'default' => ! $wgRequest->wasPosted() ||
$wgRequest->getBool( 'wpBumpThread' ),
+ ];
}
return true;
diff --git a/extension.json b/extension.json
index 5f267ea..981a857 100644
--- a/extension.json
+++ b/extension.json
@@ -297,7 +297,7 @@
"UserMergeAccountFields": [
"LqtHooks::onUserMergeAccountFields"
],
- "EditPageBeforeEditChecks": [
+ "EditPageGetCheckboxesDefinition": [
"LqtHooks::editCheckBoxes"
],
"PageContentSaveComplete": [
--
To view, visit https://gerrit.wikimedia.org/r/345630
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iab8b22e4928612e525a899003f0384e14e55b815
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/LiquidThreads
Gerrit-Branch: master
Gerrit-Owner: Jforrester <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits