You are here

function mobile_tools_roles_configuration_submit in Mobile Tools 5

Same name and namespace in other branches
  1. 6 mobile_tools_roles.inc \mobile_tools_roles_configuration_submit()
  2. 7.2 mobile_tools_roles/mobile_tools_roles.module \mobile_tools_roles_configuration_submit()
  3. 7.2 mobile_tools_roles/mobile_tools_roles.inc \mobile_tools_roles_configuration_submit()

Implementation of hook_submit()

File

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

Code

function mobile_tools_roles_configuration_submit($form_id, $form_values) {
  $role = mobile_tools_roles_info(array(
    'id' => $form['rid']['#value'],
  ));
  switch ($form['#post']['op']) {
    case 'Save role':
      if ($role->has_sibling == 1 && $form['#post']['mobile_tools_configure_role_' . $form['rid']['#value']] == FALSE && $role->type == 'desktop') {
        mobile_tools_edit_mobile_role('delete', $role);
      }
      elseif ($role->has_sibbling == FALSE && $form['#post']['mobile_tools_configure_role_' . $form['rid']['#value']] == TRUE && $role->type == 'desktop') {
        mobile_tools_edit_mobile_role('add', $role);
      }
      break;
    case 'Delete role':
      if ($role->type == 'mobile') {
        $role = mobile_tools_roles_info(array(
          'id' => $role->sibling['id'],
        ));
      }
      mobile_tools_edit_mobile_role('delete', $role);
  }
}