Index: trunk/extensions/SphinxSearch/SphinxMWSearch.php |
— | — | @@ -155,6 +155,18 @@ |
156 | 156 | return $cl; |
157 | 157 | } |
158 | 158 | |
| 159 | + /** |
| 160 | + * Find snippet highlight settings for a given user |
| 161 | + * |
| 162 | + * @param $user User |
| 163 | + * @return Array contextlines, contextchars |
| 164 | + */ |
| 165 | + public static function userHighlightPrefs( &$user ) { |
| 166 | + $contextlines = $user->getOption( 'contextlines', 2 ); |
| 167 | + $contextchars = $user->getOption( 'contextchars', 75 ); |
| 168 | + return array( $contextlines, $contextchars ); |
| 169 | + } |
| 170 | + |
159 | 171 | } |
160 | 172 | |
161 | 173 | class SphinxMWSearchResultSet extends SearchResultSet { |
— | — | @@ -410,8 +422,7 @@ |
411 | 423 | |
412 | 424 | $this->initText(); |
413 | 425 | |
414 | | - list( $contextlines, $contextchars ) = SearchEngine::userHighlightPrefs( $wgUser ); |
415 | | - |
| 426 | + list( $contextlines, $contextchars ) = SphinxMWSearch::userHighlightPrefs( $wgUser ); |
416 | 427 | $excerpts_opt = array( |
417 | 428 | "before_match" => "<span class='searchmatch'>", |
418 | 429 | "after_match" => "</span>", |