Index: nodewords_basic/nodewords_basic.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/nodewords/nodewords_basic/nodewords_basic.module,v
retrieving revision 1.8.2.27
diff -u -p -r1.8.2.27 nodewords_basic.module
--- nodewords_basic/nodewords_basic.module	8 Dec 2009 03:08:40 -0000	1.8.2.27
+++ nodewords_basic/nodewords_basic.module	11 Dec 2009 05:51:27 -0000
@@ -37,6 +37,7 @@ function nodewords_basic_nodewords_tags_
       'widget:permission' => 'edit meta tag ABSTRACT',
     ),
     'canonical' => array(
+      'label:lists' => t('Canonical URL'),
       'tag:context:allowed' => array(
         NODEWORDS_TYPE_FRONTPAGE,
         NODEWORDS_TYPE_NODE,
@@ -51,7 +52,6 @@ function nodewords_basic_nodewords_tags_
         NODEWORDS_TYPE_ERRORPAGE,
         NODEWORDS_TYPE_TRACKER,
       ),
-      'label:lists' => t('Canonical URL'),
       'tag:function:prefix' => 'nodewords_basic_canonical',
       'tag:template' => array('canonical' => NODEWORDS_LINK_REL),
       'tag:tokens' => TRUE,
@@ -139,15 +139,32 @@ function nodewords_basic_perm() {
 function nodewords_basic_abstract_form(&$form, $content, $options) {
   $form['abstract'] = array(
     '#tree' => TRUE,
+    '#prefix' => '<tr class="' . nodewords_tags_field_class() . '">',
+    '#suffix' => '</tr>',
   );
 
+  if ($options['type'] != NODEWORDS_TYPE_DEFAULT) {
+    $form['abstract']['overwrite_default'] = array(
+      '#type' => 'checkbox',
+      '#default_value' => !empty($content['overwrite_default']),
+      '#prefix' => '<td>',
+      '#suffix' => '</td>',
+    );
+  }
+
   $form['abstract']['value'] = array(
     '#type' => 'textfield',
     '#title' => t('Abstract'),
-//    '#description' => t('Enter a short abstract. Typically it is one sentence. <strong>This field supports tokens</strong>.'),
-    '#default_value' => empty($content['value']) ? (!empty($options['default']['abstract']['value']) ? $options['default']['abstract']['value'] : '') : $content['value'],
+    '#default_value' => empty($content['value']) ? '' : $content['value'],
     '#size' => 60,
     '#maxlength' => variable_get('nodewords_max_size', 350),
+    '#prefix' => '<td>',
+  );
+
+  $form['abstract']['description'] = array(
+    '#value' => t('Enter a short abstract. Typically it is one sentence. <strong>This field supports tokens</strong>.'),
+    '#prefix' => '<div class="description">',
+    '#suffix' => '</div></td>',
   );
 }
 
@@ -155,7 +172,13 @@ function nodewords_basic_abstract_form(&
  * Set the meta tag content.
  */
 function nodewords_basic_abstract_prepare(&$tags, $content, $options) {
-  $value = empty($content['value']) ? (!empty($options['default']['abstract']['value']) ? $options['default']['abstract']['value'] : '') : $content['value'];
+  if (empty($content['overwrite_default'])) {
+    $value = empty($options['default']['abstract']['value']) ? '' : $options['default']['abstract']['value'];
+  }
+  else {
+    $value = empty($content['value']) ? '' : $content['value'];
+  }
+
   $tags['abstract'] = nodewords_replace_tokens($value, $options);
 }
 
@@ -165,16 +188,32 @@ function nodewords_basic_abstract_prepar
 function nodewords_basic_canonical_form(&$form, $content, $options) {
   $form['canonical'] = array(
     '#tree' => TRUE,
+    '#prefix' => '<tr class="' . nodewords_tags_field_class() . '">',
+    '#suffix' => '</tr>',
   );
 
+  if ($options['type'] != NODEWORDS_TYPE_DEFAULT) {
+    $form['canonical']['overwrite_default'] = array(
+      '#value' => '&nbsp;',
+      '#prefix' => '<td>',
+      '#suffix' => '</td>',
+    );
+  }
+
   $form['canonical']['value'] = array(
     '#type' => 'textfield',
     '#title' => t('Canonical URL'),
-    '#description' => t('Canonical URLs are used from the search engines, and allow them to not report duplicate titles for HTML pages that are accessible from different URLs. Use a relative URL without the initial slash; canonical URLs that point to a different domain are normally not accepted. <strong>This field supports tokens</strong>.'),
     '#default_value' => empty($content['value']) ? '' : $content['value'],
     '#element_validate' => array('nodewords_basic_canonical_form_validate'),
     '#size' => 60,
     '#maxlength' => variable_get('nodewords_max_size', 350),
+    '#prefix' => '<td>',
+  );
+
+  $form['canonical']['description'] = array(
+    '#value' => t('Canonical URLs are used from the search engines, and allow them to not report duplicate titles for HTML pages that are accessible from different URLs. Use a relative URL without the initial slash; canonical URLs that point to a different domain are normally not accepted. <strong>This field supports tokens</strong>.'),
+    '#prefix' => '<div class="description">',
+    '#suffix' => '</div></td>',
   );
 }
 
@@ -271,15 +310,32 @@ function nodewords_basic_canonical_setti
 function nodewords_basic_copyright_form(&$form, $content, $options) {
   $form['copyright'] = array(
     '#tree' => TRUE,
+    '#prefix' => '<tr class="' . nodewords_tags_field_class() . '">',
+    '#suffix' => '</tr>',
   );
 
+  if ($options['type'] != NODEWORDS_TYPE_DEFAULT) {
+    $form['copyright']['overwrite_default'] = array(
+      '#type' => 'checkbox',
+      '#default_value' => !empty($content['overwrite_default']),
+      '#prefix' => '<td>',
+      '#suffix' => '</td>',
+    );
+  }
+
   $form['copyright']['value'] = array(
     '#type' => 'textfield',
     '#title' => t('Copyright'),
-    '#description' => t('Enter a short copyright statement. <strong>This field supports tokens</strong>.'),
-    '#default_value' => empty($content['value']) ? (!empty($options['default']['copyright']['value']) ? $options['default']['copyright']['value'] : '') : $content['value'],
+    '#default_value' => empty($content['value']) ? '' : $content['value'],
     '#size' => 60,
     '#maxlength' => variable_get('nodewords_max_size', 350),
+    '#prefix' => '<td>',
+  );
+
+  $form['copyright']['description'] = array(
+    '#value' => t('Enter a short copyright statement. <strong>This field supports tokens</strong>.'),
+    '#prefix' => '<div class="description">',
+    '#suffix' => '</div></td>',
   );
 }
 
@@ -287,7 +343,13 @@ function nodewords_basic_copyright_form(
  * Set the meta tag content.
  */
 function nodewords_basic_copyright_prepare(&$tags, $content, $options) {
-  $value = empty($content['value']) ? (!empty($options['default']['copyright']['value']) ? $options['default']['copyright']['value'] : '') : $content['value'];
+  if (empty($content['overwrite_default'])) {
+    $value = empty($options['default']['copyright']['value']) ? '' : $options['default']['copyright']['value'];
+  }
+  else {
+    $value = empty($content['value']) ? '' : $content['value'];
+  }
+
   $tags['copyright'] = nodewords_replace_tokens($value, $options);
 }
 
@@ -297,15 +359,32 @@ function nodewords_basic_copyright_prepa
 function nodewords_basic_description_form(&$form, $content, $options) {
   $form['description'] = array(
     '#tree' => TRUE,
+    '#prefix' => '<tr class="' . nodewords_tags_field_class() . '">',
+    '#suffix' => '</tr>',
   );
 
+  if ($options['type'] != NODEWORDS_TYPE_DEFAULT) {
+    $form['description']['overwrite_default'] = array(
+      '#type' => 'checkbox',
+      '#default_value' => !empty($content['overwrite_default']),
+      '#prefix' => '<td>',
+      '#suffix' => '</td>',
+    );
+  }
+
   $form['description']['value'] = array(
     '#type' => 'textarea',
     '#title' => t('Description'),
-    '#description' => t('Enter a description. Limit your description to about 20 words, with a maximum of %count characters. It should not contain any HTML tags or other formatting. <strong>This field supports tokens</strong>.', array('%count' => variable_get('nodewords_max_size', 350))),
-    '#default_value' => empty($content['value']) ? (!empty($options['default']['description']['value']) ? $options['default']['description']['value'] : '') : $content['value'],
+    '#default_value' => empty($content['value']) ? '' : $content['value'],
     '#cols' => 60,
     '#rows' => 6,
+    '#prefix' => '<td>',
+  );
+
+  $form['description']['description'] = array(
+    '#value' => t('Enter a description. Limit your description to about 20 words, with a maximum of %count characters. It should not contain any HTML tags or other formatting. <strong>This field supports tokens</strong>.', array('%count' => variable_get('nodewords_max_size', 350))),
+    '#prefix' => '<div class="description">',
+    '#suffix' => '</div></td>',
   );
 }
 
@@ -313,27 +392,34 @@ function nodewords_basic_description_for
  * Set the meta tag content.
  */
 function nodewords_basic_description_prepare(&$tags, $content, $options) {
+  if (!empty($content['overwrite_default'])) {
+    $value = $options['default']['description']['value'];
+  }
+  else {
+    $value = $content['value'];
+  }
+
   switch ($options['type']) {
     case NODEWORDS_TYPE_NODE:
       $bool = (
-        empty($content['value']) &&
+        empty($value) &&
         ($node = node_load(array('nid' => $options['id'], 'vid' => $options['sid']))) &&
         variable_get('nodewords_use_teaser_' . $node->type, variable_get('nodewords_use_teaser', FALSE)) &&
         !empty($node->teaser)
       );
 
       if ($bool) {
-        $content['value'] = nodewords_metatag_from_teaser($node->teaser,
+        $value = nodewords_metatag_from_teaser($node->teaser,
           $node->format
         );
       }
       break;
 
     case NODEWORDS_TYPE_TERM:
-      if (empty($content['value'])) {
+      if (empty($value)) {
         $term = nodewords_get_term($options['id']);
         if ($term) {
-          $content['value'] = $term->description;
+          $value = $term->description;
         }
       }
         break;
@@ -341,17 +427,17 @@ function nodewords_basic_description_pre
     case NODEWORDS_TYPE_VOCABULARY:
       // TODO: probably we have to do a db_rewrite_sql() query here so access is restricted
       $bool = (
-        empty($content['value']) &&
+        empty($value) &&
         ($voc = taxonomy_vocabulary_load($options['id']))
       );
 
       if ($bool) {
-        $content['value'] = $voc->description;
+        $value = $voc->description;
       }
       break;
   }
 
-  $tags['description'] = empty($content['value']) ? (!empty($options['default']['description']['value']) ? $options['default']['description']['value'] : '') : $content['value'];
+  $tags['description'] = empty($value) ? '' : nodewords_replace_tokens($value, $options);
 }
 
 function nodewords_basic_description_settings_form(&$form, $form_id, $options) {
@@ -382,16 +468,33 @@ function nodewords_basic_description_set
 function nodewords_basic_keywords_form(&$form, $content, $options) {
   $form['keywords'] = array(
     '#tree' => TRUE,
+    '#prefix' => '<tr class="' . nodewords_tags_field_class() . '">',
+    '#suffix' => '</tr>',
   );
 
+  if ($options['type'] != NODEWORDS_TYPE_DEFAULT) {
+    $form['keywords']['overwrite_default'] = array(
+      '#type' => 'checkbox',
+      '#default_value' => !empty($content['overwrite_default']),
+      '#prefix' => '<td>',
+      '#suffix' => '</td>',
+    );
+  }
+
   $form['keywords']['value'] = array(
     '#type' => 'textfield',
     '#title' => t('Keywords'),
-    '#description' => t('Enter a comma separated list of keywords. Avoid duplication of words as this will lower your search engine ranking. <strong>This field supports tokens</strong>.'),
-    '#default_value' => empty($content['value']) ? (!empty($options['default']['keywords']['value']) ? $options['default']['keywords']['value'] : '') : $content['value'],
+    '#default_value' => empty($content['value']) ? '' : $content['value'],
     '#size' => 60,
     '#element_validate' => array('nodewords_basic_keywords_form_validate'),
     '#maxlength' => variable_get('nodewords_max_size', 350),
+    '#prefix' => '<td>',
+  );
+
+  $form['keywords']['description'] = array(
+    '#value' => t('Enter a comma separated list of keywords. Avoid duplication of words as this will lower your search engine ranking. <strong>This field supports tokens</strong>.'),
+    '#prefix' => '<div class="description">',
+    '#suffix' => '</div></td>',
   );
 }
 
@@ -401,11 +504,15 @@ function nodewords_basic_keywords_form(&
 function nodewords_basic_keywords_prepare(&$tags, $content, $options) {
   $value = variable_get('nodewords_global_keywords', '');
 
-  if (empty($content['value'])) {
-    $value .= ',' . (!empty($options['default']['keywords']['value']) ? $options['default']['keywords']['value'] : '');
+  if (empty($content['overwrite_default'])) {
+    if (!empty($options['default']['keywords']['value'])) {
+      $value .= ',' . $options['default']['keywords']['value'];
+    }
   }
   else {
-    $value .= ',' . $content['value'];
+    if (!empty($content['value'])) {
+      $value .= ',' . $content['value'];
+    }
   }
 
   if ($options['type'] == NODEWORDS_TYPE_NODE && module_exists('taxonomy')) {
@@ -503,17 +610,34 @@ function nodewords_basic_keywords_settin
 function nodewords_basic_revisit_after_form(&$form, $content, $options) {
   $form['revisit-after'] = array(
     '#tree' => TRUE,
+    '#prefix' => '<tr class="' . nodewords_tags_field_class() . '">',
+    '#suffix' => '</tr>',
   );
 
+  if ($options['type'] != NODEWORDS_TYPE_DEFAULT) {
+    $form['revisit-after']['overwrite_default'] = array(
+      '#type' => 'checkbox',
+      '#default_value' => !empty($content['overwrite_default']),
+      '#prefix' => '<td>',
+      '#suffix' => '</td>',
+    );
+  }
+
   $form['revisit-after']['value'] = array(
     '#type' => 'textfield',
     '#title' => t('Revisit after'),
-    '#description' => t('The meta tag REVISIT-AFTER defines how often a search engine or spider should come to your website for re-indexing. This tag is used for websites that change their content and on a regular basis. This tag can also be beneficial in boosting your rankings if search engines display results based on the most recent submissions.'),
-    '#default_value' => empty($content['value']) ? (!empty($options['default']['revisit-after']['value']) ? (integer) $options['default']['revisit-after']['value'] : 1) : (integer) $content['value'],
+    '#default_value' => empty($content['value']) ? '' : $content['value'],
     '#size' => 3,
     '#element_validate' => array('nodewords_basic_revisit_after_form_validate'),
     '#maxlength' => 3,
     '#field_suffix' => t('day(s)'),
+    '#prefix' => '<td>',
+  );
+
+  $form['revisit-after']['description'] = array(
+    '#value' => t('The meta tag REVISIT-AFTER defines how often a search engine or spider should come to your website for re-indexing. This tag is used for websites that change their content and on a regular basis. This tag can also be beneficial in boosting your rankings if search engines display results based on the most recent submissions.'),
+    '#prefix' => '<div class="description">',
+    '#suffix' => '</div></td>',
   );
 }
 
@@ -530,7 +654,13 @@ function nodewords_basic_revisit_after_f
  * Set the meta tag content.
  */
 function nodewords_basic_revisit_after_prepare(&$tags, $content, $options) {
-  $value = empty($content['value']) ? (!empty($options['default']['revisit-after']['value']) ? (integer) $options['default']['revisit-after']['value'] : 1) : (integer) $content['value'];
+  if (empty($content['overwrite_default'])) {
+    $value = empty($options['default']['revisit-after']['value']) ? '' : $options['default']['revisit-after']['value'];
+  }
+  else {
+    $value = empty($content['value']) ? '' : $content['value'];
+  }
+
   $tags['revisit-after'] = $value > 1 ? "$value days" : '1 day';
 }
 
@@ -554,40 +684,33 @@ function nodewords_basic_robots_form(&$f
 
   $form['robots'] = array(
     '#tree' => TRUE,
+    '#prefix' => '<tr class="' . nodewords_tags_field_class() . '">',
+    '#suffix' => '</tr>',
   );
 
+  if ($options['type'] != NODEWORDS_TYPE_DEFAULT) {
+    $form['robots']['overwrite_default'] = array(
+      '#type' => 'checkbox',
+      '#default_value' => !empty($content['overwrite_default']),
+      '#prefix' => '<td>',
+      '#suffix' => '</td>',
+    );
+  }
+
   $form['robots']['value'] = array(
     '#type' => 'checkboxes',
-    '#title' => t('Robots'),
-    '#description' => t('The meta tag ROBOTS offers a simple mechanism to indicate to web robots and crawlers whether the page should be indexed (NOINDEX) and whether links on the page should be followed (NOFOLLOW).'),
     '#default_value' => empty($content['value']) ? array() : $content['value'],
+    '#title' => t('Robots'),
     '#options' => $field_options,
     '#checkall' => variable_get('nodewords_enable_checkall', FALSE),
+    '#prefix' => '<td>',
   );
 
-  if ($options['type'] != NODEWORDS_TYPE_DEFAULT) {
-    $form['robots']['use_default'] = array(
-      '#type' => 'checkbox',
-      '#title' => t('Use the default value'),
-      '#default_value' => !empty($content['use_default']),
-    );
-
-    if (!empty($options['default']['robots']['value'])) {
-      $default_values = array_keys(array_filter($options['default']['robots']['value']));
-    }
-
-    if (!empty($default_values)) {
-      $description = t(
-        'The default value is currently %default_values.',
-        array('%default_values' => implode(', ', $default_values))
-      );
-    }
-    else {
-      $description = t('The default value is currently not set.');
-    }
-
-    $form['robots']['use_default']['#description'] = $description;
-  }
+  $form['revisit-after']['description'] = array(
+    '#value' => t('The meta tag ROBOTS offers a simple mechanism to indicate to web robots and crawlers whether the page should be indexed (NOINDEX) and whether links on the page should be followed (NOFOLLOW).'),
+    '#prefix' => '<div class="description">',
+    '#suffix' => '</div></td>',
+  );
 }
 
 /**
@@ -597,7 +720,7 @@ function nodewords_basic_robots_prepare(
   if ($options['type'] == NODEWORDS_TYPE_PAGER) {
     $value = variable_get('nodewords_list_robots', array());
   }
-  else if (empty($content['use_default'])) {
+  elseif (!empty($content['overwrite_default'])) {
     $value = !empty($content['value']) ? $content['value'] : array();
   }
   else {
Index: nodewords_extra/nodewords_extra.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/nodewords/nodewords_extra/nodewords_extra.module,v
retrieving revision 1.7.2.13
diff -u -p -r1.7.2.13 nodewords_extra.module
--- nodewords_extra/nodewords_extra.module	8 Dec 2009 03:08:44 -0000	1.7.2.13
+++ nodewords_extra/nodewords_extra.module	11 Dec 2009 05:51:27 -0000
@@ -57,46 +57,52 @@ function nodewords_extra_nodewords_api()
 function nodewords_extra_nodewords_tags_info() {
   $tags = array(
     'dc.contributor' => array(
+      'label:lists' => t('Dublin Core contributor'),
+      'label:lists:edit' => t('Contributor'),
       'tag:context:allowed' => array(
         NODEWORDS_TYPE_DEFAULT,
         NODEWORDS_TYPE_NODE,
         NODEWORDS_TYPE_PAGE,
       ),
-      'label:lists' => t('Dublin Core contributor'),
       'tag:function:prefix' => 'nodewords_extra_dc_contributor',
       'tag:template' => array('dc.contributor' => NODEWORDS_META),
       'tag:tokens' => TRUE,
       'widget:permission' => 'edit meta tag Dublin Core CONTRIBUTOR',
     ),
     'dc.creator' => array(
+      'label:lists' => t('Dublin Core creator'),
+      'label:lists:edit' => t('Creator'),
       'tag:context:allowed' => array(
         NODEWORDS_TYPE_DEFAULT,
         NODEWORDS_TYPE_NODE,
         NODEWORDS_TYPE_PAGE,
       ),
-      'label:lists' => t('Dublin Core creator'),
       'tag:function:prefix' => 'nodewords_extra_dc_creator',
       'tag:template' => array('dc.creator' => NODEWORDS_META),
       'tag:tokens' => TRUE,
     ),
     'dc.date' => array(
+      'label:lists' => t('Dublin Core date'),
+      'label:lists:edit' => t('Date'),
       'tag:context:allowed' => array(
+        NODEWORDS_TYPE_DEFAULT,
         NODEWORDS_TYPE_NODE,
         NODEWORDS_TYPE_PAGE,
       ),
-      'label:lists' => t('Dublin Core date'),
       'tag:function:prefix' => 'nodewords_extra_dc_date',
       'tag:template' => array('dc.date' => NODEWORDS_META),
       'widget:permission' => 'edit meta tag Dublin Core DATE',
     ),
     'dc.description' => array(
       'label:lists' => t('Dublin Core description'),
+      'label:lists:edit' => t('Description'),
       'tag:function:prefix' => 'nodewords_extra_dc_description',
       'tag:template' => array('dc.description' => NODEWORDS_META),
       'tag:tokens' => TRUE,
     ),
     'dc.publisher' => array(
       'label:lists' => t('Dublin Core publisher'),
+      'label:lists:edit' => t('Publisher'),
       'tag:context:allowed' => array(
         NODEWORDS_TYPE_DEFAULT,
         NODEWORDS_TYPE_PAGE,
@@ -108,7 +114,19 @@ function nodewords_extra_nodewords_tags_
     ),
     'dc.title' => array(
       'label:lists' => t('Dublin Core title'),
-      'tag:context:denied' => array(NODEWORDS_TYPE_DEFAULT),
+      'label:lists:edit' => t('Title'),
+      'tag:context:allowed' => array(
+        NODEWORDS_TYPE_DEFAULT,
+        NODEWORDS_TYPE_ERRORPAGE,
+        NODEWORDS_TYPE_FRONTPAGE,
+        NODEWORDS_TYPE_NODE,
+        NODEWORDS_TYPE_PAGE,
+        NODEWORDS_TYPE_PAGER,
+        NODEWORDS_TYPE_TERM,
+        NODEWORDS_TYPE_TRACKER,
+        NODEWORDS_TYPE_USER,
+        NODEWORDS_TYPE_VOCABULARY,
+      ),
       'tag:function:prefix' => 'nodewords_extra_dc_title',
       'tag:template' => array('dc.title' => NODEWORDS_META),
       'tag:tokens' => TRUE,
@@ -124,6 +142,7 @@ function nodewords_extra_nodewords_tags_
       'widget:permission' => 'edit location meta tags',
     ),
     'pics-label' => array(
+      'label:lists' => t('PICS labels'),
       'tag:context:allowed' => array(
         NODEWORDS_TYPE_DEFAULT,
         NODEWORDS_TYPE_NODE,
@@ -140,7 +159,6 @@ function nodewords_extra_nodewords_tags_
         'pics-label' => NODEWORDS_HTTP_EQUIV,
         'meta' => NODEWORDS_LINK_REL,
       ),
-      'label:lists' => t('PICS labels'),
       'tag:weight' => array('meta' => -10),
       'widget:permission' => 'edit meta tag PICS-LABEL',
     ),
@@ -203,15 +221,32 @@ function nodewords_extra_perm() {
 function nodewords_extra_dc_contributor_form(&$form, $content, $options) {
   $form['dc.contributor'] = array(
     '#tree' => TRUE,
+    '#prefix' => '<tr class="' . nodewords_tags_field_class() . '">',
+    '#suffix' => '</tr>',
   );
 
+  if ($options['type'] != NODEWORDS_TYPE_DEFAULT) {
+    $form['dc.contributor']['overwrite_default'] = array(
+      '#type' => 'checkbox',
+      '#default_value' => !empty($content['overwrite_default']),
+      '#prefix' => '<td>',
+      '#suffix' => '</td>',
+    );
+  }
+
   $form['dc.contributor']['value'] = array(
     '#type' => 'textfield',
-    '#title' => t('Dublin Core contributor'),
-    '#description' => t('Enter the name of an entity responsible for making contributions to the resource. Examples of a contributor include a person, an organization, or a service. <strong>This field supports tokens</strong>.'),
-    '#default_value' => empty($content['value']) ? (!empty($options['default']['dc.contributor']['value']) ? $options['default']['dc.contributor']['value'] : '') : $content['value'],
+    '#title' => t('Contributor'),
+    '#default_value' => empty($content['value']) ? '' : $content['value'],
     '#size' => 60,
     '#maxlength' => variable_get('nodewords_max_size', 350),
+    '#prefix' => '<td>',
+  );
+
+  $form['dc.contributor']['description'] = array(
+    '#value' => t('Enter the name of an entity responsible for making contributions to the resource. Examples of a contributor include a person, an organization, or a service. <strong>This field supports tokens</strong>.'),
+    '#prefix' => '<div class="description">',
+    '#suffix' => '</div></td>',
   );
 }
 
@@ -219,13 +254,17 @@ function nodewords_extra_dc_contributor_
  * Set the meta tag content.
  */
 function nodewords_extra_dc_contributor_prepare(&$tags, $content, $options) {
-  if (!empty($content['value'])) {
-    $tags['dc.contributor'] = nodewords_replace_tokens($content['value'], $options);
-  }
-  elseif (!empty($options['default']['dc.contributor']['value'])) {
-    $tags['dc.contributor'] = nodewords_replace_tokens($options['default']['dc.contributor']['value'], $options);
+  if (!empty($content['overwrite_default'])) {
+    if (!empty($content['value'])) {
+      $tags['dc.contributor'] = nodewords_replace_tokens($content['value'], $options);
+    }
   }
   else {
+    if (!empty($options['default']['dc.contributor']['value'])) {
+      $tags['dc.contributor'] = nodewords_replace_tokens($options['default']['dc.contributor']['value'], $options);
+    }
+  }
+  if (empty($tags['dc.contributor'])) {
     if ($options['type'] == NODEWORDS_TYPE_NODE) {
       $bool = (
         ($node = node_load(array('nid' => $options['id'], 'vid' => $options['sid']))) &&
@@ -247,15 +286,32 @@ function nodewords_extra_dc_contributor_
 function nodewords_extra_dc_creator_form(&$form, $content, $options) {
   $form['dc.creator'] = array(
     '#tree' => TRUE,
+    '#prefix' => '<tr class="' . nodewords_tags_field_class() . '">',
+    '#suffix' => '</tr>',
   );
 
+  if ($options['type'] != NODEWORDS_TYPE_DEFAULT) {
+    $form['dc.creator']['overwrite_default'] = array(
+      '#type' => 'checkbox',
+      '#default_value' => !empty($content['overwrite_default']),
+      '#prefix' => '<td>',
+      '#suffix' => '</td>',
+    );
+  }
+
   $form['dc.creator']['value'] = array(
     '#type' => 'textfield',
-    '#title' => t('Dublin Core creator'),
-    '#description' => t('Enter the name of an entity primarily responsible for making the resource. Examples of a creator include a person, an organization, or a service. <strong>This field supports tokens</strong>.'),
-    '#default_value' => empty($content['value']) ? (!empty($options['default']['dc.creator']['value']) ? $options['default']['dc.creator']['value'] : '') : $content['value'],
+    '#title' => t('Creator'),
+    '#default_value' => empty($content['value']) ? '' : $content['value'],
     '#size' => 60,
     '#maxlength' => variable_get('nodewords_max_size', 350),
+    '#prefix' => '<td>',
+  );
+
+  $form['dc.creator']['description'] = array(
+    '#value' => t('Enter the name of an entity primarily responsible for making the resource. Examples of a creator include a person, an organization, or a service. <strong>This field supports tokens</strong>.'),
+    '#prefix' => '<div class="description">',
+    '#suffix' => '</div></td>',
   );
 }
 
@@ -263,13 +319,17 @@ function nodewords_extra_dc_creator_form
  * Set the meta tag content.
  */
 function nodewords_extra_dc_creator_prepare(&$tags, $content, $options) {
-  if (!empty($content['value'])) {
-    $tags['dc.creator'] = nodewords_replace_tokens($content['value'], $options);
-  }
-  elseif (!empty($options['default']['dc.creator']['value'])) {
-    $tags['dc.creator'] = nodewords_replace_tokens($options['default']['dc.creator']['value'], $options);
+  if (!empty($content['overwrite_default'])) {
+    if (!empty($content['value'])) {
+      $tags['dc.creator'] = nodewords_replace_tokens($content['value'], $options);
+    }
   }
   else {
+    if (!empty($options['default']['dc.contributor']['value'])) {
+      $tags['dc.creator'] = nodewords_replace_tokens($options['default']['dc.creator']['value'], $options);
+    }
+  }
+  if (empty($tags['dc.creator'])) {
     if ($options['type'] == NODEWORDS_TYPE_NODE) {
       $bool = (
         ($node = node_load(array('nid' => $options['id'], 'vid' => $options['sid']))) &&
@@ -291,13 +351,30 @@ function nodewords_extra_dc_creator_prep
 function nodewords_extra_dc_date_form(&$form, $content, $options) {
   $form['dc.date'] = array(
     '#tree' => TRUE,
+    '#prefix' => '<tr class="' . nodewords_tags_field_class() . '">',
+    '#suffix' => '</tr>',
   );
 
+  if ($options['type'] != NODEWORDS_TYPE_DEFAULT) {
+    $form['dc.date']['overwrite_default'] = array(
+      '#type' => 'checkbox',
+      '#default_value' => !empty($content['overwrite_default']),
+      '#prefix' => '<td>',
+      '#suffix' => '</td>',
+    );
+  }
+
   $form['dc.date']['value'] = array(
     '#type' => 'date',
-    '#title' => t('Dublin Core date'),
-    '#description' => t('A point or period of time associated with an event in the lifecycle of the resource. The date should be relative to UTC.'),
+    '#title' => t('Date'),
     '#default_value' => empty($content['value']) ? array() : $content['value'],
+    '#prefix' => '<td>',
+  );
+
+  $form['dc.date']['description'] = array(
+    '#value' => t('A point or period of time associated with an event in the lifecycle of the resource. The date should be relative to UTC.'),
+    '#prefix' => '<div class="description">',
+    '#suffix' => '</div></td>',
   );
 }
 
@@ -305,11 +382,16 @@ function nodewords_extra_dc_date_form(&$
  * Set the meta tag content.
  */
 function nodewords_extra_dc_date_prepare(&$tags, $content, $options) {
-  if (!empty($content['value'])) {
+
+  if (!empty($content['overwrite_default'])) {
+    $time = time();
+  }
+  else {
     $time = mktime(0, 0, 0, $content['value']['month'], $content['value']['day'], $content['value']['year']);
-    if ($time > 0) {
-      $tags['dc.date'] = date('Y-m-d\TH:i:s\Z', $time);
-    }
+  }
+
+  if ($time > 0) {
+    $tags['dc.date'] = date('Y-m-d\TH:i:s\Z', $time);
   }
 }
 
@@ -325,19 +407,33 @@ function nodewords_extra_dc_description_
 
     if (!$bool) {
       $form['dc.description'] = array(
-        '#type' => 'fieldset',
-        '#title' => t('Description'),
-        '#description' => t('Enter a description. Limit your description to about 20 words, with a maximum of %count characters. It should not contain any HTML tags or other formatting. <strong>This field supports tokens</strong>.', array('%count' => variable_get('nodewords_max_size', 350))),
-        '#collapsible' => TRUE,
-        '#collapsed' => !(empty($content['value']) && empty($options['default']['dc.description']['value'])),
         '#tree' => TRUE,
+        '#prefix' => '<tr class="' . nodewords_tags_field_class() . '">',
+        '#suffix' => '</tr>',
       );
 
+      if ($options['type'] != NODEWORDS_TYPE_DEFAULT) {
+        $form['dc.description']['overwrite_default'] = array(
+          '#type' => 'checkbox',
+          '#default_value' => !empty($content['overwrite_default']),
+          '#prefix' => '<td>',
+          '#suffix' => '</td>',
+        );
+      }
+
       $form['dc.description']['value'] = array(
         '#type' => 'textarea',
+        '#title' => t('Description'),
         '#default_value' => empty($content['value']) ? (!empty($options['default']['dc.description']['value']) ? $options['default']['dc.description']['value'] : '') : $content['value'],
         '#cols' => 60,
         '#rows' => 6,
+        '#prefix' => '<td>',
+      );
+
+      $form['dc.description']['description'] = array(
+        '#value' => t('Enter a description. Limit your description to about 20 words, with a maximum of %count characters. It should not contain any HTML tags or other formatting. <strong>This field supports tokens</strong>.', array('%count' => variable_get('nodewords_max_size', 350))),
+        '#prefix' => '<div class="description">',
+        '#suffix' => '</div></td>',
       );
     }
   }
@@ -375,19 +471,33 @@ function nodewords_extra_dc_description_
  */
 function nodewords_extra_dc_publisher_form(&$form, $content, $options) {
   $form['dc.publisher'] = array(
-    '#type' => 'fieldset',
-    '#title' => t('Dublin Core publisher'),
-    '#description' => t('Enter a name of an entity responsible for making the resource available. Examples of a publisher include a person, an organization, or a service. <strong>This field supports tokens</strong>.'),
-    '#collapsible' => TRUE,
-    '#collapsed' => !empty($options['default']['dc.publisher']['value']),
     '#tree' => TRUE,
+    '#prefix' => '<tr class="' . nodewords_tags_field_class() . '">',
+    '#suffix' => '</tr>',
   );
 
+  if ($options['type'] != NODEWORDS_TYPE_DEFAULT) {
+    $form['dc.publisher']['overwrite_default'] = array(
+      '#type' => 'checkbox',
+      '#default_value' => !empty($content['overwrite_default']),
+      '#prefix' => '<td>',
+      '#suffix' => '</td>',
+    );
+  }
+
   $form['dc.publisher']['value'] = array(
     '#type' => 'textfield',
-    '#default_value' => empty($options['default']['dc.publisher']['value']) ? '' : $options['default']['dc.publisher']['value'],
+    '#title' => t('Publisher'),
+    '#default_value' => empty($content['value']) ? '' : $content['value'],
     '#size' => 60,
     '#maxlength' => variable_get('nodewords_max_size', 350),
+    '#prefix' => '<td>',
+  );
+
+  $form['dc.date']['description'] = array(
+    '#value' => t('Enter a name of an entity responsible for making the resource available. Examples of a publisher include a person, an organization, or a service. <strong>This field supports tokens</strong>.'),
+    '#prefix' => '<div class="description">',
+    '#suffix' => '</div></td>',
   );
 }
 
@@ -395,8 +505,30 @@ function nodewords_extra_dc_publisher_fo
  * Set the meta tag content.
  */
 function nodewords_extra_dc_publisher_prepare(&$tags, $content, $options) {
-  $value = empty($options['default']['dc.publisher']['value']) ? '' : $options['default']['dc.publisher']['value'];
-  $tags['dc.publisher'] = nodewords_replace_tokens($value, $options);
+  if (!empty($content['overwrite_default'])) {
+    if (!empty($content['value'])) {
+      $tags['dc.publisher'] = nodewords_replace_tokens($content['value'], $options);
+    }
+  }
+  else {
+    if (!empty($options['default']['dc.publisher']['value'])) {
+      $tags['dc.creator'] = nodewords_replace_tokens($options['default']['dc.publisher']['value'], $options);
+    }
+  }
+  if (empty($tags['dc.creator'])) {
+    if ($options['type'] == NODEWORDS_TYPE_NODE) {
+      $bool = (
+        ($node = node_load(array('nid' => $options['id'], 'vid' => $options['sid']))) &&
+        ($uid = $node->uid) &&
+        ($user = user_load($uid)) &&
+        $user->name
+      );
+
+      if ($bool) {
+        $tags['dc.publisher'] = $user->name;
+      }
+    }
+  }
 }
 
 /**
@@ -404,19 +536,33 @@ function nodewords_extra_dc_publisher_pr
  */
 function nodewords_extra_dc_title_form(&$form, $content, $options) {
   $form['dc.title'] = array(
-    '#type' => 'fieldset',
-    '#title' => t('Dublin Core title'),
-    '#description' => t('Enter an alternative title. Do not use the value already used for the HTML tag TITLE, or you will probably get warning reports about duplicated titles from the search engines. <strong>This field supports tokens</strong>.'),
-    '#collapsible' => TRUE,
-    '#collapsed' => !empty($content['value']),
     '#tree' => TRUE,
+    '#prefix' => '<tr class="' . nodewords_tags_field_class() . '">',
+    '#suffix' => '</tr>',
   );
 
+  if ($options['type'] != NODEWORDS_TYPE_DEFAULT) {
+    $form['dc.title']['overwrite_default'] = array(
+      '#type' => 'checkbox',
+      '#default_value' => !empty($content['overwrite_default']),
+      '#prefix' => '<td>',
+      '#suffix' => '</td>',
+    );
+  }
+
   $form['dc.title']['value'] = array(
     '#type' => 'textfield',
+    '#title' => t('Alternative title'),
     '#default_value' => empty($content['value']) ? '' : $content['value'],
     '#size' => 60,
     '#maxlength' => variable_get('nodewords_max_size', 350),
+    '#prefix' => '<td>',
+  );
+
+  $form['dc.title']['description'] = array(
+    '#value' => t('Enter an alternative title. Do not use the value already used for the HTML tag TITLE, or you will probably get warning reports about duplicated titles from the search engines. <strong>This field supports tokens</strong>.'),
+    '#prefix' => '<div class="description">',
+    '#suffix' => '</div></td>',
   );
 }
 
@@ -424,8 +570,16 @@ function nodewords_extra_dc_title_form(&
  * Set the meta tag content.
  */
 function nodewords_extra_dc_title_prepare(&$tags, $content, $options) {
-  $value = empty($content['value']) ? '' : $content['value'];
-  $tags['dc.title'] = nodewords_replace_tokens($value, $options);
+  if (!empty($content['overwrite_default'])) {
+    if (!empty($content['value'])) {
+      $tags['dc.creator'] = nodewords_replace_tokens($content['value'], $options);
+    }
+  }
+  else {
+    if (!empty($options['default']['dc.title']['value'])) {
+      $tags['dc.creator'] = nodewords_replace_tokens($options['default']['dc.title']['value'], $options);
+    }
+  }
 }
 
 /**
@@ -434,50 +588,77 @@ function nodewords_extra_dc_title_prepar
 function nodewords_extra_location_form(&$form, $content, $options) {
   $form['location'] = array(
     '#tree' => TRUE,
+    '#prefix' => '<tr class="' . nodewords_tags_field_class() . '">',
+    '#suffix' => '</tr>',
   );
 
+  if ($options['type'] != NODEWORDS_TYPE_DEFAULT) {
+    $form['location']['overwrite_default'] = array(
+      '#type' => 'checkbox',
+      '#default_value' => !empty($content['overwrite_default']),
+      '#prefix' => '<td>',
+      '#suffix' => '</td>',
+    );
+  }
+
   $form['location']['latitude'] = array(
     '#type' => 'textfield',
-    '#title' => t('Location coordinates (latitude, longitude)'),
-    '#default_value' => empty($content['latitude']) ? (!empty($options['default']['location']['latitude']) ? $options['default']['location']['latitude'] : '') : $content['latitude'],
+    '#default_value' => empty($content['latitude']) ? '' : $content['latitude'],
     '#element_validate' => array('nodewords_extra_location_form_validate'),
     '#size' => 14,
     '#maxlength' => 14,
-    '#prefix' => '<div class="container-inline">',
     '#latitude' => TRUE,
+    '#prefix' => '<td><div class="container-online">',
   );
 
   $form['location']['longitude'] = array(
     '#type' => 'textfield',
-    '#title' => '',
-    '#default_value' => empty($content['longitude']) ? (!empty($options['default']['location']['longitude']) ? $options['default']['location']['longitude'] : '') : $content['longitude'],
+    '#default_value' => empty($content['longitude']) ? '' : $content['longitude'],
     '#size' => 14,
     '#element_validate' => array('nodewords_extra_location_form_validate'),
     '#maxlength' => 14,
     '#suffix' => '</div>',
   );
+
+  $form['location']['description'] = array(
+    '#value' => t('Enter latitude, and longitude.'),
+    '#prefix' => '<div class="description">',
+    '#suffix' => '</div></td>',
+  );
 }
 
 /**
  * Set the meta tag content.
  */
 function nodewords_extra_location_prepare(&$tags, $content, $options) {
-  if ((empty($content['longitude']) || empty($content['longitude'])) && $options['type'] == NODEWORDS_TYPE_NODE && module_exists('location')) {
-    $node = node_load(array('nid' => $options['id'], 'vid' => $options['sid']));
-    if ($node && isset($node->locations[0]['latitude']) && isset($node->locations[0]['longitude'])) {
-      $content['latitude'] = $node->locations[0]['latitude'];
-      $content['longitude'] = $node->locations[0]['longitude'];
+  if (!empty($content['overwrite_default'])) {
+    if (!empty($content['latitude']) && !empty($content['longitude'])) {
+      $tags['location:geo.position'] = $content['latitude'] . ';' . $content['longitude'];
+      $tags['location:icbm'] = $content['latitude'] . ',' . $content['longitude'];
     }
   }
+  else {
+    $bool = (
+      !empty($options['default']['location']['latitude']) &&
+      !empty($options['default']['location']['longitude'])
+    );
 
-  if (empty($content['latitude']) || empty($content['longitude'])) {
-    $content['latitude'] = !empty($options['default']['location']['latitude']) ? $options['default']['location']['latitude'] : '';
-    $content['longitude'] = !empty($options['default']['location']['longitude']) ? $options['default']['location']['longitude'] : '';
+    if ($bool) {
+      $tags['location:geo.position'] = $options['default']['location']['latitude'] . ';' . $options['default']['location']['longitude'];
+      $tags['location:icbm'] = $options['default']['location']['latitude'] . ',' . $options['default']['location']['longitude'];
+    }
   }
 
-  if (!empty($content['longitude']) && !empty($content['longitude'])) {
-    $tags['location:geo.position'] = $content['latitude'] . ';' . $content['longitude'];
-    $tags['location:icbm'] = $content['latitude'] . ',' . $content['longitude'];
+  $bool = (
+    empty($tags['location:geo.position']) &&
+    $options['type'] == NODEWORDS_TYPE_NODE &&
+    module_exists('location') &&
+    ($node = node_load(array('nid' => $options['id'], 'vid' => $options['vid'])))
+  );
+
+  if ($bool && isset($node->locations[0]['latitude']) && isset($node->locations[0]['longitude'])) {
+    $tags['location:geo.position'] = $node->locations[0]['latitude'] . ';' . $node->locations[0]['longitude'];
+    $tags['location:icbm'] = $node->locations[0]['latitude'] . ',' . $node->locations[0]['longitude'];
   }
 }
 
@@ -503,15 +684,32 @@ function nodewords_extra_location_form_v
 function nodewords_extra_pics_form(&$form, $content, $options) {
   $form['pics-label'] = array(
     '#tree' => TRUE,
+    '#prefix' => '<tr class="' . nodewords_tags_field_class() . '">',
+    '#suffix' => '</tr>',
   );
 
+  if ($options['type'] != NODEWORDS_TYPE_DEFAULT) {
+    $form['pics-label']['overwrite_default'] = array(
+      '#type' => 'checkbox',
+      '#default_value' => !empty($content['overwrite_default']),
+      '#prefix' => '<td>',
+      '#suffix' => '</td>',
+    );
+  }
+
   $form['pics-label']['value'] = array(
     '#type' => 'textfield',
-    '#title' => t('PICS labels'),
-    '#description' => t('Enter the ICRA PICS labels only, without any extra characters; ICRA PICS labels should be something similar to %icra-pics-example. You can use the online <a href="@icra-label-generator">ICRA label generator</a>.', array('%icra-pics-example' => 'n 0 s 0 v 0 l 0 oa 0 ob 0 oc 0 od 0 oe 0 of 0 og 0 oh 0 c 1', '@icra-label-generator' => 'http://www.icra.org/label/generator/')),
-    '#default_value' => empty($content['value']) ? (!empty($options['default']['pics-label']['value']) ? $options['default']['pics-label']['value'] : '') : $content['value'],
+    '#title' => t('PICS label'),
+    '#default_value' => empty($content['value']) ? '' : $content['value'],
     '#size' => 60,
     '#maxlength' => variable_get('nodewords_max_size', 350),
+    '#prefix' => '<td>',
+  );
+
+  $form['pics-label']['description'] = array(
+    '#value' => t('Enter the ICRA PICS labels only, without any extra characters; ICRA PICS labels should be something similar to %icra-pics-example. You can use the online <a href="@icra-label-generator">ICRA label generator</a>.', array('%icra-pics-example' => 'n 0 s 0 v 0 l 0 oa 0 ob 0 oc 0 od 0 oe 0 of 0 og 0 oh 0 c 1', '@icra-label-generator' => 'http://www.icra.org/label/generator/')),
+    '#prefix' => '<div class="description">',
+    '#suffix' => '</div></td>',
   );
 }
 
@@ -519,24 +717,38 @@ function nodewords_extra_pics_form(&$for
  * Set the meta tag content.
  */
 function nodewords_extra_pics_prepare(&$tags, $content, $options) {
-  if (empty($content['value'])) {
-    $content['value'] = !empty($options['default']['pics-label']['value']) ? $options['default']['pics-label']['value'] : '';
+  if (!empty($content['overwrite_default'])) {
+    $value = $content['value'];
+  }
+  else {
+    $value = $options['default']['pics-label']['value'];
   }
 
-  if (!empty($content['value'])) {
+  if (!empty($value)) {
     if ($options['type'] == NODEWORDS_TYPE_NODE) {
       $tags['pics-label'] = strtr(
         '(pics-1.1 "http://www.icra.org/pics/vocabularyv03/" l gen true for %url r (%pics))',
         array(
           '%url' => url("node/{$options['id']}", array('absolute' => TRUE)),
-          '%pics' => $content['value'],
+          '%pics' => $value,
         )
       );
     }
-  }
+    elseif ($options['type'] == NODEWORDS_TYPE_PAGE) {
+      $base_url = rtrim(variable_get('nodewords_base_url', ''), '/');
+      $options = array(
+        'absolute' => TRUE,
+        'base_url' => $base_url,
+      );
 
-  if (variable_get('nodewords_icra_validation_content', '')) {
-    $tags['pics-label:meta'] = url('labels.rdf', array('absolute' => TRUE));
+      $tags['pics-label'] = strtr(
+        '(pics-1.1 "http://www.icra.org/pics/vocabularyv03/" l gen true for %url r (%pics))',
+        array(
+          '%url' => url("node/{$options['id']}", array('absolute' => TRUE)),
+          '%pics' => $value,
+        )
+      );
+    }
   }
 }
 
Index: nodewords_verification_tags/nodewords_verification_tags.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/nodewords/nodewords_verification_tags/nodewords_verification_tags.module,v
retrieving revision 1.4.2.3
diff -u -p -r1.4.2.3 nodewords_verification_tags.module
--- nodewords_verification_tags/nodewords_verification_tags.module	8 Dec 2009 03:08:37 -0000	1.4.2.3
+++ nodewords_verification_tags/nodewords_verification_tags.module	11 Dec 2009 05:51:27 -0000
@@ -85,15 +85,30 @@ function nodewords_verification_tags_per
 function nodewords_verification_tags_bing_webmaster_center_form(&$form, $content, $options) {
   $form['bing_webmaster_center'] = array(
     '#tree' => TRUE,
+    '#prefix' => '<tr class="' . nodewords_tags_field_class() . '">',
+    '#suffix' => '</tr>',
   );
 
+  if ($options['type'] != NODEWORDS_TYPE_DEFAULT) {
+    $form['bing_webmaster_center']['overwrite_default'] = array(
+      '#prefix' => '<td>&nbsp;',
+      '#suffix' => '</td>',
+    );
+  }
+
   $form['bing_webmaster_center']['value'] = array(
     '#type' => 'textfield',
     '#title' => t('Bing Webmaster Center verification code'),
-    '#description' => t('<a href="@bing-url">Bing Webmaster Center</a> will ask you to add a meta tag in order to verify you have write access to the pages of the web site you registered with their services.', array('@bing-url' => 'http://www.bing.com/webmaster')),
     '#default_value' => empty($content['value']) ? '' : $content['value'],
     '#size' => 60,
     '#maxlength' => variable_get('nodewords_max_size', 350),
+    '#prefix' => '<td>',
+  );
+
+  $form['bing_webmaster_center']['description'] = array(
+    '#value' => t('<a href="@bing-url">Bing Webmaster Center</a> will ask you to add a meta tag in order to verify you have write access to the pages of the web site you registered with their services.', array('@bing-url' => 'http://www.bing.com/webmaster')),
+    '#prefix' => '<div class="description">',
+    '#suffix' => '</div></td>',
   );
 }
 
@@ -103,15 +118,30 @@ function nodewords_verification_tags_bin
 function nodewords_verification_tags_google_webmaster_tools_form(&$form, $content, $options) {
   $form['google_webmaster_tools'] = array(
     '#tree' => TRUE,
+    '#prefix' => '<tr class="' . nodewords_tags_field_class() . '">',
+    '#suffix' => '</tr>',
   );
 
+  if ($options['type'] != NODEWORDS_TYPE_DEFAULT) {
+    $form['google_webmaster_tools']['overwrite_default'] = array(
+      '#prefix' => '<td>&nbsp;',
+      '#suffix' => '</td>',
+    );
+  }
+
   $form['google_webmaster_tools']['value'] = array(
     '#type' => 'textfield',
     '#title' => t('Google Webmaster Tools verification code'),
-    '#description' => t('<a href="@google-url">Google Webmaster Tools</a> will ask you to add a meta tag in your web site to provide you with an easy way to make your site more <a href="http://google.com">Google</a>-friendly.', array('@google-url' => 'http://www.google.com/webmasters/tools')),
     '#default_value' => empty($content['value']) ? '' : $content['value'],
     '#size' => 60,
     '#maxlength' => variable_get('nodewords_max_size', 350),
+    '#prefix' => '<td>',
+  );
+
+  $form['google_webmaster_tools']['description'] = array(
+    '#value' => t('<a href="@google-url">Google Webmaster Tools</a> will ask you to add a meta tag in your web site to provide you with an easy way to make your site more <a href="http://google.com">Google</a>-friendly.', array('@google-url' => 'http://www.google.com/webmasters/tools')),
+    '#prefix' => '<div class="description">',
+    '#suffix' => '</div></td>',
   );
 }
 
@@ -121,15 +151,30 @@ function nodewords_verification_tags_goo
 function nodewords_verification_tags_yahoo_site_explorer_form(&$form, $content, $options) {
   $form['yahoo_site_explorer'] = array(
     '#tree' => TRUE,
+    '#prefix' => '<tr class="' . nodewords_tags_field_class() . '">',
+    '#suffix' => '</tr>',
   );
 
+  if ($options['type'] != NODEWORDS_TYPE_DEFAULT) {
+    $form['yahoo_site_explorer']['overwrite_default'] = array(
+      '#prefix' => '<td>&nbsp;',
+      '#suffix' => '</td>',
+    );
+  }
+
   $form['yahoo_site_explorer']['value'] = array(
     '#type' => 'textfield',
     '#title' => t('Yahoo! Site Explorer'),
-    '#description' => t('<a href="@yahoo-url">Yahoo! Site Explorer</a> will ask you to add a meta tag in your web site to allow you to explore all the web pages indexed by <a href="http://search.yahoo.com">Yahoo! Search</a>.', array('@yahoo-url' => 'https://siteexplorer.search.yahoo.com/')),
     '#default_value' => empty($content['value']) ? '' : $content['value'],
     '#size' => 60,
     '#maxlength' => variable_get('nodewords_max_size', 350),
+    '#prefix' => '<td>',
+  );
+
+  $form['yahoo_site_explorer']['description'] = array(
+    '#value' => t('<a href="@yahoo-url">Yahoo! Site Explorer</a> will ask you to add a meta tag in your web site to allow you to explore all the web pages indexed by <a href="http://search.yahoo.com">Yahoo! Search</a>.', array('@yahoo-url' => 'https://siteexplorer.search.yahoo.com/')),
+    '#prefix' => '<div class="description">',
+    '#suffix' => '</div></td>',
   );
 }
 
Index: nodewords.admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/nodewords/nodewords.admin.inc,v
retrieving revision 1.6.2.16
diff -u -p -r1.6.2.16 nodewords.admin.inc
--- nodewords.admin.inc	8 Dec 2009 07:02:19 -0000	1.6.2.16
+++ nodewords.admin.inc	11 Dec 2009 05:51:28 -0000
@@ -245,13 +245,15 @@ function nodewords_pages_edit_validate($
 function nodewords_pages_edit_submit($form, &$form_state) {
   $form_state['values']['path'] = trim($form_state['values']['path']);
 
-  nodewords_save_tags($form_state['values']['nodewords'],
+  nodewords_save_tags($form_state['values']['nodewords']['metatags'],
     array(
       'type' => NODEWORDS_TYPE_PAGE,
       'id' => $form_state['values']['path']
     )
   );
 
+  unset($form_state['values']['nodewords']['metatags']);
+
   drupal_write_record('nodewords_custom', $form_state['values'], isset($form_state['values']['pid']) ? 'pid' : array());
 
   drupal_set_message(t('The configuration options have been saved.'));
@@ -266,10 +268,8 @@ function nodewords_settings_form() {
   $form = array();
   $index_options = array();
   $metatags_options = array(
-    'fields:before' => array(
+    'fields:after' => array(
       'operations' => array(
-        '#type' => 'fieldset',
-        '#title' => t('Operations'),
         'reset_metatags' => array(
           '#type' => 'submit',
           '#value' => t('Reset default meta tag values'),
@@ -277,7 +277,8 @@ function nodewords_settings_form() {
         ),
       ),
     ),
-    'fieldset:description' => t('These are the values used for the meta tags content when there are not values for the viewed page.'),
+    'fieldset' => TRUE,
+    'fieldset:description' => t('These values are used for the meta tags content when there are not values for the viewed page.'),
     'fieldset:title' => t('Default meta tags'),
     'fieldset:weight' => 0,
   );
@@ -287,9 +288,10 @@ function nodewords_settings_form() {
   $form['enabled'] = array(
     '#type' => 'fieldset',
     '#title' => t('Enabled meta tags'),
-    '#description' => t('Select the meta tags you want to be able to edit, and which should be output.'),
+    '#description' => t('Select the meta tags that appear in the edit forms, and which should be output in HTML. Users with administration permissions can edit all the meta tags, even when they are not enabled to appear in the edit forms..'),
     '#collapsible' => TRUE,
     '#weight' => 0,
+    '#group' => 'nodewords',
   );
 
   $form['enabled']['metatags'] = array(
@@ -354,12 +356,17 @@ function nodewords_settings_form() {
     NODEWORDS_TYPE_DEFAULT, nodewords_load_tags(), $metatags_options
   );
 
+  if (!empty($form['default_metatags'])) {
+    $form['default_metatags']['#group'] = 'nodewords';
+  }
+
   $form['metatags_creation'] = array(
     '#type' => 'fieldset',
     '#title' => t('Meta tags creation options'),
     '#description' => t('These options change the way the meta tags are generated.'),
     '#collapsible' => TRUE,
     '#weight' => 1,
+    '#group' => 'nodewords',
   );
 
   $form['metatags_creation']['nodewords_list_repeat'] = array(
@@ -436,6 +443,7 @@ function nodewords_settings_form() {
     '#description' => t('These options enable the integration between Nodewords and other modules.'),
     '#collapsible' => TRUE,
     '#weight' => 1,
+    '#group' => 'nodewords',
   );
 
   $form['third_party_integration']['nodewords_enable_checkall'] = array(
@@ -513,8 +521,6 @@ function nodewords_settings_form() {
     }
   }
 
-  $form['buttons']['#weight'] = 100;
-
   $form['buttons']['submit'] = array(
     '#type' => 'submit',
     '#value' => t('Save configuration'),
@@ -524,6 +530,11 @@ function nodewords_settings_form() {
     '#value' => t('Reset to defaults'),
     '#submit' => array('nodewords_settings_form_reset'),
   );
+  $form['buttons']['#weight'] = 100;
+
+  if (variable_get('nodewords_enable_vertical_tabs', FALSE)) {
+    $form['#pre_render'][] = 'vertical_tabs_form_pre_render';
+  }
 
   $form['#submit'][] = 'nodewords_settings_form_submit';
   $form['#theme'] = 'nodewords_settings_form';
@@ -565,7 +576,7 @@ function nodewords_max_size_validate($el
  * Submission function for the settings page.
  */
 function nodewords_settings_form_submit($form, &$form_state) {
-  nodewords_save_tags($form_state['values']['default_metatags']);
+  nodewords_save_tags($form_state['values']['default_metatags']['metatags']);
 
   // Exclude unnecessary elements.
   unset(
@@ -631,13 +642,12 @@ function nodewords_settings_form_reset_m
  * Meta tags edit form.
  */
 function nodewords_tags_edit_form(&$form_state, $options = array()) {
-  global $language;
-
   $count = 0;
   $default_options = array(
+    'type' => NODEWORDS_TYPE_DEFAULT,
     'id' => '',
     'sid' => 0,
-    'language' => $language->language,
+    'language' => '',
   );
   $form = array();
   $options += $default_options;
@@ -691,7 +701,7 @@ function nodewords_tags_edit_form_reset(
  */
 function nodewords_tags_edit_form_submit($form, &$form_state) {
   nodewords_save_tags(
-    $form_state['values']['nodewords'],
+    $form_state['values']['nodewords']['metatags'],
     $form['#nodewords_options']
   );
   drupal_set_message(t('The configuration options have been saved.'));
Index: nodewords.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/nodewords/nodewords.module,v
retrieving revision 1.66.2.41
diff -u -p -r1.66.2.41 nodewords.module
--- nodewords.module	8 Dec 2009 07:02:19 -0000	1.66.2.41
+++ nodewords.module	11 Dec 2009 05:51:29 -0000
@@ -73,17 +73,6 @@ function nodewords_content_extra_fields(
  */
 function nodewords_form_alter(&$form, &$form_state, $form_id) {
   $bool = (
-    variable_get('nodewords_enable_vertical_tabs', FALSE) &&
-    module_exists('vertical_tabs') &&
-    function_exists('vertical_tabs_add_vertical_tabs') &&
-    $form_id == 'nodewords_settings_form'
-  );
-
-  if ($bool) {
-    vertical_tabs_add_vertical_tabs($form);
-  }
-
-  $bool = (
     isset($form['type']) &&
     isset($form['type']['#value']) &&
     $form_id == $form['type']['#value'] . '_node_form' &&
@@ -125,6 +114,7 @@ function nodewords_form_node_type_form_a
       '#title' => t('Meta tags settings'),
       '#collapsible' => TRUE,
       '#collapsed' => TRUE,
+      '#group' => 'additional_settings',
     );
 
     $form['nodewords']['nodewords_edit_metatags'] = array(
@@ -269,7 +259,7 @@ function nodewords_form_taxonomy_form_vo
 function nodewords_help($path, $arg) {
   switch ($path) {
     case 'admin/content/nodewords/meta-tags':
-      $output = '<p>' . t('On this page you can enter the default values for the meta tags of your site.') . '</p>';
+      $output = '<p>' . t('On this page you can enter the meta tags for the front page of your site.') . '</p>';
       break;
 
     case 'admin/content/nodewords/meta-tags/errorpage_403':
@@ -280,10 +270,6 @@ function nodewords_help($path, $arg) {
       $output = '<p>' . t('On this page you can enter the meta tags for the <q>page not found</q> error page of your site.') . '</p>';
       break;
 
-    case 'admin/content/nodewords/meta-tags/frontpage':
-      $output = '<p>' . t('On this page you can enter the meta tags for the front page of your site.') . '</p>';
-      break;
-
     case 'admin/content/nodewords/meta-tags/other':
       $output = '<p>' . t('On this page you can enter the meta tags for other pages of your site. The meta tags set in these page are used before the ones set for nodes or user profiles, and they can ovverride those meta tags.') . '</p>';
       break;
@@ -343,7 +329,7 @@ function nodewords_menu() {
   $items['admin/content/nodewords/meta-tags/errorpage_403'] = array(
     'title' => 'Error 403 page',
     'access arguments' => $admin_access,
-    'type' => MENU_DEFAULT_LOCAL_TASK,
+    'type' => MENU_LOCAL_TASK,
     'file' => 'nodewords.admin.inc',
   );
 
@@ -372,7 +358,7 @@ function nodewords_menu() {
       )
     ),
     'access arguments' => $admin_access,
-    'type' => MENU_LOCAL_TASK,
+    'type' => MENU_DEFAULT_LOCAL_TASK,
     'file' => 'nodewords.admin.inc',
   );
 
@@ -650,9 +636,9 @@ function nodewords_taxonomy($op, $type, 
 
     case 'insert':
     case 'update':
-      if (isset($object['nodewords'])) {
+      if (isset($object['nodewords']['metatags'])) {
         nodewords_save_tags(
-          $object['nodewords'],
+          $object['nodewords']['metatags'],
           array(
             'type' => $type,
             'id' => $id
@@ -676,11 +662,6 @@ function nodewords_theme() {
       'arguments' => array('form' => array()),
       'file' => 'nodewords.admin.inc',
     ),
-/*
-    'nodewords_tags_edit_fields' => array(
-      'arguments' => array('form' => array()),
-    ),
-*/
   );
 }
 
@@ -713,7 +694,7 @@ function nodewords_user($op, &$edit, &$a
     case 'update':
       if (isset($edit['nodewords'])) {
         nodewords_save_tags(
-          $edit['nodewords'],
+          $edit['nodewords']['metatags'],
             array(
               'type' => NODEWORDS_TYPE_USER,
               'id' => $account->uid
@@ -1178,13 +1159,13 @@ function nodewords_replace_tokens($conte
  * Update or insert tags in the table.
  */
 function nodewords_save_tags($tags, $options = array()) {
-  global $language, $user;
+  global $user;
 
   $default_options = array(
     'type' => NODEWORDS_TYPE_DEFAULT,
     'id' => '',
     'sid' => 0,
-    'language' => $language->language,
+    'language' => '',
     'log_message' => TRUE,
   );
   $done = FALSE;
@@ -1195,9 +1176,9 @@ function nodewords_save_tags($tags, $opt
     if (isset($tags_info[$name])) {
       $content = serialize($content);
       $result = db_fetch_object(
-        db_query(
+        db_query_range(
           "SELECT * FROM {nodewords} WHERE type = %d AND id = '%s' AND sid = %d AND name = '%s' AND language = '%s'",
-          $options['type'], $options['id'], $options['sid'], $name, $options['language']
+          $options['type'], $options['id'], $options['sid'], $name, $options['language'], 0, 1
         )
       );
 
@@ -1207,6 +1188,7 @@ function nodewords_save_tags($tags, $opt
         $row->id = $options['id'];
         $row->sid = $options['sid'];
         $row->name = $name;
+        $row->language = $options['language'];
       }
       else {
         $row = $result;
@@ -1214,9 +1196,9 @@ function nodewords_save_tags($tags, $opt
 
       $row->content = $content;
 
-      drupal_write_record('nodewords', $row, $result !== FALSE ? 'mtid' : array());
+      $ret = drupal_write_record('nodewords', $row, isset($row->mtid) ? 'mtid' : array());
 
-      if (!$done) {
+      if (!$done && $ret) {
         watchdog(
           'nodewords',
           'User %name changed the meta tags for type %type (%id - %sid).',
@@ -1224,6 +1206,7 @@ function nodewords_save_tags($tags, $opt
             '%name' => $user->name, '%type' => $options['type'], '%id' => $options['id'], '%sid' => $options['sid']
           )
         );
+
         $done = TRUE;
       }
     }
@@ -1254,6 +1237,7 @@ function nodewords_tags_edit_fields($typ
   $default_options = array(
     'fields:after' => array(),
     'fields:before' => array(),
+    'fieldset' => FALSE,
     'fieldset:collapsible' => TRUE,
     'fieldset:collapsed' => TRUE,
     'fieldset:description' => '',
@@ -1267,19 +1251,14 @@ function nodewords_tags_edit_fields($typ
     'type' => $type,
   );
   $edit_tags = variable_get('nodewords_edit', array());
-  $form = array();
-  $form_fieldset = array(
-    '#type' => 'fieldset',
-    '#title' => $options['fieldset:title'],
-    '#description' => $options['fieldset:description'],
-    '#tree' => TRUE,
-    '#collapsible' => $options['fieldset:collapsible'],
-    '#collapsed' => $options['fieldset:collapsed'],
-    '#weight' => $options['fieldset:weight'],
-  );
+  $form_metatags = array();
   $options += $default_options;
   $tags_info = nodewords_get_possible_tags();
   $tokens_support = FALSE;
+  $form = array(
+    '#tree' => TRUE,
+    '#group' => 'additional_settings',
+  );
 
   if (isset($options['tag_options']) && is_array($options['tag_options'])) {
     $tag_options = $options['tag_options'] + $default_tag_options;
@@ -1290,71 +1269,86 @@ function nodewords_tags_edit_fields($typ
 
   $tokens_enabled = module_exists('token') && $options['tokens'];
 
-  foreach ($tags_info as $name => $info) {
-    if ($options['page:permissions:see_all_tags']) {
-      if (!user_access($options['page:permissions:see_all_tags'])) {
-        continue;
-      }
-    }
-    elseif (empty($edit_tags[$name])) {
-      continue;
-    }
+  nodewords_tags_field_class(TRUE);
 
+  foreach ($tags_info as $name => $info) {
     $bool = (
       (
-        !empty($info['tag:context:allowed']) &&
-        is_array($info['tag:context:allowed']) &&
-        !in_array($type, $info['tag:context:allowed'])
+        $options['page:permissions:see_all_tags'] &&
+        user_access($options['page:permissions:see_all_tags'])
       ) ||
-      (
-        !empty($info['tag:context:denied']) &&
-        is_array($info['tag:context:denied']) &&
-        in_array($type, $info['tag:context:denied'])
-      )
+      !empty($edit_tags[$name])
     );
 
     if ($bool) {
-      continue;
-    }
+      $bool = (
+        (
+          !empty($info['tag:context:allowed']) &&
+          is_array($info['tag:context:allowed']) &&
+          !in_array($type, $info['tag:context:allowed'])
+        ) ||
+        (
+          !empty($info['tag:context:denied']) &&
+          is_array($info['tag:context:denied']) &&
+          in_array($type, $info['tag:context:denied'])
+        )
+      );
 
-    $bool = (
-      (
-        !empty($options['page:permissions:see_all_tags']) &&
-        user_access($options['page:permissions:see_all_tags'])
-      ) ||
-      (
-        !empty($info['widget:permission']) &&
-        user_access($info['widget:permission'])
-      )
-    );
+      if ($bool) {
+        continue;
+      }
 
-    if ($bool) {
-      if (function_exists($function = $info['tag:function:prefix'] . '_form')) {
-        $tag_options['parameters'] = !empty($info['tag:function:parameters']) ? $info['tag:function:parameters'] : array();
+      $bool = (
+        (
+          !empty($options['page:permissions:see_all_tags']) &&
+          user_access($options['page:permissions:see_all_tags'])
+        ) ||
+        (
+          !empty($info['widget:permission']) &&
+          user_access($info['widget:permission'])
+        )
+      );
 
-        $function($form, isset($tags[$name]) ? $tags[$name] : array(), $tag_options);
+      if ($bool) {
+        if (function_exists($function = $info['tag:function:prefix'] . '_form')) {
+          $tag_options['parameters'] = !empty($info['tag:function:parameters']) ? $info['tag:function:parameters'] : array();
 
-        $form['titles'][$name] = array(
-          '#value' => isset($info['label:lists:edit_form']) ? $info['label:lists:edit_form'] : $info['label:lists']
-        );
+          $function($form_metatags, isset($tags[$name]) ? $tags[$name] : array(), $tag_options);
 
-        if (!empty($info['tag:tokens'])) {
-          $tokens_support = TRUE;
+          if (!empty($info['tag:tokens'])) {
+            $tokens_support = TRUE;
+          }
         }
       }
     }
   }
 
-  if (!empty($form)) {
-    if (!empty($options['fields:before'])) {
-      $form = $options['fields:before'] + $form;
-    }
+  if (empty($form_metatags)) {
+    return $form_metatags;
+  }
 
-    if (!empty($options['fields:after'])) {
-      $form += $options['fields:after'];
-    }
+  if ($options['fieldset']) {
+    $form += array(
+      '#type' => 'fieldset',
+      '#title' => $options['fieldset:title'],
+      '#description' => $options['fieldset:description'],
+      '#collapsible' => $options['fieldset:collapsible'],
+      '#collapsed' => $options['fieldset:collapsed'],
+      '#weight' => $options['fieldset:weight'],
+    );
+  }
+
+  if (!empty($options['fields:before'])) {
+    $form = $options['fields:before'] + $form;
+  }
 
-    $form += $form_fieldset;
+  $form['metatags'] = $form_metatags;
+  $form['metatags']['#prefix'] = '<table><tbody>';
+  $form['metatags']['#suffix'] = '</tbody></table>';
+
+
+  if (!empty($options['fields:after'])) {
+    $form += $options['fields:after'];
   }
 
   if ($tokens_enabled && $tokens_support) {
@@ -1396,6 +1390,20 @@ function nodewords_tags_edit_fields($typ
   return $form;
 }
 
+function nodewords_tags_field_class($init = FALSE) {
+  static $class;
+  static $flip = array('even' => 'odd', 'odd' => 'even');
+
+  if ($init) {
+    $class = 'even';
+  }
+  else {
+    $class = $flip[$class];
+  }
+
+  return $class;
+}
+
 /*
  * Remove the duplicates from a list of items separated from the separator,
  * preserving the order in which they appear.
