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