The libraries interlibrary loan form module
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
2.1 KiB

<?php
namespace Drupal\upei_roblib_ill\Controller;
use Drupal\Core\Controller\ControllerBase;
use Drupal\Core\Url;
use Drupal\Core\Link;
use Symfony\Component\HttpFoundation\Response;
/**
* Controller for d3 graphs.
*/
class RoblibIllController extends ControllerBase {
/**
* Show the user contact info etc. after ILL Request.
* @return string
* Rendered HTML
*/
function finished() {
$config = \Drupal::config('upei_roblib_ill.settings');
$contact_email = $config->get('ill_contact_email');
$contact_phone_number = $config->get('ill_contact_phone');
$librarian_link = Link::fromTextAndUrl($this->t('subject-specific'), Url::fromUri('http://library.upei.ca/librarians'))->toString();
$help_message = $this->t("We can help! Please contact your !librarian_link librarian if you'd like help finding more resources relating to your topic.",
['!librarian_link' => $librarian_link]);
$standard_message = t("To contact the department about this request, you can send a message to @email or
call @phone.", ['@phone' => $contact_phone_number, '@email' => $contact_email]);
if (isset($_GET['error']) && $_GET['error'] === 'FALSE') {
$standard_message = t("A message including the Request ID has been sent to @email.", [
'@email' => $_GET['email'],
]) . $standard_message;
}
$output = [
'#prefix' => '<div upei-roblib-ill-content>',
'#suffix' => '</div>',
//'#type' => 'page',
'dynamic_message' => [
'#type' => 'markup',
'#markup' => $_GET['message'],
'#prefix' => '<div class="upei-roblib-ill-message">',
'#suffix' => '</div>',
],
'standard_message' => [
'#type' => 'markup',
'#markup' => $standard_message,
'#prefix' => '<div class="upei-roblib-ill-email">',
'#suffix' => '</div>',
],
'help_message' => [
'#type' => 'markup',
'#markup' => $help_message,
'#allowed_tags' => ['a', 'source'],
'#prefix' => '<div class="upei-roblib-ill-help">',
'#suffix' => '</div>',
],
];
return $output;
}
}