Browse Source

EDS target module can now be enabled and blocks and form display

d9
ppound 3 years ago
parent
commit
ee95dfff70
  1. 0
      modules/Readme.txt
  2. 0
      modules/evergreen/css/roblib_search_evergreen.css
  3. 0
      modules/evergreen/js/evergreen_results.js
  4. 0
      modules/evergreen/roblib_search_evergreen.info
  5. 0
      modules/evergreen/roblib_search_evergreen.install
  6. 0
      modules/evergreen/roblib_search_evergreen.module
  7. 0
      modules/evergreen/theme/roblib-search-evergreen.tpl.php
  8. 0
      modules/evergreen/theme/theme.inc
  9. 0
      modules/islandscholar/css/roblib_search_islandscholar.css
  10. 0
      modules/islandscholar/js/islandscholar_results.js
  11. 0
      modules/islandscholar/roblib_search_islandscholar.info
  12. 0
      modules/islandscholar/roblib_search_islandscholar.install
  13. 0
      modules/islandscholar/roblib_search_islandscholar.module
  14. 0
      modules/islandscholar/theme/roblib-search-islandscholar.tpl.php
  15. 0
      modules/islandscholar/theme/theme.inc
  16. 0
      modules/passthru_results/css/roblib_search_passthru.css
  17. 0
      modules/passthru_results/js/passthru_results.js
  18. 0
      modules/passthru_results/roblib_search_passthru.info
  19. 0
      modules/passthru_results/roblib_search_passthru.install
  20. 0
      modules/passthru_results/roblib_search_passthru.module
  21. 0
      modules/passthru_results/theme/roblib-search-passthru.tpl.php
  22. 0
      modules/passthru_results/theme/theme.inc
  23. 0
      modules/roblib_search_eds/css/roblib_search_eds.css
  24. 0
      modules/roblib_search_eds/js/eds_results.js
  25. 0
      modules/roblib_search_eds/js/eds_results_article.js
  26. 9
      modules/roblib_search_eds/roblib_search_eds.info.yml
  27. 46
      modules/roblib_search_eds/roblib_search_eds.module
  28. 8
      modules/roblib_search_eds/roblib_search_eds.routing.yml
  29. 7
      modules/roblib_search_eds/src/Controller/RoblibSearchEdsController.php
  30. 137
      modules/roblib_search_eds/src/Form/EdsSettingsForm.php
  31. 27
      modules/roblib_search_eds/src/Plugin/Block/RoblibSearchEdsArticles.php
  32. 27
      modules/roblib_search_eds/src/Plugin/Block/RoblibSearchEdsBooks.php
  33. 12
      modules/roblib_search_eds/templates/roblib-search-eds-articles.html.twig
  34. 9
      modules/roblib_search_eds/templates/roblib-search-eds-books.html.twig
  35. 0
      modules/roblib_search_eds/templates/theme.inc
  36. 0
      modules/solr_site/css/roblib_search_solr_site.css
  37. 0
      modules/solr_site/js/solr_site_bestbet.js
  38. 0
      modules/solr_site/js/solr_site_databases.js
  39. 0
      modules/solr_site/js/solr_site_guides.js
  40. 0
      modules/solr_site/js/solr_site_reserves.js
  41. 0
      modules/solr_site/js/solr_site_results.js
  42. 0
      modules/solr_site/roblib_search_solr_site.info
  43. 0
      modules/solr_site/roblib_search_solr_site.install
  44. 0
      modules/solr_site/roblib_search_solr_site.module
  45. 0
      modules/solr_site/theme/roblib-search-solr-site-results.tpl.php
  46. 0
      modules/solr_site/theme/theme.inc
  47. 56
      roblib_search.module
  48. 2
      src/Plugin/Block/RoblibSearchBoxBlock.php
  49. 133
      targets/eds/Form/RoblibSearchEdsSettingsForm.php
  50. 8
      targets/eds/roblib_search_eds.info.yml
  51. 25
      targets/eds/roblib_search_eds.routing.yml
  52. 35
      targets/eds/theme/roblib-search-eds-articles.tpl.php

