You are here

function pm_permission_admin_submit in Drupal PM (Project Management) 8

Same name and namespace in other branches
  1. 7.3 includes/pm.permission.inc \pm_permission_admin_submit()

Admin settings form submit handler.

1 string reference to 'pm_permission_admin_submit'
pm_permission_admin in includes/pm.permission.inc
Admin settings form.

File

includes/pm.permission.inc, line 121
Main module file for the pm_permission module.

Code

function pm_permission_admin_submit($form, $form_state) {
  $values = $form_state['values'];
  $agree = $values['pm_permission_override_core_permissions_agree'];
  $overrides = $values['pm_permission_override_core_permissions'];
  if ($agree and is_array($overrides)) {
    foreach ($overrides as $type => $value) {
      if ($value) {
        variable_set('node_permissions_' . $type, 0);
      }
      else {
        variable_set('node_permissions_' . $type, 1);
      }
    }
  }
}