55<?php
66include_once "navi.php " ;
77?>
8+
89<?php
9- include_once "data.php " ;
10+ include_once "data.php " ; // set showPlanned, showPerformed, filteredDimensions
1011include_once "detail.php " ;
1112include_once "functions.php " ;
1213
@@ -22,7 +23,7 @@ function formCheck($reference_id, $sort) {
2223 $ checked = ($ sort == $ reference_id ) ? "checked " : "" ;
2324 $ reference_label = getReferenceLabel ($ reference_id );
2425 return '
25- <div class="form-check ">
26+ <div class="form-radio ">
2627 <input class="form-check-input" type="radio" name="sort"
2728 id="radio ' .$ reference_id .'"
2829 value=" ' .$ reference_id .'"
@@ -31,25 +32,19 @@ function formCheck($reference_id, $sort) {
3132 </div>
3233 ' ;
3334}
34- function thead ($ headings ){
35- echo '<thead><tr><th scope="col"> '
36- .implode ('</th><th scope="col"> ' , $ headings )
37- .'</th></tr></thead> ' ;
38- }
39-
4035
4136?>
4237<form method="get">
43- <?php
44-
45- // Print form headers
46- echo formCheck ( " activity " , $ sort );
47- foreach ( $ referenceLabels as $ r => $ metadata ) {
48- echo formCheck ( $ r , $ sort );
49- }
50- ?>
51-
52- </div>
38+ <div class="sort-by">
39+ Sort by:
40+ <?php
41+ // Print form headers
42+ echo formCheck ( " activity " , $ sort );
43+ foreach ( $ referenceLabels as $ r => $ metadata ) {
44+ echo formCheck ( $ r , $ sort );
45+ }
46+ ?>
47+ </div>
5348 <div class="form-check">
5449 <input type="checkbox" class="form-check-input" name="performed" id="exampleCheck1" value="true"
5550 <?php if ($ showPerformed ) {echo " checked=checked " ;}?> >
@@ -83,12 +78,6 @@ function thead($headings){
8378 $ activityLink = "detail.php?dimension= " . urlencode ( $ dimension ) . "&subdimension= " . urlencode ( $ subdimension ) . "&element= " . urlencode ( $ activityName );
8479 echo "<td><a href=' $ activityLink'><div data-toggle= \"popover \" data-title= \"$ activityName \" data-content= \"$ tooltip \" type= \"button \" data-html= \"true \"> " . $ activityName . "</div></a></td> " ;
8580
86- // uniform old content.
87- if (!($ content ["references " ] ?? NULL )){
88- $ content ["references " ]["samm2 " ] = $ content ["samm2 " ] ?? array ();
89- $ content ["references " ]["iso27001-2017 " ] = $ content ["iso27001-2017 " ] ?? array ();
90- }
91-
9281 foreach ($ referenceLabels as $ r => $ rLabel ){
9382 $ rlist = $ content ["references " ][$ r ] ?? array ();
9483 echo "<td> " . renderSamms ($ rlist ) ."</td> " ;
@@ -113,21 +102,8 @@ function thead($headings){
113102 $ content ["dimension " ] = $ dimension ;
114103 $ content ["subdimension " ] = $ subdimension ;
115104
116- if (! ($ content ["references " ] ?? null )) {
117- // default.
118- if (!($ content [$ sort ] ?? null )){
119- error_log ("No $ sort mapping for $ activityName " );
120- continue ;
121- }
122-
123- foreach (as_list ($ content [$ sort ]) as $ mappingContent ) {
124- $ mapping [$ mappingContent ][$ activityName ] = $ content ;
125- }
126- continue ;
127- }
128-
129- foreach ($ content ["references " ] as $ mappingContent => $ rlist ) {
130- echo var_dump ("$ mappingContent " );
105+ $ references = $ content ["references " ][$ sort ] ?? array ();
106+ foreach (as_list ($ references ) as $ mappingContent ) {
131107 $ mapping [$ mappingContent ][$ activityName ] = $ content ;
132108 }
133109 }
@@ -145,12 +121,6 @@ function thead($headings){
145121 $ tooltip = "<div class='popoverdetails'> " . build_table_tooltip ( $ activity ) . "</div> " ;
146122 $ activityLink = "detail.php?dimension= " . urlencode ( $ activity ['dimension ' ] ) . "&subdimension= " . urlencode ( $ activity ['subdimension ' ] ) . "&element= " . urlencode ( $ activityName );
147123 echo "<td><a href=' $ activityLink'><div data-toggle= \"popover \" data-title= \"$ activityName \" data-content= \"$ tooltip \" type= \"button \" data-html= \"true \"> " . $ activityName . "</div></></td> " ;
148-
149- // uniform old content.
150- if (!($ activity ["references " ] ?? NULL )){
151- $ activity ["references " ]["samm2 " ] = $ activity ["samm2 " ] ?? array ();
152- $ activity ["references " ]["iso27001-2017 " ] = $ activity ["iso27001-2017 " ] ?? array ();
153- }
154124
155125 foreach ($ referenceLabels as $ r => $ rLabel ){
156126 $ rlist = $ activity ["references " ][$ r ] ?? array ();
0 commit comments