You are here

function filefield_widget_settings in FileField 5

Same name and namespace in other branches
  1. 5.2 filefield.module \filefield_widget_settings()
  2. 6.3 filefield.module \filefield_widget_settings()
  3. 6.2 filefield.module \filefield_widget_settings()

Implementation of hook_widget_settings().

File

./filefield.module, line 205
Defines a file field type.

Code

function filefield_widget_settings($op, $widget) {
  switch ($op) {
    case 'form':
      $form = array();
      $form['file_extensions'] = array(
        '#type' => 'textfield',
        '#title' => t('Permitted upload file extensions.'),
        '#default_value' => $widget['file_extensions'] ? $widget['file_extensions'] : 'txt',
        '#size' => 64,
        '#maxlength' => 64,
        '#description' => t('Extensions a user can upload to this field. Seperate extensions with a space and do not include the leading dot.'),
      );
      return $form;
    case 'validate':
      break;
    case 'save':
      return array(
        'file_extensions',
      );
  }
}