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