1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-18 12:21:45 +02:00

Language file cleanup

This commit is contained in:
Cameron
2013-10-29 12:20:23 -07:00
parent cb29941bda
commit cd8ea2f67c
6 changed files with 46 additions and 23 deletions

View File

@@ -2580,7 +2580,20 @@ class e_parser
return sprintf("%0".$numDigits."d",$num);
}
/**
* Generic variable translator for LAN definitions.
* @example $tp->lanVars("My name is [x] and I own a [y]", array('x'=>"John", 'y'=>"Cat"));
*/
function lanVars($lan, $array= array(), $bold=false)
{
foreach($array as $k=>$v)
{
$search[] = "[".$k."]";
$replace[] = ($bold===true) ? "<strong>".$v."</strong>" : $v;
}
return str_replace($search, $replace, $lan);
}
/**
* Return an Array of all specific tags found in an HTML document and their attributes.