public/wordpress/wp-content/plugins/wp-courseware/includes/legacy/classes/export.php
/**
		 * Turn an object into XML and return it.
		 *
		 * @param String $nodeName The name of the block to create from the object.
		 * @param Array $attributes The key => value list of items to save as attributes for the XML block.
		 * @param Object $rawDetails The raw object data.
		 * @param Array $fieldsToProcess The list of fields to extract from the raw data into XML.
		 * @param String $path The parent path to export this data to.
		 * @param Boolean $closeTag If true, close the final XML tag. If false, don't add the final section XML tags.
		 *
		 * @return String The XML for this object.
		 */
Turn an object into XML and return it.
@param String $nodeName The name of the block to create from the object.
@param Array $attributes The key => value list of items to save as attributes for the XML block.
@param Object $rawDetails The raw object data.
@param Array $fieldsToProcess The list of fields to extract from the raw data into XML.
@param String $path The parent path to export this data to.
@param Boolean $closeTag If true, close the final XML tag. If false, don't add the final section XML tags.

@return String The XML for this object.
Turn an object into XML and return it . @param String $nodeName The name of the block to create from the object . @param Array $attributes The key = > value list of items to save as attributes for the XML block . @param Object $rawDetails The raw object data . @param Array $fieldsToProcess The list of fields to extract from the raw data into XML . @param String $path The parent path to export this data to . @param Boolean $closeTag If true close the final XML tag . If false don ' t add the final section XML tags . @return String The XML for this object .
private function export_objectToXML( $nodeName, $attributes, $rawDetails, $fieldsToProcess, $path, $closeTag = true ) {
			$padding = $this->export_indent( $path );
			$xml     = false;
			$newPath = "$path/$nodeName";
			$padding = $this->export_indent( $newPath );
			$xml     .= "$padding<$nodeName";
			if ( $attributes ) {
				foreach ( $attributes as $name => $value ) {
					$xml .= " $name=\"$value\"";
				}
			}
			$xml .= '>';
			foreach ( $fieldsToProcess as $fieldToUse ) {
				if ( isset( $rawDetails->$fieldToUse ) ) {
					$xml .= $this->export_textData( $fieldToUse, $rawDetails->$fieldToUse, $newPath . '/' );
				}
			}
			if ( $closeTag ) {
				$xml .= "$padding</$nodeName>";
			}
			return $xml;
		}
private function export_objectToXML ( $ nodeName , $ attributes , $ rawDetails , $ fieldsToProcess , $ path , $ closeTag = true ) { $ padding = $ this -> export_indent ( $ path ) ; $ xml = false ; $ newPath = " $ path / $ nodeName " ; $ padding = $ this -> export_indent ( $ newPath ) ; $ xml .= " $ padding < $ nodeName " ; if ( $ attributes ) { foreach ( $ attributes as $ name => $ value ) { $ xml .= " $ name = \" $ value \" " ; } } $ xml .= '>' ; foreach ( $ fieldsToProcess as $ fieldToUse ) { if ( isset ( $ rawDetails -> $ fieldToUse ) ) { $ xml .= $ this -> export_textData ( $ fieldToUse , $ rawDetails -> $ fieldToUse , $ newPath . '/' ) ; } } if ( $ closeTag ) { $ xml .= " $ padding </ $ nodeName > " ; } return $ xml ; }
Turn an object into XML and return it.
Turn an object into XML and return it .
// Open tag with any attributes // See if there are any attributes to add to the node // Close tag // Only include fields included in our list of details // Closing tag