@@ -18,14 +18,37 @@ function generateWatchlistBlock($defaultArray, $arrayKeys, $key = "{{key}}", $it
1818 <span class= \"leftSpacingserverNames \" > Name: </span>
1919 <input class='inputWidth300' type='text' name='watchListKey " . $ i . "' value=' " . $ key . "'> " ;
2020 $ j = 0 ;
21+ $ stringToReturn .= "<div style= \"border-bottom: 1px solid black; margin-bottom: 5px; padding: 5px; \"> " ;
22+ if (count ($ defaultArray ) > 1 )
23+ {
24+ $ selectedOption = false ;
25+ foreach ($ defaultArray as $ groupName => $ groupData )
26+ {
27+ $ stringToReturn .= "<span id= \"" .$ i .$ groupName ."Button \" class= \"buttonButton " ;
28+ if (!$ selectedOption )
29+ {
30+ $ stringToReturn .= " selected " ;
31+ $ selectedOption = true ;
32+ }
33+ $ stringToReturn .= " \" style= \"margin-right: 5px; \" onclick= \"toggleSettingsGroupSection(' " .$ i ."',' " .$ groupName ."'); \" > " .$ groupName ."</span> " ;
34+ }
35+ }
36+ else
37+ {
38+ foreach ($ defaultArray as $ groupName => $ groupData )
39+ {
40+ $ stringToReturn .= "<h4 style= \"margin: 5px; \"> " .$ groupName ."</h4> " ;
41+ }
42+ }
43+ $ stringToReturn .= "</div> " ;
2144 foreach ($ defaultArray as $ groupName => $ groupData )
2245 {
23- if ($ groupName !== "" )
46+ $ stringToReturn .= "<span id= \"" .$ i .$ groupName ."\" " ;
47+ if ($ j !== 0 )
2448 {
25- $ stringToReturn .= "<div style= \"border-bottom: 1px solid black; margin-bottom: 5px; \">
26- <h4 style= \"margin: 5px; \"> " .$ groupName ."</h4>
27- </div> " ;
49+ $ stringToReturn .= " style= \"display: none; \" " ;
2850 }
51+ $ stringToReturn .= " > " ;
2952 $ brCount = 0 ;
3053 foreach ($ groupData as $ key2 => $ item2 )
3154 {
@@ -148,6 +171,7 @@ function generateWatchlistBlock($defaultArray, $arrayKeys, $key = "{{key}}", $it
148171 $ stringToReturn .= "'> " ;
149172 }
150173 }
174+ $ stringToReturn .= "</span> " ;
151175 }
152176 $ stringToReturn .= "
153177 <input style= \"display: none \" type= \"text \" name= \"watchListItem " . $ i . "-0 \" value=' " . $ j . "'>
0 commit comments