function views_ui::tablesort_link

1 call to views_ui::tablesort_link()
views_ui::list_render in plugins/export_ui/views_ui.class.php
Render all of the rows together.

File

plugins/export_ui/views_ui.class.php, line 346

Class

views_ui
CTools Export UI class handler for Views UI.

Code

public function tablesort_link($label, $field, $class) {
    $title = t('sort by @s', array(
        '@s' => $label,
    ));
    $initial = 'asc';
    if ($this->active == $field) {
        $initial = $this->order == 'asc' ? 'desc' : 'asc';
        $label .= theme('tablesort_indicator', array(
            'style' => $initial,
        ));
    }
    $query['order'] = $field;
    $query['sort'] = $initial;
    $link_options = array(
        'html' => TRUE,
        'attributes' => array(
            'title' => $title,
        ),
        'query' => $query,
    );
    $link = l($label, $_GET['q'], $link_options);
    if ($this->active == $field) {
        $class .= ' active';
    }
    return array(
        'data' => $link,
        'class' => $class,
    );
}