summaryrefslogtreecommitdiffstats
path: root/views_natural_sort_text_field.views.inc
blob: c22f2c2e1f3431a13ff54ca60ee7bd6710b78498 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<?php

/**
 * @file
 * Views Related hooks for the Views Natural Sort Text Field module.
 */

/**
 * Implements hook_field_views_data_alter().
 */
function views_natural_sort_text_field_field_views_data_alter(&$data, $field, $module) {
  // TODO: check to see if field is "registered" to be sort naturally.
  if (!in_array($field['id'], array_keys(views_natural_sort_text_field_get_configured_fields()))) {
    return;
  }
  $field_table = _field_sql_storage_tablename($field);
  $data[$field_table][$field['field_name'] . '_value']['sort']['handler'] = 'views_natural_sort_handler_sort_text_field';
}