init
This commit is contained in:
commit
9b70aa22b6
13 changed files with 711 additions and 0 deletions
lib
37
lib/helpers.php
Normal file
37
lib/helpers.php
Normal file
|
@ -0,0 +1,37 @@
|
|||
<?php
|
||||
|
||||
function remove_whitespace($target)
|
||||
{
|
||||
return str_replace(" ", "", $target);
|
||||
}
|
||||
|
||||
function render($template, $locale, $param){
|
||||
ob_start();
|
||||
extract($param, EXTR_SKIP);
|
||||
include($template);
|
||||
$ret = ob_get_contents();
|
||||
ob_end_clean();
|
||||
return $ret;
|
||||
}
|
||||
|
||||
function setup_locale()
|
||||
{
|
||||
$locale = "de_DE.UTF-8";
|
||||
|
||||
if (isset($_SESSION["locale"]))
|
||||
{
|
||||
$locale = $_SESSION["locale"];
|
||||
}
|
||||
|
||||
putenv("LC_ALL=$locale");
|
||||
setlocale(LC_ALL, $locale);
|
||||
|
||||
$domain = "rhythm";
|
||||
|
||||
bindtextdomain($domain, "./locale");
|
||||
bind_textdomain_codeset($domain, 'UTF-8');
|
||||
|
||||
textdomain($domain);
|
||||
}
|
||||
|
||||
?>
|
Loading…
Add table
Add a link
Reference in a new issue