function simple_access_form_node_type_form_alter in Simple Access 7.2
Same name and namespace in other branches
- 8.3 simple_access.module \simple_access_form_node_type_form_alter()
- 6.2 simple_access.module \simple_access_form_node_type_form_alter()
Implements hook_form_FORM_ID_alter().
For node_type_form.
File
- ./
simple_access.module, line 416 - This module allows administrators to make nodes viewable by specific 'access groups'. Each access group can contain any number of roles. If a node is not assigned to any access groups, it will remain viewable by all users.
Code
function simple_access_form_node_type_form_alter(&$form, &$form_state) {
$type = $form['old_type']['#value'];
$default = variable_get('simple_access_' . $type, array(
'simple_access' => array(),
'simple_access_profiles' => array(),
'simple_access_owner' => array(),
));
$tmp_form = simple_access_form((object) $default, TRUE);
$form['simple_access'] = $tmp_form['simple_access'];
$form['simple_access']['simple_access']['owner']['#parents'] = array(
'simple_access',
'simple_access_owner',
);
$form['simple_access']['#tree'] = TRUE;
$form['#submit'][] = 'simple_access_node_type_submit';
}