You are here

function oauth_common_export_context in OAuth 1.0 6.3

Same name and namespace in other branches
  1. 7.4 oauth_common.admin.inc \oauth_common_export_context()
  2. 7.3 oauth_common.admin.inc \oauth_common_export_context()

Page callback to export a context to PHP code.

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

File

./oauth_common.admin.inc, line 595

Code

function oauth_common_export_context(&$form_state, $context) {
  if (!is_object($context)) {
    $context = oauth_common_context_load($context);
  }
  drupal_set_title(check_plain($context->title));
  $code = oauth_common_context_export($context);
  $lines = substr_count($code, "\n") + 4;
  $form['code'] = array(
    '#type' => 'textarea',
    '#title' => $context->title,
    '#default_value' => $code,
    '#rows' => $lines,
  );
  return $form;
}