public static function StatusReportPage::preRenderGeneralInfo in Drupal 10
Same name and namespace in other branches
- 8 core/modules/system/src/Element/StatusReportPage.php \Drupal\system\Element\StatusReportPage::preRenderGeneralInfo()
- 9 core/modules/system/src/Element/StatusReportPage.php \Drupal\system\Element\StatusReportPage::preRenderGeneralInfo()
#pre_render callback to get general info out of requirements.
File
- core/
modules/ system/ src/ Element/ StatusReportPage.php, line 34
Class
- StatusReportPage
- Creates status report page element.
Namespace
Drupal\system\ElementCode
public static function preRenderGeneralInfo($element) {
$element['#general_info'] = [
'#theme' => 'status_report_general_info',
];
// Loop through requirements and pull out items.
foreach ($element['#requirements'] as $key => $requirement) {
switch ($key) {
case 'cron':
foreach ($requirement['description'] as &$description_elements) {
foreach ($description_elements as &$description_element) {
if (isset($description_element['#url']) && $description_element['#url']
->getRouteName() == 'system.run_cron') {
$description_element['#attributes']['class'][] = 'button';
$description_element['#attributes']['class'][] = 'button--small';
$description_element['#attributes']['class'][] = 'button--primary';
$description_element['#attributes']['class'][] = 'system-status-general-info__run-cron';
}
}
}
// Intentional fall-through.
case 'drupal':
case 'webserver':
case 'database_system':
case 'database_system_version':
case 'php':
case 'php_memory_limit':
$element['#general_info']['#' . $key] = $requirement;
if (isset($requirement['severity']) && $requirement['severity'] < REQUIREMENT_WARNING) {
unset($element['#requirements'][$key]);
}
break;
}
}
return $element;
}