public/wordpress/wp-content/plugins/wp-courseware/includes/legacy/classes/import.php
/**
		 * Loads the data needed to create the course.
		 */
Loads the data needed to create the course.
Loads the data needed to create the course .
private function loadCourseData() {
			global $fieldsToProcess_course;
			$db_courses = new DB_Courses();
			$dbdata              = array();
			$defaultColumnValues = $db_courses->get_column_defaults();
			foreach ( $fieldsToProcess_course as $fieldName ) {
				$dbdata[ $fieldName ] = ( isset( $this->xml->settings->$fieldName ) ? (string) $this->xml->settings->$fieldName : '' );
				if ( empty( $dbdata[ $fieldName ] ) && isset( $defaultColumnValues[ $fieldName ] ) ) {
					$dbdata[ $fieldName ] = $defaultColumnValues[ $fieldName ];
				}
				$dbdata[ $fieldName ] = html_entity_decode( $dbdata[ $fieldName ], ENT_QUOTES );
			}
			$dbdata['course_title'] .= __( ' (Imported)', 'wp-courseware' );
			if ( ! isset( $dbdata['course_author'] ) ) {
				$dbdata['course_author'] = get_current_user_id();
			}
			return $dbdata;
		}
private function loadCourseData ( ) { global $ fieldsToProcess_course ; $ db_courses = new DB_Courses ( ) ; $ dbdata = array ( ) ; $ defaultColumnValues = $ db_courses -> get_column_defaults ( ) ; foreach ( $ fieldsToProcess_course as $ fieldName ) { $ dbdata [ $ fieldName ] = ( isset ( $ this -> xml -> settings -> $ fieldName ) ? ( string ) $ this -> xml -> settings -> $ fieldName : '' ) ; if ( empty ( $ dbdata [ $ fieldName ] ) && isset ( $ defaultColumnValues [ $ fieldName ] ) ) { $ dbdata [ $ fieldName ] = $ defaultColumnValues [ $ fieldName ] ; } $ dbdata [ $ fieldName ] = html_entity_decode ( $ dbdata [ $ fieldName ] , ENT_QUOTES ) ; } $ dbdata [ 'course_title' ] .= __ ( ' (Imported)' , 'wp-courseware' ) ; if ( ! isset ( $ dbdata [ 'course_author' ] ) ) { $ dbdata [ 'course_author' ] = get_current_user_id ( ) ; } return $ dbdata ; }
Loads the data needed to create the course.
Loads the data needed to create the course .
// Put data into database, but assume data is blank if not set in XML. // Set Default Data. // Use html_entity_decode to remove HTML entities. // Update course title to use 'imported' // Update course_author to be the current user if not set.