mirror of
https://github.com/friendica/friendica
synced 2025-04-24 13:50:10 +00:00
Add new public_calendar additional feature
- This gives anonymous access to public events
This commit is contained in:
parent
ae76fa1174
commit
84b2a35e05
6 changed files with 169 additions and 162 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue