@@ -18,15 +18,12 @@ if (!isset($title_suffix)) /* this should be allowed to be empty, however */
18
18
{
19
19
$ title_suffix = ' – BNETDocs ' ;
20
20
}
21
- function _header_active ($ url , $ sr )
21
+ function _header_active (string $ url , bool $ sr )
22
22
{
23
23
$ current_url = parse_url (getenv ('REQUEST_URI ' ), PHP_URL_PATH );
24
24
$ match = (substr ($ current_url , 0 , strlen ($ url )) == $ url );
25
25
if (!$ match ) return '' ;
26
- if ($ sr )
27
- return ' <span class="sr-only">(current)</span> ' ;
28
- else
29
- return ' active ' ;
26
+ if ($ sr ) return ' <span class="sr-only">(current)</span> ' ; else return ' active ' ;
30
27
}
31
28
$ _header_user = Authentication::$ user ;
32
29
$ _unique_asset = (
@@ -79,12 +76,9 @@ $_header_nav = [
79
76
['label ' => 'Event Logs ' , 'url ' => '/eventlog/index ' , 'acl ' => User::OPTION_ACL_EVENT_LOG_VIEW ],
80
77
]],
81
78
];
82
- /* <a>Account</a>
83
- <a href="<?=Common::relativeUrlToAbsolute('/user/changepassword')?>">Change Password</a>
84
- <a href="<?=Common::relativeUrlToAbsolute('/user/update')?>">Update Profile</a>*/
85
79
function _header_nav_html ($ nav )
86
80
{
87
- function _line (string $ format ) { call_user_func_array ('printf ' , func_get_args ()) . PHP_EOL ; }
81
+ function _line (string $ format ) { call_user_func_array ('printf ' , func_get_args ()); echo PHP_EOL ; }
88
82
89
83
ob_start ();
90
84
_line ('<nav class="navbar navbar-expand-lg navbar-dark bg-primary mb-3"> ' );
@@ -157,11 +151,11 @@ function _header_nav_html($nav)
157
151
}
158
152
else if (!$ dropdown )
159
153
{
160
- if (isset ($ item ['url ' ])) printf ('<li class="nav-item"><a class="nav-link%s" href="%s">%s</a></li> ' . PHP_EOL , $ class , $ item ['url ' ], filter_var ($ item ['label ' ], FILTER_SANITIZE_FULL_SPECIAL_CHARS ));
154
+ if (isset ($ item ['url ' ])) printf ('<li class="nav-item"><a class="nav-link%s" href="%s">%s</a></li> ' . PHP_EOL , $ class , Common:: relativeUrlToAbsolute ( $ item ['url ' ]) , filter_var ($ item ['label ' ], FILTER_SANITIZE_FULL_SPECIAL_CHARS ));
161
155
}
162
156
else if ($ dropdown )
163
157
{
164
- if (isset ($ item ['url ' ])) printf ('<a class="dropdown-item%s" href="%s">%s</a> ' . PHP_EOL , $ class , $ item ['url ' ], filter_var ($ item ['label ' ], FILTER_SANITIZE_FULL_SPECIAL_CHARS ));
158
+ if (isset ($ item ['url ' ])) printf ('<a class="dropdown-item%s" href="%s">%s</a> ' . PHP_EOL , $ class , Common:: relativeUrlToAbsolute ( $ item ['url ' ]) , filter_var ($ item ['label ' ], FILTER_SANITIZE_FULL_SPECIAL_CHARS ));
165
159
}
166
160
167
161
if (isset ($ item ['dropdown ' ]))
0 commit comments