You are here

function similarterms_handler_argument_node_nid::options_form in Similar By Terms 6.2

Same name and namespace in other branches
  1. 7.2 views/similarterms_handler_argument_node_nid.inc \similarterms_handler_argument_node_nid::options_form()

File

views/similarterms_handler_argument_node_nid.inc, line 37
Provide node nid argument handler.

Class

similarterms_handler_argument_node_nid
Argument handler to accept a node id. based on node_handler_argument_node_nid except that it doesn't add a where clause to the query

Code

function options_form(&$form, &$form_state) {
  parent::options_form($form, $form_state);
  unset($form['not']);
  $r = db_query('SELECT vid, name FROM {vocabulary} ORDER BY weight');
  while ($row = db_fetch_object($r)) {
    $vocabs[$row->vid] = $row->name;
  }
  $form['vocabularies'] = array(
    '#type' => 'checkboxes',
    '#title' => t('Limit similarity to terms within these vocabularies'),
    '#description' => t('Choosing any vocabularies here will limit the terms used to calculate similarity. It is usually best NOT to limit the terms, but in some cases this is necessary. Leave all checkboxes unselected to not limit terms.'),
    '#options' => $vocabs,
    '#default_value' => empty($this->options['vocabularies']) ? array() : $this->options['vocabularies'],
  );
  $form['include_args'] = array(
    '#type' => 'checkbox',
    '#title' => t('Include argument node(s) in results'),
    '#description' => t('If selected, the node(s) passed as the argument will be included in the view results.'),
    '#default_value' => !empty($this->options['include_args']),
  );
}