mirror of
https://github.com/friendica/friendica
synced 2025-04-29 11:44:24 +02:00
Language specific median calculations / collection
This commit is contained in:
parent
97c519990b
commit
9cbd0c34a7
4 changed files with 57 additions and 13 deletions
28
src/Content/Conversation/Collection/Channels.php
Normal file
28
src/Content/Conversation/Collection/Channels.php
Normal file
|
@ -0,0 +1,28 @@
|
|||
<?php
|
||||
/**
|
||||
* @copyright Copyright (C) 2010-2023, the Friendica project
|
||||
*
|
||||
* @license GNU AGPL version 3 or any later version
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
namespace Friendica\Content\Conversation\Collection;
|
||||
|
||||
use Friendica\BaseCollection;
|
||||
|
||||
class Channels extends BaseCollection
|
||||
{
|
||||
}
|
|
@ -21,6 +21,7 @@
|
|||
|
||||
namespace Friendica\Content\Conversation\Factory;
|
||||
|
||||
use Friendica\Content\Conversation\Collection\Channels;
|
||||
use Friendica\Model\User;
|
||||
use Friendica\Content\Conversation\Entity\Channel as ChannelEntity;
|
||||
use Friendica\Core\L10n;
|
||||
|
@ -44,7 +45,7 @@ final class Channel extends \Friendica\BaseFactory
|
|||
* @param integer $uid
|
||||
* @return array
|
||||
*/
|
||||
public function getForUser(int $uid): array
|
||||
public function getForUser(int $uid): Channels
|
||||
{
|
||||
$language = User::getLanguageCode($uid);
|
||||
$languages = $this->l10n->getAvailableLanguages(true);
|
||||
|
@ -59,6 +60,6 @@ final class Channel extends \Friendica\BaseFactory
|
|||
new ChannelEntity(ChannelEntity::AUDIO, $this->l10n->t('Audio'), $this->l10n->t('Posts with audio'), 'd'),
|
||||
new ChannelEntity(ChannelEntity::VIDEO, $this->l10n->t('Videos'), $this->l10n->t('Posts with videos'), 'v'),
|
||||
];
|
||||
return $tabs;
|
||||
return new Channels($tabs);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue