function file_entity_search_admin in File Entity (fieldable files) 7.3
Same name and namespace in other branches
- 7.2 file_entity.module \file_entity_search_admin()
Implements hook_search_admin().
File
- ./
file_entity.module, line 565 - Extends Drupal file entities to be fieldable and viewable.
Code
function file_entity_search_admin() {
// Output form for defining rank factor weights.
$form['file_ranking'] = array(
'#type' => 'fieldset',
'#title' => t('File ranking'),
);
$form['file_ranking']['#theme'] = 'file_entity_search_admin';
$form['file_ranking']['info'] = array(
'#value' => '<em>' . t('The following numbers control which properties the file search should favor when ordering the results. Higher numbers mean more influence, zero means the property is ignored. Changing these numbers does not require the search index to be rebuilt. Changes take effect immediately.') . '</em>',
);
// Note: reversed to reflect that higher number = higher ranking.
$options = drupal_map_assoc(range(0, 10));
foreach (module_invoke_all('file_ranking') as $var => $values) {
$form['file_ranking']['factors']['file_entity_rank_' . $var] = array(
'#title' => $values['title'],
'#type' => 'select',
'#options' => $options,
'#default_value' => variable_get('file_entity_rank_' . $var, 0),
);
}
return $form;
}