1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-23 14:44:29 +02:00

Updated failed-login message to include variable.

This commit is contained in:
Cameron
2015-04-12 22:45:13 -07:00
parent bcfe20dd2b
commit 0d86f9a42f
3 changed files with 11 additions and 6 deletions

View File

@@ -2714,16 +2714,20 @@ class e_parser
}
/**
* Generic variable translator for LAN definitions.
* Generic variable translator for LAN definitions.
* @param $lan - string LAN
* @param $vals - either a single value, which will replace '[x]' or an array with key=>value pairs.
* @example $tp->lanVars("My name is [x] and I own a [y]", array('x'=>"John", 'y'=>"Cat"));
* @param string | array $vals - either a single value, which will replace '[x]' or an array with key=>value pairs.
* @example $tp->lanVars("My name is [x] and I own a [y]", array('x'=>"John", 'y'=>"Cat"));
* @return string
*/
function lanVars($lan, $vals, $bold=false)
{
$array = (!is_array($vals)) ? array('x'=>$vals) : $vals;
$search = array();
$replace = array();
foreach($array as $k=>$v)
{
$search[] = "[".$k."]";