pm_invoice.module in Drupal PM (Project Management) 4.x
Contains pm_invoice.module.
File
modules/pm_invoice/pm_invoice.moduleView source
<?php
/**
* @file
* Contains pm_invoice.module.
*/
use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
function pm_invoice_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
// Main module help for the pm_invoice module.
case 'help.page.pm_invoice':
$output = '';
$output .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . t('PM Invoice') . '</p>';
return $output;
default:
}
}
/**
* Implements hook_theme().
*/
function pm_invoice_theme() {
$theme = [];
$theme['pm_invoice'] = [
'render element' => 'elements',
'file' => 'pm_invoice.page.inc',
'template' => 'pm_invoice',
];
$theme['pm_invoice_content_add_list'] = [
'render element' => 'content',
'variables' => [
'content' => NULL,
],
'file' => 'pm_invoice.page.inc',
];
return $theme;
}
/**
* Implements hook_theme_suggestions_HOOK().
*/
function pm_invoice_theme_suggestions_pm_invoice(array $variables) {
$suggestions = [];
$entity = $variables['elements']['#pm_invoice'];
$sanitized_view_mode = strtr($variables['elements']['#view_mode'], '.', '_');
$suggestions[] = 'pm_invoice__' . $sanitized_view_mode;
$suggestions[] = 'pm_invoice__' . $entity
->bundle();
$suggestions[] = 'pm_invoice__' . $entity
->bundle() . '__' . $sanitized_view_mode;
$suggestions[] = 'pm_invoice__' . $entity
->id();
$suggestions[] = 'pm_invoice__' . $entity
->id() . '__' . $sanitized_view_mode;
return $suggestions;
}
Functions
Name | Description |
---|---|
pm_invoice_help | Implements hook_help(). |
pm_invoice_theme | Implements hook_theme(). |
pm_invoice_theme_suggestions_pm_invoice | Implements hook_theme_suggestions_HOOK(). |