search_api_sorts.theme.inc in Search API sorts 7
File
search_api_sorts.theme.inc
View source
<?php
function theme_search_api_sorts_list(array $variables) {
$items = array_map('render', $variables['items']);
$options = $variables['options'];
return $items ? theme('item_list', array(
'items' => $items,
) + $options) : '';
}
function theme_search_api_sorts_sort(array $variables) {
$name = $variables['name'];
$path = $variables['path'];
$options = $variables['options'] + array(
'attributes' => array(),
);
$options['attributes'] += array(
'class' => array(),
);
$order_options = $variables['order_options'] + array(
'query' => array(),
'attributes' => array(),
'html' => TRUE,
);
$order_options['attributes'] += array(
'class' => array(),
);
if ($variables['active']) {
$return_html = '<span class="search-api-sort-active">';
$return_html .= l(t(check_plain($name)) . theme('tablesort_indicator', array(
'style' => $order_options['query']['order'],
)), $path, $order_options);
$return_html .= '</span>';
}
else {
$return_html = l($name, $path, $options);
}
return $return_html;
}