--- private_nodes.module.original 2007-08-22 11:01:29.000000000 +0200 +++ private_nodes.module 2007-10-05 11:55:48.000000000 +0200 @@ -159,6 +159,18 @@ function private_nodes_get_privacy_level */ function private_nodes_form_alter($form_id, & $form) { + if ($form_id == 'node_type_form' && isset($form['identity']['type'])) { + $form['workflow']['private_nodes'] = array( + '#type' => 'radios', + '#title' => t('Private nodes'), + '#default_value' => variable_get('private_nodes_'. $form['#node_type']->type, 0), // Default value is 0 (Anyone) + '#options' => array(t('Anyone'), t('Only myself')), + '#description' => t('Default value for the private status of the node on this node type.') . " (" . $form['#node_type']->type . ")", + ); + return $form; + } + + if($form['account']['pass']){ //if there's an account password, it's the main account form $type = 'profile'; @@ -194,10 +206,20 @@ function private_nodes_form_alter($form_ } // Options - $options = array ( - PRIVATE_NODES_PUBLIC => t('Anyone'), - PRIVATE_NODES_PRIVATE => t('Only myself') - ); + // If the default value is not set, the default is set to "Anyone" + if (variable_get('private_nodes_'. $nodetypes[$type],0) == 0) { + // Default value is "Anyone" + $options = array ( + PRIVATE_NODES_PUBLIC => t('Anyone'), + PRIVATE_NODES_PRIVATE => t('Only myself') + ); + }else{ + // Default value is "Only myself" + $options = array ( + PRIVATE_NODES_PRIVATE => t('Only myself'), + PRIVATE_NODES_PUBLIC => t('Anyone') + ); + } if (function_exists('buddylist_get_buddies')) { $options[PRIVATE_NODES_BUDDIES] = t('Only my buddies');