? includes
? nodewords.migrate.patch
? nodewords_basic
? nodewords_extra
? nodewords_verification_tags
? translations
Index: nodewords.migrate.inc
===================================================================
RCS file: nodewords.migrate.inc
diff -N nodewords.migrate.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ nodewords.migrate.inc	25 Feb 2010 18:01:56 -0000
@@ -0,0 +1,82 @@
+<?php
+
+/*
+ * @file 
+ *   Hooks for handling Mirgate integration
+ */
+
+/**
+* Implementation of hook_migrate_api().
+*
+* Why is this even here? It never gets called.
+*/
+function nodewords_migrate_api() {
+  $api = array(
+    'api' => 1,
+    'integration modules' => array(
+      'nodewords' => array('status' => FALSE),
+    ),
+  );
+  return $api;
+}
+
+/**
+ * Implementation of hook_migrate_prepare_node().
+ *
+ * Converts all fields of the type nodewords_META => VALUE to a new array:
+ *   nodewords => META => array ('value' = VALUE)
+ */
+function nodewords_migrate_prepare_node(&$node, $tblinfo, $row) {
+  $errors = array();
+  
+  $node->nodewords = array();
+  
+  foreach (nodewords_migrate_fields_node($node->type) as $source_tag => $label) {
+    if (!empty($node->$source_tag)) {
+      $tag = preg_replace('/nodewords_/', '', $source_tag);
+      $node->nodewords[$tag]['value'] = $node->$source_tag;
+    }
+  }
+  
+  return $errors;
+}
+
+/**
+ * Implementation of hook_migrate_fields_node().
+ *
+ * @return 
+ *   An array of destination fields to be exposed to the Migrate content 
+ *   set for the passed content type.
+ */
+function nodewords_migrate_fields_node($type) {
+
+  // grab a list of all content types
+  $types = (array) content_types();
+  
+  // this will be the returned array of fields to expose
+  $fields = array();
+
+  // sanity checking: see if the passed content type exists
+  if (isset($types[$type])) {
+    
+    // convenience variable
+    $content_type = $types[$type];
+    
+    // check if nodewords is allowed for the content type
+    if (variable_get('nodewords_edit_metatags_' . $content_type, TRUE)) {
+      
+      // need to elimate the 0 value entries and then merge the arrays to come up
+      // with an array containing all of the edit allowed and print to head 
+      // allowed meta tags
+      $tags = array_merge(array_filter(variable_get('nodewords_edit', array())), array_filter(variable_get('nodewords_head', array())));
+      
+      foreach ($tags as $tag) {
+        $fields['nodewords_' . $tag] = t('Nodewords: ' . ucfirst($tag));
+      }
+     
+    }
+    
+  }
+  
+  return $fields;
+}
Index: nodewords.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/nodewords/nodewords.module,v
retrieving revision 1.57.2.322
diff -u -p -r1.57.2.322 nodewords.module
--- nodewords.module	15 Feb 2010 21:12:06 -0000	1.57.2.322
+++ nodewords.module	25 Feb 2010 18:01:56 -0000
@@ -289,6 +289,14 @@ function nodewords_help($path, $arg) {
 }
 
 /**
+* Implementation of hook_migrate_init().
+*/
+function nodewords_migrate_init() {
+  $path = drupal_get_path('module', 'nodewords') . '/nodewords.migrate.inc';
+  include_once($path);
+}
+
+/**
  * Implements hook_menu().
  */
 function nodewords_menu() {
