Skip to content

Commit 3a8d818

Browse files
authored
Merge pull request #23 from wurstbrot/addMappings
Add mappings
2 parents d36f086 + 4ab3a26 commit 3a8d818

5 files changed

Lines changed: 73 additions & 11 deletions

File tree

bib.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
error_reporting(E_ERROR);
3-
3+
define(NUMBER_LEVELS, 4);
44
function readCSV($filename, $delimiter)
55
{
66
if (!file_exists($filename) || !is_readable($filename))
@@ -35,4 +35,5 @@ function getCsv() {
3535
$csvFile = 'selectedData.csv';
3636
$csv= readCSV($csvFile, ",");
3737
return $csv;
38-
}
38+
}
39+

head.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,12 @@
5656
$url = "https://dsomm.timo-pagel.de{$_SERVER['SCRIPT_NAME']}";
5757
echo "<link rel='canonical' href=$url>";
5858
?>
59+
<script>
60+
$(function () {
61+
$('[data-toggle="popover"]').popover({placement: "bottom", trigger: "hover"}).on('click', function () {
62+
$(this).popover('toggle');
63+
});
64+
})</script>
5965
</head>
6066

6167
<?php
@@ -113,7 +119,7 @@ function getTable($dimensions) {
113119
$tableContent .= "$subdimension";
114120
$tableContent .= "</td>";
115121

116-
for($i = 1; $i <= 4; $i ++) {
122+
for($i = 1; $i <= NUMBER_LEVELS; $i ++) {
117123
$tableContent .= "<td><ul>";
118124
foreach ( $element as $elementName => $content ) {
119125
$content = getContentForLevelFromSubdimensions ( $i, $content, $elementName );

index.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,4 @@
1313
echo "<h1>Activtities per Dimension</h1>";
1414
echo '<div class="extra">'.getInfos($dimensions) . '</div>';
1515
?>
16-
<script>
17-
$(function () {
18-
$('[data-toggle="popover"]').popover({placement: "bottom", trigger: "hover"}).on('click', function () {
19-
$(this).popover('toggle');
20-
});
21-
})</script>
16+

mappings.php

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
<?php
2+
include_once "head.php";
3+
?>
4+
<body>
5+
<?php
6+
include_once "navi.php";
7+
?>
8+
<?php
9+
include_once "data.php";
10+
include_once "detail.php";
11+
12+
$mappingExists = array();
13+
$noMappingExists = array();
14+
?>
15+
<table class="table">
16+
<thead>
17+
<tr>
18+
<th scope="col">Dimension</th>
19+
<th scope="col">Subdimension</th>
20+
<th scope="col">Actvity</th>
21+
<th scope="col">SAMM 2</th>
22+
<th scope="col">ISO 27001</th>
23+
</tr>
24+
</thead>
25+
<tbody>
26+
<?php
27+
function getFlattenedArray($array, $index) {
28+
if(!array_key_exists($index, $array)) {
29+
return "TODO";
30+
}
31+
32+
$return = "";
33+
$potentialArray = $array[$index];
34+
if(is_array($potentialArray)) {
35+
foreach($potentialArray as $element => $content) {
36+
$return .= "$content";
37+
}
38+
}else {
39+
$return .= $potentialArray;
40+
}
41+
return $return;
42+
}
43+
44+
foreach ($dimensions as $dimension => $subdimensions) {
45+
foreach ($subdimensions as $subdimension => $activity) {
46+
foreach ($activity as $activityName => $content) {
47+
echo "<tr>";
48+
echo "<td>$dimension</td>";
49+
echo "<td>$subdimension</td>";
50+
$tooltip = "<div class='popoverdetails'>" . build_table_tooltip ( $content ) . "</div>";
51+
echo "<td><div data-toggle=\"popover\" data-title=\"$activityName\" data-content=\"$tooltip\" type=\"button\" data-html=\"true \">" . $activityName . "</div></td>";
52+
echo "<td>" . getFlattenedArray($content, "samm2") . "</td>";
53+
echo "<td>" . getFlattenedArray($content, "iso27001-2017") . "</td>";
54+
}
55+
}
56+
}
57+
58+
echo "</table>";
59+
//var_dump($noMappingExists);

navi.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
$nav = array(
55
"index.php" => "Matrix",
66
"spiderweb.php" => "Implementation Levels",
7-
"scutter.php" => "Ease and Value of Implementation",
7+
"scutter.php" => "Ease and Value",
8+
"mappings.php" => "Mappings",
89
"graph.php" => "Dependencies",
910
"report.php" => "Full Report",
1011
//"usefulnessHardness.php" => "Heatmap",
@@ -13,7 +14,7 @@
1314
?>
1415
<ul class="nav nav-tabs">
1516

16-
<a class="navbar-brand" href="https://dsomm.timo-pagel.de">
17+
<a class="navbar-brand" href="#">
1718
<img height="100%" src="/assets/images/logo.png" alt="OWASP DevSecOps Maturity Model">
1819
</a>
1920
<?php

0 commit comments

Comments
 (0)