private function _getUnsortedSqlAndSortByKeyDropDown($analyzed_sql_results, $sort_expression)
{
$drop_down_html = '';
$unsorted_sql_query = Query::replaceClause($analyzed_sql_results['statement'], $analyzed_sql_results['parser']->list, 'ORDER BY', '');
// Data is sorted by indexes only if it there is only one table.
if ($this->_isSelect($analyzed_sql_results)) {
// grab indexes data:
$indexes = Index::getFromTable($this->__get('table'), $this->__get('db'));
// do we have any index?
if (!empty($indexes)) {
$drop_down_html = $this->_getSortByKeyDropDown($indexes, $sort_expression, $unsorted_sql_query);
}
}
return array($unsorted_sql_query, $drop_down_html);
}