? 0-nodewords-drupal-attributes-output.patch
? 781440-token-replace-context-followup.patch
? 901764-nodewords-frontpage-metatags.patch
? 945786-nodewords-offline-metatags.patch
? 958542-nodewords-uninstall-variables.patch
? 960482-nodewords-dccreator.patch
? patches
Index: nodewords_extra/includes/nodewords_extra.nodewords.tags.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/nodewords/nodewords_extra/includes/Attic/nodewords_extra.nodewords.tags.inc,v
retrieving revision 1.1.2.7
diff -u -p -r1.1.2.7 nodewords_extra.nodewords.tags.inc
--- nodewords_extra/includes/nodewords_extra.nodewords.tags.inc	30 Oct 2010 19:10:16 -0000	1.1.2.7
+++ nodewords_extra/includes/nodewords_extra.nodewords.tags.inc	7 Nov 2010 20:35:44 -0000
@@ -66,26 +66,16 @@ function nodewords_extra_dc_date_form(&$
     '#tree' => TRUE,
   );
 
-  $bool = (
-    isset($content['value']['day']) &&
-    isset($content['value']['month']) &&
-    isset($content['value']['year'])
-  );
-  if ($bool) {
-    $value = $content['value']['day'] . ' ' . $content['value']['month'] . ' ' . $content['value']['year'];
-  }
-  elseif (isset($content['value']) && is_string($content['value'])) {
-    $value = $content['value'];
-  }
-  else {
-    $value = '';
+  if (isset($content['value']) && is_array($content['value'])) {
+    // Support the date form element value.
+    $content['value'] = $content['value']['day'] . ' ' . $content['value']['month'] . ' ' . $content['value']['year'];
   }
 
   $form['dc.date']['value'] = array(
     '#type' => 'textfield',
     '#title' => t('Dublin Core date'),
     '#description' => t('Enter day, month, and year in this order, separated by a space; a invalid date will not be used. The timezone is UTC.') . $options['description'],
-    '#default_value' => $value,
+    '#default_value' => isset($content['value']) ? $content['value'] : '',
   );
 }
 
@@ -93,42 +83,36 @@ function nodewords_extra_dc_date_form(&$
  * Check if the meta tag content is empty.
  */
 function nodewords_extra_dc_date_is_empty($content) {
-  $bool = (
-    isset($content['value']['day']) &&
-    isset($content['value']['month']) &&
-    isset($content['value']['year'])
-  );
-  if ($bool) {
-    return FALSE;
+  if (!empty($content['value'])) {
+    if (is_array($content['value'])) {
+      // Support the date form element value.
+      return FALSE;
+    }
+    else {
+      $parts = preg_split('/\s+/', $content['value']);
+      return count($parts) != 3;
+    }
   }
-
-  return empty($content['value']);
+  return TRUE;
 }
 
 /**
  * Set the meta tag content.
  */
 function nodewords_extra_dc_date_prepare(&$tags, $content, $options) {
-  $bool = (
-    isset($content['value']['day']) &&
-    isset($content['value']['month']) &&
-    isset($content['value']['year'])
-  );
-  if ($bool) {
-    $value = $content['value']['day'] . ' ' . $content['value']['month'] . ' ' . $content['value']['year'];
-  }
-  elseif (isset($content['value']) && is_string($content['value'])) {
-    $value = $content['value'];
-  }
-  else {
-    $value = '';
-  }
-  if (!empty($value)) {
-    $values = array_filter(array_map('trim', explode(' ', $value)));
-    if (count($values) == 3) {
-      $time = @mktime(0, 0, 0, $values[0], $values[1], $values[2]);
-      if ($time > 0) {
-        $tags['dc.date'] = date('Y-m-d\TH:i:s\Z', $time);
+  if (!empty($content['value'])) {
+    if (is_array($content['value'])) {
+      // Support the date form element value.
+      $content['value'] = $content['value']['day'] . ' ' . $content['value']['month'] . ' ' . $content['value']['year'];
+    }
+    else {
+      $content['value'] = nodewords_replace_tokens($content['value'], $options);
+    }
+    $parts = preg_split('/\s+/', $content['value']);
+    if (count($parts) == 3) {
+      list($day, $month, $year) = $parts;
+      if ($timestamp = @mktime(0, 0, 0, $month, $day, $year)) {
+        $tags['dc.date'] = gmdate('Y-m-d\TH:i:s\Z', $timestamp);
       }
     }
   }
@@ -139,11 +123,7 @@ function nodewords_extra_dc_date_prepare
  */
 function nodewords_extra_dc_description_form(&$form, $content, $options) {
   if (!isset($form['description'])) {
-    $bool = (
-      isset($options['content type']) &&
-      variable_get('nodewords_use_teaser_' . $options['content type'], FALSE)
-    );
-    if (!$bool) {
+    if (isset($options['content type']) && variable_get('nodewords_use_teaser_' . $options['content type'], FALSE)) {
       $form['dc.description'] = array(
         '#tree' => TRUE,
       );
