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

modules/comment/views_handler_sort_comment_thread.inc

00001 <?php
00005 class views_handler_sort_comment_thread extends views_handler_sort {
00006   function query() {
00007     $this->ensure_my_table();
00008 
00009     //Read comment_render() in comment.module for an explanation of the
00010     //thinking behind this sort.
00011     if ($this->options['order'] == 'DESC') {
00012       $this->query->add_orderby($this->table_alias, $this->real_field, $this->options['order']);
00013     }
00014     else {
00015       $alias = $this->table_alias . '_' . $this->real_field . 'asc';
00016       //@todo is this secure?
00017       $this->query->add_orderby(NULL, "SUBSTRING({$this->table_alias}.{$this->real_field}, 1, (LENGTH({$this->table_alias}.{$this->real_field}) - 1))", $this->options['order'], $alias);
00018     }
00019   }
00020 }

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