minor gui fix to support apostroph in the query

This commit is contained in:
SJ 2013-04-25 21:39:02 +02:00
parent a132c85be8
commit 8e27aea28d
4 changed files with 7 additions and 3 deletions

View File

@ -794,6 +794,7 @@ class ModelSearchSearch extends Model {
if($s == '') { return $s; }
$s = preg_replace("/\'/", ' ', $s);
$s = preg_replace("/\./", ' ', $s);
return $s;
}

View File

@ -448,11 +448,14 @@ var Piler =
{
Piler.log("[load_search_results_for_saved_query]", terms);
terms = decodeURIComponent(terms);
var pairs = terms.split('&');
$.each(pairs, function(i, v){
var pair = v.split('=');
if(pair[0] == 'search') {
$("input#_search").val(pair[1]);
var search = decodeURIComponent(pair[1]);
$("input#_search").val(search.replace(/\+/g, " "));
}
});

View File

@ -10,7 +10,7 @@
if(isset($s['search'])) {
?>
<tr>
<td><a href="#" onclick="Piler.load_search_results_for_saved_query('<?php print urldecode($term['term']); ?>');"><?php print $s['search']; ?></a></td>
<td><a href="#" onclick="Piler.load_search_results_for_saved_query('<?php print urlencode($term['term']); ?>');"><?php print $s['search']; ?></a></td>
<td>&nbsp;</td>
</tr>
<?php } } ?>

View File

@ -18,7 +18,7 @@
if(isset($s['search']) && $s['search']) {
?>
<div class="resultrow center">
<a href="#" onclick="Piler.load_search_results_for_saved_query('<?php print urldecode($term['term']); ?>');"><?php print $s['search']; ?></a></br />
<a href="#" onclick="Piler.load_search_results_for_saved_query('<?php print urlencode($term['term']); ?>');"><?php print $s['search']; ?></a></br />
</div>
<?php } } ?>