예제 #1
0
if ($lang === FALSE) {
    require AT_INCLUDE_PATH . 'header.inc.php';
    echo '<h3>' . _AT('edit_language') . '</h3>';
    $msg->addError('NO_LANGUAGE');
    $msg->printAll();
    require AT_INCLUDE_PATH . 'footer.inc.php';
    exit;
}
if (isset($_POST['cancel'])) {
    $msg->addFeedback('CANCELLED');
    header('Location: language.php');
    exit;
} else {
    if (isset($_POST['submit'])) {
        $languageEditor = new LanguageEditor($_GET['lang_code']);
        $state = $languageEditor->updateLanguage($_POST, $languageManager->exists($_POST['code'], $_POST['locale']));
        if (!$msg->containsErrors() && $state !== FALSE) {
            $msg->addFeedback('LANG_UPDATED');
            header('Location: language.php');
            exit;
        }
    }
}
require AT_INCLUDE_PATH . 'header.inc.php';
$msg->printAll();
if (!isset($_POST['submit'])) {
    $_POST['code'] = $lang->getParentCode();
    $_POST['locale'] = $lang->getLocale();
    $_POST['charset'] = $lang->getCharacterSet();
    $_POST['direction'] = $lang->getDirection();
    $_POST['reg_exp'] = $lang->getRegularExpression();