You are here

function mobile_tools_roles_configuration_form_submit in Mobile Tools 5

Same name and namespace in other branches
  1. 6.3 mobile_tools_roles.admin.inc \mobile_tools_roles_configuration_form_submit()
  2. 6.2 modules/mobile_tools_roles/mobile_tools_roles.admin.inc \mobile_tools_roles_configuration_form_submit()

Implementation of hook_submit().

File

./mobile_tools.module, line 476
Mobile Tools provides a range of functionality assisting in creating a mobile drupal site . this functionality contains:

Code

function mobile_tools_roles_configuration_form_submit($form_id, $form_values) {
  variable_set('mobile_tools_enable_roles', $form_values['mobile_tools_enable_roles']);
  $query = "SELECT * FROM {role}";
  $result = db_query($query);
  while ($item = db_fetch_object($result)) {
    $role = mobile_tools_roles_info(array(
      'id' => $item->rid,
    ));
    if ($role->type == 'desktop') {
      $choice = $form_values['mobile_tools_role_' . $item->rid];
      if ($role->has_sibling == 1 && $choice == 0) {

        // DELETE
        mobile_tools_edit_mobile_role('delete', $role);
      }
      else {
        if ($role->has_sibling == 0 && $choice == 1) {
          mobile_tools_edit_mobile_role('add', $role);
        }
      }
    }
  }
}