From 965cbe52f22809f19ca150feb585b0218aa89f85 Mon Sep 17 00:00:00 2001 From: brettp Date: Wed, 22 Sep 2010 17:01:17 +0000 Subject: Converted line endings to unix. git-svn-id: http://code.elgg.org/elgg/trunk@6957 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/classes/ODDDocument.php | 258 ++++++++++++++++++++--------------------- 1 file changed, 129 insertions(+), 129 deletions(-) (limited to 'engine/classes/ODDDocument.php') diff --git a/engine/classes/ODDDocument.php b/engine/classes/ODDDocument.php index 0c8731a75..834b5b8fe 100644 --- a/engine/classes/ODDDocument.php +++ b/engine/classes/ODDDocument.php @@ -1,129 +1,129 @@ -elements = $elements; - } else { - $this->addElement($elements); - } - } else { - $this->elements = array(); - } - } - - /** - * Return the version of ODD being used. - * - * @return string - */ - public function getVersion() { - return $this->ODDSupportedVersion; - } - - public function getNumElements() { - return count($this->elements); - } - - public function addElement(ODD $element) { - if (!is_array($this->elements)) { - $this->elements = array(); - $this->elements[] = $element; - } - } - - public function addElements(array $elements) { - foreach ($elements as $element) { - $this->addElement($element); - } - } - - public function getElements() { - return $this->elements; - } - - /** - * Set an optional wrapper factory to optionally embed the ODD document in another format. - */ - public function setWrapperFactory(ODDWrapperFactory $factory) { - $this->wrapperfactory = $factory; - } - - /** - * Magic function to generate valid ODD XML for this item. - */ - public function __toString() { - $xml = ""; - - if ($this->wrapperfactory) { - // A wrapper has been provided - $wrapper = $this->wrapperfactory->getElementWrapper($this); // Get the wrapper for this element - - $xml = $wrapper->wrap($this); // Wrap this element (and subelements) - } else { - // Output begin tag - $generated = date("r"); - $xml .= "ODDSupportedVersion}\" generated=\"$generated\">\n"; - - // Get XML for elements - foreach ($this->elements as $element) { - $xml .= "$element"; - } - - // Output end tag - $xml .= "\n"; - } - - return $xml; - } - - // ITERATOR INTERFACE ////////////////////////////////////////////////////////////// - /* - * This lets an entity's attributes be displayed using foreach as a normal array. - * Example: http://www.sitepoint.com/print/php5-standard-library - */ - - private $valid = FALSE; - - function rewind() { - $this->valid = (FALSE !== reset($this->elements)); - } - - function current() { - return current($this->elements); - } - - function key() { - return key($this->elements); - } - - function next() { - $this->valid = (FALSE !== next($this->elements)); - } - - function valid() { - return $this->valid; - } -} +elements = $elements; + } else { + $this->addElement($elements); + } + } else { + $this->elements = array(); + } + } + + /** + * Return the version of ODD being used. + * + * @return string + */ + public function getVersion() { + return $this->ODDSupportedVersion; + } + + public function getNumElements() { + return count($this->elements); + } + + public function addElement(ODD $element) { + if (!is_array($this->elements)) { + $this->elements = array(); + $this->elements[] = $element; + } + } + + public function addElements(array $elements) { + foreach ($elements as $element) { + $this->addElement($element); + } + } + + public function getElements() { + return $this->elements; + } + + /** + * Set an optional wrapper factory to optionally embed the ODD document in another format. + */ + public function setWrapperFactory(ODDWrapperFactory $factory) { + $this->wrapperfactory = $factory; + } + + /** + * Magic function to generate valid ODD XML for this item. + */ + public function __toString() { + $xml = ""; + + if ($this->wrapperfactory) { + // A wrapper has been provided + $wrapper = $this->wrapperfactory->getElementWrapper($this); // Get the wrapper for this element + + $xml = $wrapper->wrap($this); // Wrap this element (and subelements) + } else { + // Output begin tag + $generated = date("r"); + $xml .= "ODDSupportedVersion}\" generated=\"$generated\">\n"; + + // Get XML for elements + foreach ($this->elements as $element) { + $xml .= "$element"; + } + + // Output end tag + $xml .= "\n"; + } + + return $xml; + } + + // ITERATOR INTERFACE ////////////////////////////////////////////////////////////// + /* + * This lets an entity's attributes be displayed using foreach as a normal array. + * Example: http://www.sitepoint.com/print/php5-standard-library + */ + + private $valid = FALSE; + + function rewind() { + $this->valid = (FALSE !== reset($this->elements)); + } + + function current() { + return current($this->elements); + } + + function key() { + return key($this->elements); + } + + function next() { + $this->valid = (FALSE !== next($this->elements)); + } + + function valid() { + return $this->valid; + } +} -- cgit v1.2.3