You are here

function emaudio_field_settings in Embedded Media Field 5

Same name and namespace in other branches
  1. 6.3 contrib/emaudio/emaudio.module \emaudio_field_settings()
  2. 6 contrib/emaudio/emaudio.module \emaudio_field_settings()
  3. 6.2 contrib/emaudio/emaudio.module \emaudio_field_settings()

Implementation of hook_field_settings *

File

contrib/emaudio/emaudio.module, line 40

Code

function emaudio_field_settings($op, $field) {
  switch ($op) {
    case 'database columns':
      $columns = array(
        'embed' => array(
          'type' => 'longtext',
          'not null' => TRUE,
          'default' => "''",
          'sortable' => TRUE,
        ),
        'value' => array(
          'type' => 'varchar',
          'length' => 255,
          'not null' => TRUE,
          'default' => "''",
          'sortable' => TRUE,
        ),
        'provider' => array(
          'type' => 'varchar',
          'length' => 255,
          'not null' => TRUE,
          'default' => "''",
          'sortable' => TRUE,
        ),
        'data' => array(
          'type' => 'longtext',
          'not null' => TRUE,
          'default' => "''",
          'sortable' => false,
        ),
      );
      switch ($field['type']) {
        case 'emaudio':
          break;
      }
      return $columns;
    case 'filters':
      return array(
        'not null' => array(
          'name' => t('Has Embedded Audio'),
          'operator' => array(
            '=' => t('Has Embedded Audio'),
          ),
          'list' => 'views_handler_operator_yesno',
          'list-type' => 'select',
          'handler' => 'emfield_views_handler_filter_is_not_null',
          'help' => t('Selecting yes will choose only nodes with this field that successfully provide embedded audio.'),
        ),
        'provider' => array(
          'name' => t('Audio Provider'),
          'list' => 'emfield_views_handler_filter_provider_list',
          'list-type' => 'list',
          'operator' => 'views_handler_operator_or',
          'value-type' => 'array',
          'handler' => 'emfield_views_handler_filter_provider',
          'help' => t('Include or exclude audio from the selected provider.'),
        ),
      );
      break;
    case 'arguments':
      return array(
        'content: ' . $field['field_name'] => array(
          'name' => t('Embedded Audio: @widget (@field)', array(
            '@widget' => $field['widget']['label'],
            '@field' => $field['field_name'],
          )),
          'handler' => 'content_views_argument_handler',
          'help' => t('This is the default argument handler provided by CCK. It uses the original embed code or URL pasted into the field.'),
        ),
        'provider: ' . $field['field_name'] => array(
          'name' => t('Embedded Audio Provider: @widget (@field)', array(
            '@widget' => $field['widget']['label'],
            '@field' => $field['field_name'],
          )),
          'handler' => 'emaudio_handler_arg_provider',
          'help' => t('The Embedded Audio Provider argument allows users to filter a view by specifying the audio provider.'),
        ),
      );
      break;
  }
}