Commit 066e8f32 authored by Nigel McNie's avatar Nigel McNie Committed by Nigel McNie

A few fixes:

* Use a TH for the header row of the search table
* E-mail addresses are strings, not an array of them. Fix the special case
  code that thought they were
* If the user uses the search box in the top right, put the value in the
  search box on the results page
parent c7c9dc70
......@@ -62,7 +62,7 @@ results.updatecallback = function (d) {
results.linkspan = {$ncols};
if (!$('userfields')) {
appendChildNodes(results.thead, TR({'id':'userfields'},
map(partial(TD, null), userfieldstrings)));
map(partial(TH, null), userfieldstrings)));
}
}
else {
......@@ -82,12 +82,7 @@ results.rowfunction = function(r,n,d) {
var row = TR({'class':'r'+(n%2)},TD(null,A({'href':'user/view.php?id=' + r.id},r.name)));
for (var i = 0; i < userfields.length; i++) {
if (r[userfields[i]]) {
if (userfields[i] == 'email') {
appendChildNodes(row, TD(null, map(partial(DIV,null), r[userfields[i]])));
}
else {
appendChildNodes(row, TD(null, r[userfields[i]]));
}
appendChildNodes(row, TD(null, r[userfields[i]]));
}
else {
appendChildNodes(row, TD(null));
......@@ -106,12 +101,14 @@ function doSearch() {
EOF;
$smarty = smarty(array('tablerenderer'));
if (isset($_REQUEST['query'])) {
$javascript .= ' results.query = ' . json_encode($query) . ";\n";
$javascript .= " results.updateOnLoad();\n";
$smarty->assign('search_query_value', $query);
}
$smarty = smarty(array('tablerenderer'));
$smarty->assign('INLINEJAVASCRIPT', $javascript);
$smarty->display('search.tpl');
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment