public static function enable_pagination_hook($sort_data = array()) { if (get_display_mode() != 'mobile') { foreach ($sort_data['sortable'] as $column_id => $options) { if (isset($options['extra_sort']) && $options['extra_sort'] && $options['owner_table']) { // find all the visible extra fields for this item and add sorting buttons to them. $defaults = module_extra::get_defaults($options['owner_table']); $column_headers = array(); foreach ($defaults as $default) { if (isset($default['display_type']) && $default['display_type'] == _EXTRA_DISPLAY_TYPE_COLUMN) { $column_headers[$default['key']] = $default; } } unset($sort_data['sortable'][$column_id]); foreach ($column_headers as $column_header) { $sort_data['sortable']['extra_header_' . $column_header['extra_default_id']] = array('extra_sort' => true, 'field' => $column_header['key'], 'default_field_id' => $column_header['extra_default_id'], 'owner_table' => $options['owner_table'], 'owner_id' => $options['owner_id'], 'field_type' => isset($column_header['field_type']) ? $column_header['field_type'] : false); } } } self::$table_sort_options = $sort_data; } }