forked from devsecopsmaturitymodel/DevSecOps-MaturityModel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhead.php
136 lines (119 loc) · 4.61 KB
/
head.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
<!DOCTYPE html >
<html moznomarginboxes mozdisallowselectionprint>
<head>
<script src="//code.jquery.com/jquery-1.12.0.min.js"></script>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"
integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7"
crossorigin="anonymous">
<!-- Optional theme -->
<link rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css"
integrity="sha384-fLW2N01lMqjakBkx3l/M9EahuwpSfeNvV63J5ezn3uZzapT0u7EYsXMjQV+0En5r"
crossorigin="anonymous">
<!-- Latest compiled and minified JavaScript -->
<script
src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"
integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS"
crossorigin="anonymous"></script>
<link href="assets/css/common.css" rel="stylesheet">
<link href="assets/css/nv.d3.css" rel="stylesheet">
<script src="assets/js/bootstrap.min.js"></script>
<script src="assets/js/d3.v3.js"></script>
<script src="assets/js/nv.d3.js"></script>
<!--https://yandex.st/highlightjs/7.3/styles/default.min.css-->
<link rel="stylesheet"
href="assets/css/default.min.css">
<link rel="stylesheet" href="spiderweb.css">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo $title ?></title>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"
integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7"
crossorigin="anonymous" />
<link href="print.css" rel="spiderweb.css" />
<link href="print.css" rel="stylesheet" />
</head>
<?php
include_once "bib.php";
// I18N support information here
$language = 'en';
putenv ( "LANG=$language" );
setlocale ( LC_ALL, $language );
// Set the text domain as 'messages'
$domain = 'messages';
bindtextdomain ( $domain, "locale" );
textdomain ( $domain );
function getTableHeader() {
$headers = array (
"Dimension",
"Sub-Dimension",
"Level 1: Basic understanding of security practices" ,
"Level 2: Adoption of basic security practices",
"Level 3: High adoption of security practices",
"Level 4: Advanced deployment of security practices at scale"
);
$headerContent = "<thead class=\"thead-default\"><tr>";
foreach ( $headers as $header ) {
$headerContent .= "<th>$header</th>";
}
return $headerContent . "</tr></thead>";
}
function getInfos($dimensions) {
$text = "Activity Count: " . getElementCount ( $dimensions );
return $text;
}
function getElementCount($dimensions) {
$count = 0;
foreach ( $dimensions as $dimension => $subdimensions ) {
foreach ( $subdimensions as $subdimension => $element ) {
$count = $count + count ( $element );
echo "$subdimension: " . count ( $element ) . "<br>";
}
}
return $count;
}
function getTable($dimensions) {
$tableContent = "";
$tableContent .= getTableHeader ();
foreach ( $dimensions as $dimension => $subdimensions ) {
foreach ( $subdimensions as $subdimension => $element ) {
$tableContent .= "<tr>";
$tableContent .= "<td>";
$tableContent .= "$dimension";
$tableContent .= "</td>";
$tableContent .= "<td>";
$tableContent .= "$subdimension";
$tableContent .= "</td>";
for($i = 1; $i <= 4; $i ++) {
$tableContent .= "<td><ul>";
foreach ( $element as $elementName => $content ) {
$content = getContentForLevelFromSubdimensions ( $i, $content, $elementName );
if ($content != "") {
$elementLink = "detail.php?dimension=" . urlencode ( $dimension ) . "&subdimension=" . urlencode ( $subdimension ) . "&element=" . urlencode ( $elementName );
$tableContent .= "<a href='$elementLink' data-dimension='$dimension' data-subdimension='$subdimension' data-element='$elementName'";
if (elementIsSelected ( $elementName )) {
$tableContent .= "class='selected'";
}
$tableContent .= "><li>" . $content . "</li></a>";
}
}
$tableContent .= "</ul></td>";
}
$tableContent .= "</tr>";
}
}
$table = '<table class="table table-striped"><caption>OWASP DevSecOps Maturity Model</caption>';
$table .= $tableContent;
$table .= "</table>";
return $table;
}
function getContentForLevelFromSubdimensions($level, $subdimension, $elementName) {
if ($level != $subdimension ["level"]) {
return "";
}
$tooltip = "<div class='popoverdetails'>" . build_table_tooltip ( $subdimension ) . "</div>";
return "<div data-toggle=\"popover\" data-title=\"$elementName\" data-content=\"$tooltip\" type=\"button\" data-html=\"true \">" . $elementName . "</div>";
}