<?php // $file = /home/bluedoor/www/dev/wp-content/plugins/yooessentials/modules/source/providers/GoogleCalendar/config.json

return [
  'name' => 'google_calendar', 
  'title' => 'Google Calendar', 
  'description' => 'Source based on a Google Calendar.', 
  'group' => 'misc', 
  'icon' => $filter->apply('url', '~yooessentials_url/modules/source/providers/GoogleCalendar/icon.svg', $file), 
  'endpoints' => [
    'presave' => 'yooessentials/source/google/calendar'
  ], 
  'fields' => [
    'name' => [
      'label' => 'Name', 
      'description' => 'A name to identify this source.', 
      'attrs' => [
        'autofocus' => true
      ]
    ], 
    'account' => [
      'label' => 'Account', 
      'type' => 'yooessentials-connected-auth', 
      'connections' => [
        'google' => ['https://www.googleapis.com/auth/calendar.readonly', 'https://www.googleapis.com/auth/calendar.events.readonly']
      ], 
      'description' => 'The Google account with which to access the resources.'
    ], 
    'calendar' => [
      'label' => 'Calendar', 
      'type' => 'yooessentials-select-dropdown-async', 
      'description' => 'The Calendar from which events to feed the source.', 
      'watch' => 'account', 
      'endpoint' => 'yooessentials/source/google/calendar/calendars'
    ], 
    'cache_default' => $config->get('yooessentials.source.fields.cache_default_limited')
  ]
];
