summaryrefslogtreecommitdiff
path: root/demos/quickstart/protected/pages/Search.php
diff options
context:
space:
mode:
authorxue <>2006-08-05 21:34:30 +0000
committerxue <>2006-08-05 21:34:30 +0000
commitb7f95ce37ae577e95a81e64aa2aaf3e2e698109d (patch)
tree85c6b9961ebbd4c9283fbd9b841703f9e4c47307 /demos/quickstart/protected/pages/Search.php
parent550ba06593b467b643862d41a00ca2dd12ee704b (diff)
merge from 3.0 branch till 1329.
Diffstat (limited to 'demos/quickstart/protected/pages/Search.php')
-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;
}