public/wordpress/wp-content/plugins/wp-courseware/includes/legacy/classes/import.php
/**
		 * Extract details from the XML for this single unit.
		 */
Extract details from the XML for this single unit.
Extract details from the XML for this single unit .
private function loadUnitData_Single( $singleUnit ) {
			global $fieldsToProcess_units;
			$dbdata = array();
			foreach ( $fieldsToProcess_units as $fieldName ) {
				$dbdata[ $fieldName ] = ( isset( $singleUnit->$fieldName ) ? (string) $singleUnit->$fieldName : '' );
				$dbdata[ $fieldName ] = html_entity_decode( $dbdata[ $fieldName ], ENT_QUOTES );
			}
			if ( isset( $singleUnit->quizzes ) && isset( $singleUnit->quizzes->quiz[0] ) ) {
				$dbdata['quizzes'] = array();
				foreach ( $singleUnit->quizzes->quiz as $singleQuiz ) {
					$dbdata['quizzes'][] = $this->loadQuizData_Single( $singleQuiz );
				}
			} else {
				$dbdata['quizzes'] = false;
			}
			return $dbdata;
		}
private function loadUnitData_Single ( $ singleUnit ) { global $ fieldsToProcess_units ; $ dbdata = array ( ) ; foreach ( $ fieldsToProcess_units as $ fieldName ) { $ dbdata [ $ fieldName ] = ( isset ( $ singleUnit -> $ fieldName ) ? ( string ) $ singleUnit -> $ fieldName : '' ) ; $ dbdata [ $ fieldName ] = html_entity_decode ( $ dbdata [ $ fieldName ] , ENT_QUOTES ) ; } if ( isset ( $ singleUnit -> quizzes ) && isset ( $ singleUnit -> quizzes -> quiz [ 0 ] ) ) { $ dbdata [ 'quizzes' ] = array ( ) ; foreach ( $ singleUnit -> quizzes -> quiz as $ singleQuiz ) { $ dbdata [ 'quizzes' ] [ ] = $ this -> loadQuizData_Single ( $ singleQuiz ) ; } } else { $ dbdata [ 'quizzes' ] = false ; } return $ dbdata ; }
Extract details from the XML for this single unit.
Extract details from the XML for this single unit .
// Put data into database, but assume data is blank if not set in XML. // Use html_entity_decode to remove HTML entities. // Check for quizzes in this unit