Révision 5d12d676
Ajouté par Assos Assos il y a environ 6 ans
drupal7/sites/all/modules/views/modules/search/views_handler_sort_search_score.inc | ||
---|---|---|
11 | 11 |
* @ingroup views_sort_handlers |
12 | 12 |
*/ |
13 | 13 |
class views_handler_sort_search_score extends views_handler_sort { |
14 |
function query() { |
|
14 |
|
|
15 |
/** |
|
16 |
* {@inheritdoc} |
|
17 |
*/ |
|
18 |
public function query() { |
|
15 | 19 |
// Check to see if the search filter/argument added 'score' to the table. |
16 |
// Our filter stores it as $handler->search_score -- and we also |
|
17 |
// need to check its relationship to make sure that we're using the same
|
|
18 |
// one or obviously this won't work.
|
|
20 |
// Our filter stores it as $handler->search_score -- and we also need to
|
|
21 |
// check its relationship to make sure that we're using the same one or
|
|
22 |
// obviously this won't work. |
|
19 | 23 |
foreach (array('filter', 'argument') as $type) { |
20 | 24 |
foreach ($this->view->{$type} as $handler) { |
21 | 25 |
if (isset($handler->search_score) && $handler->relationship == $this->relationship) { |
... | ... | |
26 | 30 |
} |
27 | 31 |
} |
28 | 32 |
|
29 |
// Do absolutely nothing if there is no filter/argument in place; there is no reason to
|
|
30 |
// sort on the raw scores with this handler. |
|
33 |
// Do absolutely nothing if there is no filter/argument in place; there is |
|
34 |
// no reason to sort on the raw scores with this handler.
|
|
31 | 35 |
} |
36 |
|
|
32 | 37 |
} |
Formats disponibles : Unified diff
Weekly update of contrib modules