chado_linker__prop_adder.inc 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <?php
  2. class chado_linker__prop_adder extends TripalField {
  3. // --------------------------------------------------------------------------
  4. // EDITABLE STATIC CONSTANTS
  5. //
  6. // The following constants SHOULD be set for each descendent class. They are
  7. // used by the static functions to provide information to Drupal about
  8. // the field and it's default widget and formatter.
  9. // --------------------------------------------------------------------------
  10. // The term that this field maps to. The format for the term should be:
  11. // [vocab]:[accession] where [vocab] is the short name of the vocabulary
  12. // and [acession] is the unique accession number for the term. This term
  13. // must already exist in the vocabulary storage backend. This
  14. // value should never be changed once fields exist for this type.
  15. public static $term = 'local:property';
  16. // The default lable for this field.
  17. public static $label = 'Add a Property Type';
  18. // The default description for this field.
  19. public static $description = 'This record may have any number of properties. Use
  20. this field to first add the type.';
  21. // Provide a list of global settings. These can be accessed witihn the
  22. // globalSettingsForm. When the globalSettingsForm is submitted then
  23. // Drupal will automatically change these settings for all fields.
  24. public static $settings = array(
  25. 'chado_table' => '',
  26. 'chado_column' => '',
  27. 'base_table' => '',
  28. );
  29. // Provide a list of instance specific settings. These can be access within
  30. // the instanceSettingsForm. When the instanceSettingsForm is submitted
  31. // then Drupal with automatically change these settings for the instnace.
  32. // It is recommended to put settings at the instance level whenever possible.
  33. public static $instance_settings = array();
  34. // Set this to the name of the storage backend that by default will support
  35. // this field.
  36. public static $storage = 'tripal_no_storage';
  37. // The default widget for this field.
  38. public static $default_widget = 'chado_linker__prop_adder_widget';
  39. // The default formatter for this field.
  40. public static $default_formatter = 'chado_linker__prop_adder_formatter';
  41. // --------------------------------------------------------------------------
  42. // PROTECTED CLASS MEMBERS -- DO NOT OVERRIDE
  43. // --------------------------------------------------------------------------
  44. // An array containing details about the field. The format of this array
  45. // is the same as that returned by field_info_fields()
  46. protected $field;
  47. // An array containing details about an instance of the field. A field does
  48. // not have to have an instance. But if dealing with an instance (such as
  49. // when using the widgetForm, formatterSettingsForm, etc.) it should be set.
  50. protected $instance;
  51. /**
  52. *
  53. * @see TripalField::validate()
  54. */
  55. public function validate($entity_type, $entity, $field, $items, &$errors) {
  56. }
  57. /**
  58. *
  59. * @see TripalField::load()
  60. */
  61. public function load($entity, $details = array()) {
  62. }
  63. /**
  64. *
  65. * @see TripalField::settingsForm()
  66. */
  67. public function settingsForm($has_data) {
  68. }
  69. /**
  70. *
  71. * @param unknown $form
  72. * @param unknown $form_state
  73. */
  74. public function settingsFormValidate($form, &$form_state) {
  75. }
  76. /**
  77. *
  78. * @see TripalField::instanceSettingsForm()
  79. */
  80. public function instanceSettingsForm() {
  81. }
  82. /**
  83. *
  84. * @see TripalField::instanceSettingsFormValidate()
  85. */
  86. public function instanceSettingsFormValidate($form, &$form_state) {
  87. }
  88. }