| Current Path : /var/www/html/administrator/components/com_jchat/Framework/Html/ |
| Current File : /var/www/html/administrator/components/com_jchat/Framework/Html/Languages.php |
<?php
namespace JExtstore\Component\JChat\Administrator\Framework\Html;
/**
* @package JCHAT::administrator::components::com_jchat
* @subpackage framework
* @subpackage html
* @author Joomla! Extensions Store
* @copyright (C) 2024 - Joomla! Extensions Store
* @license GNU/GPLv2 http://www.gnu.org/licenses/gpl-2.0.html
*/
defined ( '_JEXEC' ) or die ( 'Restricted access' );
use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\Language\LanguageHelper;
/**
* Languages available
*
* @package JCHAT::administrator::components::com_jchat
* @subpackage framework
* @subpackage html
*
*/
class Languages {
/**
* Build the multiple select list for Menu Links/Pages
*
* @access public
* @return array
*/
public static function getAvailableLanguageOptions() {
$knownLangs = LanguageHelper::getLanguages();
// Get default site language
$langParams = ComponentHelper::getParams('com_languages');
// Setup predefined site language
$defaultLanguage = @array_shift(explode('-', strtolower($langParams->get('site'))));
$langs[] = HTMLHelper::_('select.option', $defaultLanguage, '- '. Text::_('COM_JCHAT_DEFAULT_SITE_LANGUAGE' ) .' -' );
// Create found languages options
foreach ($knownLangs as $langObject) {
// Extract tag lang
$langs[] = HTMLHelper::_('select.option', $langObject->sef, $langObject->title );
}
return $langs;
}
}