diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/functions.inc.php | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/include/functions.inc.php b/include/functions.inc.php index ce64148a7..2b1668de9 100644 --- a/include/functions.inc.php +++ b/include/functions.inc.php @@ -753,4 +753,29 @@ SELECT element_id mass_inserts(CADDIE_TABLE, array('element_id','user_id'), $datas); } } + +/** + * returns the element name from its filename + * + * @param string filename + * @return string name + */ +function get_name_from_file($filename) +{ + return str_replace('_',' ',get_filename_wo_extension($filename)); +} + +/** + * returns the corresponding value from $lang if existing. Else, the key is + * returned + * + * @param string key + * @return string + */ +function l10n($key) +{ + global $lang; + + return (isset($lang[$key])) ? $lang[$key] : $key; +} ?> |