in services/dashboard/dashboard.pageBuilder.php [9:74]
function buildContentSummary_dashboard(){
global $DASHBOARD;
$output = $items = [];
$dataSets = [
'S' => 0,
'R' => 0,
'C' => 0,
'P' => 0,
'O' => 0
];
$hriSets = [
'H' => 0,
'M' => 0,
'L' => 0,
'I' => 0
];
$total = 0;
if(empty($DASHBOARD['CRITICALITY'])){
__warn("0 recommendations detected, expecting empty report");
return;
}
foreach($DASHBOARD['CRITICALITY'] as $region => $details){
foreach($details as $cat => $cnt){
$hriSets[$cat] += $cnt;
$total += $cnt;
}
}
foreach($hriSets as $cat => $count){
$items[] = $this->getHRIInfo($cat, $count, $total);
}
foreach($DASHBOARD['CATEGORY'] as $region => $details){
foreach($details as $cat => $cnt)
$dataSets[$cat] += $cnt;
}
$html = "<dl class='row'>" . implode("\n", $items) . "</dl>";
$card = $this->generateCard($id=$this->getHtmlId('criticalityCount'), $html, $cardClass='danger', $title='No. Criticality', '', $collapse=false);
$securityBox = $this->generateSecurityBigBox($dataSets['S']);
$customHtml = <<<EOL
<div class="row">
<div class="col-sm-8">
$card
</div>
$securityBox
</div>
EOL;
$output[] = $customHtml;
foreach($dataSets as $cat => $total){
if($cat == 'S')
continue;
$items[] = [$this->getDashboardCategoryTiles($cat, $total), ''];
}
$output[] = $this->generateRowWithCol($size=3, $items, "data-context='pillars'");
return $output;
}