Addshore has uploaded a new change for review.
https://gerrit.wikimedia.org/r/234288
Change subject: Move field stuff to getFieldNames method
......................................................................
Move field stuff to getFieldNames method
Change-Id: Id586348e3b40f8143f6aba2d3add4c6fd00df975
---
M includes/NewsletterManageTablePager.php
M includes/NewsletterTablePager.php
M includes/specials/SpecialNewsletterManage.php
M includes/specials/SpecialNewsletters.php
4 files changed, 12 insertions(+), 40 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Newsletter
refs/changes/88/234288/1
diff --git a/includes/NewsletterManageTablePager.php
b/includes/NewsletterManageTablePager.php
index a48a62b..2c31892 100644
--- a/includes/NewsletterManageTablePager.php
+++ b/includes/NewsletterManageTablePager.php
@@ -4,20 +4,13 @@
private $newsletterOwners = array();
- /**
- * @see TablePager::getFieldnames
- * @var array|null
- */
- private $fieldNames = null;
-
public function getFieldNames() {
- if ( $this->fieldNames === null ) {
- $this->fieldNames = array();
- foreach ( SpecialNewsletterManage::$fields as $key =>
$value ) {
- $this->fieldNames[$key] = $this->msg(
"newsletter-manage-header-$value" )->text();
- }
- }
- return $this->fieldNames;
+ return array(
+ 'newsletter_id' => 'newsletter-manage-header-name',
+ 'publisher_id' => 'newsletter-manage-header-publisher',
+ 'permissions' => 'newsletter-manage-header-permissions',
+ 'action' => 'newsletter-manage-header-action',
+ );
}
public function getQueryInfo() {
diff --git a/includes/NewsletterTablePager.php
b/includes/NewsletterTablePager.php
index d4d2fad..4ba8043 100644
--- a/includes/NewsletterTablePager.php
+++ b/includes/NewsletterTablePager.php
@@ -2,20 +2,13 @@
class NewsletterTablePager extends TablePager {
- /**
- * @see TablePager::getFieldnames
- * @var array|null
- */
- private $fieldNames = null;
-
public function getFieldNames() {
- if ( $this->fieldNames === null ) {
- $this->fieldNames = array();
- foreach ( SpecialNewsletters::$fields as $field =>
$property ) {
- $this->fieldNames[$field] = $this->msg(
"newsletter-header-$property" )->text();
- }
- }
- return $this->fieldNames;
+ return array(
+ 'nl_name' => 'newsletter-header-name',
+ 'nl_desc' => 'newsletter-header-description',
+ 'subscriber_count' =>
'newsletter-header-subscriber_count',
+ 'action' => 'newsletter-header-action',
+ );
}
public function getQueryInfo() {
diff --git a/includes/specials/SpecialNewsletterManage.php
b/includes/specials/SpecialNewsletterManage.php
index e9b7945..dfeba7e 100644
--- a/includes/specials/SpecialNewsletterManage.php
+++ b/includes/specials/SpecialNewsletterManage.php
@@ -5,13 +5,6 @@
*/
class SpecialNewsletterManage extends SpecialPage {
- public static $fields = array(
- 'newsletter_id' => 'name',
- 'publisher_id' => 'publisher',
- 'permissions' => 'permissions',
- 'action' => 'action',
- );
-
public function __construct() {
parent::__construct( 'NewsletterManage' );
}
diff --git a/includes/specials/SpecialNewsletters.php
b/includes/specials/SpecialNewsletters.php
index 365ba65..533f4cc 100644
--- a/includes/specials/SpecialNewsletters.php
+++ b/includes/specials/SpecialNewsletters.php
@@ -5,13 +5,6 @@
*/
class SpecialNewsletters extends SpecialPage {
- public static $fields = array(
- 'nl_name' => 'name',
- 'nl_desc' => 'description',
- 'subscriber_count' => 'subscriber_count',
- 'action' => 'action',
- );
-
# Array containing all newsletter ids in nl_subscriptions table
public static $allSubscribedNewsletterId = array();
--
To view, visit https://gerrit.wikimedia.org/r/234288
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id586348e3b40f8143f6aba2d3add4c6fd00df975
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Newsletter
Gerrit-Branch: master
Gerrit-Owner: Addshore <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits