node_access_test_form_node_form_alter

7 node_access_test.module node_access_test_form_node_form_alter(&$form, $form_state)
8 node_access_test.module node_access_test_form_node_form_alter(&$form, $form_state)

Implements hook_form_BASE_FORM_ID_alter().

File

modules/node/tests/node_access_test.module, line 172
Dummy module implementing node access related hooks to test API interaction with the Node module. This module restricts view permission to those with a special 'node test view' permission.

Code

function node_access_test_form_node_form_alter(&$form, $form_state) {
  // Only show this checkbox for NodeAccessBaseTableTestCase.
  if (variable_get('node_access_test_private')) {
    $form['private'] = array(
      '#type' => 'checkbox', 
      '#title' => t('Private'), 
      '#description' => t('Check here if this content should be set private and only shown to privileged users.'), 
      '#default_value' => isset($form['#node']->private) ? $form['#node']->private : FALSE,
    );
  }
}
Login or register to post comments