remote__data_widget.inc 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. class remote__data_widget extends WebServicesFieldWidget {
  3. // The default label for this field.
  4. public static $default_label = 'Remote Data';
  5. // The list of field types for which this formatter is appropriate.
  6. public static $field_types = ['remote__data'];
  7. /**
  8. * @see TripalFieldWidget::form()
  9. */
  10. public function form(&$widget, &$form, &$form_state, $langcode, $items, $delta, $element) {
  11. parent::form($widget, $form, $form_state, $langcode, $items, $delta, $element);
  12. }
  13. /**
  14. * Performs validation of the widgetForm.
  15. *
  16. * Use this validate to ensure that form values are entered correctly.
  17. * The 'value' key of this field must be set in the $form_state['values']
  18. * array anytime data is entered by the user. It may be the case that there
  19. * are other fields for helping select a value. In the end those helper
  20. * fields must be used to set the 'value' field.
  21. */
  22. public function validate($element, $form, &$form_state, $langcode, $delta) {
  23. //TODO validate the tokens, site, and query. Test that query returns data.
  24. }
  25. }