You are here

function private_form_node_type_form_alter in Private 7

Same name and namespace in other branches
  1. 7.2 private.module \private_form_node_type_form_alter()

Implements hook_form_FORM_ID_alter().

File

./private.module, line 198
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'),
      '#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),
    );
  }
}