edlp_search.module 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. /**
  3. * @file
  4. * Contains edlp_search.module.
  5. */
  6. use Drupal\Core\Routing\RouteMatchInterface;
  7. use Drupal\Core\Url;
  8. /**
  9. * Implements hook_help().
  10. */
  11. function edlp_search_help($route_name, RouteMatchInterface $route_match) {
  12. switch ($route_name) {
  13. // Main module help for the edlp_search module.
  14. case 'help.page.edlp_search':
  15. $output = '';
  16. $output .= '<h3>' . t('About') . '</h3>';
  17. $output .= '<p>' . t('Edlp search module') . '</p>';
  18. return $output;
  19. default:
  20. }
  21. }
  22. /**
  23. * Implements hook_page_attachments().
  24. * @param array $attachments
  25. */
  26. function edlp_search_page_attachments(array &$attachments) {
  27. $attachments['#attached']['library'][] = 'edlp_search/edlp_search-library';
  28. $url = Url::fromRoute('edlp_search.edlp_search_controller_searchResults_ajax', [], ['absolute' => TRUE]);
  29. $attachments['#attached']['drupalSettings']['edlp_search']['results_ajax_url'] = $url->getInternalPath();
  30. }
  31. /**
  32. * Implements hook_theme().
  33. */
  34. function edlp_search_theme($existing, $type, $theme, $path) {
  35. return array(
  36. 'edlp_search_search_form' => array(
  37. 'file' => 'includes/edlp_search_search_form.inc',
  38. 'variables' => array(
  39. 'form' => null,
  40. ),
  41. ),
  42. );
  43. }