Index: annotate.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/annotate/annotate.module,v
retrieving revision 1.13
diff -u -r1.13 annotate.module
--- annotate.module	18 Sep 2009 16:10:48 -0000	1.13
+++ annotate.module	10 Nov 2009 21:42:17 -0000
@@ -117,6 +117,23 @@
     '#description' => t('Multiple annotations per users are allowed for these node types.'),
   );
   
+  $options = _annotate_get_visibility_list();
+  
+  $form['annotate_visibility'] = array(
+    '#type' => 'radios',
+    '#title' => t('Default visibility'),
+    '#default_value' => variable_get('annotate_visibility', 0),
+    '#options' => $options,
+    '#description' => t('Default visibility of annotations'),
+  );
+  
+  $form['annotate_visibility_force'] = array(
+    '#type' => 'checkbox',
+    '#title' => t('Force default visibility.'),
+    '#default_value' => variable_get('annotate_visibility_force', 0),
+    '#description' => t('This will hide the visibility option on annotations and force the site-wide default visibility setting above. Note that changing this will not affect existing annotation visibility settings - it will only affect new annotations.'),
+  );
+  
   // FAPI 2 magic: make arrays auto compact
   $form['array_filter'] = array(
     '#type' => 'hidden'
@@ -174,7 +191,7 @@
         // We put all annotation into the printer friendly page
         $node->content['annotate_print'] = array(
           '#value' => annotate_list_by_node( $node->nid),
-          '#weight' => 10,
+          '#weight' => 50,
         );
       }
       else {
@@ -182,7 +199,7 @@
       	$node->notes=_annotate_get_notes($node, $user);
         $node->content['annotate_print'] = array(
           '#value' => _annotate_forms( $node),
-          '#weight' => 10,
+          '#weight' => 50,
         );
       }
       break;
@@ -336,16 +353,22 @@
   );
   
   $form['annotate']['note_filter']['format']= filter_form( $note->note_format);
-
-  $options = _annotate_get_visibility_list();
   
-  $form['annotate']['visibility'] = array(
-    '#type' => 'radios',
-    '#title' => t('Visibility'),
-    '#default_value' => isset($note->visibility) ? $note->visibility : 0,
-    '#options' => $options,
-    '#description' => t('Set the visibility of this annotation'),
-  );
+  if (variable_get('annotate_visibility_force', 0) != 1) {
+    // This is only needed if default visibility settings are not forced.
+    $options = _annotate_get_visibility_list();
+
+    $form['annotate']['visibility'] = array(
+      '#type' => 'radios',
+      '#title' => t('Visibility'),
+      '#default_value' => isset($note->visibility) ? $note->visibility : variable_get('annotate_visibility', 0),
+      '#options' => $options,
+      '#description' => t('Set the visibility of this annotation'),
+    );
+  }
+  else {
+    $form['annotate']['visibility'] = array('#type' => 'value', '#value' => variable_get('annotate_visibility', 0));
+  }
  
   $form['annotate']['submit'] = array(
     '#type' => 'submit',
