First problem is that parameter for LITHUANIAN language is missing in phocainternationalalias.xml file:
Lithuanian radio button not appears in backend also not storing phocainternationalalias plugin parameter and its value for Lithuanian language ('lithuanian-lang'=value) in database after click on apply/save button ( or after plugin installation) without code above.
This problem fire phocainternationalalias plugin support for Lithuanian language automaticaly in both versions 1.0.0 and 1.0.1.
if was set phocainternationalalias plugin support for LITHUANIAN or ICELANDIC language chars in backend, then different conversion's chars for other active phocainternationalalias plugin languages will be always remove (chars are not merged) - rows 162-176, function stringURLSafe($string) in phocainternationalalias.php file (version 1.0.1)
Code: Select all
// LITHUANIAN
if ($ltLang == 1) {
$ltLangFrom = array('ą','č','ę','ė','į','š','ų','ū','ž','Ą','Č','Ę','Ė','Į','Š','Ų','Ū','Ž');
$ltLangTo = array('a','c','e','e','i','s','u','u','z','A','C','E','E','I','S','U','U','Z');
$langFrom = array_merge ($langFrom, $ltLangFrom);
$langTo = array_merge ($langTo, $ltLangTo);
}
// ICELANDIC
if ($isLang == 1) {
$isLangFrom = array('þ', 'æ', 'ð', 'ö', 'í', 'ó', 'é', 'á', 'ý', 'ú', 'Þ', 'Æ', 'Ð', 'Ö', 'Í', 'Ó', 'É', 'Á', 'Ý', 'Ú');
$isLangTo = array('th','ae','d', 'o', 'i', 'o', 'e', 'a', 'y', 'u', 'Th','Ae','D', 'O', 'I', 'O', 'E', 'A', 'Y', 'U');
$langFrom = array_merge ($langFrom, $isLangFrom);
$langTo = array_merge ($langTo, $isLangTo);
}
Code: Select all
<?php
/**
* @version $Id:output.php 6961 2007-03-15 16:06:53Z tcp $
* @package Joomla.Framework
* @subpackage Filter
* @copyright Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
* @copyright Copyright (C) 2008 Protos Extensions
* @copyright Copyright (C) 2008 Phoca ( www.phoca.cz )
* @license GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant to the
* GNU General Public License, and as distributed it includes or is derivative
* of works licensed under the GNU General Public License or other free or open
* source software licenses. See COPYRIGHT.php for copyright notices and
* details.
*/
/**
* JFilterOutput
*
* @static
* @package Joomla.Framework
* @subpackage Filter
* @since 1.5
*/
class JFilterOutput
{
/**
* Makes an object safe to display in forms
*
* Object parameters that are non-string, array, object or start with underscore
* will be converted
*
* @static
* @param object An object to be parsed
* @param int The optional quote style for the htmlspecialchars function
* @param string|array An optional single field name or array of field names not
* to be parsed (eg, for a textarea)
* @since 1.5
*/
function objectHTMLSafe( &$mixed, $quote_style=ENT_QUOTES, $exclude_keys='' )
{
if (is_object( $mixed ))
{
foreach (get_object_vars( $mixed ) as $k => $v)
{
if (is_array( $v ) || is_object( $v ) || $v == NULL || substr( $k, 1, 1 ) == '_' ) {
continue;
}
if (is_string( $exclude_keys ) && $k == $exclude_keys) {
continue;
} else if (is_array( $exclude_keys ) && in_array( $k, $exclude_keys )) {
continue;
}
$mixed->$k = htmlspecialchars( $v, $quote_style, 'UTF-8' );
}
}
}
/**
* This method processes a string and replaces all instances of & with & in links only
*
* @static
* @param string $input String to process
* @return string Processed string
* @since 1.5
*/
function linkXHTMLSafe($input)
{
$regex = 'href="([^"]*(&(amp;){0})[^"]*)*?"';
return preg_replace_callback( "#$regex#i", array('JFilterOutput', '_ampReplaceCallback'), $input );
}
/**
* This method processes a string and replaces all accented UTF-8 characters by unaccented
* ASCII-7 "equivalents", whitespaces are replaced by hyphens and the string is lowercased.
*
* @static
* @param string $input String to process
* @return string Processed string
* @since 1.5
*/
function stringURLSafe($string)
{
/**
* Jan: the czech version use the same code as bulgarian from Ivo but with different characters
* iapostolov: Now let's start overwriting the core class for alias replacing
* Joomla! 1.5 checks if a class is already loaded so we can load the whole class and overwrite it :)
*/
// jimport('joomla.plugin.helper');
$plugin = JPluginHelper::getPlugin('system','phocainternationalalias');
$paramsP = new JParameter( $plugin->params );
$hrLang = $paramsP->get( 'croatian-lang',1);
$czLang = $paramsP->get( 'czech-lang',1);
$huLang = $paramsP->get( 'hungarian-lang',1);
$plLang = $paramsP->get( 'polish-lang',1);
$skLang = $paramsP->get( 'slovak-lang',1);
$slLang = $paramsP->get( 'slovenian-lang',1);
$ltLang = $paramsP->get( 'lithuanian-lang',1);
$isLang = $paramsP->get( 'icelandic-lang',1);
$langFrom = array();
$langTo = array();
// CZECH
if ($czLang == 1) {
$czLangFrom = array('á','č','ď','é','ě','í','ň','ó','ř','š','ť','ú','ů','ý','ž','Á','Č','Ď','É','Ě','Í','Ň','Ó','Ř','Š','Ť','Ú','Ů','Ý','Ž');
$czLangTo = array('a','c','d','e','e','i','n','o','r','s','t','u','u','y','z','a','c','d','e','e','i','ň','o','r','s','t','u','u','y','z');
$langFrom = $czLangFrom;
$langTo = $czLangTo;
}
// CROATIAN
if ($hrLang == 1) {
$hrLangFrom = array('č','ć','đ','š','ž','Č','Ć','Đ','Š','Ž');
$hrLangTo = array('c','c','d','s','z','c','c','d','s','z');
$langFrom = array_merge ($langFrom, $hrLangFrom);
$langTo = array_merge ($langTo, $hrLangTo);
}
// HUNGARIAN
if ($huLang == 1) {
$huLangFrom = array('á','é','ë','í','ó','ö','ő','ú','ü','ű','Á','É','Ë','Í','Ó','Ö','Ő','Ú','Ü','Ű');
$huLangTo = array('a','e','e','i','o','o','o','u','u','u','a','e','e','i','o','o','o','u','u','u');
$langFrom = array_merge ($langFrom, $huLangFrom);
$langTo = array_merge ($langTo, $huLangTo);
}
// POLISH
if ($plLang == 1) {
$plLangFrom = array('ą','ć','ę','ł','ń','ó','ś','ź','ż','Ą','Ć','Ę','Ł','Ń','Ó','Ś','Ź','Ż');
$plLangTo = array('a','c','e','l','n','o','s','z','z','a','c','e','l','n','o','s','z','z');
$langFrom = array_merge ($langFrom, $plLangFrom);
$langTo = array_merge ($langTo, $plLangTo);
}
// SLOVAK
if ($skLang == 1) {
$skLangFrom = array('á','ä','č','ď','é','í','ľ','ĺ','ň','ó','ô','ŕ','š','ť','ú','ý','ž','Á','Ä','Č','Ď','É','Í','Ľ','Ĺ','Ň','Ó','Ô','Ŕ','Š','Ť','Ú','Ý','Ž');
$skLangTo = array('a','a','c','d','e','i','l','l','n','o','o','r','s','t','u','y','z','a','a','c','d','e','i','l','l','n','o','o','r','s','t','u','y','z');
$langFrom = array_merge ($langFrom, $skLangFrom);
$langTo = array_merge ($langTo, $skLangTo);
}
// SLOVENIAN
if ($slLang == 1) {
$slLangFrom = array('č','š','ž','Č','Š','Ž');
$slLangTo = array('c','s','z','c','s','z');
$langFrom = array_merge ($langFrom, $slLangFrom);
$langTo = array_merge ($langTo, $slLangTo);
}
// LITHUANIAN
if ($ltLang == 1) {
$ltLangFrom = array('ą','č','ę','ė','į','š','ų','ū','ž','Ą','Č','Ę','Ė','Į','Š','Ų','Ū','Ž');
$ltLangTo = array('a','c','e','e','i','s','u','u','z','A','C','E','E','I','S','U','U','Z');
$langFrom = array_merge ($langFrom, $ltLangFrom);
$langTo = array_merge ($langTo, $ltLangTo);
}
// ICELANDIC
if ($isLang == 1) {
$isLangFrom = array('þ', 'æ', 'ð', 'ö', 'í', 'ó', 'é', 'á', 'ý', 'ú', 'Þ', 'Æ', 'Ð', 'Ö', 'Í', 'Ó', 'É', 'Á', 'Ý', 'Ú');
$isLangTo = array('th','ae','d', 'o', 'i', 'o', 'e', 'a', 'y', 'u', 'Th','Ae','D', 'O', 'I', 'O', 'E', 'A', 'Y', 'U');
$langFrom = array_merge ($langFrom, $isLangFrom);
$langTo = array_merge ($langTo, $isLangTo);
}
// GERMAN - because of german names used in Czech, Hungarian, Polish or Slovak (because of possible
// match - e.g. German ä => ae, but Slovak ä => a ... we can use only one, so we use:
// a not ae, u not ue, o not oe, ß will be ss
$deLangFrom = array('ä','ö','ü','ß','Ä','Ö','Ü');
$deLangTo = array('a','o','u','ss','a','o','u');
//$deLangTo = array('ae','oe','ue','ss','ae','oe','ue');
$langFrom = array_merge ($langFrom, $deLangFrom);
$langTo = array_merge ($langTo, $deLangTo);
$string = JString::strtolower($string);
$string = JString::str_ireplace($langFrom, $langTo, $string);
//remove any '-' from the string they will be used as concatonater
$str = str_replace('-', ' ', $string);
$lang =& JFactory::getLanguage();
$str = $lang->transliterate($str);
// remove any duplicate whitespace, and ensure all characters are alphanumeric
$str = preg_replace(array('/\s+/','/[^A-Za-z0-9\-]/'), array('-',''), $str);
// lowercase and trim
$str = trim(strtolower($str));
return $str;
}
/**
* Replaces & with & for xhtml compliance
*
* @todo There must be a better way???
*
* @static
* @since 1.5
*/
function ampReplace( $text )
{
$text = str_replace( '&&', '*--*', $text );
$text = str_replace( '&#', '*-*', $text );
$text = str_replace( '&', '&', $text );
$text = preg_replace( '|&(?![\w]+;)|', '&', $text );
$text = str_replace( '*-*', '&#', $text );
$text = str_replace( '*--*', '&&', $text );
return $text;
}
/**
* Callback method for replacing & with & in a string
*
* @static
* @param string $m String to process
* @return string Replaced string
* @since 1.5
*/
function _ampReplaceCallback( $m )
{
$rx = '&(?!amp;)';
return preg_replace( '#'.$rx.'#', '&', $m[0] );
}
/**
* Cleans text of all formating and scripting code
*/
function cleanText ( &$text )
{
$text = preg_replace( "'<script[^>]*>.*?</script>'si", '', $text );
$text = preg_replace( '/<a\s+.*?href="([^"]+)"[^>]*>([^<]+)<\/a>/is', '\2 (\1)', $text );
$text = preg_replace( '/<!--.+?-->/', '', $text );
$text = preg_replace( '/{.+?}/', '', $text );
$text = preg_replace( '/ /', ' ', $text );
$text = preg_replace( '/&/', ' ', $text );
$text = preg_replace( '/"/', ' ', $text );
$text = strip_tags( $text );
$text = htmlspecialchars( $text );
return $text;
}
}