summaryrefslogtreecommitdiff
path: root/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/system/views_handler_field_file_extension.inc
blob: e64fbc91dd0771827b14314c98774c8997ca106e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<?php

/**
 * Returns a pure file extension of the file, for example 'module'.
 * @ingroup views_field_handlers
 */
class views_handler_field_file_extension extends views_handler_field {
  function render($values) {
    $value = $this->get_value($values);
    if (preg_match('/\.([^\.]+)$/', $value, $match)) {
      return $this->sanitize_value($match[1]);
    }
  }
}