X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModule%2FBaseProfile.php;h=3573542c05ef7b79009e2e33f0f35d0499c5ab0b;hb=4eceb2d26f1e13bb2128c5b899ec60966b7beec2;hp=1347ae0df335fbad2eee7e4af7afc2013a87fddc;hpb=ae76fa1174f56e3d68473cf2a4b606838b514521;p=friendica.git diff --git a/src/Module/BaseProfile.php b/src/Module/BaseProfile.php index 1347ae0df3..3573542c05 100644 --- a/src/Module/BaseProfile.php +++ b/src/Module/BaseProfile.php @@ -23,9 +23,11 @@ namespace Friendica\Module; use Friendica\App; use Friendica\BaseModule; +use Friendica\Content\Feature; use Friendica\Core\Hook; use Friendica\Core\Renderer; use Friendica\DI; +use Friendica\Model\User; class BaseProfile extends BaseModule { @@ -87,17 +89,18 @@ class BaseProfile extends BaseModule '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 } else { - $tabs[] = [ - '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', - ]; + $owner = User::getByNickname($nickname, ['uid']); + if(DI::userSession()->isAuthenticated() || $owner && Feature::isEnabled($owner['uid'], 'public_calendar')) { + $tabs[] = [ + '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', + ]; + } } if ($is_owner) {