<?php
+/**
+ * @copyright Copyright (C) 2010-2022, 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\Module;
* @return string
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
- public static function getTabsHTML(App $a, string $current, bool $is_owner, string $nickname = null)
+ public static function getTabsHTML(App $a, string $current, bool $is_owner, string $nickname, bool $hide_friends)
{
- if (is_null($nickname)) {
- $nickname = $a->user['nickname'];
- }
-
$baseProfileUrl = DI::baseUrl() . '/profile/' . $nickname;
$tabs = [
'accesskey' => 'h',
],
[
- 'label' => DI::l10n()->t('Videos'),
- 'url' => DI::baseUrl() . '/videos/' . $nickname,
- 'sel' => $current == 'videos' ? 'active' : '',
- 'title' => DI::l10n()->t('Videos'),
- 'id' => 'video-tab',
- 'accesskey' => 'v',
+ 'label' => DI::l10n()->t('Media'),
+ 'url' => $baseProfileUrl . '/media',
+ 'sel' => $current == 'media' ? 'active' : '',
+ 'title' => DI::l10n()->t('Media'),
+ 'id' => 'media-tab',
+ 'accesskey' => 'd',
],
];
// the calendar link for the full featured events calendar
- if ($is_owner && $a->theme_events_in_profile) {
+ if ($is_owner && $a->getThemeInfoValue('events_in_profile')) {
$tabs[] = [
'label' => DI::l10n()->t('Events'),
'url' => DI::baseUrl() . '/events',
'id' => 'notes-tab',
'accesskey' => 't',
];
+ $tabs[] = [
+ 'label' => DI::l10n()->t('Scheduled Posts'),
+ 'url' => $baseProfileUrl . '/schedule',
+ 'sel' => $current == 'schedule' ? 'active' : '',
+ 'title' => DI::l10n()->t('Posts that are scheduled for publishing'),
+ 'id' => 'schedule-tab',
+ 'accesskey' => 'o',
+ ];
}
- if (empty($a->profile['hide-friends'])) {
+ if (!$hide_friends) {
$tabs[] = [
'label' => DI::l10n()->t('Contacts'),
'url' => $baseProfileUrl . '/contacts',