Browse Source

remove covid header message from module probably makes more sense to just have a block if we need a message at the top of the page

9.x-1.0
ppound 3 years ago
parent
commit
14af884818
  1. 9
      src/Form/RoblibIllLoanForm.php
  2. 8
      src/Form/RoblibIllSettingsForm.php

9
src/Form/RoblibIllLoanForm.php

@ -136,14 +136,7 @@ class RoblibIllLoanForm extends FormBase {
function ill_request_form($form, &$form_state) {
module_load_include('inc', 'upei_roblib_ill', 'includes/utilities');
$config = \Drupal::config('upei_roblib_ill.settings');
$header_message = $config->get('ill_header_message', '');
$emergency_message = '';
if (!empty($header_message)) {
$emergency_message = '<div class="messages messages--error closure-notice">';
$emergency_message .= $header_message;
$emergency_message .= '</div>';
}
$form['#prefix'] = $emergency_message . '<div id="upei-roblib-ill-request-form">';
$form['#prefix'] = '<div id="upei-roblib-ill-request-form">';
$form['#suffix'] = '<div class="roblib-required">* = Required Field</div></div>';
$type = upei_roblib_ill_get_request_variable('genre');
$genre = empty($type) ? 'article' : $type;

8
src/Form/RoblibIllSettingsForm.php

@ -84,13 +84,6 @@ class RoblibIllSettingsForm extends FormBase {
'#title' => t('Contact Phone Number'),
'#description' => t('The phone number we want to show to the user after a user has submitted an ILL request, Roblib uses 902-566-0445'),
'#default_value' => $config->get('ill_contact_phone'),
];
$form['ill_header_message'] = [
'#required' => TRUE,
'#type' => 'textarea',
'#title' => t('ILL Header Message'),
'#description' => t('The message that appears at the top of the ILL form, recently used for Covid messages. Leave this blank for no message to appear at the top of the form.'),
'#default_value' => $config->get('ill_header_message'),
];
$form['actions']['submit'] = [
'#type' => 'submit',
@ -120,7 +113,6 @@ class RoblibIllSettingsForm extends FormBase {
$config->set('ill_doi_openurl_pid', $form_state->getValue('ill_doi_openurl_pid'))->save();
$config->set('ill_contact_email', $form_state->getValue('ill_contact_email'))->save();
$config->set('ill_contact_phone', $form_state->getValue('ill_contact_phone'))->save();
$config->set('ill_header_message', $form_state->getValue('ill_header_message'))->save();
}
}

Loading…
Cancel
Save