aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/opendd.php
diff options
context:
space:
mode:
Diffstat (limited to 'engine/lib/opendd.php')
-rw-r--r--engine/lib/opendd.php34
1 files changed, 21 insertions, 13 deletions
diff --git a/engine/lib/opendd.php b/engine/lib/opendd.php
index ae382881f..7d635a295 100644
--- a/engine/lib/opendd.php
+++ b/engine/lib/opendd.php
@@ -2,32 +2,34 @@
/**
* OpenDD PHP Library.
*
- * @package Elgg
- * @subpackage Core
- * @author Curverider Ltd
+ * @package Elgg.Core
+ * @subpackage ODD
* @version 0.4
- * @link http://elgg.org/
*/
+// @codingStandardsIgnoreStart
+
/**
* 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.
+ * @access private
*/
-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;
}
@@ -35,15 +37,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);
@@ -56,7 +58,9 @@ function ODD_factory(XmlElement $element) {
* Import an ODD document.
*
* @param string $xml The XML ODD.
+ *
* @return ODDDocument
+ * @access private
*/
function ODD_Import($xml) {
// Parse XML to an array
@@ -94,8 +98,12 @@ 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
+ * @access private
*/
function ODD_Export(ODDDocument $document) {
return "$document";
-} \ No newline at end of file
+}
+
+// @codingStandardsIgnoreEnd