Re: EMLH smarty plugin and smarty default_modifiers
The one to call easiestml as an edit plug-in of the template was tested making it.
Reason to make this
'Management of content of article'
for the omission
ext.
en , ja , zh
if I writed
[en] [ja]
only lang tag articles
,
when lang tag is zh
too
display
[en] lang tag article
html/class/smarty/plugins/modifier.domi_easiestml.php
function smarty_modifier_domi_easiestml($str)
{
//option initialize
if (!isset($str)) {
return $str;
}
if (empty($str) || !is_string($str)) {
return $str;
}
global $easiestml_lang;
if (function_exists('easiestml') && isset($easiestml_lang) && defined( 'EASIESTML_LANGS' )) {
$original_easiestml_lang = $easiestml_lang ;
$easiestml_langs = explode( ',' , EASIESTML_LANGS ) ;
if ($easiestml_lang != $easiestml_langs[0] && !preg_match('/\['.preg_quote($easiestml_lang).'\]/i' , $str)) {
$easiestml_lang = $easiestml_langs[0] ;
}
$str = easiestml($str);
$easiestml_lang = $original_easiestml_lang ;
}
return $str;
}
html/class/template.php
Constructor
function XoopsTpl
about last lines add line
$this->default_modifiers = array('domi_easiestml');
html/class/template.php
// ob_start( 'easiestml' ) ;