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