You are here

function linkedin_admin in LinkedIn Integration 7

Same name and namespace in other branches
  1. 6 linkedin.pages.inc \linkedin_admin()

@todo Please document this function.

See also

http://drupal.org/node/1354

1 string reference to 'linkedin_admin'
linkedin_menu in ./linkedin.module
@todo Please document this function.

File

./linkedin.pages.inc, line 15

Code

function linkedin_admin($form, &$form_state) {

  //LinkedIn API credentials
  global $base_url;
  $form['linkedin'] = array(
    '#title' => t('Base settings'),
    '#type' => 'fieldset',
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
  );
  $form['linkedin']['linkedin_liboauth_path'] = array(
    '#default_value' => variable_get('linkedin_liboauth_path', ''),
    '#title' => t('OAuth library full path (including filename)'),
    '#type' => 'textfield',
    '#description' => t('Linkedin module needs the OAuth php library from http://code.google.com/p/oauth/. You can either download OAuth.php from there and specify the full path here or install the OAuth module from http://drupal.org/project/oauth (both 6.x-2 and 6.x-3 versions are supported)'),
  );
  $form['linkedin']['consumer'] = array(
    '#description' => t('You will get theses values by requesting an API key at https://www.linkedin.com/secure/developer. <br /><em>Notice that the "integration url" you specify at Linkedin must match the base url (@url)</em>', array(
      '@url' => $base_url,
    )),
    '#title' => t('Consumer information'),
    '#type' => 'fieldset',
  );
  $form['linkedin']['consumer']['linkedin_consumer_key'] = array(
    '#default_value' => variable_get('linkedin_consumer_key', ''),
    '#title' => t('API key'),
    '#type' => 'textfield',
  );
  $form['linkedin']['consumer']['linkedin_consumer_secret'] = array(
    '#default_value' => variable_get('linkedin_consumer_secret', ''),
    '#title' => t('API Secret key'),
    '#type' => 'textfield',
  );
  $form['linkedin']['linkedin_debug_mode'] = array(
    '#default_value' => variable_get('linkedin_debug_mode', 0),
    '#title' => t('Turn on debug mode'),
    '#type' => 'checkbox',
  );

  //Fetch forms from submodules.
  $forms = array();
  $forms = module_invoke_all('linkedin_admin_page');

  //Tabs on user page don't always get rebuild, so manually trigger it.
  $form['#submit'][] = 'menu_rebuild';
  $form = array_merge($form, $forms);
  return system_settings_form($form);
}