diff options
Diffstat (limited to 'Zotlabs/Widget')
-rw-r--r-- | Zotlabs/Widget/Categories.php | 3 | ||||
-rw-r--r-- | Zotlabs/Widget/Cdav.php | 23 | ||||
-rw-r--r-- | Zotlabs/Widget/Notifications.php | 2 |
3 files changed, 20 insertions, 8 deletions
diff --git a/Zotlabs/Widget/Categories.php b/Zotlabs/Widget/Categories.php index 27d4b5980..82c37cd0c 100644 --- a/Zotlabs/Widget/Categories.php +++ b/Zotlabs/Widget/Categories.php @@ -18,10 +18,9 @@ class Categories { $articles = ((array_key_exists('articles',$arr) && $arr['articles']) ? true : false); - if(($articles) && (! feature_enabled(App::$profile['profile_uid'],'articles'))) + if(($articles) && (! Apps::system_app_installed(App::$profile['profile_uid'],'Articles'))) return ''; - if((! App::$profile['profile_uid']) || (! perm_is_allowed(App::$profile['profile_uid'],get_observer_hash(),(($cards || $articles) ? 'view_pages' : 'view_stream')))) { return ''; diff --git a/Zotlabs/Widget/Cdav.php b/Zotlabs/Widget/Cdav.php index 589f915c5..ce716b455 100644 --- a/Zotlabs/Widget/Cdav.php +++ b/Zotlabs/Widget/Cdav.php @@ -22,7 +22,7 @@ class Cdav { $o = ''; - if(argc() == 2 && argv(1) === 'calendar') { + if(argc() <= 3 && argv(1) === 'calendar') { $caldavBackend = new \Sabre\CalDAV\Backend\PDO($pdo); @@ -57,7 +57,7 @@ class Cdav { $switch = get_pconfig(local_channel(), 'cdav_calendar', $sabrecal['id'][0]); - $color = (($sabrecal['{http://apple.com/ns/ical/}calendar-color']) ? $sabrecal['{http://apple.com/ns/ical/}calendar-color'] : '#3a87ad'); + $color = (($sabrecal['{http://apple.com/ns/ical/}calendar-color']) ? $sabrecal['{http://apple.com/ns/ical/}calendar-color'] : '#6cad39'); $editable = (($sabrecal['share-access'] == 2) ? 'false' : 'true'); // false/true must be string since we're passing it to javascript @@ -113,10 +113,22 @@ class Cdav { } } + $channel_calendars[] = [ + 'ownernick' => $channel['channel_address'], + 'displayname' => $channel['channel_name'], + 'calendarid' => 'channel_calendar', + 'json_source' => '/channel_calendar/json', + 'color' => '#3a87ad', + 'editable' => true, + 'switch' => get_pconfig(local_channel(), 'cdav_calendar', 'channel_calendar') + ]; + $o .= replace_macros(get_markup_template('cdav_widget_calendar.tpl'), [ - '$my_calendars_label' => t('My Calendars'), + '$channel_calendars_label' => t('Channel Calendar'), + '$channel_calendars' => $channel_calendars, + '$my_calendars_label' => t('CalDAV Calendars'), '$my_calendars' => $my_calendars, - '$shared_calendars_label' => t('Shared Calendars'), + '$shared_calendars_label' => t('Shared CalDAV Calendars'), '$shared_calendars' => $shared_calendars, '$sharee_options' => $sharee_options, '$access_options' => $access_options, @@ -124,10 +136,11 @@ class Cdav { '$share' => t('Share'), '$edit_label' => t('Calendar name and color'), '$edit' => t('Edit'), - '$create_label' => t('Create new calendar'), + '$create_label' => t('Create new CalDAV calendar'), '$create' => t('Create'), '$create_placeholder' => t('Calendar Name'), '$tools_label' => t('Calendar Tools'), + '$tools_options_label' => [t('Channel Calendars'), t('CalDAV Calendars')], '$import_label' => t('Import calendar'), '$import_placeholder' => t('Select a calendar to import to'), '$upload' => t('Upload'), diff --git a/Zotlabs/Widget/Notifications.php b/Zotlabs/Widget/Notifications.php index 37d9139ec..077949b4e 100644 --- a/Zotlabs/Widget/Notifications.php +++ b/Zotlabs/Widget/Notifications.php @@ -69,7 +69,7 @@ class Notifications { 'label' => t('New Events'), 'title' => t('New Events Notifications'), 'viewall' => [ - 'url' => 'events', + 'url' => 'cdav/calendar', 'label' => t('View events') ], 'markall' => [ |