$module_info) { $type_map[$module_type] = $module; } } foreach ($data as $type) { // Poll node module to determine who provides the node type. if ($info = node_get_types('module', $type)) { $export['dependencies'][$info] = $info; if ($info == 'node') { $export['features']['node'][$type] = $type; } // If this node type is provided by a different module, add it as a dependency $module = $type_map[$type]; if ($module && $module != $module_name) { $export['dependencies'][$module] = $module; unset($export['features']['node'][$type]); } // Create a pipe for CCK fields if (module_exists('content')) { $content_info = content_types($type); if (!empty($content_info['fields'])) { foreach ($content_info['fields'] as $key => $field) { $pipe['content'][] = "{$type}-{$field['field_name']}"; } } } } } return $pipe; } /** * Implementation of hook_features_export_render(). */ function node_features_export_render($module = 'foo', $data) { $elements = array( 'name' => TRUE, 'module' => FALSE, 'description' => TRUE, 'has_title' => FALSE, 'title_label' => TRUE, 'has_body' => FALSE, 'body_label' => TRUE, ); $output = array(); $output[] = ' $items = array('; foreach ($data as $type) { $info = node_get_types('type', $type); $output[] = " '{$type}' => array("; foreach ($elements as $key => $t) { if ($t) { $output[] = " '{$key}' => t('" . str_replace('"', '\"', $info->$key). "'),"; } else { $output[] = " '{$key}' => '{$info->$key}',"; } } $output[] = " ),"; } $output[] = ' );'; $output[] = ' return $items;'; $output = implode("\n", $output); return array('node_info' => $output); }