? private_batch.patch
? private_per_user.patch
Index: private.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/private/Attic/private.module,v
retrieving revision 1.1.2.2
diff -u -p -r1.1.2.2 private.module
--- private.module	28 Jan 2007 21:31:40 -0000	1.1.2.2
+++ private.module	20 Jun 2007 15:54:47 -0000
@@ -25,6 +25,10 @@
  * @endcode
  */
 
+// Possible user default privacy settings.
+define('PRIVATE_DEFAULT_PUBLIC', 0);
+define('PRIVATE_DEFAULT_PRIVATE', 1);
+
 
 /**
  * Implementation of hook_enable().
@@ -146,12 +150,19 @@ function private_node_access_records($no
 function private_form_alter($form_id, &$form) {
   if ($form['#id'] == 'node-form') {
     if (user_access('mark content as private')) {
+      if (!isset($form['#node']->private)) {
+        $author = user_load(array('uid'=> $form['#node']->uid));
+        $private = $author->private_default;
+      }
+      else {
+        $private = $form['#node']->private;
+      }
       $form['private'] = array(
         '#type' => 'checkbox',
         '#title' => t('Private'),
         '#return_value' => 1,
         '#description' => t('Check here if this content should be set private and only shown to authorized users.'),
-        '#default_value' => $form['#node']->private,
+        '#default_value' => $private,
       );
     }
     else {
@@ -219,4 +230,46 @@ function private_link($type, $node = NUL
 
 function theme_private_node_link($node) {
   return theme('image', drupal_get_path('module', 'private') . '/icon_key.gif', t('Private'), t('This content is private'));
+}
+
+/**
+ * Implementation of hook_user
+ */
+
+function private_user($op, $edit, &$account, $category = NULL) {
+  global $user;
+
+  switch ($op) {
+    case 'register':
+      break;
+    case 'form':
+      if ($category == 'account') {
+        $form['private_settings'] = array(
+          '#type' => 'fieldset',
+          '#title' => t('Private Settings'),
+          '#collapsible' => TRUE,
+          '#weight' => 4);
+        $options = array(PRIVATE_DEFAULT_PRIVATE => t('Default to private.'),
+                         PRIVATE_DEFAULT_PUBLIC =>  t('Default to public.'),
+                          );
+        $form['private_settings']['private_default'] = array('#type' => 'radios', 
+                                            '#title' => t('Default Privacy Setting'), 
+                                            '#options' => $options, 
+                                            '#default_value' => isset($account->private_default) ? $account->private_default : variable_get('private_default', PRIVATE_DEFAULT_PUBLIC),
+                                            '#description' => t('When you create posts should they default to public or private?'),
+                                            );
+        return $form;
+      }
+      break;
+    case 'insert':
+      break;
+    case 'update':
+      break;
+    case 'delete':
+      break;
+    case 'load':
+      break;
+    case 'view':
+      break;
+  }
 }
\ No newline at end of file
