function content_access_page_submit in Content Access 6
Same name and namespace in other branches
- 5 content_access.module \content_access_page_submit()
- 7 content_access.admin.inc \content_access_page_submit()
File
- ./
content_access.admin.inc, line 65 - Content access administration UI.
Code
function content_access_page_submit($form, &$form_state) {
$settings = array();
$node = $form_state['node'];
foreach (_content_access_get_operations() as $op) {
// Set the settings so that further calls will return this settings.
$settings[$op] = array_keys(array_filter($form_state['values'][$op]));
}
// Save per-node settings.
content_access_save_per_node_settings($node, $settings);
if (module_exists('acl')) {
foreach (array(
'view',
'update',
'delete',
) as $op) {
acl_save_form($form_state['values']['acl'][$op]);
}
}
// Apply new settings.
node_access_acquire_grants($node);
cache_clear_all();
drupal_set_message(t('Your changes have been saved.'));
}