aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/opendd.php
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-10-28 19:17:36 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-10-28 19:17:36 +0000
commit7ddd9521b3f3a397da3b0a6b56238d31414eb4be (patch)
tree6eb6a9a51db5fa0f5d3cc2ec6de29b9e258b12a1 /engine/lib/opendd.php
parentbd3484417d170e62bc94e9db81d4ad37e8ddee6a (diff)
downloadelgg-7ddd9521b3f3a397da3b0a6b56238d31414eb4be.tar.gz
elgg-7ddd9521b3f3a397da3b0a6b56238d31414eb4be.tar.bz2
Standardized code in all of core, not including language files, tests, or core mods.
git-svn-id: http://code.elgg.org/elgg/trunk@7124 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/opendd.php')
-rw-r--r--engine/lib/opendd.php23
1 files changed, 13 insertions, 10 deletions
diff --git a/engine/lib/opendd.php b/engine/lib/opendd.php
index f3f9f017d..d856806f5 100644
--- a/engine/lib/opendd.php
+++ b/engine/lib/opendd.php
@@ -2,8 +2,8 @@
/**
* OpenDD PHP Library.
*
- * @package Elgg
- * @subpackage Core
+ * @package Elgg.Core
+ * @subpackage ODD
* @version 0.4
*/
@@ -11,21 +11,22 @@
* Attempt to construct an ODD object out of a XmlElement or sub-elements.
*
* @param XmlElement $element The element(s)
+ *
* @return mixed An ODD object if the element can be handled, or false.
*/
-function ODD_factory(XmlElement $element) {
+function ODD_factory (XmlElement $element) {
$name = $element->name;
$odd = false;
switch ($name) {
case 'entity' :
- $odd = new ODDEntity("","","");
+ $odd = new ODDEntity("", "", "");
break;
case 'metadata' :
- $odd = new ODDMetaData("","","","");
+ $odd = new ODDMetaData("", "", "", "");
break;
case 'relationship' :
- $odd = new ODDRelationship("","","");
+ $odd = new ODDRelationship("", "", "");
break;
}
@@ -33,15 +34,15 @@ function ODD_factory(XmlElement $element) {
if ($odd) {
// Attributes
foreach ($element->attributes as $k => $v) {
- $odd->setAttribute($k,$v);
+ $odd->setAttribute($k, $v);
}
// Body
$body = $element->content;
$a = stripos($body, "<![CDATA");
$b = strripos($body, "]]>");
- if (($body) && ($a!==false) && ($b!==false)) {
- $body = substr($body, $a+8, $b-($a+8));
+ if (($body) && ($a !== false) && ($b !== false)) {
+ $body = substr($body, $a + 8, $b - ($a + 8));
}
$odd->setBody($body);
@@ -54,6 +55,7 @@ function ODD_factory(XmlElement $element) {
* Import an ODD document.
*
* @param string $xml The XML ODD.
+ *
* @return ODDDocument
*/
function ODD_Import($xml) {
@@ -92,7 +94,8 @@ function ODD_Import($xml) {
* Export an ODD Document.
*
* @param ODDDocument $document The Document.
- * @param ODDWrapperFactory $wrapper Optional wrapper permitting the export process to embed ODD in other document formats.
+ *
+ * @return string
*/
function ODD_Export(ODDDocument $document) {
return "$document";