Index: content_profile.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/content_profile/Attic/content_profile.module,v
retrieving revision 1.1.2.48
diff -u -p -r1.1.2.48 content_profile.module
--- content_profile.module	7 Apr 2010 15:09:17 -0000	1.1.2.48
+++ content_profile.module	2 Sep 2010 04:36:32 -0000
@@ -162,6 +162,16 @@ function content_profile_admin_settings(
     '#default_value' => content_profile_get_settings($type, 'add_link'),
     '#description' => t("If selected and the user has no profile of this type yet, a link to add one is shown on the user page."),
   );
+  $form['display']['hide_preview'] = array(
+    '#type' => 'checkbox',
+    '#title' => t("Hide the node editor form's Preview button"),
+    '#default_value' => content_profile_get_settings($type, 'hide_preview'),
+  );
+  $form['display']['hide_delete'] = array(
+    '#type' => 'checkbox',
+    '#title' => t("Hide the node editor form's Delete button"),
+    '#default_value' => content_profile_get_settings($type, 'hide_delete'),
+  );
   $form['display']['edit_tab'] = array(
     '#type' => 'radios',
     '#title' => t("Profile edit tab"),
@@ -274,8 +284,12 @@ function content_profile_form_alter(&$fo
   elseif (isset($form['#node']) && $form['#node']->type .'_node_form' == $form_id && is_content_profile($form['#node'])) {
     // Customize the redirect target and buttons of our own node forms.
     if (arg(0) == 'user' && is_numeric(arg(1)) && arg(2) == 'edit' || arg(2) == 'profile') {
-      $form['buttons']['preview']['#access'] = FALSE;
-      $form['buttons']['delete']['#access'] = FALSE;
+      if (content_profile_get_settings($form['#node'], 'hide_preview')) {
+        $form['buttons']['preview']['#access'] = FALSE;
+      }
+      if (content_profile_get_settings($form['#node'], 'hide_delete')) {
+        $form['buttons']['delete']['#access'] = FALSE;
+      }
       $form['#redirect'] = arg(2) == 'profile' ? 'user/'. $form['#node']->uid : $_GET['q'];
     }
     // Set the author value - note that this works only for admins.
@@ -463,6 +477,8 @@ function content_profile_content_profile
     'edit_link' => 0,
     'edit_tab' => 'sub',
     'add_link' => 1,
+    'hide_preview' => TRUE,
+    'hide_delete' => TRUE,
   );
 }
 
