12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- <?php
- /**
- * @file
- * Contains statusmessage.module..
- */
- use Drupal\Core\Routing\RouteMatchInterface;
- /**
- * Implements hook_help().
- */
- function statusmessage_help($route_name, RouteMatchInterface $route_match) {
- switch ($route_name) {
- // Main module help for the statusmessage module.
- case 'help.page.statusmessage':
- $output = '';
- $output .= '<h3>' . t('About') . '</h3>';
- $output .= '<p>' . t('Status Messages for Users') . '</p>';
- return $output;
- default:
- }
- }
- /**
- * Implements hook_theme().
- */
- function statusmessage_theme() {
- $theme = [];
- $theme['status'] = [
- 'render element' => 'elements',
- 'file' => 'status.page.inc',
- 'template' => 'status',
- ];
- $theme['status_content_add_list'] = [
- 'render element' => 'content',
- 'variables' => ['content' => NULL],
- 'file' => 'status.page.inc',
- ];
- return $theme;
- }
- /**
- * Implements hook_theme_suggestions_HOOK().
- */
- function statusmessage_theme_suggestions_status(array $variables) {
- $suggestions = array();
- $entity = $variables['elements']['#status'];
- $sanitized_view_mode = strtr($variables['elements']['#view_mode'], '.', '_');
- $suggestions[] = 'status__' . $sanitized_view_mode;
- $suggestions[] = 'status__' . $entity->bundle();
- $suggestions[] = 'status__' . $entity->bundle() . '__' . $sanitized_view_mode;
- $suggestions[] = 'status__' . $entity->id();
- $suggestions[] = 'status__' . $entity->id() . '__' . $sanitized_view_mode;
- return $suggestions;
- }
|