summaryrefslogtreecommitdiff
path: root/demos
diff options
context:
space:
mode:
authorxue <>2006-08-04 15:40:44 +0000
committerxue <>2006-08-04 15:40:44 +0000
commita9bdf9fde29c5bf71d3a402fc15806ca8923aea8 (patch)
tree27dceeb5fbf0c2264c579b3b0089dd285fc0da56 /demos
parentdc76ce6c04347a42bdd03b2c6060395d071ddb0e (diff)
Fixed #320.
Diffstat (limited to 'demos')
-rw-r--r--demos/quickstart/protected/pages/Search.php10
1 files changed, 5 insertions, 5 deletions
diff --git a/demos/quickstart/protected/pages/Search.php b/demos/quickstart/protected/pages/Search.php
index f1d07ffa..d2dfa7da 100644
--- a/demos/quickstart/protected/pages/Search.php
+++ b/demos/quickstart/protected/pages/Search.php
@@ -13,11 +13,11 @@ class Search extends TPage
$hits_1 = $quickstart->find($text);
$this->quickstart_results->setDataSource($hits_1);
$this->quickstart_results->dataBind();
-
+
$this->emptyResult->setVisible(!count($hits_1));
}
}
-
+
public function highlightSearch($text)
{
$words = str_word_count($text, 1);
@@ -33,7 +33,7 @@ class Search extends TPage
break;
}
}
-
+
$min = $where - 15 < 0 ? 0 : $where - 15;
$max = $where + 15 > $t ? $t : $where + 15;
$subtext = array_splice($words, $min, $max-$min);
@@ -41,13 +41,13 @@ class Search extends TPage
$suffix = $max == $t ? '' : '...';
return $prefix.implode(' ', $subtext).$suffix;
}
-
+
protected function containsKeys($word, $keys)
{
foreach($keys as $key)
{
if(is_int(strpos($word, $key)))
- return true;
+ return true;
}
return false;
}