]> git.mxchange.org Git - friendica.git/commitdiff
Remove unused first parameter from BaseProfile::getTabsHTML
authorHypolite Petovan <hypolite@mrpetovan.com>
Wed, 30 Nov 2022 19:38:23 +0000 (14:38 -0500)
committerHypolite Petovan <hypolite@mrpetovan.com>
Thu, 1 Dec 2022 13:03:35 +0000 (08:03 -0500)
- Add expected Profile::load call to Profile\Photos module

mod/notes.php
mod/photos.php
src/Module/BaseProfile.php
src/Module/Profile/Common.php
src/Module/Profile/Contacts.php
src/Module/Profile/Media.php
src/Module/Profile/Photos.php
src/Module/Profile/Profile.php
src/Module/Profile/Schedule.php
src/Module/Profile/Status.php

index 39649d81f64a80bd025ade8f8d05d044f15861a6..475e0b7e574222f7895f18272f85eab02ab1c6fc 100644 (file)
@@ -45,7 +45,7 @@ function notes_content(App $a, bool $update = false)
                return;
        }
 
-       $o = BaseProfile::getTabsHTML($a, 'notes', true, $a->getLoggedInUserNickname(), false);
+       $o = BaseProfile::getTabsHTML('notes', true, $a->getLoggedInUserNickname(), false);
 
        if (!$update) {
                $o .= '<h3>' . DI::l10n()->t('Personal Notes') . '</h3>';
index 865e0fb318ce34569e79055397a3c39426ca7cc1..8bcd9f460cd83acf750ada2e897768002d2f26e6 100644 (file)
@@ -875,7 +875,7 @@ function photos_content(App $a)
 
        // tabs
        $is_owner = (DI::userSession()->getLocalUserId() && (DI::userSession()->getLocalUserId() == $owner_uid));
-       $o .= BaseProfile::getTabsHTML($a, 'photos', $is_owner, $user['nickname'], $profile['hide-friends']);
+       $o .= BaseProfile::getTabsHTML('photos', $is_owner, $user['nickname'], $profile['hide-friends']);
 
        // Display upload form
        if ($datatype === 'upload') {
index 10384e1578289c39db5b6f76a1fd1b67c7ec7d00..1347ae0df335fbad2eee7e4af7afc2013a87fddc 100644 (file)
@@ -32,14 +32,13 @@ class BaseProfile extends BaseModule
        /**
         * Returns the HTML for the profile pages tabs
         *
-        * @param App    $a
         * @param string $current
         * @param bool   $is_owner
         * @param string $nickname
         * @return string
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public static function getTabsHTML(App $a, string $current, bool $is_owner, string $nickname, bool $hide_friends)
+       public static function getTabsHTML(string $current, bool $is_owner, string $nickname, bool $hide_friends)
        {
                $baseProfileUrl = DI::baseUrl() . '/profile/' . $nickname;
 
index 6837e0f8218b276723fb0b9bf69e9ce0eb1c522d..5056758603814f450de00c962817a804b6bf863f 100644 (file)
@@ -61,7 +61,7 @@ class Common extends BaseProfile
                        $a->redirect('profile/' . $nickname . '/contacts');
                };
 
-               $o = self::getTabsHTML($a, 'contacts', false, $profile['nickname'], $profile['hide-friends']);
+               $o = self::getTabsHTML('contacts', false, $profile['nickname'], $profile['hide-friends']);
 
                $tabs = self::getContactFilterTabs('profile/' . $nickname, 'common', $displayCommonTab);
 
index 6397ff459564f34149bffd0e93709dd25c70e5ec..5f8363a03df39f4f90d9c0488111bd4b4cd608b1 100644 (file)
@@ -57,7 +57,7 @@ class Contacts extends Module\BaseProfile
 
                Nav::setSelected('home');
 
-               $o = self::getTabsHTML($a, 'contacts', $is_owner, $profile['nickname'], $profile['hide-friends']);
+               $o = self::getTabsHTML('contacts', $is_owner, $profile['nickname'], $profile['hide-friends']);
 
                $tabs = self::getContactFilterTabs('profile/' . $nickname, $type, DI::userSession()->isAuthenticated() && $profile['uid'] != DI::userSession()->getLocalUserId());
 
index bae2f9ad86060fa93d99c739d7324dd279fd34e2..6c140acce2670184b84316841d75196a5c28e976 100644 (file)
@@ -44,7 +44,7 @@ class Media extends BaseProfile
 
                $is_owner = DI::userSession()->getLocalUserId() == $profile['uid'];
 
-               $o = self::getTabsHTML($a, 'media', $is_owner, $profile['nickname'], $profile['hide-friends']);
+               $o = self::getTabsHTML('media', $is_owner, $profile['nickname'], $profile['hide-friends']);
 
                $o .= Contact::getPostsFromUrl($profile['url'], false, 0, 0, true);
 
index 940c1257b2043c3b07aaec95a055c23d615f4a03..12c0552b6aa98663b25c1f10f01a29afdbe5178e 100644 (file)
@@ -72,8 +72,8 @@ class Photos extends \Friendica\Module\BaseProfile
                        throw new HttpException\ForbiddenException($this->t('Public access denied.'));
                }
 
-               $owner = User::getOwnerDataByNick($this->parameters['nickname']);
-               if (!isset($owner['account_removed']) || $owner['account_removed']) {
+               $owner = Profile::load($this->app, $this->parameters['nickname'] ?? '');
+               if (!$owner || $owner['account_removed'] || $owner['account_expired']) {
                        throw new HTTPException\NotFoundException($this->t('User not found.'));
                }
 
@@ -174,13 +174,11 @@ class Photos extends \Friendica\Module\BaseProfile
                        ]);
                }
 
-               $this->page['aside'] .= Widget\VCard::getHTML($owner);
-
                if (!empty($photo_albums_widget)) {
                        $this->page['aside'] .= $photo_albums_widget;
                }
 
-               $o = self::getTabsHTML($this->app, 'photos', $is_owner, $owner['nickname'], Profile::getByUID($owner['uid'])['hide-friends'] ?? false);
+               $o = self::getTabsHTML('photos', $is_owner, $owner['nickname'], Profile::getByUID($owner['uid'])['hide-friends'] ?? false);
 
                $tpl = Renderer::getMarkupTemplate('photos_recent.tpl');
                $o .= Renderer::replaceMacros($tpl, [
index 553e9c523140b06a184138f3e3e1843a6a69b775..2c680d446785fd0cf3988e3ff6928f03bb3a7599 100644 (file)
@@ -100,7 +100,7 @@ class Profile extends BaseProfile
                Nav::setSelected('home');
 
                $is_owner = DI::userSession()->getLocalUserId() == $profile['uid'];
-               $o = self::getTabsHTML($a, 'profile', $is_owner, $profile['nickname'], $profile['hide-friends']);
+               $o = self::getTabsHTML('profile', $is_owner, $profile['nickname'], $profile['hide-friends']);
 
                $view_as_contacts = [];
                $view_as_contact_id = 0;
index 0e1f92018e394e7f5b197c2316b54507adcffd55..10dd5339f8cd3fb5b48c2a5110a74caf6c3eb6e0 100644 (file)
@@ -58,7 +58,7 @@ class Schedule extends BaseProfile
 
                $a = DI::app();
 
-               $o = self::getTabsHTML($a, 'schedule', true, $a->getLoggedInUserNickname(), false);
+               $o = self::getTabsHTML('schedule', true, $a->getLoggedInUserNickname(), false);
 
                $schedule = [];
                $delayed = DBA::select('delayed-post', [], ['uid' => DI::userSession()->getLocalUserId()]);
index 4b5e56755131f673f28e27441c5b15f2b74b30a5..0a4a17e462e1b3deb9d0145235834105be2ef50c 100644 (file)
@@ -109,7 +109,7 @@ class Status extends BaseProfile
                        $this->baseUrl->redirect('profile/' . $profile['nickname'] . '/restricted');
                }
 
-               $o .= self::getTabsHTML($a, 'status', $is_owner, $profile['nickname'], $profile['hide-friends']);
+               $o .= self::getTabsHTML('status', $is_owner, $profile['nickname'], $profile['hide-friends']);
 
                $o .= Widget::commonFriendsVisitor($profile['uid'], $profile['nickname']);