--- search_api/contrib/search_api_views/includes/handler_field.inc 2011-06-20 11:24:16.000000000 +0200 +++ search_api.new/contrib/search_api_views/includes/handler_field.inc 2011-06-23 20:54:01.000000000 +0200 @@ -62,6 +62,9 @@ class SearchApiViewsHandlerField extends 'collapse' => t('Concatenate values using the list seperator'), 'first' => t('Show first (if present)'), 'count' => t('Show item count'), + 'sum' => t('Show the sum of the values'), + 'min' => t('Show the minimum of the values'), + 'max' => t('Show the maximum of the values'), ), '#default_value' => $this->options['list']['mode'], ); @@ -152,6 +155,23 @@ class SearchApiViewsHandlerField extends if ($this->options['list']['mode'] == 'count') { return count($value); } + if ($this->options['list']['mode'] == 'sum') { + return count($value) ? array_sum($value) : 0; + } + if ($this->options['list']['mode'] == 'min') { + if (!count($value)) { + return NULL; + } + sort($value); + return $this->renderLink($value[0], $values); + } + if ($this->options['list']['mode'] == 'max') { + if (!count($value)) { + return NULL; + } + rsort($value); + return $this->renderLink($value[0], $values); + } } $vs = array(); foreach ($value as $v) {