You are here

function emfield_widget_settings in Embedded Media Field 6.3

File

./emfield.module, line 164
Embedded Media Field is a CCK-based framework for embedding media files.

Code

function emfield_widget_settings($op, $widget) {
  switch ($op) {
    case 'form':
      if ($widget['type'] == 'emfield_browser') {
        $form = array();
        $classes = emapi_get_provider_classes();
        foreach ($classes as $class) {
          $options[$class['class_name']] = $class['name'];
        }
        $form['provider_list'] = array(
          '#type' => 'fieldset',
          '#title' => t('Providers Supported'),
          '#description' => t('Select which third party providers you wish to allow for this content type from the list below. If no checkboxes are checked, then all providers will be supported. When a user submits new content, the URL they enter will be matched to the provider, assuming that provider is allowed here.'),
          '#collapsible' => TRUE,
          '#collapsed' => FALSE,
        );
        $form['provider_list']['providers'] = array(
          '#type' => 'checkboxes',
          '#title' => t('Providers'),
          '#default_value' => empty($widget['providers']) ? array() : $widget['providers'],
          '#options' => $options,
        );
      }
      return $form;
    case 'validate':
      break;
    case 'save':
      if ($widget['widget_type'] == 'emfield_browser') {
        $columns = array(
          'providers',
        );
        return $columns;
      }
      break;
  }
}