You are here

public static function NodeGallerySelectionHandler::settingsForm in Node Gallery 7

Override settings form().

Overrides EntityReference_SelectionHandler_Generic::settingsForm

File

plugins/entityreference/selection/NodeGallerySelectionHandler.class.php, line 23
Node Gallery EntityReference selection plugin.

Class

NodeGallerySelectionHandler
Node Gallery API selection handler.

Code

public static function settingsForm($field, $instance) {
  $form = parent::settingsForm($field, $instance);
  $entity_type = $field['settings']['target_type'];
  entity_get_info($entity_type);
  $relationship_types = node_gallery_api_get_relationship_type();
  $rt_options = array();
  foreach ($relationship_types as $rt) {
    $rt_options[$rt->id] = $rt->label;
  }
  $form['node_gallery_relationship_type'] = array(
    '#title' => t('Relationship Type'),
    '#type' => 'select',
    '#options' => $rt_options,
    '#default_value' => isset($field['settings']['handler_settings']['node_gallery_relationship_type']) ? $field['settings']['handler_settings']['node_gallery_relationship_type'] : NULL,
  );
  $form['target_bundles'] = array(
    '#type' => 'value',
    '#value' => array(),
  );
  return $form;
}