function get_tripal_pub_admin_form_select_search_list
1.x tripal_pub.admin.inc | get_tripal_pub_admin_form_select_search_list(&$form) |
1 call to get_tripal_pub_admin_form_select_search_list()
- tripal_pub_admin in tripal_pub/
includes/ tripal_pub.admin.inc - Administrative settings form
File
- tripal_pub/
includes/ tripal_pub.admin.inc, line 139
Code
function get_tripal_pub_admin_form_select_search_list(&$form) {
$form['searching'] = array(
'#type' => 'fieldset',
'#title' => t('Searching Options')
);
// get publication properties list
$properties = array();
$properties[] = 'Any Field';
$sql = "
SELECT DISTINCT CVTS.cvterm_id, CVTS.name, CVTS.definition
FROM {cvtermpath} CVTP
INNER JOIN {cvterm} CVTS ON CVTP.subject_id = CVTS.cvterm_id
INNER JOIN {cvterm} CVTO ON CVTP.object_id = CVTO.cvterm_id
INNER JOIN {cv} ON CVTO.cv_id = CV.cv_id
WHERE CV.name = 'tripal_pub' and
(CVTO.name = 'Publication Details' or CVTS.name = 'Publication Type') and
NOT CVTS.is_obsolete = 1
ORDER BY CVTS.name ASC
";
$prop_types = chado_query($sql);
while ($prop = db_fetch_object($prop_types)) {
$properties[$prop->cvterm_id] = $prop->name;
}
$form['searching']['allowed_search_fields'] = array(
'#type' => 'checkboxes',
'#options' => $properties,
'#description' => t("Please select the publication details that users can search by in the publication search form. If none are selected then all fields will be available to the user."),
'#prefix' => '<div style="scroll: auto; border:1px solid #CCCCCC;">',
'#suffix' => '</div>',
'#default_value' => variable_get('tripal_pub_allowed_search_fields', array()),
);
}