mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-12 20:51:30 +00:00
add selection of sort field to form
This commit is contained in:
parent
a0566372f7
commit
3d3bee169f
|
@ -234,6 +234,24 @@ function typeahead() { /* {{{ */
|
|||
)
|
||||
);
|
||||
$options = array();
|
||||
$options[] = array('', getMLText('orderby_unsorted'));
|
||||
$options[] = array('dd', getMLText('orderby_date_desc'), 'dd'==$orderby);
|
||||
$options[] = array('d', getMLText('orderby_date_asc'), 'd'==$orderby);
|
||||
$options[] = array('nd', getMLText('orderby_name_desc'), 'nd'==$orderby);
|
||||
$options[] = array('n', getMLText('orderby_name_asc'), 'n'==$orderby);
|
||||
$options[] = array('id', getMLText('orderby_id_desc'), 'id'==$orderby);
|
||||
$options[] = array('i', getMLText('orderby_id_asc'), 'i'==$orderby);
|
||||
$this->formField(
|
||||
getMLText("orderby"),
|
||||
array(
|
||||
'element'=>'select',
|
||||
'name'=>'orderby',
|
||||
'class'=>'chzn-select',
|
||||
'multiple'=>false,
|
||||
'options'=>$options
|
||||
)
|
||||
);
|
||||
$options = array();
|
||||
foreach ($allUsers as $currUser) {
|
||||
if($user->isAdmin() || (!$currUser->isGuest() && (!$currUser->isHidden() || $currUser->getID() == $user->getID())))
|
||||
$options[] = array($currUser->getID(), htmlspecialchars($currUser->getLogin()), in_array($currUser->getID(), $owner), array(array('data-subtitle', htmlspecialchars($currUser->getFullName()))));
|
||||
|
@ -552,14 +570,14 @@ foreach($facets as $facetname=>$values) {
|
|||
echo $txt;
|
||||
else {
|
||||
parse_str($_SERVER['QUERY_STRING'], $tmp);
|
||||
$tmp['orderby'] = $orderby=="n"||$orderby=="na)"?"nd":"n";
|
||||
$tmp['orderby'] = ($orderby=="n"||$orderby=="na") ? "nd" : "n";
|
||||
print "<table class=\"table table-condensed table-sm table-hover\">";
|
||||
print "<thead>\n<tr>\n";
|
||||
print "<th></th>\n";
|
||||
print "<th>".getMLText("name");
|
||||
if(!$fullsearch) {
|
||||
print " <a href=\"../out/out.Search.php?".http_build_query($tmp)."\" title=\"".getMLText("sort_by_name")."\">".($orderby=="n"||$orderby=="na"?' <i class="fa fa-sort-alpha-asc selected"></i>':($orderby=="nd"?' <i class="fa fa-sort-alpha-desc selected"></i>':' <i class="fa fa-sort-alpha-asc"></i>'))."</a>";
|
||||
$tmp['orderby'] = $orderby=="d"||$orderby=="da)"?"dd":"d";
|
||||
print $orderby." <a href=\"../out/out.Search.php?".http_build_query($tmp)."\" title=\"".getMLText("sort_by_name")."\">".($orderby=="n"||$orderby=="na"?' <i class="fa fa-sort-alpha-asc selected"></i>':($orderby=="nd"?' <i class="fa fa-sort-alpha-desc selected"></i>':' <i class="fa fa-sort-alpha-asc"></i>'))."</a>";
|
||||
$tmp['orderby'] = ($orderby=="d"||$orderby=="da") ? "dd" : "d";
|
||||
print " <a href=\"../out/out.Search.php?".http_build_query($tmp)."\" title=\"".getMLText("sort_by_date")."\">".($orderby=="d"||$orderby=="da"?' <i class="fa fa-sort-amount-asc selected"></i>':($orderby=="dd"?' <i class="fa fa-sort-amount-desc selected"></i>':' <i class="fa fa-sort-amount-asc"></i>'))."</a>";
|
||||
}
|
||||
print "</th>\n";
|
||||
|
|
Loading…
Reference in New Issue
Block a user