From 3cdedccdeb01642d59ebe60dc0390d50f1080878 Mon Sep 17 00:00:00 2001 From: Nigel Banks Date: Sun, 13 Feb 2011 13:43:20 -0400 Subject: [PATCH 01/19] ISLANDORA-192: Checked to see if [1], is set before using it. --- ObjectHelper.inc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ObjectHelper.inc b/ObjectHelper.inc index 9b24f088..99fd719c 100644 --- a/ObjectHelper.inc +++ b/ObjectHelper.inc @@ -1017,7 +1017,8 @@ class ObjectHelper { $matches =str_getcsv(join("\n",$result)); if ($matches !== NULL) { $parent = preg_replace('/^info:fedora\//','',$matches[0]); - $breadcrumbs[] = l($matches[1], 'fedora/repository/' . $pid); + $text = isset($matches[1]) ? $matches[1] : ''; + $breadcrumbs[] = l($text, 'fedora/repository/' . $pid); if ($parent == variable_get('fedora_repository_pid', 'islandora:top')) { $breadcrumbs[] = l(t('Home'), ''); // l(t('Digital repository'), 'fedora/repository'); } elseif ($level > 0) { From 1b5784e4e104f2c23951bc79eb24d5d6f890d7d5 Mon Sep 17 00:00:00 2001 From: Nigel Banks Date: Sun, 13 Feb 2011 18:19:00 -0400 Subject: [PATCH 02/19] Changed the content model to support the new form format. --- islandoracm.xsd | 515 +++++++++++++++++++++++++++++++++--------------- 1 file changed, 352 insertions(+), 163 deletions(-) diff --git a/islandoracm.xsd b/islandoracm.xsd index 204c198c..1971e8d2 100644 --- a/islandoracm.xsd +++ b/islandoracm.xsd @@ -1,167 +1,356 @@ - - - + + + Islandora Content Model Schema Islandora, Robertson Library, University of Prince Edward Island, 550 University Ave., Charlottetown, Prince Edward Island - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 2ec401e7dfabddacba3ab0f836011bcf1f988f3b Mon Sep 17 00:00:00 2001 From: Nigel Banks Date: Sun, 13 Feb 2011 22:06:08 -0400 Subject: [PATCH 03/19] New formatting. --- islandoracm.xsd | 131 +++++++++++++++++++++++++----------------------- 1 file changed, 69 insertions(+), 62 deletions(-) diff --git a/islandoracm.xsd b/islandoracm.xsd index 1971e8d2..89d44f46 100644 --- a/islandoracm.xsd +++ b/islandoracm.xsd @@ -189,143 +189,119 @@ - + - + - - + - + - - - + - - + - + - - + - - + - + - - + - - + - + - - + - - + - + - - + - - + - + - - + - - + - + - + - - + - + - - - - + + - - - - + - - + + @@ -353,4 +329,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From a0d16be879d728506ae7fffeafe041ed9983d51d Mon Sep 17 00:00:00 2001 From: Nigel Banks Date: Wed, 16 Feb 2011 14:08:03 -0400 Subject: [PATCH 04/19] Content Model can now list form names, updated islandoracm.xsd to reflex the new form structure. --- ContentModel.inc | 20 ++++++++++++++++++++ islandoracm.xsd | 14 ++++++++------ 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/ContentModel.inc b/ContentModel.inc index 5ed33d59..8f0d1df5 100644 --- a/ContentModel.inc +++ b/ContentModel.inc @@ -2013,4 +2013,24 @@ class ContentModel extends XMLDatastream { } return $ret; } + + /** + * + * @return array + * An array of form names that exist in this content model. + */ + public function getFormNames() { + if (!$this->validate()) { + return FALSE; + } + $xpath = new DOMXPath($this->xml); + $xpath->registerNamespace('cm', 'http://www.islandora.ca'); + $result = $xpath->query('//cm:forms/cm:form/@name'); // Select the name attribute of all forms. + for($i = 0; $i < $result->length; $i++) { + $attribute = $result->item($i); + $name = $attribute->value; + $names[$name] = $name; + } + return $names; + } } diff --git a/islandoracm.xsd b/islandoracm.xsd index 89d44f46..d199d8ee 100644 --- a/islandoracm.xsd +++ b/islandoracm.xsd @@ -344,20 +344,22 @@ - + - - - + - + + + + + + From 6f1786f53dbf2bbcdcb84a56cc0ead84531d03ec Mon Sep 17 00:00:00 2001 From: Nigel Banks Date: Thu, 17 Feb 2011 12:46:55 -0400 Subject: [PATCH 05/19] Added support for changing islandora_form_builder form elements. --- ContentModel.inc | 132 +++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 128 insertions(+), 4 deletions(-) diff --git a/ContentModel.inc b/ContentModel.inc index 8f0d1df5..071718fb 100644 --- a/ContentModel.inc +++ b/ContentModel.inc @@ -11,6 +11,7 @@ class ContentModel extends XMLDatastream { private $mimes = NULL; public $pid_namespace; public $name; + private $xpath; /** * Gets the default DSID to use for ContentModel datastreams. @@ -223,8 +224,9 @@ class ContentModel extends XMLDatastream { public function __construct($xmlStr, $pid = NULL, $dsid = NULL, $pid_namespace = NULL, $name = NULL) { parent::__construct($xmlStr, $pid, $dsid); $this->pid_namespace = $pid_namespace; - $this->name = ($name == NULL)?'Islandora Content Model':$name; + $this->xpath = new DOMXPath($this->xml); + $this->xpath->registerNamespace('cm', 'http://www.islandora.ca'); } /** @@ -2023,9 +2025,7 @@ class ContentModel extends XMLDatastream { if (!$this->validate()) { return FALSE; } - $xpath = new DOMXPath($this->xml); - $xpath->registerNamespace('cm', 'http://www.islandora.ca'); - $result = $xpath->query('//cm:forms/cm:form/@name'); // Select the name attribute of all forms. + $result = $this->xpath->query('//cm:forms/cm:form/@name'); // Select the name attribute of all forms. for($i = 0; $i < $result->length; $i++) { $attribute = $result->item($i); $name = $attribute->value; @@ -2033,4 +2033,128 @@ class ContentModel extends XMLDatastream { } return $names; } + + /** + * Removes the named form. + * + * @param string $name + * Name of the form to remove. + * + * @return boolean + * TRUE on success, FALSE otherwise. + */ + public function removeForm($name) { + $result = $this->xpath->query("//cm:form[@name='$name']"); + if ($result->length == 1) { + $form = $result->item(0); + $form->parentNode->removeChild($form); + return TRUE; + } + return FALSE; + } + + /** + * Adds the named form. + * + * @param string $name + * Name of the form to add. + * + * @return boolean + * TRUE on success, FALSE otherwise. + */ + public function addForm($name) { + $result = $this->xpath->query("//cm:form[@name='$name']"); + if ($result->length != 0) { + return FALSE; // Already Exists. + } + $result = $this->xpath->query("//cm:forms"); + if ($result->length == 0) { // Forms doesn't exist + $forms = $this->xml->createElement('forms'); + $form = $this->xml->createElement('form'); + $form->setAttribute('name', $name); + $forms->appendChild($form); + $result = $this->xpath->query("//cm:content_model"); + $result->item(0)->appendChild($forms); + return TRUE; + } + else { // Forms exists just create form. + $form = $this->xml->createElement($name); + $form->setAttribute('name', $name); + $result->item(0)->appendChild($form); + return TRUE; + } + } + + /** + * + * @param $element_definition + * @param $parent_element + * @return + */ + public function addElementToForm($element, $parent_element) { + $element = $this->xml->importNode($element, TRUE); + $parent_element->appendChild($element); + return TRUE; + } + + /** + * + * @param $element_definition + * @param $parent_element + */ + public function editFormElement($new_element, $edit_element) { + $new_element = $this->xml->importNode($new_element, TRUE); + $this->insertElementInPlace($new_element, $edit_element); + $edit_element->parentNode->removeChild($edit_element); + return TRUE; + } + + /** + * + * @param $new_element + * @param $element + */ + private function insertElementInPlace($new_element, $element) { + $next = $element->nextSibling; + if ($next) { + $element->parentNode->insertBefore($new_element, $next); + } + else { + $element->parentNode->appendChild($new_element); + } + } + + /** + * + * @param $form_element + * @return + */ + public function incFormElement($form_element) { + $prev = $form_element; + $name = $prev->getAttribute('name'); + while ($prev = $prev->previousSibling) { + if (get_class($prev) == 'DOMElement') { + $form_element->parentNode->insertBefore($form_element, $prev); + break; + } + } + return TRUE; + } + + /** + * + * @param $form_element + * @return + */ + public function decFormElement($form_element) { + $next = $form_element; + while ($next = $next->nextSibling) { + if (get_class($next) == 'DOMElement') { + $this->insertElementInPlace($form_element, $next); + break; + } + } + return TRUE; + } + } From 142335ef3992d94768a9906ae578a1b8ccfda424 Mon Sep 17 00:00:00 2001 From: Nigel Banks Date: Thu, 17 Feb 2011 15:10:22 -0400 Subject: [PATCH 06/19] Latest changes to the content model for islandora_form_builder_support. --- ContentModel.inc | 41 ++++++++++++++++++++++++++++------------- islandoracm.xsd | 4 ++++ 2 files changed, 32 insertions(+), 13 deletions(-) diff --git a/ContentModel.inc b/ContentModel.inc index 071718fb..51f18ab9 100644 --- a/ContentModel.inc +++ b/ContentModel.inc @@ -2056,33 +2056,48 @@ class ContentModel extends XMLDatastream { /** * Adds the named form. * - * @param string $name + * @param string $element * Name of the form to add. * * @return boolean * TRUE on success, FALSE otherwise. */ - public function addForm($name) { - $result = $this->xpath->query("//cm:form[@name='$name']"); - if ($result->length != 0) { - return FALSE; // Already Exists. - } + public function addForm($element) { $result = $this->xpath->query("//cm:forms"); if ($result->length == 0) { // Forms doesn't exist $forms = $this->xml->createElement('forms'); - $form = $this->xml->createElement('form'); - $form->setAttribute('name', $name); - $forms->appendChild($form); + $element = $this->xml->importNode($element); + $forms->appendChild($element); $result = $this->xpath->query("//cm:content_model"); $result->item(0)->appendChild($forms); return TRUE; } - else { // Forms exists just create form. - $form = $this->xml->createElement($name); - $form->setAttribute('name', $name); - $result->item(0)->appendChild($form); + else if ($result->length == 1) { + $element = $this->xml->importNode($element); + $result->item(0)->appendChild($element); return TRUE; } + return FALSE; + } + + + /** + * Edits a form element with attribute name='$name' from the 'forms' element. + * + * @param String $name + */ + public function editForm($name, $element) { + if (!$this->validate()) { + return FALSE; + } + $result = $this->xpath->query("//cm:form[@name='$name']"); + if($result->length == 1) { + $element = $this->xml->importNode($element); + $form = $result->item(0); + $form->parentNode->replaceChild($element, $form); + return TRUE; + } + return FALSE; } /** diff --git a/islandoracm.xsd b/islandoracm.xsd index d199d8ee..89194b6e 100644 --- a/islandoracm.xsd +++ b/islandoracm.xsd @@ -182,6 +182,10 @@ + + + + From 03bc6bdeff3573dd7235f338c88dbbf849fe4f4f Mon Sep 17 00:00:00 2001 From: Nigel Banks Date: Sat, 19 Feb 2011 16:21:58 -0400 Subject: [PATCH 07/19] Added a function for getting a named form. --- ContentModel.inc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/ContentModel.inc b/ContentModel.inc index 51f18ab9..bbbb5546 100644 --- a/ContentModel.inc +++ b/ContentModel.inc @@ -2016,6 +2016,19 @@ class ContentModel extends XMLDatastream { return $ret; } + /** + * Find the form element with name $name. + * + * @param string $name + * The name of the form element to find. + * @return DOMElement + * The form element $name, if found FALSE otherwise. + */ + public function getForm($name) { + $result = $this->xpath->query("//cm:form[@name='$name']"); + return $result->length == 1 ? $result->item(0) : FALSE; + } + /** * * @return array From 9635c23c704784fb963e69e263229fb5f6ccd88e Mon Sep 17 00:00:00 2001 From: Nigel Banks Date: Mon, 21 Feb 2011 08:52:19 -0400 Subject: [PATCH 08/19] Fixes for the content modeler. Lists have become sets. --- ContentModel.inc | 20 +++++++++++++++++--- islandoracm.xsd | 48 +++++++++++++++++++++++++----------------------- 2 files changed, 42 insertions(+), 26 deletions(-) diff --git a/ContentModel.inc b/ContentModel.inc index bbbb5546..4650d1ad 100644 --- a/ContentModel.inc +++ b/ContentModel.inc @@ -2105,8 +2105,13 @@ class ContentModel extends XMLDatastream { } $result = $this->xpath->query("//cm:form[@name='$name']"); if($result->length == 1) { - $element = $this->xml->importNode($element); $form = $result->item(0); + $result = $this->xpath->query("child::node()", $form); + $element = $this->xml->importNode($element); + for($i = 0; $i < $result->length; $i++) { + $child = $result->item($i); + $element->appendChild($child); + } $form->parentNode->replaceChild($element, $form); return TRUE; } @@ -2132,8 +2137,17 @@ class ContentModel extends XMLDatastream { */ public function editFormElement($new_element, $edit_element) { $new_element = $this->xml->importNode($new_element, TRUE); - $this->insertElementInPlace($new_element, $edit_element); - $edit_element->parentNode->removeChild($edit_element); + $name = $new_element->tagName; + $result = $new_element->getElementsByTagName('content'); + if($result->length == 1) { + $new_content = $result->item(0); + $result = $this->xpath->query("child::cm:content/child::node()", $edit_element); + for($i = 0; $i < $result->length; $i++) { + $child = $result->item($i); + $new_content->appendChild($child); + } + } + $edit_element->parentNode->replaceChild($new_element, $edit_element); return TRUE; } diff --git a/islandoracm.xsd b/islandoracm.xsd index 89194b6e..7bbf8daa 100644 --- a/islandoracm.xsd +++ b/islandoracm.xsd @@ -193,45 +193,46 @@ - + - - + + - + - + - + - + - + @@ -239,73 +240,74 @@ - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + From 0d1589e7604ea9da4da32f96336cfa0095224ca3 Mon Sep 17 00:00:00 2001 From: Nigel Banks Date: Wed, 23 Feb 2011 09:07:35 -0400 Subject: [PATCH 09/19] Allow hidden elements to have content. --- islandoracm.xsd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/islandoracm.xsd b/islandoracm.xsd index 7bbf8daa..893f1e10 100644 --- a/islandoracm.xsd +++ b/islandoracm.xsd @@ -305,8 +305,8 @@ - + + From 56c65922242de16988e81efce553198e5bf6fde8 Mon Sep 17 00:00:00 2001 From: jonathangreen Date: Tue, 22 Mar 2011 14:15:13 -0300 Subject: [PATCH 10/19] Change to fedora_utils to add fixdsid function. It cleans a DSID so fedora will accept it. --- api/fedora_utils.inc | 47 ++++++++++++++++++++++++++++++++------------ 1 file changed, 34 insertions(+), 13 deletions(-) diff --git a/api/fedora_utils.inc b/api/fedora_utils.inc index 97612595..5b144b21 100644 --- a/api/fedora_utils.inc +++ b/api/fedora_utils.inc @@ -88,20 +88,41 @@ function fix_encoding($in_str) { } } - function validPid($pid) { - $valid = FALSE; - if (strlen(trim($pid)) <= 64 && preg_match('/^([A-Za-z0-9]|-|\.)+:(([A-Za-z0-9])|-|\.|~|_|(%[0-9A-F]{2}))+$/', trim($pid))) { - $valid = TRUE; - } - - return $valid; +function validPid($pid) { + $valid = FALSE; + if (strlen(trim($pid)) <= 64 && preg_match('/^([A-Za-z0-9]|-|\.)+:(([A-Za-z0-9])|-|\.|~|_|(%[0-9A-F]{2}))+$/', trim($pid))) { + $valid = TRUE; } - function validDsid($dsid) { - $valid = FALSE; - if (strlen(trim($dsid)) <= 64 && preg_match('/^[a-zA-Z0-9\_\-\.]+$/', trim($dsid))) { - $valid = TRUE; - } + return $valid; +} - return $valid; +function validDsid($dsid) { + $valid = FALSE; + if (strlen(trim($dsid)) <= 64 && preg_match('/^[a-zA-Z0-9\_\-\.]+$/', trim($dsid))) { + $valid = TRUE; } + + return $valid; +} + +function fixDsid($dsid) { + $new_dsid = trim($dsid); + + $find = '/[^a-zA-Z0-9\.\_\-]/'; + $replace = ''; + $new_dsid = preg_replace($find, $replace, $new_dsid); + + if( strlen($new_dsid) > 63 ) + $new_dsid = substr($new_dsid, -63); + + if( preg_match('/^[^a-zA-Z]/', $dsid ) ) + $new_dsid = 'x' . $new_dsid; + + if( strlen($new_dsid) == 0 ) + $new_dsid = 'item' . rand(1, 100); + + return $new_dsid; + +} + From 4c51598ebac49fe9108e73117907578227d81e1b Mon Sep 17 00:00:00 2001 From: jonathangreen Date: Tue, 22 Mar 2011 14:24:13 -0300 Subject: [PATCH 11/19] Defined names in contentmodel.inc so that if no content model is defined PHP doesn't complain about using undefined variables --- ContentModel.inc | 1 + 1 file changed, 1 insertion(+) diff --git a/ContentModel.inc b/ContentModel.inc index 4650d1ad..c82baf89 100644 --- a/ContentModel.inc +++ b/ContentModel.inc @@ -2038,6 +2038,7 @@ class ContentModel extends XMLDatastream { if (!$this->validate()) { return FALSE; } + $names = FALSE; $result = $this->xpath->query('//cm:forms/cm:form/@name'); // Select the name attribute of all forms. for($i = 0; $i < $result->length; $i++) { $attribute = $result->item($i); From 365c7d3d5d0f1ba77068b740206b258ea9531685 Mon Sep 17 00:00:00 2001 From: Nigel Banks Date: Fri, 25 Mar 2011 18:31:39 -0300 Subject: [PATCH 12/19] Added auto-complete to the forms definition. --- islandoracm.xsd | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/islandoracm.xsd b/islandoracm.xsd index 893f1e10..8735c33c 100644 --- a/islandoracm.xsd +++ b/islandoracm.xsd @@ -213,6 +213,8 @@ + @@ -250,6 +252,8 @@ + @@ -284,6 +288,10 @@ + + From 7cd71e6f871cc1502da04a9f1c8b2bae615fc9eb Mon Sep 17 00:00:00 2001 From: Nigel Banks Date: Mon, 28 Mar 2011 09:59:36 -0300 Subject: [PATCH 13/19] Allow for the specification of custom ingest/edit form builders --- islandoracm.xsd | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/islandoracm.xsd b/islandoracm.xsd index 8735c33c..f6bb93d8 100644 --- a/islandoracm.xsd +++ b/islandoracm.xsd @@ -182,10 +182,16 @@ - - - + + + + + + + + + From 01e984a7f8a58872ef879ea873b3753b7c32a608 Mon Sep 17 00:00:00 2001 From: Nigel Banks Date: Mon, 28 Mar 2011 10:59:09 -0300 Subject: [PATCH 14/19] Changed attributes for form tag so that edit/ingest declartions aren't required. --- islandoracm.xsd | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/islandoracm.xsd b/islandoracm.xsd index f6bb93d8..8fc5c0ef 100644 --- a/islandoracm.xsd +++ b/islandoracm.xsd @@ -186,12 +186,12 @@ - - - - - - + + + + + + From 0ca2c50681e8c7b3a5a1878a3189d252ca2ddd69 Mon Sep 17 00:00:00 2001 From: Nigel Banks Date: Mon, 28 Mar 2011 13:31:18 -0300 Subject: [PATCH 15/19] Added functions to select form names based on wether they are ingest or edit forms. --- ContentModel.inc | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/ContentModel.inc b/ContentModel.inc index 4650d1ad..dd8913e2 100644 --- a/ContentModel.inc +++ b/ContentModel.inc @@ -2047,6 +2047,42 @@ class ContentModel extends XMLDatastream { return $names; } + /** + * + * @return array + * An array of form names that exist in this content model. + */ + public function getIngestFormNames() { + if (!$this->validate()) { + return FALSE; + } + $result = $this->xpath->query('//cm:forms/cm:form[@ingest_class and @ingest_file and @ingest_module]/@name'); // Select the name attribute of all forms. + for($i = 0; $i < $result->length; $i++) { + $attribute = $result->item($i); + $name = $attribute->value; + $names[$name] = $name; + } + return $names; + } + + /** + * + * @return array + * An array of form names that exist in this content model. + */ + public function getEditFormNames() { + if (!$this->validate()) { + return FALSE; + } + $result = $this->xpath->query('//cm:forms/cm:form[@edit_class and @edit_file and @edit_module]/@name'); // Select the name attribute of all forms. + for($i = 0; $i < $result->length; $i++) { + $attribute = $result->item($i); + $name = $attribute->value; + $names[$name] = $name; + } + return $names; + } + /** * Removes the named form. * From f573c765d03ecc5de5f46ac5ca2ad78daf21926c Mon Sep 17 00:00:00 2001 From: Alexander O'Neill Date: Mon, 18 Apr 2011 16:08:16 -0300 Subject: [PATCH 16/19] Remove NMLT codebase from core. --- plugins/nmlt/cck/scorm_fedora_type.txt | 223 ----------- .../nmlt_collection_policy.xml | 22 -- .../nmlt_collection_view.xslt | 23 -- plugins/nmlt/collection_policies/query.txt | 5 - .../content_models/islandora_SCORMCModel.xml | 20 - plugins/nmlt/fedora_nmlt.info | 9 - plugins/nmlt/fedora_nmlt.install | 48 --- plugins/nmlt/fedora_nmlt.module | 12 - plugins/nmlt/scorm.inc | 369 ------------------ 9 files changed, 731 deletions(-) delete mode 100644 plugins/nmlt/cck/scorm_fedora_type.txt delete mode 100644 plugins/nmlt/collection_policies/nmlt_collection_policy.xml delete mode 100644 plugins/nmlt/collection_policies/nmlt_collection_view.xslt delete mode 100644 plugins/nmlt/collection_policies/query.txt delete mode 100644 plugins/nmlt/content_models/islandora_SCORMCModel.xml delete mode 100644 plugins/nmlt/fedora_nmlt.info delete mode 100644 plugins/nmlt/fedora_nmlt.install delete mode 100644 plugins/nmlt/fedora_nmlt.module delete mode 100644 plugins/nmlt/scorm.inc diff --git a/plugins/nmlt/cck/scorm_fedora_type.txt b/plugins/nmlt/cck/scorm_fedora_type.txt deleted file mode 100644 index 1679dc0b..00000000 --- a/plugins/nmlt/cck/scorm_fedora_type.txt +++ /dev/null @@ -1,223 +0,0 @@ -$content['type'] = array ( - 'name' => 'SCORM Repository Item', - 'type' => 'repository_item', - 'description' => 'Contains a reference to an item in the Fedora repository. The item will be fully rendered when a user views the node. Comments and other node-attached content can then be added to the node page.', - 'title_label' => 'Title', - 'body_label' => 'Body', - 'min_word_count' => '0', - 'help' => '', - 'node_options' => - array ( - 'status' => true, - 'promote' => true, - 'sticky' => false, - 'revision' => false, - ), - 'upload' => '1', - 'old_type' => 'repository_item', - 'orig_type' => '', - 'module' => 'node', - 'custom' => '1', - 'modified' => '1', - 'locked' => '0', - 'comment' => '2', - 'comment_default_mode' => '4', - 'comment_default_order' => '1', - 'comment_default_per_page' => '50', - 'comment_controls' => '3', - 'comment_anonymous' => 0, - 'comment_subject_field' => '1', - 'comment_preview' => '1', - 'comment_form_location' => '0', - 'fivestar' => 1, - 'fivestar_stars' => '5', - 'fivestar_labels_enable' => 1, - 'fivestar_label_0' => 'Cancel rating', - 'fivestar_label_1' => 'Poor', - 'fivestar_label_2' => 'Okay', - 'fivestar_label_3' => 'Good', - 'fivestar_label_4' => 'Great', - 'fivestar_label_5' => 'Awesome', - 'fivestar_label_6' => 'Give it @star/@count', - 'fivestar_label_7' => 'Give it @star/@count', - 'fivestar_label_8' => 'Give it @star/@count', - 'fivestar_label_9' => 'Give it @star/@count', - 'fivestar_label_10' => 'Give it @star/@count', - 'fivestar_style' => 'average', - 'fivestar_text' => 'dual', - 'fivestar_title' => 1, - 'fivestar_feedback' => 1, - 'fivestar_unvote' => 1, - 'fivestar_position_teaser' => 'hidden', - 'fivestar_position' => 'below', -); -$content['fields'] = array ( - 0 => - array ( - 'label' => 'SCORM Object', - 'field_name' => 'field_scorm_obj', - 'type' => 'filefield', - 'widget_type' => 'SCORM_widget', - 'change' => 'Change basic information', - 'weight' => '-3', - 'file_extensions' => 'zip', - 'progress_indicator' => 'bar', - 'file_path' => '', - 'max_filesize_per_file' => '', - 'max_filesize_per_node' => '', - 'description' => 'Embed a SCORM object into this node.', - 'required' => 0, - 'multiple' => '0', - 'list_field' => '0', - 'list_default' => 1, - 'description_field' => '0', - 'op' => 'Save field settings', - 'module' => 'filefield', - 'widget_module' => 'SCORM', - 'columns' => - array ( - 'fid' => - array ( - 'type' => 'int', - 'not null' => false, - 'views' => true, - ), - 'list' => - array ( - 'type' => 'int', - 'size' => 'tiny', - 'not null' => false, - 'views' => true, - ), - 'data' => - array ( - 'type' => 'text', - 'serialize' => true, - 'views' => true, - ), - ), - 'display_settings' => - array ( - 'label' => - array ( - 'format' => 'above', - 'exclude' => 0, - ), - 'teaser' => - array ( - 'format' => 'SCORM_embedded', - 'exclude' => 0, - ), - 'full' => - array ( - 'format' => 'SCORM_embedded', - 'exclude' => 0, - ), - 4 => - array ( - 'format' => 'SCORM_embedded', - 'exclude' => 0, - ), - 2 => - array ( - 'format' => 'SCORM_embedded', - 'exclude' => 0, - ), - 3 => - array ( - 'format' => 'SCORM_embedded', - 'exclude' => 0, - ), - ), - ), - 1 => - array ( - 'label' => 'Fedora Object Reference', - 'field_name' => 'field_fedora_pid_reference', - 'type' => 'pidfield', - 'widget_type' => 'pidfield_widget', - 'change' => 'Change basic information', - 'weight' => '-2', - 'size' => '60', - 'description' => 'A Fedora object PID that this node references.', - 'default_value' => - array ( - 0 => - array ( - 'value' => '', - '_error_element' => 'value', - ), - ), - 'default_value_php' => '', - 'default_value_widget' => - array ( - 'field_fedora_pid_reference' => - array ( - 0 => - array ( - 'value' => '', - '_error_element' => 'value', - ), - ), - ), - 'required' => 0, - 'multiple' => '0', - 'max_length' => '64', - 'op' => 'Save field settings', - 'module' => 'pidfield', - 'widget_module' => 'pidfield', - 'columns' => - array ( - 'value' => - array ( - 'type' => 'varchar', - 'length' => '64', - 'not null' => false, - 'sortable' => true, - 'views' => true, - ), - ), - 'display_settings' => - array ( - 'label' => - array ( - 'format' => 'above', - 'exclude' => 0, - ), - 'teaser' => - array ( - 'format' => 'default', - 'exclude' => 0, - ), - 'full' => - array ( - 'format' => 'default', - 'exclude' => 0, - ), - 4 => - array ( - 'format' => 'default', - 'exclude' => 0, - ), - 2 => - array ( - 'format' => 'default', - 'exclude' => 0, - ), - 3 => - array ( - 'format' => 'default', - 'exclude' => 0, - ), - ), - ), -); -$content['extra'] = array ( - 'title' => '-5', - 'body_field' => '-1', - 'revision_information' => '0', - 'comment_settings' => '3', - 'menu' => '-4', - 'path' => '1', - 'attachments' => '2', -); diff --git a/plugins/nmlt/collection_policies/nmlt_collection_policy.xml b/plugins/nmlt/collection_policies/nmlt_collection_policy.xml deleted file mode 100644 index 4e0df197..00000000 --- a/plugins/nmlt/collection_policies/nmlt_collection_policy.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - dc.title - dc.creator - dc.description - dc.date - dc.identifier - dc.language - dc.publisher - dc.rights - dc.subject - dc.relation - dcterms.temporal - dcterms.spatial - Full Text - - isMemberOfCollection - diff --git a/plugins/nmlt/collection_policies/nmlt_collection_view.xslt b/plugins/nmlt/collection_policies/nmlt_collection_view.xslt deleted file mode 100644 index 11041e12..00000000 --- a/plugins/nmlt/collection_policies/nmlt_collection_view.xslt +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/plugins/nmlt/collection_policies/query.txt b/plugins/nmlt/collection_policies/query.txt deleted file mode 100644 index 37c6638a..00000000 --- a/plugins/nmlt/collection_policies/query.txt +++ /dev/null @@ -1,5 +0,0 @@ -select $object $title from <#ri> - where ($object $title - and ($object ) - and $object ) - order by $title \ No newline at end of file diff --git a/plugins/nmlt/content_models/islandora_SCORMCModel.xml b/plugins/nmlt/content_models/islandora_SCORMCModel.xml deleted file mode 100644 index 241de3d1..00000000 --- a/plugins/nmlt/content_models/islandora_SCORMCModel.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - application/zip - - - - application/zip - - - - - - - - - - - - - diff --git a/plugins/nmlt/fedora_nmlt.info b/plugins/nmlt/fedora_nmlt.info deleted file mode 100644 index 28b22363..00000000 --- a/plugins/nmlt/fedora_nmlt.info +++ /dev/null @@ -1,9 +0,0 @@ -; $Id$ -name = Islandora NMLT -description = Provides SCORM learning object support for Islandora -package = Fedora Repository -dependencies[] = fedora_repository -dependencies[] = content_copy -dependencies[] = SCORM -version = 6.1dev -core = 6.x diff --git a/plugins/nmlt/fedora_nmlt.install b/plugins/nmlt/fedora_nmlt.install deleted file mode 100644 index 55d699f2..00000000 --- a/plugins/nmlt/fedora_nmlt.install +++ /dev/null @@ -1,48 +0,0 @@ -', '', $file); -} - -function fedora_nmlt_enable() { - // Set the module weight so it can override other modules. - db_query("UPDATE {system} SET weight = 50 WHERE name = 'fedora_nmlt'"); -} - -/** - * Programmatically create CCK fields and types using the content copy module - * @param $type string - * content type to create, defaults to new type, if type exists, only fields will be added - * @param $macro array - * exported array from content types -> export. If file is not specified, macro will be used - * @param $file string - * path to file containing content copy exported macro data structure. no escaping needed. - */ -function fedora_nmlt_import_content_type($type = '', $macro = '', $file = '') { - if(!module_exists("content_copy")){ - drupal_set_message('Programmatically creating CCK fields requires the Content Copy module. Exiting.'); - return; - } - - include_once( $_SERVER['DOCUMENT_ROOT'].'/'. drupal_get_path('module', 'content') .'/includes/content.admin.inc'); - include_once( $_SERVER['DOCUMENT_ROOT'].'/'. drupal_get_path('module', 'node') .'/content_types.inc'); - - $values = array(); - $values['type_name'] = $type; - if($file){ - if(file_exists($file)){ - $values['macro'] = file_get_contents($file); - }else{ - drupal_set_message('Unable to read input file for import. Exiting.'); - return; - } - }elseif($macro){ - $values['macro'] = $macro; - } - $form_state = array(); - $form_state['values'] = $values; - //drupal_set_message('
DEBUG: '.print_r($values['macro'],1).'
'); - drupal_execute("content_copy_import_form", $form_state); - content_clear_type_cache(); -} \ No newline at end of file diff --git a/plugins/nmlt/fedora_nmlt.module b/plugins/nmlt/fedora_nmlt.module deleted file mode 100644 index 427bcc49..00000000 --- a/plugins/nmlt/fedora_nmlt.module +++ /dev/null @@ -1,12 +0,0 @@ - 'Results', - 'page callback' => 'scorm_show_results', - 'page arguments' => array(1), - 'access callback' => user_access('use scorm'), - 'type' => MENU_NORMAL_ITEM, - ); - return $items; -} \ No newline at end of file diff --git a/plugins/nmlt/scorm.inc b/plugins/nmlt/scorm.inc deleted file mode 100644 index 13c77f4c..00000000 --- a/plugins/nmlt/scorm.inc +++ /dev/null @@ -1,369 +0,0 @@ -pid = $pid; - $this->item = new Fedora_Item($pid); - } - } - - public function buildIngestForm($form = array(), $form_state = array()) { - $form['bulk_ingest_location'] = array( - '#title' => 'Bulk ingest location', - '#type' => 'textfield', - '#size' => 60, - '#description' => "Server location from which to upload SCORM objects. Leave this blank if you are uploading a single file.", - ); - return $form; - } - - public function buildEditMetadataForm($form = array()) { - - $form['submit'] = array( - '#type' => 'submit', - '#weight' => 10, - '#value' => 'Update' - ); - $form['pid'] = array( - '#type' => 'hidden', - '#value' => $this->pid, - ); - $form['dsid'] = array( - '#type' => 'hidden', - '#value' => "DARWIN_CORE", - ); - - return $this->buildDrupalForm($form); - } - - public function handleEditMetadataForm($form_id, $form_values) { - /* - * Process the metadata form - * Update the datastreams - */ - - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); - module_load_include('inc', 'fedora_repository', 'plugins/DarwinCore'); - module_load_include('inc', 'fedora_repository', 'MimeClass'); - global $user; - $mimetype = new MimeClass(); - $dwc = new DarwinCore($this->item); - $dwc->handleForm($form_values); - $this->item->purge_datastream('DARWIN_CORE'); - $this->item->add_datastream_from_string($dwc->darwinCoreXML, 'DARWIN_CORE', - 'Darwin Core Metadata', 'text/xml', 'X'); - return TRUE; - } - - /** - * process the metadata form - * Create fedora object - * Add the datastreams - */ - public function handleIngestForm($form_values) { - - module_load_include('inc', 'fedora_repository', 'MimeClass'); - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); - - global $user; - $mimetype = new MimeClass(); - $file_list = array(); - if (!empty($form_values['bulk_ingest_location'])) { - if ($scorm_dir = opendir($form_values['bulk_ingest_location'])) { - while (FALSE !== ($file_name = readdir($scorm_dir))) { - $ext = strrchr($file_name, '.'); - if ($ext == '.zip') { - - array_push($file_list, $form_values['bulk_ingest_location'] .'/'. $file_name); - } - } - closedir($scorm_dir); - sort($file_list); - } - } - else { - array_push($file_list, $form_values['ingest-file-location']); - } - scorm_create_scorm_objects($form_values['collection_pid'], $file_list, $form_values['content_model_pid'], $form_values['relationship'] ); - } - - public function showFieldSets() { - global $base_url; -// Try and get a node that references this object. - //$result = db_query("SELECT * FROM {content_node_field} nf INNER JOIN {content_node_field_instance} ni ON nf.field_name = ni.field_name WHERE nf.type='field_fedora_pid_reference'"); - - fedora_pidfield_redirect_to_node($this); - $tabset['my_tabset']['first_tab'] = array( - '#type' => 'tabpage', - '#title' => t('Description'), - ); - if (module_load_include('module', 'SCORM', 'SCORM')) { - $dest_array = explode('/', urldecode(drupal_get_destination())); - $nid = $dest_array[count($dest_array) - 1]; - $node = node_load($nid); - - $tabset = array(); - - $tabset['my_tabset'] = array( - '#type' => 'tabset', - ); - $tabset['my_tabset']['second_tab'] = array( - '#type' => 'tabpage', - '#title' => t('Results'), - '#content' => scorm_show_results($node), - ); - } - - - module_load_include('inc', 'fedora_repository', 'ObjectHelper'); - $obj = new ObjectHelper(); - $tabset['my_tabset']['first_tab']['tabset'] = array( - '#type' => 'tabset', - ); - - $tabset['my_tabset']['first_tab']['tabset']['view'] = array( - '#type' => 'tabpage', - '#title' => t('View'), - '#content' => $obj->getQDC($this->pid), - ); - if (fedora_repository_access(OBJECTHELPER :: $EDIT_FEDORA_METADATA, $this->pid, $user)) { - $editform = drupal_get_form('fedora_repository_edit_qdc_form', $this->pid, 'DC'); - $tabset['my_tabset']['first_tab']['tabset']['edit'] = array( - '#type' => 'tabpage', - '#title' => t('Edit'), - '#content' => $editform, - ); - - } - - return tabs_render($tabset); - } - - public function extractFile($filename) { - // Get a file from the zip and put it in a temporary location. - $tmpdir = sys_get_temp_dir(); - - exec("unzip $this->file $filename -d $tmpdir", $output); - if (file_exists($tmpdir.'/'.$filename)) { - return $tmpdir.'/'.$filename; - } - else { - return FALSE; - } - } - - private function _cleanUpHTML($html) { - - $tmp = substr($html, strpos($html, '')); - - return _filter_html($tmp, FILTER_HTML_STRIP); - - } - - public function _createSCORMObjectNode($scorm_file, $item) { - module_load_include('inc', 'node', 'node.pages'); // required\ - module_load_include('inc', 'fedora_repository', 'api/dublin_core'); - - global $user; - $node = array('type' => 'repository_item'); - $form_state = array(); - - $dc = new Dublin_Core($item); - $title = $dc->dc['dc:title'][0]; - if (empty($title)) { - $title = $pid; - } - $form_state['values']['title'] = $title; // node's title - - // Prepare the file field. - $mime = 'application/zip'; - $file = new stdClass(); - $file->filename = basename($scorm_file); - $file->filepath = $scorm_file; - $file->filemime = $mime; - $file->filesize = filesize($scorm_file); - - $file->uid = $user->uid; - $file->status = 0; - $file->timestamp = time(); - drupal_write_record('files', $file); - $file->fid = db_result(db_query("SELECT fid FROM {files} WHERE filepath = '%s'", $file->filepath)); - - - - // Create a drupal node that includes a SCORM object and reference to this Fedora PID. - // Drupal Content Type is SCORM Fedora Object. Fields are - // field_scorm_obj-0-value - // field_fedora_pid_reference-0-value - $form_state['values']['field_fedora_pid_reference'][0]['value'] = $item->pid; - /*$form_state['values']['field_scorm_obj'] = array ( - array( - 'fid' => $file->fid, - 'title' => basename($file->filename), - 'filename' => $file->filename, - 'filepath' => $file->filepath, - 'filesize' => $file->filesize, - 'mimetype' => $mime, - 'description' => basename($file->filename), - 'list' => 1, - ), - );*/ - $form_state['values']['op'] = t('Save'); // required value - drupal_execute('repository_item_node_form', $form_state, (object)$node); - - // you can probably configure the node-author in $form_state or $node, - // but i'm doing it this way to demonstrate the use of $form_state['nid']. - // the following lines aren't required, but otherwise the node-author will be "Anonymous" in this case. - $node = node_load($form_state['nid']); // nid from the node that gets created is set in $form_state['nid'] after drupal_execute() - $node->uid = $user->uid; // set author to the current user - $field = content_fields('field_scorm_obj', 'repository_item'); - // Load up the appropriate validators - //$validators = array_merge(filefield_widget_upload_validators($field), SCORM_widget_upload_validators($field)); - $validators = SCORM_widget_upload_validators($field); - // Where do we store the files? - $files_path = filefield_widget_file_path($field); - // Create the file object - $file = field_file_save_file($scorm_file, $validators, $files_path); - // Apply the file to the field - $file['data']['width'] = 640; - $file['data']['height'] = 480; - $node->field_scorm_obj = array(0 => $file); - $this->_processSCORMObject($file); - node_save($node); - return $node; - } - - private function _processSCORMObject($field) { - - $packagedata=scorm_validate_file($field['filepath']); - - $scorm->pkgtype = $packagedata->pkgtype; - $scorm->datadir = $packagedata->datadir; - $scorm->launch = $packagedata->launch; - $scorm->parse = 1; - - $scorm->timemodified = time(); - /* if (!scorm_external_link($scorm->reference)) { - $scorm->md5hash = md5_file($CFG->dataroot.'/'.$scorm->course.'/'.$scorm->reference); - } else { - $scorm->dir = $CFG->dataroot.'/'.$scorm->course.'/moddata/scorm'; - $scorm->md5hash = md5_file($scorm->dir.$scorm->datadir.'/'.basename($scorm->reference)); - }*/ - - $scorm = scorm_option2text($scorm); - //TODO: Implement form for user to set height and width for SCORM package - $scorm->width = '640'; - $scorm->height = '480'; - - if (!isset($scorm->whatgrade)) { - $scorm->whatgrade = 0; - } - $scorm->grademethod = ($scorm->whatgrade * 10) + $scorm->grademethod; - - //TODO: Do we need this fields: - $scorm->name="SCORM"; - $scorm->summary="SCORM 2004."; - $scorm->grademethod=''; - $scorm->maxgrade=100; - $scorm->maxattempt=0; - $scorm->updatefreq=0; - $scorm->course=1; - - - //At this point it is still empty - $scorm->version=''; - $scorm->skipview=0; - $scorm->hidebrowse=0; - $scorm->hidetoc=0; - $scorm->hidenav=0; - $scorm->auto=0; - $scorm->popup=0; - - //TODO: Do we still need it? - //$scorm->reference=$field->filepath; - - - //TODO: Remove MD5 field, we dont use it. - //$id = insert_record('scorm', $scorm); - - $result = db_query("INSERT INTO {scorm} - (course,name,nodereference,reference,summary,version,maxgrade,grademethod,whatgrade,maxattempt,updatefreq,md5hash,launch, - skipview,hidebrowse,hidetoc,hidenav,auto,popup,options,width,height,timemodified) - VALUES (%d,'%s',%d,'%s','%s','%s',%d,%d,%d,%d,%d,'%s',%d,%d,%d,%d,%d,%d,%d,'%s',%d,%d,%d)", $scorm->course, $scorm->name, NULL, NULL, $scorm->summary, $scorm->version, - $scorm->maxgrade, $scorm->grademethod, $scorm->whatgrade, $scorm->maxattempt, $scorm->updatefreq, NULL, $scorm->launch, $scorm->skipview, $scorm->hidebrowse, - $scorm->hidetoc, $scorm->hidenav, $scorm->auto, $scorm->popup, $scorm->options, $scorm->width, $scorm->height, $scorm->timemodified ); - - $id = db_last_insert_id('scorm', 'id'); //$id=mysql_insert_id(); - - //TODO: Test it on Linux - // Move SCORM from temp dir to scorm dir - - $storedir=file_directory_path() .'/SCORM'; - $path=$storedir .'/'. $id; - - if (!file_exists($storedir)) { - mkdir($storedir); - } - $res=mkdir($path); - if ($res==TRUE) { - full_copy($packagedata->tempdir, $path); - //rmdirr($packagedata->tempdir); - scorm_delete_files($packagedata->tempdir); - //Replace reference field with node field. - db_query("UPDATE {scorm} SET reference = '%s' WHERE id = %d", $field['fid'], $id); - } - else - return FALSE; - - - $scorm->id = $id; - //Parse SCORM manifest - $scorm->launch=scorm_parse_scorm($path, $scorm->id); - - //Save SCORM launch instance - db_query("UPDATE {scorm} SET launch = '%s' WHERE id = %d", $scorm->launch, $scorm->id); - - } -} - -function scorm_create_scorm_objects($collection_pid, $file_list = array(), $content_model_pid = 'islandora:SCORMCModel', $relationship = 'isMemberOfCollection') { - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); - - $batch = array( - 'title' => 'Ingesting SCORM objects', - 'operations' => array(), - 'file' => drupal_get_path('module', 'fedora_nmlt') .'/scorm.inc', - ); - - foreach ($file_list as $file_path) { - $batch['operations'][] = array('_create_single_SCORM_object', array($file_path, $collection_pid, $content_model_pid, $relationship)); - } - batch_set($batch); -} - -function _create_single_SCORM_object($file, $collection_pid, $content_model_pid, $relationship = 'isMemberOfCollection') { - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); - $url = parse_url(variable_get('fedora_base_url', 'http://localhost:8080/fedora')); - $fedora_host = ("{$url['scheme']}://{$url['host']}" . (!empty($url['port']) ? ":{$url['port']}/" : '/')); - $scorm2fedora_url = $fedora_host . 'scorm2fedora'; - $ch = curl_init($scorm2fedora_url); - curl_setopt($ch, CURLOPT_POSTFIELDS, array('scormfile' => "@{$file}")); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); - $post_result = curl_exec($ch); - curl_close($ch); - $scorm2fedora_result = json_decode($post_result); - $scorm_object_pid = $scorm2fedora_result->pid; - if (!empty($scorm_object_pid)) { - $scorm_object = new Fedora_Item($scorm_object_pid); - $scorm_object->add_relationship('hasModel', $content_model_pid, FEDORA_MODEL_URI); - $scorm_object->add_relationship($relationship, $collection_pid); - $scorm = new SCORMObject($scorm_object_pid); - $scorm->_createSCORMObjectNode($file, $scorm_object); - } -} \ No newline at end of file From ab3141e6397e8c7542b70df7af68b474a6864e9f Mon Sep 17 00:00:00 2001 From: Alan Stanley Date: Tue, 19 Apr 2011 08:48:49 -0300 Subject: [PATCH 17/19] ISLANDORA-247 Removed superfluous closing div tag --- ObjectHelper.inc | 2 +- fedora_repository.module | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ObjectHelper.inc b/ObjectHelper.inc index e84a297e..6bc4d8a9 100644 --- a/ObjectHelper.inc +++ b/ObjectHelper.inc @@ -345,7 +345,7 @@ class ObjectHelper { } $xsl = $proc->importStylesheet($xsl); $newdom = $proc->transformToDoc($input); - $output = $newdom->saveXML(); + $output = $newdom->saveHTML(); return $output; } diff --git a/fedora_repository.module b/fedora_repository.module index 10d48acd..4ed5cb4b 100644 --- a/fedora_repository.module +++ b/fedora_repository.module @@ -815,7 +815,7 @@ function fedora_repository_get_items($pid = NULL, $dsId = NULL, $collection = NU //the below is for islandlives we should be able to do this in the xslt though //$css=$path.'/stylesheets/container-large.css'; //drupal_add_css($css); - return tabs_render($cmodels_tabs) . ''; + return tabs_render($cmodels_tabs); } function fedora_repository_urlencode_string($str) { From 16b567540b7663a010ca2783c2e7746da36724b8 Mon Sep 17 00:00:00 2001 From: Alan Stanley Date: Tue, 19 Apr 2011 08:48:49 -0300 Subject: [PATCH 18/19] ISLANDORA-244 moved superfluous closing div tag --- ObjectHelper.inc | 2 +- fedora_repository.module | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ObjectHelper.inc b/ObjectHelper.inc index e84a297e..6bc4d8a9 100644 --- a/ObjectHelper.inc +++ b/ObjectHelper.inc @@ -345,7 +345,7 @@ class ObjectHelper { } $xsl = $proc->importStylesheet($xsl); $newdom = $proc->transformToDoc($input); - $output = $newdom->saveXML(); + $output = $newdom->saveHTML(); return $output; } diff --git a/fedora_repository.module b/fedora_repository.module index 10d48acd..4ed5cb4b 100644 --- a/fedora_repository.module +++ b/fedora_repository.module @@ -815,7 +815,7 @@ function fedora_repository_get_items($pid = NULL, $dsId = NULL, $collection = NU //the below is for islandlives we should be able to do this in the xslt though //$css=$path.'/stylesheets/container-large.css'; //drupal_add_css($css); - return tabs_render($cmodels_tabs) . ''; + return tabs_render($cmodels_tabs); } function fedora_repository_urlencode_string($str) { From 2a07621c981e5dbac57573f14ad5915fcc2c4758 Mon Sep 17 00:00:00 2001 From: Alan Stanley Date: Tue, 19 Apr 2011 09:42:36 -0300 Subject: [PATCH 19/19] ISLANDORA-246 Fixed incorrect method call --- plugins/map_viewer.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/map_viewer.inc b/plugins/map_viewer.inc index 2bf5abd8..0a1bda62 100644 --- a/plugins/map_viewer.inc +++ b/plugins/map_viewer.inc @@ -46,7 +46,7 @@ class ShowMapStreamsInFieldSets { '#type' => 'tabpage', '#title' => t('Description'), '#content' => $item->get_dissemination('islandora:mods2htmlSdef', 'mods2html') - . $objectHelper->getFormattedDatastreamList($this->pid, NULL, $item), + . $objectHelper->get_formatted_datastream_list($this->pid, NULL, $item), ); // Render the tabset. return tabs_render($tabset);