/**
 * Add a type
 */
if ($option_addtype) {
    if (isset($_POST['type'])) {
        $storyboard_db_api->insert_type($_POST['type'], 'type');
    }
}
/**
 * Delete a type
 */
if ($option_deltype) {
    if (isset($_POST['types'])) {
        $type_string = $_POST['types'];
        $type_id = $storyboard_db_api->select_typeid_by_typestring($type_string, 'type');
        $storyboard_db_api->delete_type($type_string, 'type');
    }
}
/**
 * Change a type
 */
if ($option_changetype) {
    if (isset($_POST['types']) && isset($_POST['newtype'])) {
        $type_string = $_POST['types'];
        $type_id = $storyboard_db_api->select_typeid_by_typestring($type_string, 'type');
        $new_type_string = $_POST['newtype'];
        $storyboard_db_api->update_type($type_id, $new_type_string, 'type');
    }
}
form_security_purge('plugin_StoryBoard_config_update');
print_successful_redirect(plugin_page('config_page', true));