In the spirit of the GPL, I'll include my changes for those interested...
I modified onContentSearchAreas to include a new member (and re-titled the existing key for clarity):
Code:
function onContentSearchAreas()
{
static $areas = array(
'edocman_search_documents' => 'Documents',
'edocman_search_downloads' => 'Downloads'
);
return $areas;
}
I then added a conditional evaluation to concatenate $where with checks for filetype as determined by the end of the original filename:
Code:
$user = & JFactory::getUser() ;
$isfirstarea = '1';
$where = $where . ' AND (';
foreach ($areas as $area) {
if ($area == 'edocman_search_documents') {
if (!$isfirstarea) {
$where = $where . ' OR ';
}
$where = $where . 'a.original_filename LIKE \'%.pdf\' OR a.original_filename LIKE \'%.doc\' OR a.original_filename LIKE \'%.docx\'';
$isfirstarea = '0';
}
if ($area == 'edocman_search_downloads') {
if (!$isfirstarea) {
$where = $where . ' OR ';
}
$where= $where . 'a.original_filename LIKE \'%.zip\'';
$isfirstarea = '0';
}
}
$where = $where . ')';
Hope that helps someone else. Tuan, this may be worth patching in with a new version of the search plugin? It's rather lazier than extending the schema of #_edocman_documents to include storing the filetype and then retrieving it, but this works well and predictably enough, I believe.