You are here

function linkimagefield_widget_settings_validate in Link Image Field 6

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

Parameters

array $widget:

1 call to linkimagefield_widget_settings_validate()
linkimagefield_widget_settings in ./linkimagefield.module
Implementation of CCK's hook_widget_settings().

File

./linkimagefield_widget.inc, line 45
linkimagefield widget code @author John Young <john@codeandcreative.com>

Code

function linkimagefield_widget_settings_validate($widget) {
  module_invoke('imagefield', 'widget_settings', 'validate', $widget);

  // Check the URL
  if (!empty($widget['url'])) {
    if (!valid_url($widget['url'])) {
      form_set_error('url', t('Please provide a valid url.'));
      return;
    }
    $widget['url'] = check_url($widget['url']);
  }
}