<?php

class WizardStepTOC extends WizardStep
{

    public function run()
    {
        $wizardModel = WizardHelper::getWizardModel();

        $this->performAjaxValidation($wizardModel, "toc-form");

        // Speichere das TOC Akzeptiert wurde
        if (isset($_POST["Wizard"])) {
            $wizardModel->attributes = $_POST["Wizard"];
            $wizardModel->save();
            $this->setStepIsDone(true);
            return;
        }

        // Render TOC
        $termsContent = TermsOfUseProvider::text();
        $privacyContent = PrivacyProvider::text();
        $this->wizardController->render("termsOfConditions", array(
            "termsContent" => $termsContent,
            "privacyContent" => $privacyContent,
            "wizardModel" => $wizardModel
        ));
    }
}
