public function Translation::buildOptionsForm in Views (for Drupal 7) 8.3
Add a translation selector.
Overrides RelationshipPluginBase::buildOptionsForm
File
- lib/
Views/ translation/ Plugin/ views/ relationship/ Translation.php, line 36 - Definition of Views\translation\Plugin\views\relationship\Translation.
Class
- Translation
- Handles relationships for content translation sets and provides multiple options.
Namespace
Views\translation\Plugin\views\relationshipCode
public function buildOptionsForm(&$form, &$form_state) {
parent::buildOptionsForm($form, $form_state);
$options = array(
'all' => t('All'),
'current' => t('Current language'),
'default' => t('Default language'),
);
$options = array_merge($options, views_language_list());
$form['language'] = array(
'#type' => 'select',
'#options' => $options,
'#default_value' => $this->options['language'],
'#title' => t('Translation option'),
'#description' => t('The translation options allows you to select which translation or translations in a translation set join on. Select "Current language" or "Default language" to join on the translation in the current or default language respectively. Select a specific language to join on a translation in that language. If you select "All", each translation will create a new row, which may appear to cause duplicates.'),
);
}