You are here

function block_access_module_form_submit in Block Access 7

Same name and namespace in other branches
  1. 6.2 block_access.admin.inc \block_access_module_form_submit()
  2. 6 block_access.admin.inc \block_access_module_form_submit()

File

./block_access.admin.inc, line 85

Code

function block_access_module_form_submit($form, &$form_state) {
  $values = $form_state['values'];
  $module = $values['module'];
  $current_theme = variable_get('theme_default', 'none');
  block_access_config_set_roles('view', $values['view_roles'], $module);
  block_access_config_set_roles('move', $values['move_roles'], $module);
  block_access_config_set_roles('enable', $values['enable_roles'], $module);
  block_access_config_set_roles('disable', $values['disable_roles'], $module);
  block_access_config_set_roles('config', $values['config_roles'], $module);
  block_access_config_set_roles('delete', $values['delete_roles'], $module);
  block_access_config_set_roles('config_lang', $values['config_lang_roles'], $module);
  block_access_config_set_roles('config_title', $values['config_title_roles'], $module);
  block_access_config_set_roles('config_desc', $values['config_desc_roles'], $module);
  block_access_config_set_roles('config_body', $values['config_body_roles'], $module);
  block_access_config_set_roles('config_region', $values['config_region_roles'], $module);
  block_access_config_set_roles('config_type_visibility', $values['config_type_visibility_roles'], $module);
  block_access_config_set_roles('config_user_visibility', $values['config_user_visibility_roles'], $module);
  block_access_config_set_roles('config_role_visibility', $values['config_role_visibility_roles'], $module);
  block_access_config_set_roles('config_page_visibility', $values['config_page_visibility_roles'], $module);
  $region_list = system_region_list($current_theme);
  foreach ($region_list as $region_name => $realname) {
    if (isset($values["dreg_{$region_name}_roles"])) {
      block_access_config_set_roles("dreg_{$region_name}", $values["dreg_{$region_name}_roles"], $module);
    }
  }
  drupal_set_message("Settings have been updated");
}