Exemple #1
0
/**
 * Get list of engines for default engine selection
 */
function setup_getEngines($engines_ary)
{
    $engines = array();
    foreach ($engines_ary as $engine => $meta) {
        if (engine_get_capability($engine, 'movie')) {
            $engines[$engine] = $meta['name'];
        }
    }
    return $engines;
}
Exemple #2
0
/**
 * Get list of engines which have certain capability
 *
 * 'movie' search capability is assumed as default, either if
 * $searchtype is empty or engine does not maintain specific capability
 *
 * @return  array   list of capable engines
 */
function engine_get_capable_engines($searchtype)
{
    global $config;
    if (!$searchtype) {
        $searchtype = 'movie';
    }
    $engines = array();
    foreach ($config['engines'] as $engine => $meta) {
        $enabled = $config['engine'][$engine];
        if ($enabled && engine_get_capability($engine, $searchtype)) {
            $engines[$engine] = $enabled;
        }
    }
    return $engines;
}