function private_form_node_type_form_alter in Private 7.2
Same name and namespace in other branches
- 7 private.module \private_form_node_type_form_alter()
Implements hook_form_FORM_ID_alter().
File
- ./
private.module, line 207 - A tremendously simple access control module -- it allows users to mark individual nodes as private; users with 'access private content' perms can read these nodes, while others cannot.
Code
function private_form_node_type_form_alter(&$form, &$form_state, $form_id) {
if (isset($form['type'])) {
$form['workflow']['private'] = array(
'#type' => 'radios',
'#title' => t('Privacy'),
'#description' => t('Privacy settings for nodes of this content type. Changing this value will update all existing nodes and rebuild access permissions.'),
'#options' => array(
PRIVATE_DISABLED => t('Disabled (always public)'),
PRIVATE_ALLOWED => t('Enabled (public by default)'),
PRIVATE_AUTOMATIC => t('Enabled (private by default)'),
PRIVATE_ALWAYS => t('Hidden (always private)'),
),
'#default_value' => variable_get('private_' . $form['#node_type']->type, PRIVATE_ALLOWED),
);
$form['#submit'][] = 'private_node_type_submit';
}
}