You are here

function UIkitViewsPluginStyleTable::build_sort in UIkit Components 7.2

Same name and namespace in other branches
  1. 7.3 uikit_views/plugins/UIkitViewsPluginStyleTable.inc \UIkitViewsPluginStyleTable::build_sort()

Determine if we should provide sorting based upon $_GET inputs

Return value

bool

Overrides views_plugin_style::build_sort

File

uikit_views/plugins/UIkitViewsPluginStyleTable.inc, line 57
Contains the table style plugin.

Class

UIkitViewsPluginStyleTable
Style plugin to render each item as a row in a UIkit table.

Code

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']);
}