You are here

function globallink_pd_settings in GlobalLink Connect for Drupal 7.7

Same name and namespace in other branches
  1. 7.5 globallink_settings.inc \globallink_pd_settings()
  2. 7.6 globallink_settings.inc \globallink_pd_settings()

Renders form for globallink_pd_settings.

1 string reference to 'globallink_pd_settings'
globallink_settings_page in ./globallink_settings.inc

File

./globallink_settings.inc, line 27

Code

function globallink_pd_settings() {
  $module_path = drupal_get_path('module', 'globallink');
  drupal_add_css($module_path . '/css/globallink.css');
  $form = array();
  $variables = array(
    'path' => $module_path . '/css/anchor.png',
    'title' => 'PD Link',
    'attributes' => array(),
  );
  $img = theme_image($variables);
  $form['globallink_pd_settings'] = array(
    '#type' => 'fieldset',
    '#title' => t('GlobalLink Settings'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
  );
  $form['globallink_pd_settings']['globallink_pd_url'] = array(
    '#type' => 'textfield',
    '#title' => t('URL'),
    '#default_value' => variable_get('globallink_pd_url', ''),
    '#required' => TRUE,
    '#size' => 50,
  );
  $form['globallink_pd_settings']['globallink_pd_link'] = array(
    '#markup' => l($img, variable_get('globallink_pd_url', ''), array(
      'attributes' => array(
        'target' => '_blank',
        'class' => array(
          'globallink_pd_link',
        ),
      ),
      'html' => TRUE,
    )),
  );
  $form['globallink_pd_settings']['globallink_pd_username'] = array(
    '#type' => 'textfield',
    '#title' => t('User Id'),
    '#default_value' => variable_get('globallink_pd_username', ''),
    '#required' => TRUE,
    '#size' => 50,
  );
  $form['globallink_pd_settings']['globallink_pd_password'] = array(
    '#type' => 'password',
    '#title' => t('Password'),
    '#required' => TRUE,
    '#size' => 50,
  );
  $form['globallink_pd_settings']['globallink_pd_projectid'] = array(
    '#type' => 'textfield',
    '#title' => t('Project Short Code(s)'),
    '#description' => t('Enter comma separated codes for multiple projects.'),
    '#default_value' => variable_get('globallink_pd_projectid', ''),
    '#required' => TRUE,
    '#size' => 50,
  );
  $form['globallink_pd_settings']['globallink_pd_submissionprefix'] = array(
    '#type' => 'textfield',
    '#title' => t('Submission Name Prefix'),
    '#default_value' => variable_get('globallink_pd_submissionprefix', 'DRU_'),
    '#required' => FALSE,
    '#size' => 50,
  );
  $form['globallink_pd_settings']['globallink_pd_classifier'] = array(
    '#type' => 'textfield',
    '#title' => t('Classifier'),
    '#default_value' => variable_get('globallink_pd_classifier', 'XML'),
    '#required' => TRUE,
    '#size' => 50,
  );
  $form['globallink_pd_settings']['globallink_pd_max_target'] = array(
    '#type' => 'textfield',
    '#title' => t('Max Target Count'),
    '#default_value' => variable_get('globallink_pd_max_target', '99999'),
    '#required' => TRUE,
    '#size' => 50,
  );
  $form['globallink_pd_settings']['globallink_batch'] = array(
    '#type' => 'textfield',
    '#title' => t('Max documents before new submission'),
    '#default_value' => variable_get('globallink_batch', 4999),
    '#required' => TRUE,
    '#size' => 50,
  );
  $form['globallink_pd_settings']['globallink_unique_identifier'] = array(
    '#type' => 'textfield',
    '#title' => t('Unique Instance Identifier'),
    '#default_value' => variable_get('globallink_unique_identifier', $_SERVER['SERVER_NAME']),
    '#required' => TRUE,
    '#size' => 50,
  );
  $form['globallink_pd_settings']['submit_pd_test'] = array(
    '#type' => 'submit',
    '#value' => t('Save and Test Settings'),
    '#suffix' => '</div>',
  );
  return $form;
}