You are here

public static function EntityReference_SelectionHandler_Translation_Generic_node::settingsForm in Translated Entity Reference 7

Overrides EntityReference_SelectionHandler_Generic::settingsForm(). 0 = Makes the filtering configurable. Either show all nodes (filtered on interface language) or show only those nodes with the same language as the referencing (parent) node.

Overrides EntityReference_SelectionHandler_Generic::settingsForm

File

plugins/selection/EntityReference_SelectionHandler_Translation_Generic.class.php, line 67

Class

EntityReference_SelectionHandler_Translation_Generic_node
Override for the Node type.

Code

public static function settingsForm($field, $instance) {
  $form = parent::settingsForm($field, $instance);
  $form['filter']['language'] = array(
    '#type' => 'select',
    '#title' => t('Language handling'),
    '#options' => array(
      0 => t('Select all nodes matching with the interface language'),
      1 => t('Select only nodes matching the parent\'s language'),
    ),
    '#default_value' => isset($field['settings']['handler_settings']['filter']['language']) ? $field['settings']['handler_settings']['filter']['language'] : 0,
  );
  return $form;
}