mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-14 05:31:42 +00:00
add new methode typeahead() which is to replace the restapi method
This commit is contained in:
parent
5c9ddac11d
commit
d64af2b3b1
|
@ -65,6 +65,26 @@ class SeedDMS_View_Search extends SeedDMS_Bootstrap_Style {
|
||||||
$this->printClickFolderJs();
|
$this->printClickFolderJs();
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
|
function typeahead() { /* {{{ */
|
||||||
|
$dms = $this->params['dms'];
|
||||||
|
$user = $this->params['user'];
|
||||||
|
$query = $this->params['query'];
|
||||||
|
$entries = $this->params['searchhits'];
|
||||||
|
$recs = array();
|
||||||
|
if($entries) {
|
||||||
|
foreach ($entries as $entry) {
|
||||||
|
if($entry->isType('document')) {
|
||||||
|
$recs[] = 'D'.$entry->getName();
|
||||||
|
} elseif($entry->isType('folder')) {
|
||||||
|
$recs[] = 'F'.$entry->getName();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
array_unshift($recs, ' '.$query);
|
||||||
|
header('Content-Type: application/json');
|
||||||
|
echo json_encode($recs);
|
||||||
|
} /* }}} */
|
||||||
|
|
||||||
function show() { /* {{{ */
|
function show() { /* {{{ */
|
||||||
$dms = $this->params['dms'];
|
$dms = $this->params['dms'];
|
||||||
$user = $this->params['user'];
|
$user = $this->params['user'];
|
||||||
|
|
Loading…
Reference in New Issue
Block a user