10
10
11
11
namespace Mistralys \MarkdownViewer ;
12
12
13
- use AppUtils \OutputBuffering ;use AppUtils \OutputBuffering_Exception ;
13
+ use AppUtils \OutputBuffering ;use AppUtils \OutputBuffering_Exception ;use function AppLocalize \ pt ;
14
14
15
15
/**
16
16
* Renders the documentation viewer UI, using the
@@ -96,7 +96,9 @@ public function getActiveFile() : DocFile
96
96
97
97
public function display () : void
98
98
{
99
- $ parser = new DocParser ($ this ->getActiveFile ());
99
+ $ activeFile = $ this ->getActiveFile ();
100
+ $ activeFileID = $ activeFile ->getID ();
101
+ $ parser = new DocParser ($ activeFile );
100
102
101
103
?> <!doctype html>
102
104
<html lang="en">
@@ -107,29 +109,53 @@ public function display() : void
107
109
<title><?php echo $ this ->title ?> </title>
108
110
</head>
109
111
<body>
110
- <nav class="navbar navbar-dark bg-dark fixed-top">
111
- <div class="navbar-content">
112
- <a class="navbar-brand" href="#"><?php echo $ this ->title ?> </a>
113
- <ul class="navbar-nav mr-auto">
114
- <li class="nav-item dropdown">
115
- <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" data-bs-toggle="dropdown" role="button">
116
- <?php echo $ this ->menuLabel ?>
117
- </a>
118
- <div class="dropdown-menu" aria-labelledby="navbarDropdown" style="position: absolute">
119
- <?php
120
- $ files = $ this ->docs ->getFiles ();
121
-
122
- foreach ($ files as $ file ) {
123
- ?>
124
- <a class="dropdown-item" href="?doc=<?php echo $ file ->getID () ?> ">
125
- <?php echo $ file ->getTitle () ?>
126
- </a>
112
+ <nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top">
113
+ <div class="container-fluid">
114
+ <a class="navbar-brand" href="?"><?php echo $ this ->title ?> </a>
115
+ <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#mainNav" aria-controls="mainNav" aria-expanded="false" aria-label="<?php pt ('Toggle navigation ' ) ?> ">
116
+ <span class="navbar-toggler-icon"></span>
117
+ </button>
118
+ <div class="collapse navbar-collapse" id="mainNav">
119
+ <ul class="navbar-nav me-auto mb-2 mb-lg-0">
120
+ <li class="nav-item">
121
+ <a class="nav-link active" aria-current="page" href="#">
122
+ <?php echo $ activeFile ->getTitle () ?>
123
+ </a>
124
+ </li>
125
+ <li class="nav-item dropdown">
126
+ <a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
127
+ <?php echo $ this ->menuLabel ?>
128
+ </a>
129
+ <ul class="dropdown-menu files-dropdown">
127
130
<?php
128
- }
129
- ?>
130
- </div>
131
- </li>
132
- </ul>
131
+ $ files = $ this ->docs ->getFiles ();
132
+
133
+ foreach ($ files as $ file )
134
+ {
135
+ ?>
136
+ <li>
137
+ <a class="dropdown-item <?php if ($ file ->getID () === $ activeFileID ) { echo 'disabled ' ; } ?> " href="?doc=<?php echo $ file ->getID () ?> ">
138
+ <?php echo $ file ->getTitle () ?>
139
+ </a>
140
+ </li>
141
+ <?php
142
+ }
143
+
144
+ for ($ i =0 ; $ i < 30 ; $ i ++)
145
+ {
146
+ ?>
147
+ <li>
148
+ <a class="dropdown-item" href="#">
149
+ <?php echo $ i ?>
150
+ </a>
151
+ </li>
152
+ <?php
153
+ }
154
+ ?>
155
+ </ul>
156
+ </li>
157
+ </ul>
158
+ </div>
133
159
</div>
134
160
</nav>
135
161
<div id="scaffold">
0 commit comments