diff options
Diffstat (limited to 'includes/tablesort.inc')
-rw-r--r-- | includes/tablesort.inc | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/includes/tablesort.inc b/includes/tablesort.inc index 5b17f9c94..1a6c9f2f3 100644 --- a/includes/tablesort.inc +++ b/includes/tablesort.inc @@ -146,37 +146,6 @@ function tablesort_init($header) { } /** - * Create an SQL sort clause. - * - * This function produces the ORDER BY clause to insert in your SQL queries, - * assuring that the returned database table rows match the sort order chosen - * by the user. - * - * @param $header - * An array of column headers in the format described in theme_table(). - * @param $before - * An SQL string to insert after ORDER BY and before the table sorting code. - * Useful for sorting by important attributes like "sticky" first. - * @return - * An SQL string to append to the end of a query. - * - * @ingroup database - */ -function tablesort_sql($header, $before = '') { - $ts = tablesort_init($header); - if ($ts['sql']) { - // Based on code from db_escape_table(), but this can also contain a dot. - $field = preg_replace('/[^A-Za-z0-9_.]+/', '', $ts['sql']); - - // Sort order can only be ASC or DESC. - $sort = drupal_strtoupper($ts['sort']); - $sort = in_array($sort, array('ASC', 'DESC')) ? $sort : ''; - - return " ORDER BY $before $field $sort"; - } -} - -/** * Format a column header. * * If the cell in question is the column header for the current sort criterion, |