forked from JanisV/Rompr
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfilesearch.php
More file actions
54 lines (43 loc) · 1.17 KB
/
Copy pathfilesearch.php
File metadata and controls
54 lines (43 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
include ("vars.php");
include ("functions.php");
include ("connection.php");
include ("filelister.php");
?>
<div>
<form name="filesearch" action="filesearch.php" method="get">
<ul class="sourcenav">
<li><b>Search For Files Containing:</b></li>
<li><input class="sourceform winkle" name="searchtitle" type="text" size="60" />
<button onclick="doSomethingUseful('filesearch', 'Searching...')" type="submit">Search</button></li>
</ul>
</form>
</div>
<?php
$cmd = "";
if(array_key_exists("searchtitle", $_REQUEST)) {
$cmd = 'search file "'.format_for_mpd(html_entity_decode($_REQUEST['searchtitle'])).'"';
}
if ($cmd != "") {
$count = 1;
doFileSearch($cmd);
}
close_mpd($connection);
function doFileSearch($cmd) {
global $FILESEARCH;
$output = new collectionOutput($FILESEARCH);
$tree = doFileList($cmd);
$tree->getXML("b", $output);
$output->closeFile();
print '<div class="menuitem">';
print "<h3>Search Results:</h3>";
print "</div>";
dumpTree('bdirroot');
print '<div class="separator"></div>';
}
?>
<script type="text/javascript">
$('form[name="filesearch"]').ajaxForm(function(data) {
$('#filesearch').html(data);
});
</script>