public function OgVocabBehaviorHandler::settingsForm in OG Vocabulary 7
Generate a settings form for this handler.
Overrides EntityReference_BehaviorHandler_Abstract::settingsForm
File
- plugins/
behavior/ OgVocabBehaviorHandler.class.php, line 12
Class
- OgVocabBehaviorHandler
- OG vocab behavior handler.
Code
public function settingsForm($field, $instance) {
$form = parent::settingsForm($field, $instance);
$settings = !empty($field['settings']['handler_settings']['behaviors']['og_vocab']) ? $field['settings']['handler_settings']['behaviors']['og_vocab'] : array();
$settings += array(
'use_context' => 'yes',
);
$form['use_context'] = array(
'#type' => 'select',
'#title' => t('Use context'),
'#required' => TRUE,
'#options' => array(
'force' => t('Hide widget if no context found'),
'yes' => t('Use if possible'),
'no' => t('Do not use'),
),
'#description' => t('Should the OG vocabularies appear according to OG context. Depends on OG-context module.'),
'#default_value' => $settings['use_context'],
);
return $form;
}