예제 #1
0
function translator_add($option, $task)
{
    global $_CONFIG, $lang_array, $lang_dir;
    if ($task == 'add_lang_new') {
        $lfile = $lang_dir . "/" . strtolower($_REQUEST['lname']) . ".php";
        if (file_exists($lfile)) {
            $msg = "Language " . $_REQUEST['lname'] . " already exists!";
        } else {
            if ($fp = @fopen($lfile, 'w')) {
                fwrite($fp, "");
                fclose($fp);
                $msg = "Language " . ucfirst($_REQUEST['language']) . " successfully added!";
            } else {
                $msg = "File {$lfile} could not be updated, please check it's permissions'!";
            }
        }
        mosRedirect('index2.php?option=' . $option . "&task=lang", $msg);
    }
    HTML_cloner::Translator_Add($option);
}
예제 #2
0
function translator_add($option, $task)
{
    global $_CONFIG, $lang_array, $lang_dir;
    if ($task == 'add_lang_new') {
        if (empty($_POST) || !wp_verify_nonce($_POST['csrf'], 'add_lang')) {
            print 'Sorry, your nonce did not verify.';
            exit;
        }
        $lfile = $lang_dir . "/" . strtolower($_REQUEST['lname']) . ".php";
        if (file_exists($lfile)) {
            $msg = "Language " . $_REQUEST['lname'] . " already exists!";
        } elseif ($fp = @fopen($lfile, 'w')) {
            fwrite($fp, "");
            fclose($fp);
            $msg = "Language " . ucfirst($_REQUEST['language']) . " successfully added!";
        } else {
            $msg = "File {$lfile} could not be updated, please check it's permissions'!";
        }
        mosRedirect('index2.php?option=' . $option . "&task=lang", $msg);
    }
    $html = new HTML_cloner();
    $html->Translator_Add($option);
}