public function FacetapiDependencyBundle::settingsForm in Facet API 6.3
Same name and namespace in other branches
- 7.2 plugins/facetapi/dependency_bundle.inc \FacetapiDependencyBundle::settingsForm()
- 7 plugins/facetapi/dependency_bundle.inc \FacetapiDependencyBundle::settingsForm()
Adds dependency settings to the form.
Overrides FacetapiDependency::settingsForm
File
- plugins/
facetapi/ dependency_bundle.inc, line 74 - Performs a dependency check against the passed bundle.
Class
- FacetapiDependencyBundle
- Adds a dependency on bundle.
Code
public function settingsForm(&$form, &$form_state) {
// Builds array of options.
$options = array();
$options['none'] = t('No dependencies.');
if ($this->facet['field api name']) {
$options['referenced'] = t('A bundle this field is attached to must be active.');
}
$options['selected'] = t('At least one of the selected bundles must be active.');
$form[$this->id]['bundle'] = array(
'#title' => t('Dependency settings'),
'#type' => 'radios',
'#options' => $options,
'#default_value' => $this->settings['bundle'],
);
$form[$this->id]['bundle_selected'] = array(
'#title' => t('Required bundles'),
'#type' => 'checkboxes',
'#options' => $this
->getBundleOptions($form['#facetapi']['adapter']
->getTypes()),
'#default_value' => $this->settings['bundle_selected'],
'#states' => array(
'visible' => array(
'input[name="bundle"]' => array(
'value' => 'selected',
),
),
),
'#description' => t('At least one of the selected bundles must be active for this facet to be rendered.'),
);
}