
| Current Path : /var/www/html/pallets/web/core/modules/system/tests/modules/olivero_test/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : /var/www/html/pallets/web/core/modules/system/tests/modules/olivero_test/olivero_test.module |
<?php
/**
* @file
* Functions to support testing the Olivero theme.
*/
/**
* Implements hook_preprocess_field_multiple_value_form().
*/
function olivero_test_preprocess_field_multiple_value_form(&$variables) {
// Set test multiple value form field to disabled
if ($variables["element"]["#field_name"] === "field_multiple_value_form_field") {
$variables['element']['#disabled'] = TRUE;
}
}
/**
* Implements hook_preprocess().
*/
function olivero_test_preprocess_page(&$variables) {
$route = \Drupal::routeMatch()->getRouteName();
switch ($route) {
case 'js_message_test.links':
$messenger = \Drupal::messenger();
$messenger->addStatus('PHP Status');
$messenger->addWarning('PHP Warning');
$messenger->addError('PHP Error');
break;
default:
break;
}
}
/**
* Implements hook_preprocess_html().
*/
function olivero_test_preprocess_html(&$variables) {
$variables['#attached']['library'][] = 'olivero_test/log-errors';
}