pm-4.1.x-dev/pm.module
pm.module
<?php
/**
* @file
* Contains pm.module.
*/
use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
function pm_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
// Main module help for the pm module.
case 'help.page.pm':
$output = '';
$output .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . t('Drupal PM') . '</p>';
return $output;
default:
}
}
/**
* Implements hook_theme().
*/
function pm_theme() {
$theme = [];
$theme['pm_dashboard'] = [
'render element' => 'elements',
'template' => 'pm-dashboard',
'variables' => [
'items' => [],
],
];
return $theme;
}
function pm_gin_content_form_routes_alter(&$route_names) {
$route_names = array_merge(
[
'entity.pm_board.add_form',
'entity.pm_board.edit_form',
'entity.pm_board_column.add_form',
'entity.pm_board_column.edit_form',
'entity.pm_epic.add_form',
'entity.pm_epic.edit_form',
'entity.pm_expense.add_form',
'entity.pm_expense.edit_form',
'entity.pm_feature.add_form',
'entity.pm_feature.edit_form',
'entity.pm_invoice.add_form',
'entity.pm_invoice.edit_form',
'entity.pm_note.add_form',
'entity.pm_note.edit_form',
'entity.pm_organization.add_form',
'entity.pm_organization.edit_form',
'entity.pm_persona.add_form',
'entity.pm_persona.edit_form',
'entity.pm_priority.add_form',
'entity.pm_priority.edit_form',
'entity.pm_priority.canonical',
'entity.pm_project.add_form',
'entity.pm_project.edit_form',
'entity.pm_status.add_form',
'entity.pm_status.edit_form',
'entity.pm_status.canonical',
'entity.pm_story.add_form',
'entity.pm_story.edit_form',
'entity.pm_sub_task.add_form',
'entity.pm_sub_task.edit_form',
'entity.pm_task.add_form',
'entity.pm_task.edit_form',
'entity.pm_timetracking.add_form',
'entity.pm_timetracking.edit_form',
]
);
}
/**
* Implements hook_entity_presave().
*/
function pm_entity_presave(\Drupal\Core\Entity\EntityInterface $entity) {
\Drupal::service('pm.pm_key')
->handleEntityPresave($entity);
\Drupal::service('pm.computed_parent')
->handleEntityPresave($entity);
\Drupal::service('pm.etag')
->handleEntityPresave($entity);
}
