Skip to content

Commit

Permalink
Added support for NOT selecting any material types in the backed, thu…
Browse files Browse the repository at this point in the history
…s searching for all types. (3rd try)
  • Loading branch information
luckow committed Jul 27, 2011
1 parent 0b4de3d commit eab5556
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions ting.client.inc
Expand Up @@ -521,11 +521,14 @@ function ting_add_agency(TingClientAgentRequest $request) {
*/
function ting_add_supporting_types(TingClientSearchRequest $request) {
$supportingTypes = arrange_types(variable_get('ting_materials', array()));
foreach ($supportingTypes as &$type)
{
$type = 'facet.type="' . $type . '"';
}
$request->setQuery($request->getQuery().' ('.implode(' OR ', $supportingTypes).')');
if(!empty($supportingTypes))
{
foreach ($supportingTypes as &$type)
{
$type = 'facet.type="' . $type . '"';
}
$request->setQuery($request->getQuery().' ('.implode(' OR ', $supportingTypes).')');
}
return $request;
}

Expand Down

0 comments on commit eab5556

Please sign in to comment.