You are here

function videoftp_widget_settings_validate in Video 6.5

Same name and namespace in other branches
  1. 6.4 types/videoftp/videoftp_widget.inc \videoftp_widget_settings_validate()

Implementation of CCK's hook_widget_settings($op = 'validate').

@todo Integrate this into a universal function to share with uploadfield_widget

1 call to videoftp_widget_settings_validate()
videoftp_widget_settings in types/videoftp/videoftp.module
Implementation of CCK's hook_widget_settings().

File

types/videoftp/videoftp_widget.inc, line 55
videoftp widget hooks and callbacks.

Code

function videoftp_widget_settings_validate($widget) {

  // Check that only web images are specified in the callback.
  if (!video_web_extensions($widget['file_extensions'])) {
    form_set_error('file_extensions', t('Only web-standard videos are supported through the videoftp widget. If needing to upload other types of files, change the widget to use a standard file upload.'));
  }

  // Check for our ftp filepath and try to create it, if not it will throw an error.
  $ftp_path = file_directory_path() . '/' . $widget['ftp_path'];
  file_check_directory($ftp_path, TRUE, 'ftp_path');
}