? .project
? admin-default.patch
? admin-title.patch
? css_14.patch
? fix_signatures.patch
? menu-title.patch
? modules/aggregator/aggregator.css
? modules/archive/archive.css
? modules/block/block.css
? modules/book/book.css
? modules/forum/forum.css
? modules/help/help.css
? modules/locale/locale.css
? modules/menu/menu.css
? modules/node/node.css
? modules/poll/poll.css
? modules/profile/profile.css
? modules/search/search.css
? modules/tracker/tracker.css
? modules/watchdog/watchdog.css
? sites/localhost
Index: modules/comment/comment.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment/comment.module,v
retrieving revision 1.471
diff -u -F^f -r1.471 comment.module
--- modules/comment/comment.module	6 Aug 2006 23:00:42 -0000	1.471
+++ modules/comment/comment.module	7 Aug 2006 03:54:07 -0000
@@ -351,26 +351,9 @@ function comment_nodeapi(&$node, $op, $a
 
 /**
  * Implementation of hook_user().
- *
- * Provides signature customization for the user's comments.
  */
 function comment_user($type, $edit, &$user, $category = NULL) {
-  if ($type == 'form' && $category == 'account') {
-    // when user tries to edit his own data
-    $form['comment_settings'] = array(
-      '#type' => 'fieldset',
-      '#title' => t('Comment settings'),
-      '#collapsible' => TRUE,
-      '#weight' => 4);
-    $form['comment_settings']['signature'] = array(
-      '#type' => 'textarea',
-      '#title' => t('Signature'),
-      '#default_value' => $edit['signature'],
-      '#description' => t('Your signature will be publicly displayed at the end of your comments.'));
-
-    return $form;
-  }
-  elseif ($type == 'delete') {
+  if ($type == 'delete') {
     db_query('UPDATE {comments} SET uid = 0 WHERE uid = %d', $user->uid);
     db_query('UPDATE {node_comment_statistics} SET last_comment_uid = 0 WHERE last_comment_uid = %d', $user->uid);
   }
@@ -1389,7 +1372,7 @@ function comment_form($edit, $title = NU
     $form['subject'] = array('#type' => 'textfield', '#title' => t('Subject'), '#maxlength' => 64, '#default_value' => $edit['subject']);
   }
 
-  $form['comment_filter']['comment'] = array('#type' => 'textarea', '#title' => t('Comment'), '#rows' => 15, '#default_value' => $edit['comment'] ? $edit['comment'] : $user->signature, '#required' => TRUE);
+  $form['comment_filter']['comment'] = array('#type' => 'textarea', '#title' => t('Comment'), '#rows' => 15, '#default_value' => $edit['comment'], '#required' => TRUE);
   $form['comment_filter']['format'] = filter_form($edit['format']);
 
   $form['cid'] = array('#type' => 'value', '#value' => $edit['cid']);
Index: modules/system/system.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.module,v
retrieving revision 1.335
diff -u -F^f -r1.335 system.module
--- modules/system/system.module	6 Aug 2006 23:00:42 -0000	1.335
+++ modules/system/system.module	7 Aug 2006 03:54:07 -0000
@@ -341,7 +341,7 @@ function system_admin_page_settings() {
     '#options' => $options,
     '#title' => t('Administration theme'),
     '#description' => t('Choose which theme the administration pages should display in. If you choose "System default" the administration pages theme will display in the same theme the rest of the site uses.'),
-    '#default_value' => variable_get('admin_theme', 'bluemarine'),
+    '#default_value' => variable_get('admin_theme', 0),
   );
 
   // In order to give it our own submit, we have to give it the default submit
Index: modules/user/user.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/user/user.module,v
retrieving revision 1.649
diff -u -F^f -r1.649 user.module
--- modules/user/user.module	5 Aug 2006 18:56:35 -0000	1.649
+++ modules/user/user.module	7 Aug 2006 03:54:08 -0000
@@ -1304,6 +1304,24 @@ function user_edit_form($uid, $edit, $re
     }
   }
 
+  // Signature:
+  foreach (node_get_types() as $type => $details) {
+    // Only show signature textarea if at least one node type is signature-enabled.
+    if (variable_get('user_signatures_'. $type, 0)) {
+      $form['signature_settings'] = array(
+        '#type' => 'fieldset',
+        '#title' => t('Signature settings'),
+      );
+      $form['signature_settings']['signature'] = array(
+        '#type' => 'textarea',
+        '#title' => t('Signature'),
+        '#default_value' => $edit['signature'],
+        '#description' => t('Your signature will be publicly displayed at the end of your comments.'),
+      );
+      break;
+    }
+  }
+
   // Picture/avatar:
   if (variable_get('user_pictures', 0)) {
     $form['picture'] = array('#type' => 'fieldset', '#title' => t('Picture'), '#weight' => 1);
@@ -2159,6 +2177,16 @@ function user_admin_settings() {
   $form['registration']['user_email_verification'] = array('#type' => 'checkbox', '#title' => t('Require e-mail verification when a visitor creates an account'), '#default_value' => variable_get('user_email_verification', TRUE), '#description' => t('If this box is checked, new users will be required to validate their e-mail address prior to logging into to the site, and will be assigned a system-generated password. With it unchecked, users will be logged in immediately upon registering, and may select their own passwords during registration.'));
   $form['registration']['user_registration_help'] = array('#type' => 'textarea', '#title' => t('User registration guidelines'), '#default_value' => variable_get('user_registration_help', ''), '#description' => t("This text is displayed at the top of the user registration form. It's useful for helping or instructing your users."));
 
+  // Signature settings.
+  $form['signatures'] = array(
+    '#type' => 'fieldset',
+    '#title' => t('Signature settings'),
+  );
+  $form['signatures']['user_signatures_format_description'] = array(
+    '#value' => '<p>'. t("Select which input format should be allowed on users' signatures:") .'</p>',
+  );
+  $form['signatures']['user_signatures_format'] = filter_form(variable_get('user_signature_format', 1));
+
   // User e-mail settings.
   $form['email'] = array('#type' => 'fieldset', '#title' => t('User e-mail settings'));
   $form['email']['user_mail_welcome_subject'] = array('#type' => 'textfield', '#title' => t('Subject of welcome e-mail'), '#default_value' => _user_mail_text('welcome_subject'), '#maxlength' => 180, '#description' => t('Customize the subject of your welcome e-mail, which is sent to new members upon registering.') .' '. t('Available variables are:') .' %username, %site, %password, %uri, %uri_brief, %mailto, %date, %login_uri, %edit_uri, %login_url.');
@@ -2321,3 +2349,80 @@ function user_autocomplete($string) {
   print drupal_to_js($matches);
   exit();
 }
+
+/**
+ * Implementation of hook_form_alter().
+ *
+ * Add user signature option to content type settings forms.
+ */
+function user_form_alter($form_id, &$form) {
+  if ($form_id == 'node_type_form') {
+    $type = $form['orig_type']['#value'];
+    $form['workflow']["user_signatures_$type"] = array(
+      '#type' => 'checkbox',
+      '#title' => t('Show user signatures on this node type.'),
+      '#default_value' => variable_get("user_signatures_$type", 0),
+      '#description' => t("If enabled, users' signatures will be appended to the end of all posts and comments for this type."),
+    );
+    $form['#submit'] = array_merge($form['#submit'], array('user_signature_submit' => array($type)));
+  }
+}
+
+/**
+ * Submit callback; sets variable to track whether user signatures are enabled
+ * for the given node type.
+ */
+function user_signature_submit($form_id, $form_values, $type) {
+  if ($form_values["user_signatures_$type"]) {
+    variable_set("user_signatures_$type", 1);
+  }
+  else {
+    variable_set("user_signatures_$type", 0);
+  }
+}
+
+/**
+ * Implementation of hook_nodeapi().
+ *
+ * Append signatures to signature-enabled node types.
+ */
+function user_nodeapi(&$node, $op, $arg = 0) {
+  if (variable_get('user_signatures_'. $node->type, 0)) {
+    if ($op == 'view') {
+      $author = user_load(array('uid' => $node->uid));
+      $node->body .= theme('user_signature', $author->signature);
+    }
+  }
+}
+
+/**
+ * Implementation of hook_comment().
+ *
+ * Append signatures to comments, if the parent node type is signature-enabled.
+ */
+function user_comment($comment, $op) {
+  if ($op == 'view') {
+    $node = node_load($comment->nid);
+    if (variable_get('user_signatures_'. $node->type, 0)) {
+      $author = user_load(array('uid' => $comment->uid));
+      $comment->comment .= theme('user_signature', $author->signature);
+    }
+  }
+}
+
+/**
+ * Output a user's signature.
+ * 
+ * @ingroup themeable
+ */
+function theme_user_signature($signature) {
+  $output = '<div class="user_signature">';
+  // Note: check_markup is important, as without it people could enter potentially dangerous stuff like PHP.
+  $output .= check_markup("
+-- 
+$signature
+", variable_get('user_signatures_format', 1));
+  $output .= '</div>';
+
+  return $output;
+}
