- md5
- dba85413a95ef3045237d7afbebefafc
- sha1
- 6c4413b88736cae59508f70ec4b536cfd357607e
- sha256
- 95168101a8d92b72939b04410361e2a62cc68d74ba5369c4a6cb6c7ee6d06dc4
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
<?php
/**
* @package Joomla.Administrator
* @subpackage com_languages
*
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace Joomla\Component\Languages\Administrator\Helper;
defined('_JEXEC') or die;
/**
* Languages component helper.
*
* @since 1.6
*/
class LanguagesHelper
{
/**
* Configure the Linkbar.
*
* @param string $vName The name of the active view.
* @param int $client The client id of the active view. Maybe be 0 or 1.
*
* @return void
*
* @deprecated 4.0 $client parameter is not needed anymore.
*/
public static function addSubmenu($vName, $client = 0)
{
\JHtmlSidebar::addEntry(
\JText::_('COM_LANGUAGES_SUBMENU_INSTALLED'),
'index.php?option=com_languages&view=installed',
$vName == 'installed'
);
\JHtmlSidebar::addEntry(
\JText::_('COM_LANGUAGES_SUBMENU_CONTENT'),
'index.php?option=com_languages&view=languages',
$vName == 'languages'
);
\JHtmlSidebar::addEntry(
\JText::_('COM_LANGUAGES_SUBMENU_OVERRIDES'),
'index.php?option=com_languages&view=overrides',
$vName == 'overrides'
);
}
/**
* Method for parsing ini files.
*
* @param string $filename Path and name of the ini file to parse.
*
* @return array Array of strings found in the file, the array indices will be the keys. On failure an empty array will be returned.
*
* @since 2.5
*/
public static function parseFile($filename)
{
if (!is_file($filename))
{
return array();
}
$contents = file_get_contents($filename);
$contents = str_replace('"_QQ_"', '\\"', $contents);
$strings = @parse_ini_string($contents, INI_SCANNER_RAW);
if ($strings === false)
{
return array();
}
return $strings;
}
/**
* Filter method for language keys.
* This method will be called by \JForm while filtering the form data.
*
* @param string $value The language key to filter.
*
* @return string The filtered language key.
*
* @since 2.5
*/
public static function filterKey($value)
{
$filter = \JFilterInput::getInstance(null, null, 1, 1);
return strtoupper($filter->clean($value, 'cmd'));
}
/**
* Filter method for language strings.
* This method will be called by \JForm while filtering the form data.
*
* @param string $value The language string to filter.
*
* @return string The filtered language string.
*
* @since 2.5
*/
public static function filterText($value)
{
$filter = \JFilterInput::getInstance(null, null, 1, 1);
return $filter->clean($value);
}
}
No other release has this exact content. See every version of this file.