Skip to content

Commit

Permalink
People filter - Hide follower options if Following is disabled in the…
Browse files Browse the repository at this point in the history
… User module (#6963)
  • Loading branch information
yurabakhtin committed Apr 23, 2024
1 parent 72b0bb8 commit 100b0e1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGELOG-DEV.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ HumHub Changelog
- Enh #6920: Enhancing of meta search for advanced search providers
- Enh #6952: Improve container title encoding in header
- Fix #6954: Search out of viewport on mobile
- Fix #6962: People filter - Hide follower options if Following is disabled in the User module


1.16.0-beta.2 (April 9, 2024)
Expand Down
20 changes: 12 additions & 8 deletions protected/humhub/modules/user/widgets/PeopleFilters.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,19 +82,23 @@ protected function initDefaultFilters()
// Connection
$connectionOptions = [
'' => Yii::t('UserModule.base', 'All'),
'followers' => Yii::t('UserModule.base', 'Followers'),
'following' => Yii::t('UserModule.base', 'Following'),
];
if (!Yii::$app->getModule('user')->disableFollow) {
$connectionOptions['followers'] = Yii::t('UserModule.base', 'Followers');
$connectionOptions['following'] = Yii::t('UserModule.base', 'Following');
}
if (Yii::$app->getModule('friendship')->settings->get('enable')) {
$connectionOptions['friends'] = Yii::t('UserModule.base', 'Friends');
$connectionOptions['pending_friends'] = Yii::t('UserModule.base', 'Pending Requests');
}
$this->addFilter('connection', [
'title' => Yii::t('SpaceModule.base', 'Status'),
'type' => 'dropdown',
'options' => $connectionOptions,
'sortOrder' => 400,
]);
if (count($connectionOptions) > 1) {
$this->addFilter('connection', [
'title' => Yii::t('SpaceModule.base', 'Status'),
'type' => 'dropdown',
'options' => $connectionOptions,
'sortOrder' => 400,
]);
}

// Profile fields
$profileFields = ProfileField::find()
Expand Down

0 comments on commit 100b0e1

Please sign in to comment.