/**
* Method to determine if the language filter Associations parameter is enabled.
* This works for both site and administrator.
*
* @return boolean True if the parameter is implemented; false otherwise.
*
* @since 3.2
*/
public static function isEnabled()
{
// Flag to avoid doing multiple database queries.
static $tested = false;
// Status of language filter parameter.
static $enabled = false;
if (Multilanguage::isEnabled()) {
// If already tested, don't test again.
if (!$tested) {
$plugin = PluginHelper::getPlugin('system', 'languagefilter');
if (!empty($plugin)) {
$params = new Registry($plugin->params);
$enabled = (bool) $params->get('item_associations', true);
}
$tested = true;
}
}
return $enabled;
}