Пример #1
0
function mainLogic()
{
    global $debugMode, $option, $requestCategory, $optionValue, $serverName;
    //$category = $data[4];
    switch ($option) {
        case "newEntry":
            if ($debugMode == "on") {
                echo "Calling newEntryPass()";
            }
            newEntryForm();
            break;
        case "newEntryForm":
            if ($debugMode == "on") {
                echo "Calling newEntryForm()";
            }
            newEntryForm();
            break;
        case "newEntrySubmit":
            newEntrySubmit();
            break;
        case "newEntrySuccess":
            newEntrySuccess();
            break;
        case "mainPage":
            $requestCategory = '';
            listPosts();
            $referrer = $serverName . $_SERVER['REQUEST_URI'];
            $_SESSION['referrer'] = $referrer;
            break;
        case "adminPage":
            adminPage();
            break;
        case "adminPageBasic":
            if ($debugMode == "on") {
                echo "adminPageBasic  " . $_POST['process'] . "<br>";
            }
            adminPageBasic();
            break;
        case "adminPageBasicSubmit":
            if ($debugMode == "on") {
                echo "adminPageBasicSubmit  " . $_POST['process'] . "<br>";
            }
            adminPageBasicSubmit();
            break;
        case "adminPageAdvanced":
            if ($debugMode == "on") {
                echo "adminPageAdvanced  " . $_POST['process'] . "<br>";
            }
            adminPageAdvanced();
            break;
        case "adminPageAdvancedSubmit":
            if ($debugMode == "on") {
                echo "adminPageAdvancedSubmit  " . $_POST['process'] . "<br>";
            }
            adminPageAdvancedSubmit();
            break;
        case "adminPageAuthors":
            if ($debugMode == "on") {
                echo "adminPageAuthors  " . $_POST['process'] . "<br>";
            }
            adminPageAuthors();
            break;
        case "adminAuthorsAdd":
            if ($debugMode == "on") {
                echo "adminAuthorsAdd  " . $_POST['process'] . "<br>";
            }
            adminAuthorsAdd();
            break;
        case "adminAuthorsEdit":
            if ($debugMode == "on") {
                echo "adminAuthorsEdit  " . $_POST['process'] . "<br>";
            }
            adminAuthorsEdit();
            break;
        case "adminPluginsSubmit":
        case "adminPagePlugins":
            adminPagePlugins();
            break;
        case "adminPageModerate":
        case "adminModerateSubmit":
            adminPageModerate();
            break;
        case "deleteEntry":
            if ($debugMode == "on") {
                echo "deleteEntry  " . $_POST['process'] . "<br>";
            }
            //deleteEntrySubmit();
            if ($_POST['process'] !== "deleteEntrySubmit") {
                deleteEntryForm();
            } else {
                deleteEntrySubmit();
            }
            break;
        case "editEntry":
            if ($debugMode == "on") {
                echo "editEntry  " . $_POST['process'] . "<br>";
            }
            editEntryForm();
            $referrer = $serverName . $_SERVER['REQUEST_URI'];
            $_SESSION['referrer'] = $referrer;
            break;
        case "editEntryForm":
            editEntryForm();
            break;
        case "editEntrySubmit":
            editEntrySubmit();
            break;
        case "posts":
            viewEntry();
            break;
        case "archives":
            viewArchive();
            break;
        case "month":
            viewArchiveMonth();
            break;
        case "category":
            $requestCategory = $optionValue;
            listPosts();
            $referrer = $serverName . $_SERVER['REQUEST_URI'];
            $_SESSION['referrer'] = $referrer;
            break;
        case "searchPosts":
            searchPosts();
            break;
        case "sendComment":
            sendComment();
            break;
        case "sendCommentSuccess":
            sendCommentSuccess();
            break;
        case "listAllComments":
            listAllComments();
            break;
        case "deleteComment":
            if ($debugMode == "on") {
                echo "deleteEntry  " . $_POST['process'] . "<br>";
            }
            $process = isset($_POST['process']) ? $_POST['process'] : "";
            if ($process !== "deleteCommentSubmit") {
                deleteCommentForm();
            } else {
                deleteCommentSubmit();
            }
            break;
        case "loginPage":
            loginPage();
            break;
        case "logoutPage":
            logoutPage();
            break;
        case "registerPage":
            registerPage();
            break;
        case "registerPageSubmit":
            registerPageSubmit();
            break;
        case "forgotPass":
            forgotPass();
            break;
        case "forgotPassSubmit":
            forgotPassSubmit();
            break;
        case "activation":
            activation();
            break;
        case "myProfile":
            myProfile();
            break;
        case "myProfileSubmit":
            myProfileSubmit();
            break;
        case "pluginFunction1":
            pluginFunction1();
            break;
        case "pluginFunction2":
            pluginFunction2();
            break;
        case "pluginFunction3":
            pluginFunction3();
            break;
        case "pluginFunction4":
            pluginFunction4();
            break;
        case "pluginFunction5":
            pluginFunction5();
            break;
    }
}
Пример #2
0
            $i++;
        }
    }
    if ($i == 0) {
        echo "Sorry no matches found!";
    }
}
switch ($option) {
    case "newEntry":
        if ($debugMode == "on") {
            echo "Calling newEntryForm()";
        }
        newEntryForm();
        break;
    case "newEntrySubmit":
        newEntrySubmit();
        break;
    case "mainPage":
        $requestCategory = '';
        listPosts();
        break;
    case "deleteEntry":
        if ($debugMode == "on") {
            echo "deleteEntry  " . $_POST['process'] . "<br>";
        }
        if ($_POST['process'] !== "deleteEntrySubmit") {
            deleteEntryForm();
        } else {
            deleteEntrySubmit();
        }
        break;