Exemple #1
0
    if ($cmd == 'go') {
        $sStopRegex = clearInputText(__paramInit('array', null, 'regex', ''));
        $sTestText = clearInputText(__paramInit('array', null, 'test', ''));
        $sBadRegex = stop_words::validateAdminStopRegex($sStopRegex);
        if (!$sBadRegex) {
            $action = __paramInit('string', null, 'action', '');
            if ($action == 'update') {
                if (stop_words::updateAdminStopRegex($sStopRegex)) {
                    $_SESSION['admin_stop_words_success'] = TRUE;
                    header('Location: /siteadmin/stop_words/');
                    exit;
                } else {
                    $error = 'Ошибка при сохранеии стоп-слов';
                }
            } else {
                $stop_words->setStopRegex($sStopRegex);
                $sUserMode = $stop_words->replace($sTestText, 'html', false);
                $sAdminMode = $stop_words->replace($sTestText, 'html', true);
            }
        } else {
            $error = 'Выражение "' . $sBadRegex . '" не корректно';
        }
    } else {
        $sStopRegex = implode("\n", stop_words::getAdminStopRegex(false));
    }
}
$menu_item = 14;
$rpath = '../../';
$js_file = array('stop_words_admin.js');
$css_file = array('moderation.css', 'nav.css');
$header = $rpath . 'header.php';