@ -23,96 +23,96 @@ class EdsSettingsForm extends FormBase {
* {@inheritdoc}
*/
public function buildForm(array $form, FormStateInterface $form_state) {
$config = \Drupal:: config('roblib_search_eds.settings');
$config = $this-> config('roblib_search_eds.settings');
/* $form['eds_rest_url'] = array(
'#type' => 'textfield',
'#title' => t('EDS Rest endpoint'),
'#title' => $this-> t('EDS Rest endpoint'),
'#default_value' => $config->get('eds_rest_url'),
'#description' => t('The base EDS URL, for example https://eds-api.ebscohost.com/edsapi/rest'),
'#description' => $this-> t('The base EDS URL, for example https://eds-api.ebscohost.com/edsapi/rest'),
'#required' => TRUE,
);
$form['eds_auth_url'] = array(
'#type' => 'textfield',
'#title' => t('EDS Auth endpoint'),
'#title' => $this-> t('EDS Auth endpoint'),
'#default_value' => $config->get('eds_auth_url'),
'#description' => t('The EDS Auth endpoint, for example https://eds-api.ebscohost.com/Authservice/rest'),
'#description' => $this-> t('The EDS Auth endpoint, for example https://eds-api.ebscohost.com/Authservice/rest'),
'#required' => TRUE,
);
$form['eds_user'] = array(
'#type' => 'textfield',
'#title' => t('EDS user'),
'#title' => $this-> t('EDS user'),
'#default_value' => $config->get('eds_user'),
'#description' => t('EDS user, for example username'),
'#description' => $this-> t('EDS user, for example username'),
'#required' => TRUE,
);
$form['eds_pass'] = array(
'#type' => 'textfield',
'#title' => t('EDS password'),
'#title' => $this-> t('EDS password'),
'#default_value' => $config->get('eds_pass'),
'#description' => t('EDS password, for example password'),
'#description' => $this-> t('EDS password, for example password'),
'#required' => TRUE,
);
$form['eds_guest'] = array(
'#type' => 'textfield',
'#title' => t('EDS Guest access'),
'#title' => $this-> t('EDS Guest access'),
'#default_value' => $config->get('eds_guest'),
'#description' => t('EDS Guest access, y = guest access, n = not a guest'),
'#description' => $this-> t('EDS Guest access, y = guest access, n = not a guest'),
'#required' => TRUE,
);*/
$form['eds_local_ip'] = array(
'#type' => 'textfield',
'#title' => t('EDS Local IP'),
'#title' => $this-> t('EDS Local IP'),
'#default_value' => $config->get('eds_local_ip'),
'#description' => t('Local IP address prefix, i. 137.149.'),
'#description' => $this-> t('Local IP address prefix, i. 137.149.'),
'#required' => TRUE,
);
$form['eds_article_profile'] = array(
'#type' => 'textfield',
'#title' => t('EDS Article profile'),
'#title' => $this-> t('EDS Article profile'),
'#default_value' => $config->get('eds_article_profile'),
'#description' => t('EDS profile, for example edsapi'),
'#description' => $this-> t('EDS profile, for example edsapi'),
'#required' => TRUE,
);
$form['eds_book_profile'] = array(
'#type' => 'textfield',
'#title' => t('EDS Book profile'),
'#title' => $this-> t('EDS Book profile'),
'#default_value' => $config->get('eds_book_profile'),
'#description' => t('EDS Book profile, for example apilite'),
'#description' => $this-> t('EDS Book profile, for example apilite'),
'#required' => TRUE,
);
$form['eds_num_results'] = array(
'#type' => 'textfield',
'#title' => t('Number of results to return'),
'#title' => $this-> t('Number of results to return'),
'#default_value' => $config->get('eds_num_results'),
'#description' => t('The number of results to display in the Bento box, usurally 5'),
'#description' => $this-> t('The number of results to display in the Bento box, usurally 5'),
'#required' => TRUE,
);
$form['eds_article_limiters'] = array(
'#type' => 'textarea',
'#title' => t('The limiters for Article searches'),
'#title' => $this-> t('The limiters for Article searches'),
'#default_value' => $config->get('eds_article_limiters'),
'#description' => t('Specify the Publication Types to use as limiters for Article searches. Formatted similar to
'#description' => $this-> t('Specify the Publication Types to use as limiters for Article searches. Formatted similar to
AND (PT Article OR PT Magazines OR PT News OR PT Academic Journals OR PT Conference Materials)'),
'#required' => TRUE,
);
$form['eds_book_limiters'] = array(
'#type' => 'textarea',
'#title' => t('The limiters for Books and Media searches'),
'#title' => $this-> t('The limiters for Books and Media searches'),
'#default_value' => $config->get('eds_book_limiters'),
'#description' => t('Specify the Publication Types to use as limiters for Article searches. Formatted similar to
'#description' => $this-> t('Specify the Publication Types to use as limiters for Article searches. Formatted similar to
AND (PT Book OR PT Video OR PT Audio'),
'#required' => TRUE,
);
$form['actions']['submit'] = [
'#type' => 'submit',
'#value' => t('Save'),
'#value' => $this-> t('Save'),
'#button_type' => 'primary',
];
return $form;
@ -129,7 +129,7 @@ class EdsSettingsForm extends FormBase {
* {@inheritdoc}
*/
public function submitForm(array & $form, FormStateInterface $form_state) {
$config = \Drupal:: configFactory()->getEditable('roblib_search_eds.settings');
$config = $this-> configFactory()->getEditable('roblib_search_eds.settings');
//$config->set('eds_rest_url', $form_state->getValue('eds_rest_url'))->save();
//$config->set('eds_auth_url', $form_state->getValue('eds_auth_url'))->save();
//$config->set('eds_user', $form_state->getValue('eds_user'))->save();