Enh #5280: Allow to set the number of contents from which "Show {i} more." appears in the stream (#5288)

This commit is contained in:
Marc Farré 2021-09-15 18:20:00 +02:00 committed by GitHub
parent c5d009a06b
commit 569651f104
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 1 deletions

View File

@ -20,3 +20,4 @@
- Enh #5005: Possibility to invite a registered user to a space by email
- Enh #3546: Sign in back from impersonate mode
- Fix #5282: On account creation, registration form has HTML tag set with English language
- Enh #5280: Allow to set the number of contents from which "Show {i} more." appears in the stream

View File

@ -32,6 +32,11 @@ class Module extends \humhub\components\Module
*/
public $defaultStreamSuppressQueryIgnore = [\humhub\modules\post\models\Post::class, \humhub\modules\activity\models\Activity::class];
/**
* @var int number of contents from which "Show more" appears in the stream
*/
public $streamSuppressLimit = 2;
/**
* @var boolean show contents of deactivated users in stream
*/

View File

@ -85,7 +85,10 @@ class StreamSuppressQuery extends StreamQuery
*/
protected function isSuppressionActive()
{
return !($this->preventSuppression || $this->limit < 3 || $this->isSingleContentQuery());
/* @var $streamModule \humhub\modules\stream\Module */
$streamModule = Yii::$app->getModule('stream');
return !($this->preventSuppression || $this->limit <= $streamModule->streamSuppressLimit || $this->isSingleContentQuery());
}
/**