0
targets/Readme.txt → modules/Readme.txt

0
targets/evergreen/css/roblib_search_evergreen.css → modules/evergreen/css/roblib_search_evergreen.css

0
targets/evergreen/js/evergreen_results.js → modules/evergreen/js/evergreen_results.js

0
targets/evergreen/roblib_search_evergreen.info → modules/evergreen/roblib_search_evergreen.info

0
targets/evergreen/roblib_search_evergreen.install → modules/evergreen/roblib_search_evergreen.install

0
targets/evergreen/roblib_search_evergreen.module → modules/evergreen/roblib_search_evergreen.module

0
targets/evergreen/theme/roblib-search-evergreen.tpl.php → modules/evergreen/theme/roblib-search-evergreen.tpl.php

0
targets/evergreen/theme/theme.inc → modules/evergreen/theme/theme.inc

0
targets/islandscholar/css/roblib_search_islandscholar.css → modules/islandscholar/css/roblib_search_islandscholar.css

0
targets/islandscholar/js/islandscholar_results.js → modules/islandscholar/js/islandscholar_results.js

0
targets/islandscholar/roblib_search_islandscholar.info → modules/islandscholar/roblib_search_islandscholar.info

0
targets/islandscholar/roblib_search_islandscholar.install → modules/islandscholar/roblib_search_islandscholar.install

0
targets/islandscholar/roblib_search_islandscholar.module → modules/islandscholar/roblib_search_islandscholar.module

0
targets/islandscholar/theme/roblib-search-islandscholar.tpl.php → modules/islandscholar/theme/roblib-search-islandscholar.tpl.php

0
targets/islandscholar/theme/theme.inc → modules/islandscholar/theme/theme.inc

0
targets/passthru_results/css/roblib_search_passthru.css → modules/passthru_results/css/roblib_search_passthru.css

0
targets/passthru_results/js/passthru_results.js → modules/passthru_results/js/passthru_results.js

0
targets/passthru_results/roblib_search_passthru.info → modules/passthru_results/roblib_search_passthru.info

0
targets/passthru_results/roblib_search_passthru.install → modules/passthru_results/roblib_search_passthru.install

0
targets/passthru_results/roblib_search_passthru.module → modules/passthru_results/roblib_search_passthru.module

0
targets/passthru_results/theme/roblib-search-passthru.tpl.php → modules/passthru_results/theme/roblib-search-passthru.tpl.php

0
targets/passthru_results/theme/theme.inc → modules/passthru_results/theme/theme.inc

0
targets/eds/css/roblib_search_eds.css → modules/roblib_search_eds/css/roblib_search_eds.css

0
targets/eds/js/eds_results.js → modules/roblib_search_eds/js/eds_results.js

0
targets/eds/js/eds_results_article.js → modules/roblib_search_eds/js/eds_results_article.js

9
modules/roblib_search_eds/roblib_search_eds.info.yml

@ -0,0 +1,9 @@
name: Roblib Search EDS
type: module
configure: roblib_search_eds.settings
description: Implements the Roblib Search EDS book and article results
package: Roblib Search
core_version_requirement: ^8.9 || ^9
dependancies:
- roblib_search
- ebsco

46
targets/eds/roblib_search_eds.module → modules/roblib_search_eds/roblib_search_eds.module

