@@ -18,15 +18,12 @@ if (!isset($title_suffix)) /* this should be allowed to be empty, however */
1818{
1919 $ title_suffix = ' – BNETDocs ' ;
2020}
21- function _header_active ($ url , $ sr )
21+ function _header_active (string $ url , bool $ sr )
2222{
2323 $ current_url = parse_url (getenv ('REQUEST_URI ' ), PHP_URL_PATH );
2424 $ match = (substr ($ current_url , 0 , strlen ($ url )) == $ url );
2525 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 ' ;
3027}
3128$ _header_user = Authentication::$ user ;
3229$ _unique_asset = (
@@ -79,12 +76,9 @@ $_header_nav = [
7976 ['label ' => 'Event Logs ' , 'url ' => '/eventlog/index ' , 'acl ' => User::OPTION_ACL_EVENT_LOG_VIEW ],
8077 ]],
8178];
82- /* <a>Account</a>
83- <a href="<?=Common::relativeUrlToAbsolute('/user/changepassword')?>">Change Password</a>
84- <a href="<?=Common::relativeUrlToAbsolute('/user/update')?>">Update Profile</a>*/
8579function _header_nav_html ($ nav )
8680{
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 ; }
8882
8983 ob_start ();
9084 _line ('<nav class="navbar navbar-expand-lg navbar-dark bg-primary mb-3"> ' );
@@ -157,11 +151,11 @@ function _header_nav_html($nav)
157151 }
158152 else if (!$ dropdown )
159153 {
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 ));
161155 }
162156 else if ($ dropdown )
163157 {
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 ));
165159 }
166160
167161 if (isset ($ item ['dropdown ' ]))
0 commit comments