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

return [
  'name' => 'facebook', 
  'title' => 'Facebook', 
  'description' => 'Source based on Facebook Pages.', 
  'group' => 'Social Media', 
  'icon' => $filter->apply('url', '~yooessentials_url/modules/source/providers/Facebook/icon.svg', $file), 
  'endpoints' => [
    'presave' => 'yooessentials/source/facebook'
  ], 
  'fields' => [
    'name' => [
      'label' => 'Name', 
      'description' => 'A name to identify this source.', 
      'attrs' => [
        'autofocus' => true, 
        'placeholder' => 'Facebook'
      ]
    ], 
    'account' => [
      'label' => 'Account', 
      'type' => 'yooessentials-connected-auth', 
      'connections' => [
        'facebook' => ['pages_show_list', 'pages_read_engagement', 'pages_read_user_content']
      ], 
      'description' => 'The Facebook account which to authenticate with.'
    ], 
    'page_id' => [
      'enable' => 'account', 
      'label' => 'Page', 
      'description' => 'The Facebook Page from which to create the source.', 
      'type' => 'yooessentials-select-dropdown-async', 
      'endpoint' => 'yooessentials/source/facebook/pages', 
      'account' => 'account'
    ], 
    'cache_default' => $config->get('yooessentials.source.fields.cache_default_limited')
  ]
];
