1
0
Fork 0

Apply calendar owner custom theme

This commit is contained in:
Hypolite Petovan 2022-12-15 23:14:45 -05:00
parent 590f92ba42
commit 777afb45fc

View file

@ -31,6 +31,7 @@ use Friendica\Core\Renderer;
use Friendica\Core\Session\Capability\IHandleUserSessions; use Friendica\Core\Session\Capability\IHandleUserSessions;
use Friendica\Core\Theme; use Friendica\Core\Theme;
use Friendica\Model\Event; use Friendica\Model\Event;
use Friendica\Model\Profile;
use Friendica\Model\User; use Friendica\Model\User;
use Friendica\Module\BaseProfile; use Friendica\Module\BaseProfile;
use Friendica\Module\Response; use Friendica\Module\Response;
@ -68,7 +69,7 @@ class Show extends BaseModule
throw new HTTPException\UnauthorizedException(); throw new HTTPException\UnauthorizedException();
} }
$owner = User::getOwnerDataByNick($nickname); $owner = Profile::load($this->app, $nickname, false);
if (!$owner || $owner['account_expired'] || $owner['account_removed']) { if (!$owner || $owner['account_expired'] || $owner['account_removed']) {
throw new HTTPException\NotFoundException($this->t('User not found.')); throw new HTTPException\NotFoundException($this->t('User not found.'));
} }
@ -102,8 +103,9 @@ class Show extends BaseModule
Nav::setSelected($is_owner ? 'home' : 'calendar'); Nav::setSelected($is_owner ? 'home' : 'calendar');
if (!$is_owner) { if ($is_owner) {
$this->page['aside'] .= Widget\VCard::getHTML($owner); // Removing the vCard added by Profile::load for owners
$this->page['aside'] = '';
} }
$this->page['aside'] .= Widget\CalendarExport::getHTML($owner['uid']); $this->page['aside'] .= Widget\CalendarExport::getHTML($owner['uid']);