@ -60,7 +60,7 @@ function roblib_search_eds_info($type = 'Articles') {
/** /**
* Implements hook_permission(). * Implements hook_permission().
*/ */
function roblib_search_eds_permission() { /*function roblib_search_eds_permission() {
return array( return array(
'search roblib eds' => array( 'search roblib eds' => array(
'title' => t('Search the eds target'), 'title' => t('Search the eds target'),
@ -71,36 +71,26 @@ function roblib_search_eds_permission() {
'description' => t('Administer settings for the Roblib eds search client.'), 'description' => t('Administer settings for the Roblib eds search client.'),
), ),
); );
} }*/
/** /**
* Implements hook_theme(). * Implements hook_theme().
*/ */
function roblib_search_eds_theme() { function roblib_search_eds_theme($existing, $type, $theme, $path) {
// set path return [
$path = drupal_get_path('module', 'roblib_search_eds'); 'roblib_search_eds_books' => [
$file = 'theme.inc'; 'variables' => ['query' => NULL],
],
return array( 'roblib_search_eds_articles' => [
// results page 'variables' => ['query' => NULL],
'roblib_search_eds' => array( ],
'path' => $path . '/theme', ];
'file' => $file,
'template' => 'roblib-search-eds',
'variables' => array('results' => NULL),
),
'roblib_search_eds_articles' => array(
'path' => $path . '/theme',
'file' => $file,
'template' => 'roblib-search-eds-articles',
'variables' => array('results' => NULL),
),
);
} }
function roblib_search_eds_block_info() { /*function roblib_search_eds_block_info() {
$blocks['roblib_search_eds_results'] = array( $blocks['roblib_search_eds_results'] = array(
// info: The name of the block. // info: The name of the block.
@ -113,9 +103,9 @@ function roblib_search_eds_block_info() {
'cache' => DRUPAL_CACHE_PER_ROLE, 'cache' => DRUPAL_CACHE_PER_ROLE,
); );
return $blocks; return $blocks;
} }*/
function roblib_search_eds_block_view($delta = '') { /*function roblib_search_eds_block_view($delta = '') {
switch ($delta) { switch ($delta) {
case 'roblib_search_eds_results': case 'roblib_search_eds_results':
$block['subject'] = t('Books & Media'); $block['subject'] = t('Books & Media');
@ -129,9 +119,9 @@ function roblib_search_eds_block_view($delta = '') {
} }
return $block; return $block;
} }*/
function roblib_search_eds_ajax($query) { /*function roblib_search_eds_ajax($query) {
print roblib_search_eds_get_results($query, 'Books'); print roblib_search_eds_get_results($query, 'Books');
exit(); exit();
} }
@ -139,7 +129,7 @@ function roblib_search_eds_ajax($query) {
function roblib_search_eds_articles($query) { function roblib_search_eds_articles($query) {
print roblib_search_eds_get_results($query, 'Articles'); print roblib_search_eds_get_results($query, 'Articles');
exit(); exit();
} }*/
/** /**
* *

8
modules/roblib_search_eds/roblib_search_eds.routing.yml

@ -0,0 +1,8 @@
roblib_search_eds.settings:
path: '/admin/config/system/roblib_search_eds_settings'
defaults:
_form: '\Drupal\roblib_search_eds\Form\EdsSettingsForm'
_title: 'Roblib Search EDS Settings Form'
requirements:
_permission: 'administer site configuration'

7
targets/eds/Controller/RoblibSearchEdsController.php → modules/roblib_search_eds/src/Controller/RoblibSearchEdsController.php

@ -16,10 +16,7 @@ class RoblibSearchEdsController extends ControllerBase {
* A renderable array. * A renderable array.
*/ */
public function articleResults($query = NULL) { public function articleResults($query = NULL) {
return [
'#theme' => 'roblib_search_results',
'#query' => $query,
];
} }
/** /**
@ -30,7 +27,7 @@ class RoblibSearchEdsController extends ControllerBase {
*/ */
public function bookResults($query = NULL) { public function bookResults($query = NULL) {
return [ return [
'#theme' => 'roblib_search_results', '#theme' => 'roblib_search_eds_books',
'#query' => $query, '#query' => $query,
]; ];
} }

137
modules/roblib_search_eds/src/Form/EdsSettingsForm.php

@ -0,0 +1,137 @@
<?php
namespace Drupal\roblib_search_eds\Form;
use Drupal\Core\Form\FormBase;
use Drupal\Core\Form\FormStateInterface;
/**
* Settings form for module
*
* @author ppound
*/
class EdsSettingsForm extends FormBase {
/**
* {@inheritdoc}
*/
public function getFormId() {
return 'roblib_search_eds_settings_form';
}
/**
* {@inheritdoc}
*/
public function buildForm(array $form, FormStateInterface $form_state) {
$config = \Drupal::config('roblib_search_eds.settings');
$form['eds_rest_url'] = array(
'#type' => 'textfield',
'#title' => 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'),
'#required' => TRUE,
);
$form['eds_auth_url'] = array(
'#type' => 'textfield',
'#title' => 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'),
'#required' => TRUE,
);
$form['eds_user'] = array(
'#type' => 'textfield',
'#title' => t('EDS user'),
'#default_value' => $config->get('eds_user'),
'#description' => t('EDS user, for example username'),
'#required' => TRUE,
);
$form['eds_pass'] = array(
'#type' => 'textfield',
'#title' => t('EDS password'),
'#default_value' => $config->get('eds_pass'),
'#description' => t('EDS password, for example password'),
'#required' => TRUE,
);
$form['eds_guest'] = array(
'#type' => 'textfield',
'#title' => t('EDS Guest access'),
'#default_value' => $config->get('eds_guest'),
'#description' => t('EDS Guest access, y = guest access, n = not a guest'),
'#required' => TRUE,
);
$form['eds_article_profile'] = array(
'#type' => 'textfield',
'#title' => t('EDS Article profile'),
'#default_value' => $config->get('eds_article_profile'),
'#description' => t('EDS profile, for example edsapi'),
'#required' => TRUE,
);
$form['eds_book_profile'] = array(
'#type' => 'textfield',
'#title' => t('EDS Book profile'),
'#default_value' => $config->get('eds_book_profile'),
'#description' => t('EDS Book profile, for example apilite'),
'#required' => TRUE,
);
$form['eds_num_results'] = array(
'#type' => 'textfield',
'#title' => 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'),
'#required' => TRUE,
);
$form['eds_article_limiters'] = array(
'#type' => 'textarea',
'#title' => 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
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'),
'#default_value' => $config->get('eds_book_limiters'),
'#description' => 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'),
'#button_type' => 'primary',
];
return $form;
}
/**
* {@inheritdoc}
*/
public function validateForm(array &$form, FormStateInterface $form_state) {
}
/**
* {@inheritdoc}
*/
public function submitForm(array &$form, FormStateInterface $form_state) {
$config = \Drupal::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();
$config->set('eds_pass', $form_state->getValue('eds_pass'))->save();
$config->set('eds_guest', $form_state->getValue('eds_guest'))->save();
$config->set('eds_article_profile', $form_state->getValue('eds_article_profile'))->save();
$config->set('eds_book_profile', $form_state->getValue('eds_book_profile'))->save();
$config->set('eds_num_results', $form_state->getValue('eds_num_results'))->save();
$config->set('eds_article_limiters', $form_state->getValue('eds_article_limiters'))->save();
$config->set('eds_book_limiters', $form_state->getValue('eds_book_limiters'))->save();
}
}

27
modules/roblib_search_eds/src/Plugin/Block/RoblibSearchEdsArticles.php

@ -0,0 +1,27 @@
<?php
namespace Drupal\roblib_search_eds\Plugin\Block;
use Drupal\Core\Block\BlockBase;
/**
* Provides EDS Article search results.
*
* @Block(
* id = "roblib_search_eds_articles_block",
* admin_label = @Translation("Roblib Search EDS Articles Block"),
* category = @Translation("Roblib Search"),
* )
*/
class RoblibSearchEdsArticles extends BlockBase {
/**
* {@inheritdoc}
*/
public function build() {
return [
'#theme' => 'roblib_search_eds_articles',
'#query' => $query,
];
}
}

27
modules/roblib_search_eds/src/Plugin/Block/RoblibSearchEdsBooks.php

@ -0,0 +1,27 @@
<?php
namespace Drupal\roblib_search_eds\Plugin\Block;
use Drupal\Core\Block\BlockBase;
/**
* Provides EDS book search results.
*
* @Block(
* id = "roblib_search_eds_books_block",
* admin_label = @Translation("Roblib Search EDS Books Block"),
* category = @Translation("Roblib Search"),
* )
*/
class RoblibSearchEdsBooks extends BlockBase {
/**
* {@inheritdoc}
*/
public function build() {
return [
'#theme' => 'roblib_search_eds_books',
'#query' => $query,
];
}
}

12
modules/roblib_search_eds/templates/roblib-search-eds-articles.html.twig

@ -0,0 +1,12 @@
<div class ="roblib-search-more" id="roblib-search-eds-article-more"></div>
<div class ="roblib-search-content eds-article" id="roblib-search-content-eds-articles">
</div>
<div id="roblib-eds-articles-more-results" class="roblib-eds-more-button button"></div>
<div id="roblib-eds-articles-toc" class="roblib-bento-toc moveme-please"></div>

9
targets/eds/theme/roblib-search-eds.tpl.php → modules/roblib_search_eds/templates/roblib-search-eds-books.html.twig

@ -1,13 +1,6 @@
<?php
/**
* @file roblib-search-eds.tpl.php
*
*/
?>
<div class ="roblib-search-more" id="roblib-search-eds-more"></div> <div class ="roblib-search-more" id="roblib-search-eds-more"></div>
<div class ="roblib-search-content eds" id="roblib-search-content-eds"> <div class ="roblib-search-content eds" id="roblib-search-content-eds">
<img src="<?php print (empty($spinner_path) ? ' ' : $spinner_path); ?>"/>
</div> </div>
<div id="roblib-eds-books-more-results" class="roblib-eds-more-button button"></div> <div id="roblib-eds-books-more-results" class="roblib-eds-more-button button"></div>

0
targets/eds/theme/theme.inc → modules/roblib_search_eds/templates/theme.inc

0
targets/solr_site/css/roblib_search_solr_site.css → modules/solr_site/css/roblib_search_solr_site.css

0
targets/solr_site/js/solr_site_bestbet.js → modules/solr_site/js/solr_site_bestbet.js

0
targets/solr_site/js/solr_site_databases.js → modules/solr_site/js/solr_site_databases.js

0
targets/solr_site/js/solr_site_guides.js → modules/solr_site/js/solr_site_guides.js

0
targets/solr_site/js/solr_site_reserves.js → modules/solr_site/js/solr_site_reserves.js

0
targets/solr_site/js/solr_site_results.js → modules/solr_site/js/solr_site_results.js

0
targets/solr_site/roblib_search_solr_site.info → modules/solr_site/roblib_search_solr_site.info

0
targets/solr_site/roblib_search_solr_site.install → modules/solr_site/roblib_search_solr_site.install

0
targets/solr_site/roblib_search_solr_site.module → modules/solr_site/roblib_search_solr_site.module

0
targets/solr_site/theme/roblib-search-solr-site-results.tpl.php → modules/solr_site/theme/roblib-search-solr-site-results.tpl.php

0
targets/solr_site/theme/theme.inc → modules/solr_site/theme/theme.inc

56
roblib_search.module

@ -5,46 +5,6 @@
* Implementation of Roblib search for searching several targets. * Implementation of Roblib search for searching several targets.
*/ */
/**
* Implements hook_menu().
*/
function roblib_search_menu() {
$items['admin/roblib_search'] = array(
'title' => 'Roblib search',
'description' => 'Configure global Roblib search settings.',
'access arguments' => array('administer site configuration'),
'type' => MENU_NORMAL_ITEM,
);
$items['admin/roblib_search/configure'] = array(
'title' => 'Global Configuration',
'description' => 'Configure global Roblib search settings.',
'access arguments' => array('administer site configuration'),
'page callback' => 'drupal_get_form',
'page arguments' => array('roblib_search_config_form'),
'type' => MENU_NORMAL_ITEM,
);
return $items;
}
/**
* Implements hook_block_info().
*/
function roblib_search_block_info() {
$blocks['roblib_search_form'] = array(
'info' => t('Roblib Global Search Form'),
'cache' => DRUPAL_CACHE_PER_ROLE,
);
$blocks['roblib_search_other'] = array(
'info' => t('Roblib Search Other Sources'),
'cache' => DRUPAL_CACHE_PER_ROLE,
);
return $blocks;
}
/** /**
* Implements hook_theme(). * Implements hook_theme().
*/ */
@ -67,22 +27,6 @@ function roblib_search_theme($existing, $type, $theme, $path) {
drupal_add_css(drupal_get_path('module', 'roblib_search') . '/css/jquery.qtip.min.css'); drupal_add_css(drupal_get_path('module', 'roblib_search') . '/css/jquery.qtip.min.css');
}*/ }*/
/**
* Implements hook_block_view().
*/
function roblib_search_block_view($delta = '') {
switch ($delta) {
case 'roblib_search_form':
$block['subject'] = t('Bento Search');
$block['content'] = drupal_get_form('roblib_search_simple_form');
break;
case 'roblib_search_other':
$block['subject'] = t('Other Sources');
$block['content'] = theme('roblib_search_other_sources', array('results' => NULL));
}
return $block;
}
/** /**
* Implements hook_help(). * Implements hook_help().

2
src/Plugin/Block/RoblibSearchBoxBlock.php

@ -5,7 +5,7 @@ namespace Drupal\roblib_search\Plugin\Block;
use Drupal\Core\Block\BlockBase; use Drupal\Core\Block\BlockBase;
/** /**
* Provides a 'Hello' Block. * Provides a search form.
* *
* @Block( * @Block(
* id = "roblib_search_box", * id = "roblib_search_box",

133
targets/eds/Form/RoblibSearchEdsSettingsForm.php

@ -1,133 +0,0 @@
<?php
namespace Drupal\roblib_search\Form;
use Drupal\Core\Form\FormBase;
use Drupal\Core\Form\FormStateInterface;
/**
* Settings form for module
*
* @author ppound
*/
class RoblibSearchEdsSettingsForm extends FormBase {
/**
* {@inheritdoc}
*/
public function getFormId() {
return 'roblib_search_eds_settings_form';
}
/**
* {@inheritdoc}
*/
public function buildForm(array $form, FormStateInterface $form_state) {
$config = \Drupal::config('roblib_search_eds.settings');
$form['eds_rest_url'] = array(
'#type' => 'textfield',
'#title' => 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'),
'#required' => TRUE,
);
$form['eds_auth_url'] = array(
'#type' => 'textfield',
'#title' => 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'),
'#required' => TRUE,
);
$form['eds_user'] = array(
'#type' => 'textfield',
'#title' => t('EDS user'),
'#default_value' => $config->get('eds_user'),
'#description' => t('EDS user, for example username'),
'#required' => TRUE,
);
$form['eds_pass'] = array(
'#type' => 'textfield',
'#title' => t('EDS password'),
'#default_value' => $config->get('eds_pass'),
'#description' => t('EDS password, for example password'),
'#required' => TRUE,
);
$form['eds_guest'] = array(
'#type' => 'textfield',
'#title' => t('EDS Guest access'),
'#default_value' => $config->get('eds_guest'),
'#description' => t('EDS Guest access, y = guest access, n = not a guest'),
'#required' => TRUE,
);
$form['eds_article_profile'] = array(
'#type' => 'textfield',
'#title' => t('EDS Article profile'),
'#default_value' => $config->get('eds_article_profile'),
'#description' => t('EDS profile, for example edsapi'),
'#required' => TRUE,
);
$form['eds_book_profile'] = array(
'#type' => 'textfield',
'#title' => t('EDS Book profile'),
'#default_value' => $config->get('eds_book_profile'),
'#description' => t('EDS Book profile, for example apilite'),
'#required' => TRUE,
);
$form['eds_num_results'] = array(
'#type' => 'textfield',
'#title' => 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'),
'#required' => TRUE,
);
$form['eds_article_limiters'] = array(
'#type' => 'textarea',
'#title' => 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
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'),
'#default_value' => $config->get('eds_book_limiters'),
'#description' => 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,
);
return $form;
}
/**
* {@inheritdoc}
*/
public function validateForm(array &$form, FormStateInterface $form_state) {
}
/**
* {@inheritdoc}
*/
public function submitForm(array &$form, FormStateInterface $form_state) {
$config = \Drupal::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();
$config->set('eds_pass', $form_state->getValue('eds_pass'))->save();
$config->set('eds_guest', $form_state->getValue('eds_guest'))->save();
$config->set('eds_article_profile', $form_state->getValue('eds_article_profile'))->save();
$config->set('eds_book_profile', $form_state->getValue('eds_book_profile'))->save();
$config->set('eds_num_results', $form_state->getValue('eds_num_results'))->save();
$config->set('eds_article_limiters', $form_state->getValue('eds_article_limiters'))->save();
$config->set('eds_book_limiters', $form_state->getValue('eds_book_limiters'))->save();
}
}

8
targets/eds/roblib_search_eds.info.yml

@ -1,8 +0,0 @@
name: Roblib Search EDS
configure: admin/roblib_search/eds_search
description: Implements the Roblib Search modules _roblib_search hook
package: Roblib Search
core_version_requirement: ^8.9 || ^9
dependancies:
- roblib_search
- ebsco

25
targets/eds/roblib_search_eds.routing.yml

@ -1,25 +0,0 @@
roblib_search_eds.settings:
path: '/admin/config/system/roblib_search'
defaults:
_form: '\Drupal\roblib_search_eds\Form\RoblibSearchEdsSettingsForm'
_title: 'Roblib Search EDS Settings Form'
requirements:
_permission: 'administer site configuration'
roblib_search_eds.article_search:
path: '/roblib_search/eds/articles/{query}'
defaults:
_controller: '\Drupal\roblib_search_eds\Controller\RoblibSearchEdsController::articleResults'
_title: 'Roblib Search EDS Articles'
query: '[a-zA-Z\s]+'
requirements:
_permission: 'access content'
roblib_search_eds.book_search:
path: '/roblib_search/eds/book/{query}'
defaults:
_controller: '\Drupal\roblib_search_eds\Controller\RoblibSearchEdsController::bookResults'
_title: 'Roblib Search EDS Articles'
query: '[a-zA-Z\s]+'
requirements:
_permission: 'access content'

35
targets/eds/theme/roblib-search-eds-articles.tpl.php

@ -1,35 +0,0 @@
<?php
/**
* @file roblib-search-eds-article.tpl.php
* Search ebscohost for articles
*
* Variables available:
* - $variables: all array elements of $variables can be used as a variable. e.g. $base_url equals $variables['base_url']
*
*
*/
?>
<div class ="roblib-search-more" id="roblib-search-eds-article-more"></div>
<div class ="roblib-search-content eds-article" id="roblib-search-content-eds-articles">
<img src="<?php print (empty($spinner_path) ? ' ' : $spinner_path); ?>"/>
</div>
<div id="roblib-eds-articles-more-results" class="roblib-eds-more-button button"></div>
<div id="roblib-eds-articles-toc" class="roblib-bento-toc moveme-please"></div>
<?php
/**
* Alternate way to create link back to ebscohost.
<form action="" id = 'roblib-search-eds-articles' method="post" style="width: 375px; overflow: auto;" onsubmit="return ebscoHostSearchGo(this);">
<input id="ebscohosturl" name="ebscohosturl" type="hidden" value="https://search.ebscohost.com/login.aspx?direct=true&amp;site=ehost-live&amp;scope=site&amp;type=0&amp;custid=uprince&amp;profid=eds&amp;groupid=main&amp;mode=and&amp;cli0=RV&amp;clv0=N&amp;lang=en" />
<input id="ebscohostsearchsrc" name="ebscohostsearchsrc" type="hidden" value="url" /> <input id="ebscohostsearchmode" name="ebscohostsearchmode" type="hidden" value="+" />
<input id="ebscohostkeywords" name="ebscohostkeywords" type="hidden" value="" />
<div><input id="ebscohostsearchtext" name="ebscohostsearchtext" value="history" type="hidden" size="23" style="font-size: 9pt; padding-left: 5px; margin-left: 0px;" /> <input type="submit" value="Search" style="font-size: 9pt; padding-left: 5px;" /></div>
</div>
</form>
*/
?>
Loading…
Cancel
Save