Skip to content
Permalink
Browse files

Fix for timestamp problem

  • Loading branch information...
Theophilix committed May 16, 2019
1 parent 4c81c0d commit e27aa39f6c3e7244584274180f48d519a643b5f1
Showing with 34 additions and 5 deletions.
  1. +34 −5 site/views/etetable/tmpl/default_thead.php
@@ -98,12 +98,41 @@
{
$options = '';
$default = JText::_('COM_EVENTTABLEEDIT_SELECT_SORT');
foreach($this->heads as $head)
$heads = $this->heads;
$ordering = new stdclass;
$ordering->datatype = '';
$ordering->head = 'a.timestamp';
$ordering->name = 'timestamp';
$heads = (object) array_merge((array)$heads, (array)array($ordering));
foreach($heads as $head)
{
$selected1 = $head->head == $listOrder && $listDirn == 'asc' ? ' selected' && $default = $head->name.' ↑' : '';
$selected2 = $head->head == $listOrder && $listDirn == 'desc' ? ' selected' && $default = $head->name. ' ↓' : '';
$options .= '<option value="'.$head->head.'|asc"'.$selected1.'>'.$head->name.' &uarr;</option>';
$options .= '<option value="'.$head->head.'|desc"'.$selected2.'>'.$head->name.' &darr;</option>';
$types = array('text','link','email');
$name_asc = $head->name;
$name_desc = $head->name;
$asc = '&uarr;';
$desc = '&darr;';
if($head->name == 'timestamp')
{
$name_asc = JText::_('COM_EVENTTABLEEDIT_NEWEST');
$name_desc = JText::_('COM_EVENTTABLEEDIT_OLDEST');
}
if(in_array($head->datatype, $types))
{
$asc = '(A-Z)';
$desc = '(Z-A)';
}
$selected1 = $head->head == $listOrder && $listDirn == 'asc' ? ' selected' && $default = $name_asc.' '.$asc : '';
$selected2 = $head->head == $listOrder && $listDirn == 'desc' ? ' selected' && $default = $name_desc. ' '.$desc : '';
$options .= '<option value="'.$head->head.'|asc"'.$selected1.'>'.$name_asc.' '.$asc.'</option>';
$options .= '<option value="'.$head->head.'|desc"'.$selected2.'>'.$name_desc.' '.$desc.'</option>';
}
$select = '';
$sort_select = '<div class="table-sorting tablesaw-toolbar"><label>'.JText::_('COM_EVENTTABLEEDIT_SORT').':<span class="btn btn-small btn-select">'.$default.'<select class="sort-select">'.$options.'</select></span></label></div>';

0 comments on commit e27aa39

Please sign in to comment.
You can’t perform that action at this time.