6 * simplified xl() version for smarty templates
7 * Christian Navalici 2007
12 * Smarty {xl} function plugin
16 * Purpose: translate in OpenEMR - Smarty templates<br>
26 function smarty_function_xl($params, &$smarty)
28 if (empty($params['t'])) {
29 $smarty->trigger_error("xk: missing 't' parameter");
32 $translate = $params['t'];
35 $lang_id = $_SESSION['language_choice'];
36 $sql = "SELECT * FROM lang_definitions JOIN lang_constants ON " .
37 "lang_definitions.cons_id = lang_constants.cons_id WHERE " .
38 "lang_id='$lang_id' AND constant_name = '" .
39 addslashes($translate) . "' LIMIT 1";
41 $res = SqlStatement($sql);
42 $row = SqlFetchArray($res);
44 $string = $row['definition'];
53 /* vim: set expandtab: */