if ($option_deltype) {
    if (isset($_POST['types'])) {
        $type_string = $_POST['types'];
        $type_id = $specmanagement_database_api->get_type_id($type_string);
        /*
         * Just delete a type if it is not used!
         */
        if (!$specmanagement_database_api->check_type_is_used($type_id)) {
            $specmanagement_database_api->delete_type_row($type_string);
        }
    }
}
/**
 * Change a document type
 */
if ($option_changetype) {
    if (isset($_POST['types']) && isset($_POST['newtype'])) {
        $type_string = $_POST['types'];
        $type_id = $specmanagement_database_api->get_type_id($type_string);
        $new_type_string = $_POST['newtype'];
        $specmanagement_database_api->update_type_row($type_id, $new_type_string);
    }
}
/**
 *
 */
if ($option_manage_doc_types) {
    print_successful_redirect(plugin_page('manage_types', true));
}
form_security_purge('plugin_SpecManagement_config_update');
print_successful_redirect(plugin_page('config_page', true));