-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Custom search function
Naoki Sawada edited this page May 2, 2018
·
1 revision
In elFinder 2.1.38 or later, you can add custom search functions such as searching from content metadata.
Add the definition of the custom search method to the client option.
opts = {
url : 'php/connector.php',
commandsOptions : {
search : {
// Additional search types
searchTypes : {
// "SearchMime" is implemented in default
SearchMime : { // The key is search type that send to the connector
name : 'btnMime', // Button text to be processed in i18n()
title : 'searchMime' // Button title to be processed in i18n()
},
// This is custom search method for a function `searchMatchContents()` of your customized volume driver
Contents : {
name : 'MetaData',
title : 'Do serach contents of meta data.'
}
}
}
}
}
Add search matching method searchMatchContents()
to your customized volume driver.
This function must return true
or false
as to whether or not it matches the condition.
protected function searchMatchContents($name, $query, $path) {
$match = true; // or false
return $match;
}