- md5
- c2f25e49dbf008a6a8731d4166d23d2f
- sha1
- 0a089b62a5139612b8c6a78acc79e1ac1e205c42
- sha256
- 9a6b1751cf573024efae6401658ee1acd397d21e6a054734f9841f36c65fbcf4
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
<?php
/**
* @package Joomla.Administrator
* @subpackage com_languages
*
* @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace Joomla\Component\Languages\Administrator\Service\HTML;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects
/**
* Utility class working with languages
*
* @since 1.6
*/
class Languages
{
/**
* Method to generate an information about the default language.
*
* @param boolean $published True if the language is the default.
*
* @return string HTML code.
*/
public function published($published)
{
if (!$published) {
return ' ';
}
return HTMLHelper::_('image', 'menu/icon-16-default.png', Text::_('COM_LANGUAGES_HEADING_DEFAULT'), null, true);
}
/**
* Method to generate an input radio button.
*
* @param integer $rowNum The row number.
* @param string $language Language tag.
*
* @return string HTML code.
*/
public function id($rowNum, $language)
{
return '<input'
. ' class="form-check-input"'
. ' type="radio"'
. ' id="cb' . $rowNum . '"'
. ' name="cid"'
. ' value="' . htmlspecialchars($language, ENT_COMPAT, 'UTF-8') . '"'
. ' onclick="Joomla.isChecked(this.checked);"'
. '>';
}
/**
* Method to generate an array of clients.
*
* @return array of client objects.
*/
public function clients()
{
return [
HTMLHelper::_('select.option', 0, Text::_('JSITE')),
HTMLHelper::_('select.option', 1, Text::_('JADMINISTRATOR')),
];
}
/**
* Returns an array of published state filter options.
*
* @return string The HTML code for the select tag.
*
* @since 1.6
*/
public function publishedOptions()
{
// Build the active state filter options.
$options = [];
$options[] = HTMLHelper::_('select.option', '1', 'JPUBLISHED');
$options[] = HTMLHelper::_('select.option', '0', 'JUNPUBLISHED');
$options[] = HTMLHelper::_('select.option', '-2', 'JTRASHED');
$options[] = HTMLHelper::_('select.option', '*', 'JALL');
return $options;
}
}
The same content is in 208 releases, Joomla 4.3.0-beta1 to 6.2.1-rc1. See them all, or every version of this file.