- #49405: Minor advanced search UI/code tweaks
parent
dd549cd2d6
commit
fe77e77431
|
@ -434,11 +434,12 @@ img.screenshot {
|
||||||
.search-results .search-info {
|
.search-results .search-info {
|
||||||
font-size: 0.85em;
|
font-size: 0.85em;
|
||||||
}
|
}
|
||||||
.search-advanced .criterium {
|
.search-advanced .criterion {
|
||||||
float: left;
|
float: left;
|
||||||
margin-right: 2em;
|
margin-right: 2em;
|
||||||
}
|
}
|
||||||
.search-advanced .action {
|
.search-advanced .action {
|
||||||
|
float: left;
|
||||||
clear: left;
|
clear: left;
|
||||||
}
|
}
|
||||||
#tracker td.replies {
|
#tracker td.replies {
|
||||||
|
|
|
@ -736,22 +736,64 @@ function node_search($op = 'search', $keys = null) {
|
||||||
$form = array();
|
$form = array();
|
||||||
|
|
||||||
// Keyword boxes
|
// Keyword boxes
|
||||||
$form['advanced'] = array('#type' => 'fieldset', '#title' => t('Advanced search'), '#collapsible' => TRUE, '#collapsed' => TRUE, '#attributes' => array('class' => 'search-advanced'));
|
$form['advanced'] = array(
|
||||||
|
'#type' => 'fieldset',
|
||||||
$form['advanced']['keywords'] = array('#type' => 'markup', '#prefix' => '<div class="criterium">', '#suffix' => '</div>');
|
'#title' => t('Advanced search'),
|
||||||
$form['advanced']['keywords']['or'] = array('#type' => 'textfield', '#title' => t('Containing any of the words'), '#size' => 30, '#maxlength' => 255);
|
'#collapsible' => TRUE,
|
||||||
$form['advanced']['keywords']['phrase'] = array('#type' => 'textfield', '#title' => t('Containing the phrase'), '#size' => 30, '#maxlength' => 255);
|
'#collapsed' => TRUE,
|
||||||
$form['advanced']['keywords']['negative'] = array('#type' => 'textfield', '#title' => t('Containing none of the words'), '#size' => 30, '#maxlength' => 255);
|
'#attributes' => array('class' => 'search-advanced'),
|
||||||
|
);
|
||||||
|
$form['advanced']['keywords'] = array(
|
||||||
|
'#prefix' => '<div class="criterion">',
|
||||||
|
'#suffix' => '</div>',
|
||||||
|
);
|
||||||
|
$form['advanced']['keywords']['or'] = array(
|
||||||
|
'#type' => 'textfield',
|
||||||
|
'#title' => t('Containing any of the words'),
|
||||||
|
'#size' => 30,
|
||||||
|
'#maxlength' => 255,
|
||||||
|
);
|
||||||
|
$form['advanced']['keywords']['phrase'] = array(
|
||||||
|
'#type' => 'textfield',
|
||||||
|
'#title' => t('Containing the phrase'),
|
||||||
|
'#size' => 30,
|
||||||
|
'#maxlength' => 255,
|
||||||
|
);
|
||||||
|
$form['advanced']['keywords']['negative'] = array(
|
||||||
|
'#type' => 'textfield',
|
||||||
|
'#title' => t('Containing none of the words'),
|
||||||
|
'#size' => 30,
|
||||||
|
'#maxlength' => 255,
|
||||||
|
);
|
||||||
|
|
||||||
// Taxonomy box
|
// Taxonomy box
|
||||||
if ($taxonomy = module_invoke('taxonomy', 'form_all', 1)) {
|
if ($taxonomy = module_invoke('taxonomy', 'form_all', 1)) {
|
||||||
$form['advanced']['category'] = array('#type' => 'select', '#title' => t('Only in the category'), '#prefix' => '<div class="criterium">', '#suffix' => '</div>', '#options' => $taxonomy, '#extra' => 'size="10"', '#multiple' => true);
|
$form['advanced']['category'] = array(
|
||||||
|
'#type' => 'select',
|
||||||
|
'#title' => t('Only in the category(s)'),
|
||||||
|
'#prefix' => '<div class="criterion">',
|
||||||
|
'#size' => 10,
|
||||||
|
'#suffix' => '</div>',
|
||||||
|
'#options' => $taxonomy,
|
||||||
|
'#multiple' => TRUE,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Node types
|
// Node types
|
||||||
$types = node_get_types();
|
$types = node_get_types();
|
||||||
$form['advanced']['type'] = array('#type' => 'checkboxes', '#title' => t('Only of the type'), '#prefix' => '<div class="criterium">', '#suffix' => '</div>', '#options' => $types);
|
$form['advanced']['type'] = array(
|
||||||
$form['advanced']['submit'] = array('#type' => 'submit', '#value' => t('Advanced Search'), '#prefix' => '<div class="action">', '#suffix' => '</div>');
|
'#type' => 'checkboxes',
|
||||||
|
'#title' => t('Only of the type(s)'),
|
||||||
|
'#prefix' => '<div class="criterion">',
|
||||||
|
'#suffix' => '</div>',
|
||||||
|
'#options' => $types,
|
||||||
|
);
|
||||||
|
$form['advanced']['submit'] = array(
|
||||||
|
'#type' => 'submit',
|
||||||
|
'#value' => t('Advanced search'),
|
||||||
|
'#prefix' => '<div class="action">',
|
||||||
|
'#suffix' => '</div><br clear="all" />',
|
||||||
|
);
|
||||||
return $form;
|
return $form;
|
||||||
|
|
||||||
case 'post':
|
case 'post':
|
||||||
|
|
|
@ -736,22 +736,64 @@ function node_search($op = 'search', $keys = null) {
|
||||||
$form = array();
|
$form = array();
|
||||||
|
|
||||||
// Keyword boxes
|
// Keyword boxes
|
||||||
$form['advanced'] = array('#type' => 'fieldset', '#title' => t('Advanced search'), '#collapsible' => TRUE, '#collapsed' => TRUE, '#attributes' => array('class' => 'search-advanced'));
|
$form['advanced'] = array(
|
||||||
|
'#type' => 'fieldset',
|
||||||
$form['advanced']['keywords'] = array('#type' => 'markup', '#prefix' => '<div class="criterium">', '#suffix' => '</div>');
|
'#title' => t('Advanced search'),
|
||||||
$form['advanced']['keywords']['or'] = array('#type' => 'textfield', '#title' => t('Containing any of the words'), '#size' => 30, '#maxlength' => 255);
|
'#collapsible' => TRUE,
|
||||||
$form['advanced']['keywords']['phrase'] = array('#type' => 'textfield', '#title' => t('Containing the phrase'), '#size' => 30, '#maxlength' => 255);
|
'#collapsed' => TRUE,
|
||||||
$form['advanced']['keywords']['negative'] = array('#type' => 'textfield', '#title' => t('Containing none of the words'), '#size' => 30, '#maxlength' => 255);
|
'#attributes' => array('class' => 'search-advanced'),
|
||||||
|
);
|
||||||
|
$form['advanced']['keywords'] = array(
|
||||||
|
'#prefix' => '<div class="criterion">',
|
||||||
|
'#suffix' => '</div>',
|
||||||
|
);
|
||||||
|
$form['advanced']['keywords']['or'] = array(
|
||||||
|
'#type' => 'textfield',
|
||||||
|
'#title' => t('Containing any of the words'),
|
||||||
|
'#size' => 30,
|
||||||
|
'#maxlength' => 255,
|
||||||
|
);
|
||||||
|
$form['advanced']['keywords']['phrase'] = array(
|
||||||
|
'#type' => 'textfield',
|
||||||
|
'#title' => t('Containing the phrase'),
|
||||||
|
'#size' => 30,
|
||||||
|
'#maxlength' => 255,
|
||||||
|
);
|
||||||
|
$form['advanced']['keywords']['negative'] = array(
|
||||||
|
'#type' => 'textfield',
|
||||||
|
'#title' => t('Containing none of the words'),
|
||||||
|
'#size' => 30,
|
||||||
|
'#maxlength' => 255,
|
||||||
|
);
|
||||||
|
|
||||||
// Taxonomy box
|
// Taxonomy box
|
||||||
if ($taxonomy = module_invoke('taxonomy', 'form_all', 1)) {
|
if ($taxonomy = module_invoke('taxonomy', 'form_all', 1)) {
|
||||||
$form['advanced']['category'] = array('#type' => 'select', '#title' => t('Only in the category'), '#prefix' => '<div class="criterium">', '#suffix' => '</div>', '#options' => $taxonomy, '#extra' => 'size="10"', '#multiple' => true);
|
$form['advanced']['category'] = array(
|
||||||
|
'#type' => 'select',
|
||||||
|
'#title' => t('Only in the category(s)'),
|
||||||
|
'#prefix' => '<div class="criterion">',
|
||||||
|
'#size' => 10,
|
||||||
|
'#suffix' => '</div>',
|
||||||
|
'#options' => $taxonomy,
|
||||||
|
'#multiple' => TRUE,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Node types
|
// Node types
|
||||||
$types = node_get_types();
|
$types = node_get_types();
|
||||||
$form['advanced']['type'] = array('#type' => 'checkboxes', '#title' => t('Only of the type'), '#prefix' => '<div class="criterium">', '#suffix' => '</div>', '#options' => $types);
|
$form['advanced']['type'] = array(
|
||||||
$form['advanced']['submit'] = array('#type' => 'submit', '#value' => t('Advanced Search'), '#prefix' => '<div class="action">', '#suffix' => '</div>');
|
'#type' => 'checkboxes',
|
||||||
|
'#title' => t('Only of the type(s)'),
|
||||||
|
'#prefix' => '<div class="criterion">',
|
||||||
|
'#suffix' => '</div>',
|
||||||
|
'#options' => $types,
|
||||||
|
);
|
||||||
|
$form['advanced']['submit'] = array(
|
||||||
|
'#type' => 'submit',
|
||||||
|
'#value' => t('Advanced search'),
|
||||||
|
'#prefix' => '<div class="action">',
|
||||||
|
'#suffix' => '</div><br clear="all" />',
|
||||||
|
);
|
||||||
return $form;
|
return $form;
|
||||||
|
|
||||||
case 'post':
|
case 'post':
|
||||||
|
|
Loading…
Reference in New Issue