diff options
Diffstat (limited to 'app/Models/Entry.php')
| -rw-r--r-- | app/Models/Entry.php | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/app/Models/Entry.php b/app/Models/Entry.php index 9caca1fb7..c782f4c94 100644 --- a/app/Models/Entry.php +++ b/app/Models/Entry.php @@ -816,6 +816,28 @@ HTML; } /** + * @return array{array<string>,array<string>} Array of first tags to show, then array of remaining tags + */ + public function tagsFormattingHelper(): array { + $firstTags = []; + $remainingTags = []; + + if (FreshRSS_Context::hasUserConf() && in_array(FreshRSS_Context::userConf()->show_tags, ['b', 'f', 'h'], true)) { + $maxTagsDisplayed = (int)FreshRSS_Context::userConf()->show_tags_max; + $tags = $this->tags(); + if (!empty($tags)) { + if ($maxTagsDisplayed > 0) { + $firstTags = array_slice($tags, 0, $maxTagsDisplayed); + $remainingTags = array_slice($tags, $maxTagsDisplayed); + } else { + $firstTags = $tags; + } + } + } + return [$firstTags,$remainingTags]; + } + + /** * Integer format conversion for Google Reader API format * @param string|int $dec Decimal number * @return string 64-bit hexa http://code.google.com/p/google-reader-api/wiki/ItemId |
