Fixed some layout issues with Table style search results and made current sort order more visible.
1.1 --- a/system/classes/listfactory.class.php Thu Nov 05 00:53:29 2009 +0000
1.2 +++ b/system/classes/listfactory.class.php Thu Nov 05 19:05:28 2009 +0000
1.3 @@ -612,8 +612,6 @@
1.4 $href = $this->_page_url . "order={$this->_sort_arr['field']}&" .
1.5 "direction={$this->_sort_arr['direction']}&results=$val";
1.6
1.7 - $selected = $this->_per_page == $val ? ' selected="selected"' : '';
1.8 -
1.9 // Prevent displaying too many limit items
1.10 if ($this->_total_found <= $val)
1.11 {
1.12 @@ -652,17 +650,11 @@
1.13 }
1.14 else
1.15 {
1.16 - $sort_selected = ' selected="selected"';
1.17 + $sort_selected = '';
1.18 $sort_text = $LANG09[68].' ';
1.19 if (!$show_sort) {
1.20 $list_templates->set_var('show_sort', 'display:none;');
1.21 }
1.22 -
1.23 - // Write field
1.24 - $list_templates->set_var('sort_text', "$sort_text...");
1.25 - $list_templates->set_var('sort_href', "");
1.26 - $list_templates->set_var('sort_selected', $sort_selected);
1.27 - $list_templates->parse('page_sort', 'sort', true);
1.28 }
1.29
1.30 // Draw the sorting select box/table headings
1.31 @@ -678,10 +670,22 @@
1.32 $direction = $this->_def_sort_arr['direction'];
1.33
1.34 // Show the sort arrow
1.35 - if ($this->_sort_arr['field'] === $field['name']) {
1.36 - //$selected = $sort_selected;
1.37 + if ($this->_sort_arr['field'] === $field['name'])
1.38 + {
1.39 $direction = $this->_sort_arr['direction'] == 'asc' ? 'desc' : 'asc';
1.40 - $text .= " ($direction)";
1.41 +
1.42 + if ($this->_style == 'inline') {
1.43 + // Add drop down item for current sort order
1.44 + $list_templates->set_var('sort_text', $text.' ('.$this->_sort_arr['direction'].')');
1.45 + $list_templates->set_var('sort_href', '');
1.46 + $list_templates->set_var('sort_selected', ' selected="selected"');
1.47 + $list_templates->parse('page_sort', 'sort', true);
1.48 +
1.49 + // Set up the sort order for the opposite direction
1.50 + $text .= " ($direction)";
1.51 + } else {
1.52 + $selected = $sort_selected;
1.53 + }
1.54 }
1.55
1.56 $href = $this->_page_url . "results={$this->_per_page}&" .
1.57 @@ -729,6 +733,10 @@
1.58 // Write field
1.59 $list_templates->set_var('field_text', $fieldvalue);
1.60 $list_templates->parse('item_field', 'field', true);
1.61 + } else {
1.62 + // Write an empty field
1.63 + $list_templates->set_var('field_text', ' ');
1.64 + $list_templates->parse('item_field', 'field', true);
1.65 }
1.66 }
1.67 }