function nodequeue_form_apachesolr_search_bias_form_alter in Nodequeue 6.2
Same name and namespace in other branches
- 7.3 nodequeue.module \nodequeue_form_apachesolr_search_bias_form_alter()
- 7.2 nodequeue.module \nodequeue_form_apachesolr_search_bias_form_alter()
Implementation of hook_form_FORM_ID_alter().
1 call to nodequeue_form_apachesolr_search_bias_form_alter()
File
- ./
nodequeue.module, line 374 - Maintains queues of nodes in arbitrary order.
Code
function nodequeue_form_apachesolr_search_bias_form_alter(&$form, $form_state) {
// setup for the form building
$weights = drupal_map_assoc(array(
'21.0',
'13.0',
'8.0',
'5.0',
'3.0',
'2.0',
'1.0',
'0.8',
'0.5',
'0.3',
'0.2',
'0.1',
));
$weights['0'] = t('Normal');
$queues = nodequeue_load_subqueues_by_queue(array_keys(nodequeue_get_all_qids()));
// build the form
$form['biasing']['nodequeue_boost'] = array(
'#type' => 'fieldset',
'#title' => t('Nodequeue Biasing'),
'#weight' => -5,
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
$form['biasing']['nodequeue_boost']['nodequeue_apachesolr_boost'] = array(
'#type' => 'item',
'#description' => t("Specify to bias the search result when a node is in a queue. Any value except <em>Normal</em> will increase the socre for the given queue in the search results"),
);
foreach ($queues as $sqid => $queue) {
$boost = variable_get("nodequeue_apachesolr_boost_{$sqid}", 0);
// add in setting for each queue
$form['biasing']['nodequeue_boost']['nodequeue_apachesolr_boost']["nodequeue_apachesolr_boost_{$sqid}"] = array(
'#type' => 'select',
'#title' => t('Weight for %title nodequeue', array(
'%title' => $queue->title,
)),
'#options' => $weights,
'#default_value' => $boost,
);
}
}