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

return [
  'name' => 'csv', 
  'title' => 'CSV', 
  'description' => 'Source based on a locally-stored CSV file.', 
  'group' => 'Structured Data', 
  'icon' => $filter->apply('url', '~yooessentials_url/modules/source/providers/Csv/icon.svg', $file), 
  'endpoints' => [
    'presave' => 'yooessentials/source/csv'
  ], 
  'fields' => [
    'name' => [
      'label' => 'Name', 
      'description' => 'A name to identify this source.', 
      'attrs' => [
        'autofocus' => true, 
        'placeholder' => 'CSV'
      ]
    ], 
    'file' => [
      'label' => 'File', 
      'type' => 'yooessentials-file', 
      'description' => 'A path to a local CSV formated file which will be used as source. Must be UTF-8 encoded.'
    ], 
    '_delimeters' => [
      'description' => 'The delimiter and enclosure characters the CSV file is formated with.', 
      'type' => 'grid', 
      'width' => '1-2', 
      'fields' => [
        'delimiter' => [
          'label' => 'Delimiter', 
          'attrs' => [
            'placeholder' => ','
          ]
        ], 
        'enclosure' => [
          'label' => 'Enclosure', 
          'attrs' => [
            'placeholder' => '"'
          ]
        ]
      ]
    ], 
    'cache_default' => $config->get('yooessentials.source.fields.cache_default')
  ]
];
