@@ -3,6 +3,7 @@ namespace BNETDocs\Templates;
3
3
use \BNETDocs \Libraries \Authentication ;
4
4
use \BNETDocs \Libraries \Document ;
5
5
use \BNETDocs \Libraries \Logger ;
6
+ use \BNETDocs \Libraries \Packet ;
6
7
use \BNETDocs \Libraries \User ;
7
8
use \BNETDocs \Libraries \VersionInfo ;
8
9
use \CarlBennett \MVC \Libraries \Common ;
@@ -37,7 +38,8 @@ if (isset(Authentication::$user))
37
38
$ _header_user_url = null ;
38
39
$ _header_staff = null ;
39
40
}
40
- $ _header_documents = Document::getAllDocuments (['title ' , 'ASC ' ]);
41
+ $ _header_documents = Document::getDocumentsByLastEdited (10 );
42
+ $ _header_packets = Packet::getPacketsByLastEdited (10 );
41
43
$ _header_navigation_config = Common::$ config ->bnetdocs ->navigation ;
42
44
$ _header_user_register_disabled = Common::$ config ->bnetdocs ->user_register_disabled ;
43
45
$ _unique_asset = (
@@ -128,27 +130,33 @@ $_campaign_vultr = (
128
130
</li>
129
131
<? } ?>
130
132
<li class="nav-item<?= _header_active ('/document/ ' , false )?> dropdown">
131
- <a class="nav-link dropdown-toggle" href="#" id="navbarObjectsDropdown " role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Documents</a>
132
- <div class="dropdown-menu" aria-labelledby="navbarObjectsDropdown ">
133
+ <a class="nav-link dropdown-toggle" href="#" id="navbarDocumentsDropdown " role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Documents</a>
134
+ <div class="dropdown-menu" aria-labelledby="navbarDocumentsDropdown ">
133
135
<a class="dropdown-item<?= _header_active ('/document/index ' , false )?> text-info" href="<?= Common::relativeUrlToAbsolute ('/document/index ' )?> ">All Documents<?= _header_active ('/document/index ' , true )?> </a>
134
136
<? if ($ _header_staff ) { ?>
135
137
<div class="dropdown-divider"></div>
136
138
<a class="dropdown-item<?= _header_active ('/document/create ' , false )?> text-success" href="<?= Common::relativeUrlToAbsolute ('/document/create ' )?> ">Create Document<?= _header_active ('/document/create ' , true )?> </a>
137
139
<div class="dropdown-divider"></div>
138
- <? }
139
- foreach ($ _header_documents as $ doc ) { $ doc_url_part = '/document/ ' . $ doc ->getId (); ?>
140
- <a class="dropdown-item<?= _header_active ($ doc_url_part , false )?> " href="<?= Common::relativeUrlToAbsolute ($ doc ->getURI ())?> "><?= filter_var ($ doc ->getTitle (), FILTER_SANITIZE_FULL_SPECIAL_CHARS )?> <?= _header_active ($ doc_url_part , true )?> </a>
140
+ <? }?>
141
+ <div class="dropdown-header">Recently Edited Documents</div>
142
+ <? foreach ($ _header_documents as $ doc ) { $ doc_url_part = '/document/ ' . $ doc ->getId (); ?>
143
+ <a class="dropdown-item<?= _header_active ($ doc_url_part , false )?> " href="<?= $ doc ->getURI ()?> "><?= filter_var ($ doc ->getTitle (), FILTER_SANITIZE_FULL_SPECIAL_CHARS )?> <?= _header_active ($ doc_url_part , true )?> </a>
141
144
<? } ?>
142
145
</div>
143
146
</li>
144
147
<li class="nav-item<?= _header_active ('/packet/ ' , false )?> dropdown">
145
- <a class="nav-link dropdown-toggle" href="#" id="navbarObjectsDropdown " role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Packets</a>
146
- <div class="dropdown-menu" aria-labelledby="navbarObjectsDropdown ">
148
+ <a class="nav-link dropdown-toggle" href="#" id="navbarPacketsDropdown " role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Packets</a>
149
+ <div class="dropdown-menu" aria-labelledby="navbarPacketsDropdown ">
147
150
<a class="dropdown-item<?= _header_active ('/packet/index ' , false )?> text-info" href="<?= Common::relativeUrlToAbsolute ('/packet/index ' )?> ">All Packets<?= _header_active ('/packet/index ' , true )?> </a>
148
151
<? if ($ _header_staff ) { ?>
149
152
<div class="dropdown-divider"></div>
150
153
<a class="dropdown-item<?= _header_active ('/packet/create ' , false )?> text-success" href="<?= Common::relativeUrlToAbsolute ('/packet/create ' )?> ">Create Packet<?= _header_active ('/packet/create ' , true )?> </a>
154
+ <div class="dropdown-divider"></div>
151
155
<? }?>
156
+ <div class="dropdown-header">Recently Edited Packets</div>
157
+ <? foreach ($ _header_packets as $ pkt ) { $ pkt_url_part = '/packet/ ' . $ pkt ->getId (); ?>
158
+ <a class="dropdown-item<?= _header_active ($ pkt_url_part , false )?> " href="<?= $ pkt ->getURI ()?> "><?= filter_var ($ pkt ->getName (), FILTER_SANITIZE_FULL_SPECIAL_CHARS )?> <?= _header_active ($ pkt_url_part , true )?> </a>
159
+ <? } ?>
152
160
</div>
153
161
</li>
154
162
</ul>
0 commit comments