- md5
- f211fc1f6611809d04668cac5a6767f1
- sha1
- 076c8bddeab412da5a81420a556ba8a17aede244
- sha256
- 4c2871f3ea11ffbc762d9e77854da3ea0b2f45f9a6a733b77f4ddbf1d8e4d705
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
<?php
/**
* @package Joomla.Libraries
* @subpackage Language
*
* @copyright Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('JPATH_PLATFORM') or die;
/**
* Utitlity class for multilang
*
* @package Joomla.Libraries
* @subpackage Language
* @since 2.5.4
*/
class JLanguageMultilang
{
/**
* Method to determine if the language filter plugin is enabled.
* This works for both site and administrator.
*
* @return boolean True if site is supporting multiple languages; false otherwise.
*
* @since 2.5.4
*/
public static function isEnabled()
{
// Flag to avoid doing multiple database queries.
static $tested = false;
// Status of language filter plugin.
static $enabled = false;
// Get application object.
$app = JFactory::getApplication();
// If being called from the front-end, we can avoid the database query.
if ($app->isSite())
{
$enabled = $app->getLanguageFilter();
return $enabled;
}
// If already tested, don't test again.
if (!$tested)
{
// Determine status of language filter plug-in.
$db = JFactory::getDBO();
$query = $db->getQuery(true);
$query->select('enabled');
$query->from($db->quoteName('#__extensions'));
$query->where($db->quoteName('type') . ' = ' . $db->quote('plugin'));
$query->where($db->quoteName('folder') . ' = ' . $db->quote('system'));
$query->where($db->quoteName('element') . ' = ' . $db->quote('languagefilter'));
$db->setQuery($query);
$enabled = $db->loadResult();
$tested = true;
}
return $enabled;
}
}
The same content is in 11 releases, Joomla 2.5.18 to 2.5.28. See them all, or every version of this file.