You are here

function farm_asset_plugin_argument_validate_farm_asset::options_form in farmOS 7

Provide the default form for setting options.

Overrides views_plugin_argument_validate::options_form

File

modules/farm/farm_asset/includes/views/plugins/farm_asset_plugin_argument_validate_farm_asset.inc, line 18
Contains the 'farm asset' argument validator plugin.

Class

farm_asset_plugin_argument_validate_farm_asset
Validate whether an argument is an acceptable farm_asset entity.

Code

function options_form(&$form, &$form_state) {
  $types = farm_asset_types();
  $options = array();
  foreach ($types as $type => $definition) {
    $options[$type] = check_plain($definition->label);
  }
  $form['types'] = array(
    '#type' => 'checkboxes',
    '#title' => t('Asset types'),
    '#options' => $options,
    '#default_value' => $this->options['types'],
    '#description' => t('If you wish to validate for specific asset types, check them; if none are checked, all assets will pass.'),
  );
}