public/wordpress/wp-content/plugins/wp-courseware/includes/legacy/admin/functions.php
/**
 * Function that checks to see if a data export has been triggered.
 *
 * @since 1.0.0
 */
Function that checks to see if a data export has been triggered.
Function that checks to see if a data export has been triggered .
function WPCW_data_handleDataExport() {
	if ( isset( $_GET['wpcw_export'] ) && $exportType = $_GET['wpcw_export'] ) {
		if ( ! is_user_logged_in() ) {
			wp_die( __( 'You do not have sufficient permissions to access this page.', 'wp-courseware' ) );
		}
		$exportTypeList = array(
			'csv_import_user_sample'      => 'WPCW_data_export_userImportSample',
			'csv_import_questions_sample' => 'WPCW_data_export_questionImportSample',
			'csv_export_survey_data'      => 'WPCW_data_export_quizSurveyData',
			'gradebook_csv'               => 'WPCW_data_export_gradebookData',
		);
		if ( ! in_array( $exportType, array_keys( $exportTypeList ) ) ) {
			return;
		}
		call_user_func( $exportTypeList[ $exportType ] );
	}
}
function WPCW_data_handleDataExport ( ) { if ( isset ( $ _GET [ 'wpcw_export' ] ) && $ exportType = $ _GET [ 'wpcw_export' ] ) { if ( ! is_user_logged_in ( ) ) { wp_die ( __ ( 'You do not have sufficient permissions to access this page.' , 'wp-courseware' ) ) ; } $ exportTypeList = array ( 'csv_import_user_sample' => 'WPCW_data_export_userImportSample' , 'csv_import_questions_sample' => 'WPCW_data_export_questionImportSample' , 'csv_export_survey_data' => 'WPCW_data_export_quizSurveyData' , 'gradebook_csv' => 'WPCW_data_export_gradebookData' , ) ; if ( ! in_array ( $ exportType , array_keys ( $ exportTypeList ) ) ) { return ; } call_user_func ( $ exportTypeList [ $ exportType ] ) ; } }
Function that checks to see if a data export has been triggered.
Function that checks to see if a data export has been triggered .
// Check for a generic trigger for an export. // Check logged in status // Contains the data type => the function that generates it. // Permissions are checked in each individual function // Check the export type matches the only types of export that we handle. // Trigger the function that will export this type of file.