Exemplo n.º 1
0
function at_autolang($config)
{
    extract($config);
    $lang = atGetLang();
    if (!is_array($autolang['rtl'])) {
        $autolang['rtl'] = array("ara", "far", "heb");
    }
    foreach ($autolang['rtl'] as $rtllang) {
        if ($lang == $rtllang) {
            echo "<style type=\"text/css\">body { direction: rtl; text-align: right }</style>\n";
            break;
        }
    }
}
Exemplo n.º 2
0
function at_themelang($vars)
{
    extract($vars);
    $themelang = atAutoGetVar("themelang");
    if (!$themelang) {
        return;
    }
    foreach ($themelang['lang'] as $k => $v) {
        $newarray[$v] = $themelang['theme'][$k] . ":" . $themelang['user'][$k];
    }
    $themelang = $newarray;
    $userlang = atGetLang();
    ksort($themelang);
    foreach ($themelang as $lang => $theme) {
        if ($userlang == $lang) {
            $parts = explode(":", $theme);
            $newtheme = $parts[0];
            $user = $parts[1];
            break;
        }
    }
    atThemeSet($newtheme, $user);
}
Exemplo n.º 3
0
function atExtraLoad($name)
{
    $globalconfig = atGetGlobalConfig();
    extract($globalconfig);
    $extra = atRunningGetVar("extra");
    $platform = atGetPlatform();
    $lang = atGetLang();
    if (@file_exists($atdir . "lang/{$lang}/{$name}.php")) {
        @include_secure($atdir . "lang/{$lang}/{$name}.php");
    } else {
        @include_secure($atdir . "lang/eng/{$name}.php");
    }
    if (@file_exists($extradir . $platform . "/{$name}.ext.php")) {
        @include_secure($extradir . $platform . "/{$name}.ext.php");
    } else {
        @include_secure($extradir . "{$name}.ext.php");
    }
    atRunningSetVar("extra", $extra);
    return $extra[$name];
}