need to run : drush ev 'drupal_flush_all_caches();' drush cr and restart nginx and php-fpm before loading the website
59 lines
1.4 KiB
Plaintext
59 lines
1.4 KiB
Plaintext
<?php
|
|
|
|
/**
|
|
* @file
|
|
* Contains edlp_search.module.
|
|
*/
|
|
|
|
use Drupal\Core\Routing\RouteMatchInterface;
|
|
use Drupal\Core\Url;
|
|
|
|
/**
|
|
* Implements hook_help().
|
|
*/
|
|
function edlp_search_help($route_name, RouteMatchInterface $route_match) {
|
|
switch ($route_name) {
|
|
// Main module help for the edlp_search module.
|
|
case 'help.page.edlp_search':
|
|
$output = '';
|
|
$output .= '<h3>' . t('About') . '</h3>';
|
|
$output .= '<p>' . t('Edlp search module') . '</p>';
|
|
return $output;
|
|
|
|
default:
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Implements hook_page_attachments().
|
|
* @param array $attachments
|
|
*/
|
|
function edlp_search_page_attachments(array &$attachments) {
|
|
$attachments['#attached']['library'][] = 'edlp_search/edlp_search-library';
|
|
$url = Url::fromRoute('edlp_search.edlp_search_controller_search_results_ajax');
|
|
$attachments['#attached']['drupalSettings']['edlp_search']['results_ajax_url'] = $url->getInternalPath();
|
|
}
|
|
|
|
|
|
/**
|
|
* Implements hook_theme().
|
|
*/
|
|
function edlp_search_theme($existing, $type, $theme, $path) {
|
|
return array(
|
|
'edlp_search_search_form' => array(
|
|
'file' => 'includes/edlp_search_search_form.inc',
|
|
'variables' => array(
|
|
'form' => null,
|
|
),
|
|
),
|
|
'edlp_search_results' => array(
|
|
'file' => 'includes/edlp_search_results.inc',
|
|
'variables' => array(
|
|
'items' => null,
|
|
'no_results_found' => '',
|
|
'search_help' => ''
|
|
),
|
|
),
|
|
);
|
|
}
|