Index: trunk/extensions/SemanticDrilldown/includes/SD_FilterValue.php |
— | — | @@ -65,25 +65,31 @@ |
66 | 66 | } |
67 | 67 | |
68 | 68 | /* |
69 | | - * Used in sorting, when BrowseDataPage creates a new URL |
| 69 | + * Used in sorting, when BrowseDataPage creates a new URL. |
70 | 70 | */ |
71 | | - function compare( $fv1, $fv2 ) { |
| 71 | + public static function compare( $fv1, $fv2 ) { |
72 | 72 | if ( $fv1->is_none ) return 1; |
73 | 73 | if ( $fv2->is_none ) return - 1; |
74 | 74 | if ( $fv1->is_other ) return 1; |
75 | 75 | if ( $fv2->is_other ) return - 1; |
| 76 | + |
76 | 77 | if ( $fv1->year != null && $fv2->year != null ) { |
77 | 78 | if ( $fv1->year == $fv2->year ) { |
78 | 79 | if ( $fv1->month == $fv1->month ) return 0; |
79 | 80 | return ( $fv1->month > $fv2->month ) ? 1 : - 1; |
80 | 81 | } |
| 82 | + |
81 | 83 | return ( $fv1->year > $fv2->year ) ? 1 : - 1; |
82 | 84 | } |
| 85 | + |
83 | 86 | if ( $fv1->is_numeric ) { |
84 | 87 | if ( $fv1->lower_limit == null ) return - 1; |
85 | 88 | return ( $fv1->lower_limit > $fv2->lower_limit ) ? 1 : - 1; |
86 | 89 | } |
| 90 | + |
87 | 91 | if ( $fv1->text == $fv2->text ) return 0; |
| 92 | + |
88 | 93 | return ( $fv1->text > $fv2->text ) ? 1 : - 1; |
89 | 94 | } |
90 | | -} |
| 95 | + |
| 96 | +} |
\ No newline at end of file |