• Main Page
  • Related Pages
  • Modules
  • Classes
  • Files
  • File List
  • File Members

modules/search/views_handler_sort_search_score.inc

00001 <?php
00002 
00008 class views_handler_sort_search_score extends views_handler_sort {
00009   function query() {
00010     // Check to see if the search filter/argument added 'score' to the table.
00011     // Our filter stores it as $handler->search_score -- and we also
00012     // need to check its relationship to make sure that we're using the same
00013     // one or obviously this won't work.
00014     foreach (array('filter', 'argument') as $type) {
00015       foreach ($this->view->{$type} as $handler) {
00016         if (isset($handler->search_score) && $handler->relationship == $this->relationship) {
00017           $this->query->add_orderby(NULL, NULL, $this->options['order'], $handler->search_score);
00018           $this->table_alias = $handler->table_alias;
00019           return;
00020         }
00021       }
00022     }
00023 
00024     // Do absolutely nothing if there is no filter/argument in place; there is no reason to
00025     // sort on the raw scores with this handler.
00026   }
00027 }

Generated on Sun Feb 26 2012 12:52:51 for Views by  doxygen 1.7.1