From f1b960c4eb7c35abf3e394eb50d1d522774c6f95 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sun, 27 Sep 2020 11:31:18 -0400 Subject: [PATCH] Add additional account types to the profile filter --- src/classes/Pollers/Profile.php | 13 ++++++++++--- src/classes/Views/Widget/AccountTypeTabs.php | 6 ++++-- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/classes/Pollers/Profile.php b/src/classes/Pollers/Profile.php index ca43237..70db56e 100644 --- a/src/classes/Pollers/Profile.php +++ b/src/classes/Pollers/Profile.php @@ -193,9 +193,16 @@ class Profile return false; } - $account_type = 'People'; - if (!empty($params['comm'])) { - $account_type = 'Forum'; + switch ($params['account-type'] ?? 0) { + case 1: $account_type = 'News'; break; + case 2: $account_type = 'Organization'; break; + case 3: $account_type = 'Forum'; break; + case 0: + default: + $account_type = 'People'; + if (!empty($params['comm'])) { + $account_type = 'Forum'; + } } $tags = []; diff --git a/src/classes/Views/Widget/AccountTypeTabs.php b/src/classes/Views/Widget/AccountTypeTabs.php index faec5de..b0b6c09 100644 --- a/src/classes/Views/Widget/AccountTypeTabs.php +++ b/src/classes/Views/Widget/AccountTypeTabs.php @@ -53,8 +53,10 @@ class AccountTypeTabs foreach ($account_types as $account_type) { switch ($account_type['account_type']) { - case 'People': $title = $this->renderer->np__('account-type', 'People (%d)', 'People (%d)', $account_type['count']); break; - case 'Forum' : $title = $this->renderer->np__('account-type', 'Forum (%d)', 'Forums (%d)', $account_type['count']); break; + case 'People' : $title = $this->renderer->np__('account-type', 'People (%d)' , 'People (%d)' , $account_type['count']); break; + case 'News' : $title = $this->renderer->np__('account-type', 'News (%d)' , 'News (%d)' , $account_type['count']); break; + case 'Organization': $title = $this->renderer->np__('account-type', 'Organization (%d)', 'Organizations (%d)', $account_type['count']); break; + case 'Forum' : $title = $this->renderer->np__('account-type', 'Forum (%d)' , 'Forums (%d)' , $account_type['count']); break; default: $title = $this->renderer->np__('account-type', $account_type['account_type']. ' (%d)', $account_type['account_type']. ' (%d)', $account_type['count']); } -- 2.43.5