Matthias Mullie has uploaded a new change for review.
https://gerrit.wikimedia.org/r/259528
Change subject: Use current (with keys) array format for primary & secondary
links
......................................................................
Use current (with keys) array format for primary & secondary links
They're currently auto-converted to the new format, but ideally,
we wouldn't need that B/C code. And since this is the extension
others will likely look at for examples when implementing, we
should do it right here.
Also: there is no B/C correction for missing keys in secondary
links (description, icon).
Change-Id: If1a8b9911e81bb4c565f21a4b9e31fdc73426d93
---
M includes/formatters/EditUserTalkPresentationModel.php
M includes/formatters/MentionPresentationModel.php
M includes/formatters/PageLinkedPresentationModel.php
M includes/formatters/RevertedPresentationModel.php
M includes/formatters/UserRightsPresentationModel.php
M includes/formatters/WelcomePresentationModel.php
6 files changed, 19 insertions(+), 8 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Echo
refs/changes/28/259528/1
diff --git a/includes/formatters/EditUserTalkPresentationModel.php
b/includes/formatters/EditUserTalkPresentationModel.php
index 7b7252a..1a545ba 100644
--- a/includes/formatters/EditUserTalkPresentationModel.php
+++ b/includes/formatters/EditUserTalkPresentationModel.php
@@ -30,6 +30,8 @@
$diffLink = array(
'url' => $this->getDiffLinkUrl(),
'label' => $this->msg(
'notification-link-text-view-changes' )->text(),
+ 'description' => '',
+ 'icon' => false,
'prioritized' => true
);
return array( $diffLink );
diff --git a/includes/formatters/MentionPresentationModel.php
b/includes/formatters/MentionPresentationModel.php
index c5d47db..da65c6a 100644
--- a/includes/formatters/MentionPresentationModel.php
+++ b/includes/formatters/MentionPresentationModel.php
@@ -94,8 +94,8 @@
public function getPrimaryLink() {
return array(
- $this->getTitleWithSection()->getLocalURL(),
- $this->msg( 'notification-link-text-view-mention'
)->text()
+ 'url' => $this->getTitleWithSection()->getLocalURL(),
+ 'label' => $this->msg(
'notification-link-text-view-mention' )->text()
);
}
@@ -105,7 +105,13 @@
'diff' => $this->event->getExtraParam( 'revid' )
) );
return array(
- $url => $this->msg(
'notification-link-text-view-changes' )->text()
+ array(
+ 'url' => $url,
+ 'label' => $this->msg(
'notification-link-text-view-changes' )->text(),
+ 'description' => '',
+ 'icon' => false,
+ 'prioritized' => true,
+ ),
);
}
}
diff --git a/includes/formatters/PageLinkedPresentationModel.php
b/includes/formatters/PageLinkedPresentationModel.php
index ba6c8de..229b666 100644
--- a/includes/formatters/PageLinkedPresentationModel.php
+++ b/includes/formatters/PageLinkedPresentationModel.php
@@ -30,6 +30,8 @@
$whatLinksHereLink = array(
'url' => SpecialPage::getTitleFor( 'WhatLinkshere',
$this->event->getTitle()->getPrefixedText() )->getFullURL(),
'label' => $this->msg(
'notification-link-text-what-links-here' )->text(),
+ 'description' => '',
+ 'icon' => false,
'prioritized' => true
);
return array( $whatLinksHereLink );
diff --git a/includes/formatters/RevertedPresentationModel.php
b/includes/formatters/RevertedPresentationModel.php
index 4f26804..bbfe5fa 100644
--- a/includes/formatters/RevertedPresentationModel.php
+++ b/includes/formatters/RevertedPresentationModel.php
@@ -23,7 +23,8 @@
'diff' => $this->event->getExtraParam( 'revid' )
) );
return array(
- $url, $this->msg( 'notification-link-text-view-changes'
)->text()
+ 'url' => $url,
+ 'label' => $this->msg(
'notification-link-text-view-changes' )->text()
);
}
diff --git a/includes/formatters/UserRightsPresentationModel.php
b/includes/formatters/UserRightsPresentationModel.php
index ee1abc2..aa8a841 100644
--- a/includes/formatters/UserRightsPresentationModel.php
+++ b/includes/formatters/UserRightsPresentationModel.php
@@ -47,8 +47,8 @@
public function getPrimaryLink() {
return array(
- SpecialPage::getTitleFor( 'Listgrouprights'
)->getLocalURL(),
- $this->msg( 'echo-learn-more' )->text()
+ 'url' => SpecialPage::getTitleFor( 'Listgrouprights'
)->getLocalURL(),
+ 'label' => $this->msg( 'echo-learn-more' )->text()
);
}
}
diff --git a/includes/formatters/WelcomePresentationModel.php
b/includes/formatters/WelcomePresentationModel.php
index 117995a..4301f38 100644
--- a/includes/formatters/WelcomePresentationModel.php
+++ b/includes/formatters/WelcomePresentationModel.php
@@ -18,8 +18,8 @@
}
return array(
- $title->getFullURL(),
- $this->msg( 'notification-welcome-linktext' )->text(),
+ 'url' => $title->getFullURL(),
+ 'label' => $this->msg( 'notification-welcome-linktext'
)->text(),
);
}
}
--
To view, visit https://gerrit.wikimedia.org/r/259528
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: If1a8b9911e81bb4c565f21a4b9e31fdc73426d93
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: master
Gerrit-Owner: Matthias Mullie <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits