2018-09-06 15:57:39 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
* Contains opencase_reporting.module.
|
|
|
|
*/
|
|
|
|
|
|
|
|
use Drupal\Core\Routing\RouteMatchInterface;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Implements hook_help().
|
|
|
|
*/
|
|
|
|
function opencase_reporting_help($route_name, RouteMatchInterface $route_match) {
|
|
|
|
switch ($route_name) {
|
|
|
|
// Main module help for the opencase_reporting module.
|
|
|
|
case 'help.page.opencase_reporting':
|
|
|
|
$output = '';
|
|
|
|
$output .= '<h3>' . t('About') . '</h3>';
|
|
|
|
$output .= '<p>' . t('Reporting functionality for OpenCase.') . '</p>';
|
|
|
|
return $output;
|
|
|
|
|
|
|
|
default:
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-09-12 14:50:08 +00:00
|
|
|
/**
|
|
|
|
* Implements hook_theme().
|
|
|
|
*/
|
|
|
|
function opencase_reporting_theme() {
|
|
|
|
return array(
|
|
|
|
'opencase_reporting_presets' => array(
|
|
|
|
'variables' => array('presets' => array()),
|
|
|
|
'template' => 'block--opencase-reporting-presets',
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2018-09-06 18:33:47 +00:00
|
|
|
/**
|
|
|
|
* Implements hook_page_attachments
|
|
|
|
*
|
|
|
|
* Add the opencase library to every page
|
|
|
|
*/
|
|
|
|
function opencase_reporting_page_attachments(array &$page) {
|
|
|
|
$page['#attached']['library'][] = 'opencase_reporting/opencase-reporting-lib';
|
|
|
|
}
|
|
|
|
|
2018-09-06 15:57:39 +00:00
|
|
|
/**
|
|
|
|
* Implements hook_uninstall().
|
|
|
|
* Removes configs.
|
|
|
|
*/
|
|
|
|
function opencase_reporting_uninstall() {
|
|
|
|
$configs = [
|
|
|
|
'search_api.server.opencase_reporting_server',
|
2018-09-06 18:11:49 +00:00
|
|
|
'search_api.index.opencase_reporting_actors',
|
|
|
|
'facets.facet.actor_type',
|
|
|
|
'facets.facet.actor_type_export',
|
|
|
|
'facets.facet.created',
|
|
|
|
'facets.facet.created_export',
|
|
|
|
'views.view.reporting_actors',
|
|
|
|
'block.block.facet_actortype',
|
|
|
|
'block.block.facet_created',
|
2018-09-06 15:57:39 +00:00
|
|
|
];
|
|
|
|
foreach($configs as $config) {
|
|
|
|
Drupal::configFactory()->getEditable($config)->delete();
|
|
|
|
}
|
|
|
|
}
|