53 lines
1.1 KiB
Plaintext
53 lines
1.1 KiB
Plaintext
<?php
|
|
|
|
/**
|
|
* @file
|
|
* Contains zencrm.module.
|
|
*/
|
|
|
|
use Drupal\Core\Routing\RouteMatchInterface;
|
|
|
|
/**
|
|
* Implements hook_help().
|
|
*/
|
|
function zencrm_help($route_name, RouteMatchInterface $route_match) {
|
|
switch ($route_name) {
|
|
// Main module help for the zencrm module.
|
|
case 'help.page.zencrm':
|
|
$output = '';
|
|
$output .= '<h3>' . t('About') . '</h3>';
|
|
$output .= '<p>' . t('Zen CRM') . '</p>';
|
|
return $output;
|
|
|
|
default:
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Implements hook_theme().
|
|
*/
|
|
function zencrm_theme() {
|
|
return [
|
|
'zencrm' => [
|
|
'render element' => 'children',
|
|
],
|
|
];
|
|
}
|
|
|
|
function zencrm_page_attachments(array &$page) {
|
|
$page['#attached']['library'][] = 'zencrm/opencase-lib';
|
|
}
|
|
|
|
/**
|
|
* Implements hook_user_login().
|
|
*/
|
|
function zencrm_user_login(\Drupal\user\UserInterface $account) {
|
|
// Default login destination to the dashboard.
|
|
$current_request = \Drupal::service('request_stack')->getCurrentRequest();
|
|
if (!$current_request->query->get('destination')) {
|
|
$current_request->query->set(
|
|
'destination', '/'
|
|
);
|
|
}
|
|
}
|