]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/BaseProfile.php
Add license
[friendica.git] / src / Module / BaseProfile.php
index e84ebded101c4f8fcd454ab6d0022d6a1659c03e..16ba224c9cb008f4648a03c6c2a323c7966da700 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2021, the Friendica project
+ * @copyright Copyright (C) 2010-2022, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -39,10 +39,8 @@ class BaseProfile extends BaseModule
         * @return string
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public static function getTabsHTML(App $a, string $current, bool $is_owner, array $profile)
+       public static function getTabsHTML(App $a, string $current, bool $is_owner, string $nickname, bool $hide_friends)
        {
-               $nickname = $profile['nickname'];
-
                $baseProfileUrl = DI::baseUrl() . '/profile/' . $nickname;
 
                $tabs = [
@@ -71,35 +69,35 @@ class BaseProfile extends BaseModule
                                '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',
-                               'sel'   => $current == 'events' ? 'active' : '',
-                               'title' => DI::l10n()->t('Events and Calendar'),
-                               'id'    => 'events-tab',
-                               'accesskey' => 'e',
+                               'label' => DI::l10n()->t('Calendar'),
+                               'url'   => DI::baseUrl() . '/calendar',
+                               'sel'   => $current == 'calendar' ? 'active' : '',
+                               'title' => DI::l10n()->t('Calendar'),
+                               'id'    => 'calendar-tab',
+                               'accesskey' => 'c',
                        ];
                        // if the user is not the owner of the calendar we only show a calendar
                        // with the public events of the calendar owner
                } elseif (!$is_owner) {
                        $tabs[] = [
-                               'label' => DI::l10n()->t('Events'),
-                               'url'   => DI::baseUrl() . '/cal/' . $nickname,
-                               'sel'   => $current == 'cal' ? 'active' : '',
-                               'title' => DI::l10n()->t('Events and Calendar'),
-                               'id'    => 'events-tab',
-                               'accesskey' => 'e',
+                               'label' => DI::l10n()->t('Calendar'),
+                               'url'   => DI::baseUrl() . '/calendar/show/' . $nickname,
+                               'sel'   => $current == 'calendar' ? 'active' : '',
+                               'title' => DI::l10n()->t('Calendar'),
+                               'id'    => 'calendar-tab',
+                               'accesskey' => 'c',
                        ];
                }
 
@@ -112,9 +110,17 @@ class BaseProfile extends BaseModule
                                '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($profile['hide-friends'])) {
+               if (!$hide_friends) {
                        $tabs[] = [
                                'label' => DI::l10n()->t('Contacts'),
                                'url'   => $baseProfileUrl . '/contacts',