Mercurial > hg > mgallery
diff mgallery.inc.php @ 232:e618280253ca
Move mgGetTrans() to mgallery.php as it is used only there. Also change how
the second function argument works, instead of being a boolean to filter
through chentities() use it as a callable which defaults to NULL for greater
flexibility.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 26 Mar 2018 19:37:42 +0300 |
parents | 77e72455c99f |
children | e7e9b39f2480 |
line wrap: on
line diff
--- a/mgallery.inc.php Mon Mar 26 17:06:12 2018 +0300 +++ b/mgallery.inc.php Mon Mar 26 19:37:42 2018 +0300 @@ -290,19 +290,6 @@ } -function mgGetTrans($val, $useEntities = FALSE) -{ - global $pageLang; - - if (is_array($val)) - $str = array_key_exists($pageLang, $val) ? $val[$pageLang] : reset($val); - else - $str = $val; - - return $useEntities ? chentities($str) : $str; -} - - function mgGetArr($data, $skeys, $sfmt1 = "%1", $sfmt2 = "", $func = NULL) { global $pageLang;