public function views_plugin_style_table::build_sort in Views (for Drupal 7) 7.3
Same name and namespace in other branches
- 6.3 plugins/views_plugin_style_table.inc \views_plugin_style_table::build_sort()
- 6.2 plugins/views_plugin_style_table.inc \views_plugin_style_table::build_sort()
Determine if we should provide sorting based upon $_GET inputs
Return value
bool
Overrides views_plugin_style::build_sort
File
- plugins/
views_plugin_style_table.inc, line 52 - Definition of views_plugin_style_table.
Class
- views_plugin_style_table
- Style plugin to render each item as a row in a table.
Code
public function build_sort() {
if (!isset($_GET['order']) && ($this->options['default'] == -1 || empty($this->view->field[$this->options['default']]))) {
return TRUE;
}
// If a sort we don't know anything about gets through, exit gracefully.
if (isset($_GET['order']) && empty($this->view->field[$_GET['order']])) {
return TRUE;
}
// Let the builder know whether or not we're overriding the default sorts.
return empty($this->options['override']);
}