public function similar_handler_argument_nid::option_definition in Similar Entries 6.2
Same name and namespace in other branches
- 7.2 views/similar_handler_argument_nid.inc \similar_handler_argument_nid::option_definition()
Defines default values for argument settings.
File
- views/
similar_handler_argument_nid.inc, line 29 - 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_type'] = array(
'default' => 'node',
);
$options['similar']['boolean_mode'] = array(
'default' => 0,
);
$options['similar']['adjust_relevance'] = array(
'default' => 1,
);
$options['similar']['relevance']['title_relevance'] = array(
'default' => 1.4,
);
$options['similar']['relevance']['body_relevance'] = array(
'default' => 0.8,
);
$options['similar']['boolean_options']['title_operator'] = array(
'default' => 'increase',
);
$options['similar']['boolean_options']['enable_custom_operators'] = array(
'default' => 0,
);
$options['similar']['boolean_options']['operators_fieldset']['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('content')) {
$options['similar']['include_fields'] = array(
'default' => 0,
);
foreach (self::get_field_options() as $table => $field) {
$options['similar']['cck_fields']['included_fields:' . $table] = array(
'default' => 1,
);
}
}
return $options;
}