Browse Source

Forgot to add the sort handler

Stephen Ficklin 7 years ago
parent
commit
dffb2a2b0b
1 changed files with 21 additions and 0 deletions
  1. 21 0
      tripal/views_handlers/tripal_views_handler_sort.inc

+ 21 - 0
tripal/views_handlers/tripal_views_handler_sort.inc

@@ -0,0 +1,21 @@
+<?php
+
+
+/**
+ * Base sort handler that has no options and performs a simple sort.
+ *
+ * @ingroup views_sort_handlers
+ */
+class tripal_views_handler_sort extends views_handler_sort {
+
+  /**
+   * Called to add the sort to a query.
+   */
+  function query() {
+    $field_name = $this->real_field;
+    $this->ensure_my_table();
+    // Add the field.
+    $this->query->add_orderby($this->table_alias, $this->real_field, $this->options['order']);
+  }
+
+}