Skip to content

Commit dcd4c34

Browse files
authored
Merge pull request #48 from ioggstream/ioggstream-47
Fix: #47. Maturity levels moved to yaml.
2 parents ba3cd9a + ffa1395 commit dcd4c34

3 files changed

Lines changed: 36 additions & 13 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
.idea
2+
data/dimensions.yaml

data/maturity-levels.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
maturity-levels:
2+
level-1:
3+
level: 1
4+
label: "Basic understanding of security practices"
5+
description: |-
6+
An extensive description of Level 1
7+
level-2:
8+
level: 2
9+
label: "Adoption of basic security practices"
10+
description: |-
11+
An extensive description of this level in markdown format.
12+
level-3:
13+
level: 3
14+
label: "High adoption of security practices"
15+
description: |-
16+
An extensive description of this level in markdown format.
17+
level-4:
18+
level: 4
19+
label: "Advanced deployment of security practices at scale"
20+
description: |-
21+
An extensive description of this level in markdown format.

head.php

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -77,19 +77,20 @@
7777
bindtextdomain ( $domain, "locale" );
7878
textdomain ( $domain );
7979
function getTableHeader() {
80-
$headers = array (
81-
"Dimension",
82-
"Sub-Dimension",
83-
"Level 1: Basic understanding of security practices" ,
84-
"Level 2: Adoption of basic security practices",
85-
"Level 3: High adoption of security practices",
86-
"Level 4: Advanced deployment of security practices at scale"
87-
);
88-
$headerContent = "<thead class=\"thead-default\"><tr>";
89-
foreach ( $headers as $header ) {
90-
$headerContent .= "<th>$header</th>";
91-
}
92-
return $headerContent . "</tr></thead>";
80+
$levels_labels = array_map(
81+
function($item){
82+
return "Level " . $item['level']. ": ". $item['label'];
83+
},
84+
readYaml("data/maturity-levels.yaml#/maturity-levels")
85+
);
86+
$headers = array_merge(
87+
array ("Dimension", "Sub-Dimension"),
88+
$levels_labels
89+
);
90+
91+
return "<thead class=\"thead-default\"><tr>"
92+
."<th>" . implode("</th><th>", $headers) . "</th>"
93+
."</tr></thead>";
9394
}
9495
function getInfos($dimensions) {
9596
$text = "Activity Count: " . getElementCount ( $dimensions );

0 commit comments

Comments
 (0)