Location: PHPKode > projects > DOOR - Digital Open Object Repository > door/admin/teaching_disciplines_support.php
<?php
    // include libraries
    require_once("../setup.php");
    
    if($logged_in != 1) { //not logged
        error_catcher(1);
        exit;
    }else{
        // check if the user can access the page
        authorized_to_access_page('manage_parameters');
        
        // check if the form has already been submitted
        if (isset($_POST["submitted"]) AND
            $_POST["submitted"] === "true") {
            
            // check input data
            if (!isset($_POST["teaching_disciplines_support"]) OR
                !isset($_POST["submit"])) {
                @ob_clean();
                error_catcher(44);
                exit;
            }
            
            // validate values
            if ($_POST["teaching_disciplines_support"] !== "yes" AND $_POST["teaching_disciplines_support"] !== "no") {
                @ob_clean();
                error_catcher(45);
                exit;       
            }
                
            // update settings
            update_setting("teaching_disciplines_support", $_POST["teaching_disciplines_support"]);
                    
            // go back to the previous page
            header ("Location: ../home/home.php");    
            exit;
        }
?>
    <div id="content_area">
        <p class="pagetitle"><?php echo get_string('home', 'ManageTeachingDisciplinesPageTitle'); ?></p>
        <p class="txt"><?php echo get_string('home', 'ManageTeachingDisciplinesMessage'); ?></p>
        <p class="txt"><a href="http://lor.switch.ch/spec/2008/disciplines/" target="_blank">http://lor.switch.ch/spec/2008/disciplines/</a></p>
        <p class="txt"><?php echo get_string('home', 'ManageTeachingDisciplinesMessage2'); ?></p>
        <form action="../admin/teaching_disciplines_support.php" name="parameter_form" id="parameter_form" method="post" class="txt">   
            <input id="teaching_disciplines_support_yes" name="teaching_disciplines_support" type="radio" value="yes" <?php if (isset($settings->teaching_disciplines_support) AND $settings->teaching_disciplines_support === "yes") echo "checked"; ?> /><?php echo get_string('home', 'ManageTeachingDisciplinesEnableSupport'); ?>
            <input id="teaching_disciplines_support_no" name="teaching_disciplines_support" type="radio" value="no" <?php if (isset($settings->teaching_disciplines_support) AND $settings->teaching_disciplines_support === "no") echo "checked"; ?> /><?php echo get_string('home', 'ManageTeachingDisciplinesDisableSupport'); ?><br /><br />
            <input class="button" style="margin-left: 2px !important;" id="submit" name="submit" type="submit" value="<?php echo get_string('home', 'ManageTeachingDisciplinesUpdateButton'); ?>"><br />
            <input id="submitted" name="submitted" type="hidden" value="true" />
        </form>
    </div>
<?php
    }
?>
Return current item: DOOR - Digital Open Object Repository