public/wordpress/wp-content/plugins/wp-courseware/includes/legacy/pages/page-course-dashboard.php
/**
 * Handle any deletion if any has been requested.
 *
 * @since 1.0.0
 *
 * @param object $page The reference to the object showing the page content
 */
Handle any deletion if any has been requested.

@param object $page The reference to the object showing the page content
Handle any deletion if any has been requested . @param object $page The reference to the object showing the page content
function WPCW_handler_processDeletion( $page ) {
	if ( ! isset( $_GET['action'] ) ) {
		return;
	}
	$action = WPCW_arrays_getValue( $_GET, 'action' );
	switch ( $action ) {
		case 'delete_module':
			$module_id     = WPCW_arrays_getValue( $_GET, 'module_id' );
			$moduleDetails = WPCW_modules_getModuleDetails( $module_id );
			if ( $moduleDetails ) {
				WPCW_modules_deleteModule( $moduleDetails );
				$page->showMessage( sprintf( __( 'Successfully deleted module "<em>%s</em>".', 'wp-courseware' ), $moduleDetails->module_title ) );
			}
			break;
		case 'delete_course':
			$course_id     = WPCW_arrays_getValue( $_GET, 'course_id' );
			$courseDetails = WPCW_courses_getCourseDetails( $course_id );
			if ( $courseDetails ) {
								$deleteMethod = 'complete';
				if ( 'course_and_module' == WPCW_arrays_getValue( $_POST, 'delete_course_type' ) ) {
					$deleteMethod = 'course_and_module';
				}
				WPCW_modules_deleteCourse( $courseDetails, $deleteMethod );
				$page->showMessage( sprintf( __( 'Successfully deleted training course "<em>%s</em>".', 'wp-courseware' ), $courseDetails->course_title ) );
			}
			break;
	}
}
function WPCW_handler_processDeletion ( $ page ) { if ( ! isset ( $ _GET [ 'action' ] ) ) { return ; } $ action = WPCW_arrays_getValue ( $ _GET , 'action' ) ; switch ( $ action ) { case 'delete_module' : $ module_id = WPCW_arrays_getValue ( $ _GET , 'module_id' ) ; $ moduleDetails = WPCW_modules_getModuleDetails ( $ module_id ) ; if ( $ moduleDetails ) { WPCW_modules_deleteModule ( $ moduleDetails ) ; $ page -> showMessage ( sprintf ( __ ( 'Successfully deleted module "<em>%s</em>".' , 'wp-courseware' ) , $ moduleDetails -> module_title ) ) ; } break ; case 'delete_course' : $ course_id = WPCW_arrays_getValue ( $ _GET , 'course_id' ) ; $ courseDetails = WPCW_courses_getCourseDetails ( $ course_id ) ; if ( $ courseDetails ) { $ deleteMethod = 'complete' ; if ( 'course_and_module' == WPCW_arrays_getValue ( $ _POST , 'delete_course_type' ) ) { $ deleteMethod = 'course_and_module' ; } WPCW_modules_deleteCourse ( $ courseDetails , $ deleteMethod ) ; $ page -> showMessage ( sprintf ( __ ( 'Successfully deleted training course "<em>%s</em>".' , 'wp-courseware' ) , $ courseDetails -> course_title ) ) ; } break ; } }
Handle any deletion if any has been requested.
Handle any deletion if any has been requested .
// Check for deletion command // Deleting a module // Actually delete the module from the system // Deleting a course // What deletion method?
 // Actually delete the course from the system