You are here

public function similar_handler_argument_nid::option_definition in Similar Entries 7.2

Same name and namespace in other branches
  1. 6.2 views/similar_handler_argument_nid.inc \similar_handler_argument_nid::option_definition()

Defines default values for argument settings.

Overrides views_handler_argument_numeric::option_definition

File

views/similar_handler_argument_nid.inc, line 16
Defines the Similar entries node ID argument.

Class

similar_handler_argument_nid
Defines the similar entries View node ID argument.

Code

public function option_definition() {
  $common_words = array(
    '-not',
    '-and',
    '-a',
    '-or',
    '-the',
    '-but',
    '-therefore',
    '-because',
    '-can\'t',
    '-can',
    '-for',
    '-until',
    '-the',
    '-of',
    '-and',
    '-to',
    '-in',
    '-is',
    '-you',
    '-that',
    '-it',
    '-he',
    '-was',
    '-on',
    '-are',
    '-as',
    '-with',
    '-his',
    '-they',
    '-I',
    '-at',
    '-be',
    '-this',
    '-have',
    '-from',
    '-one',
    '-had',
    '-by',
    '-word',
    '-but',
    '-not',
    '-what',
    '-all',
    '-were',
    '-we',
    '-when',
    '-your',
    '-said',
    '-there',
    '-use',
    '-an',
    '-each',
    '-which',
    '-she',
    '-do',
    '-how',
    '-their',
    '-if',
    '-will',
    '-up',
    '-other',
    '-about',
    '-out',
    '-many',
    '-then',
    '-them',
    '-these',
    '-so',
    '-some',
    '-her',
    '-would',
    '-make',
    '-like',
    '-him',
    '-into',
    '-time',
    '-has',
    '-look',
    '-two',
    '-more',
    '-write',
    '-go',
    '-see',
    '-no',
    '-way',
    '-could',
    '-people',
    '-my',
    '-than',
    '-first',
    '-water',
    '-been',
    '-call',
    '-who',
    '-oil',
    '-its',
    '-now',
    '-find',
  );
  $options = parent::option_definition();
  $options['default_action'] = array(
    'default' => 'default',
  );
  $options['default_argument_type'] = array(
    'default' => 'node',
  );
  $options['validate']['contains']['type'] = array(
    'default' => 'node',
  );
  $options['boolean_mode'] = array(
    'default' => 0,
  );
  $options['rendered_content'] = array(
    'default' => 0,
  );
  $options['rendered_view_mode'] = array(
    'default' => 'full',
  );
  $options['adjust_relevance'] = array(
    'default' => 1,
  );
  $options['title_relevance'] = array(
    'default' => 1.4,
  );
  $options['body_relevance'] = array(
    'default' => 0.8,
  );
  $options['source_relevance'] = array(
    'default' => 1,
  );
  $options['title_operator'] = array(
    'default' => 'increase',
  );
  $options['enable_custom_operators'] = array(
    'default' => 0,
  );
  $options['custom_operators'] = array(
    'default' => implode(' | ', $common_words),
  );

  // Notify Views of individual field weights.
  // Note: the Views cache may need to be reset when fields are added.
  if (module_exists('field')) {
    $options['include_fields'] = array(
      'default' => 0,
    );
    foreach (similar_get_indices() as $field => $info) {
      $options['included_fields:' . $field] = array(
        'default' => 1,
      );
    }
  }
  return $options;
}