function facetapi_file_include in Facet API 6
Loads a file in a facet or realm definition.
Parameters
$definition: An array containing the full facet / realm definitions.
Return value
A boolean, returns FALSE only when the specified file fails to load.
3 calls to facetapi_file_include()
- FacetapiFacet::build in ./
facetapi.adapter.inc - Returns the facet's render array.
- facetapi_adapter_load in ./
facetapi.module - Returns a searcher module's adapter class.
- facetapi_enabled_facets_get in ./
facetapi.module - Returns facets enabled in a given realm. If the realm name is NULL, all facets that are enabled in at least one realm will be returned.
File
- ./
facetapi.module, line 974 - An abstracted facet API that can be used by various search backens.
Code
function facetapi_file_include(array $definition) {
if (!empty($definition['file']) && !empty($definition['file path'])) {
$filename = $definition['file path'] . '/' . $definition['file'];
if (!file_exists($filename)) {
return FALSE;
}
require_once $filename;
}
return TRUE;
}