You are here

function opigno_tincan_api_settings_form in Opigno TinCan API 7

1 string reference to 'opigno_tincan_api_settings_form'
opigno_tincan_api_menu in ./opigno_tincan_api.module
Implements hook_menu().

File

includes/opigno_tincan_api.settings_form.inc, line 4

Code

function opigno_tincan_api_settings_form($form, &$form_state) {
  $libraries = libraries_get_libraries();
  if (!isset($libraries['TinCanPHP'])) {
    drupal_set_message(t('Please install the !tincanphp_library in the <em>sites/all/library/TinCanPHP</em> folder.', array(
      '!tincanphp_library' => l(t('TinCanPHP library'), 'https://github.com/RusticiSoftware/TinCanPHP/releases'),
    )), 'error');
  }
  $form['endpoint'] = array(
    '#type' => 'textfield',
    '#title' => 'Endpoint',
    '#default_value' => variable_get('opigno_tincan_api_endpoint', ''),
  );
  $form['username'] = array(
    '#type' => 'textfield',
    '#title' => 'User',
    '#default_value' => variable_get('opigno_tincan_api_username', ''),
  );
  $form['password'] = array(
    '#type' => 'textfield',
    '#title' => 'Password',
    '#default_value' => variable_get('opigno_tincan_api_password', ''),
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => 'Submit',
  );
  $form['#submit'][] = 'opigno_tincan_api_settings_submit';
  $form['#validate'][] = 'opigno_tincan_api_settings_validate';
  return $form;
}