diff --git a/insert.module b/insert.module index a0e9553..9a27df1 100644 --- a/insert.module +++ b/insert.module @@ -67,6 +67,30 @@ function insert_theme() { } /** + * Implements hook_features_pipe_COMPONENT_alter(). + */ +function insert_features_pipe_field_alter(&$more, $data, $export) { + // If a field is being exported, add Insert to the pipe of modules that need + // to add additional export data. + $more['insert'] = $data; +} + +/** + * Implements hook_features_export(). + */ +function insert_features_export($data, &$export, $module_name) { + foreach ($data as $field_key) { + list($entity_type, $bundle_name, $field_name) = explode('-', $field_key); + $instance = field_info_instance($entity_type, $field_name, $bundle_name); + if (!empty($instance['widget']['settings']['insert'])) { + $export['dependencies']['insert'] = 'insert'; + break; + } + } + return array(); +} + +/** * Get a list of all supported image styles. */ function insert_styles($reset = FALSE) {