You are here

function oauth_common_ahah_add_auth_level in OAuth 1.0 6.3

Menu system callback for adding auth levels

Return value

void

1 string reference to 'oauth_common_ahah_add_auth_level'
oauth_common_providerui_menu in ./oauth_common_providerui.module
Implementation of hook_menu().

File

./oauth_common.admin.inc, line 389

Code

function oauth_common_ahah_add_auth_level() {
  $cached_form_state = array();
  $form = form_get_cache($_POST['form_build_id'], $cached_form_state);
  $context = $form['context_object']['#value'];
  $idx = $form['authorization_level_count']['#value'];
  $form['authorization_level_count']['#value'] = $idx + 1;
  $level = oauth_common_edit_form_auth_level($context, $idx, t('Authorization level'));
  $form['authorization_levels'][] = $level;
  form_set_cache($_POST['form_build_id'], $form, $cached_form_state);
  $form_state = array(
    'submitted' => FALSE,
  );
  $level = form_builder('oauth_common_ahah_add_auth_level', $level, $form_state);
  $output = drupal_render($level);
  print drupal_to_js(array(
    'status' => TRUE,
    'data' => $output,
  ));
  exit;
}