summaryrefslogtreecommitdiff
path: root/lib/peoplesearchresults.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/peoplesearchresults.php')
-rw-r--r--lib/peoplesearchresults.php17
1 files changed, 11 insertions, 6 deletions
diff --git a/lib/peoplesearchresults.php b/lib/peoplesearchresults.php
index 9cd162baa..9f6696b5f 100644
--- a/lib/peoplesearchresults.php
+++ b/lib/peoplesearchresults.php
@@ -12,7 +12,7 @@
* @link http://laconi.ca/
*
* Laconica - a distributed open-source microblogging tool
- * Copyright (C) 2008, Controlez-Vous, Inc.
+ * Copyright (C) 2008, 2009, Control Yourself, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
@@ -56,20 +56,25 @@ class PeopleSearchResults extends ProfileList
function __construct($profile, $terms, $action)
{
- parent::__construct($profile, null, $action);
+ parent::__construct($profile, $action);
+
$this->terms = array_map('preg_quote',
array_map('htmlspecialchars', $terms));
+
$this->pattern = '/('.implode('|',$terms).')/i';
}
- function highlight($text)
+ function newProfileItem($profile)
{
- return preg_replace($this->pattern, '<strong>\\1</strong>', htmlspecialchars($text));
+ return new PeopleSearchResultItem($profile, $this->action);
}
+}
- function isReadOnly($args)
+class PeopleSearchResultItem extends ProfileListItem
+{
+ function highlight($text)
{
- return true;
+ return preg_replace($this->pattern, '<strong>\\1</strong>', htmlspecialchars($text));
}
}