Browse Source

Moved collection rendering into the content model.

pull/105/head
Alexander O'Neill 14 years ago
parent
commit
e0be6600e4
  1. 4
      CollectionClass.inc
  2. 4
      ContentModel.inc
  3. 6
      ObjectHelper.inc
  4. 9
      fedora_repository.module

4
CollectionClass.inc

@ -397,7 +397,7 @@ class CollectionClass {
return TRUE; return TRUE;
} }
function showFieldSets() { function showFieldSets($page_number) {
global $base_url; global $base_url;
@ -413,7 +413,7 @@ class CollectionClass {
$html = $objectHelper->renderCollection($results, $this->pid ); $html = $objectHelper->renderCollection($results, $this->pid, NULL, NULL, $page_number );

4
ContentModel.inc

@ -1437,7 +1437,7 @@ class ContentModel extends XMLDatastream {
* @param string $pid * @param string $pid
* @return string $output * @return string $output
*/ */
public function displayExtraFieldset($pid) { public function displayExtraFieldset($pid, $page_number) {
$output = ''; $output = '';
if ($this->validate()) { if ($this->validate()) {
$datastreams = $this->xml->getElementsByTagName('datastreams'); $datastreams = $this->xml->getElementsByTagName('datastreams');
@ -1467,7 +1467,7 @@ class ContentModel extends XMLDatastream {
self::$errors[] = 'Execute Form Handler: method \''. $className .'->'. $methodName .'\' does not exist.'; self::$errors[] = 'Execute Form Handler: method \''. $className .'->'. $methodName .'\' does not exist.';
} }
else { else {
$output .= $class->$methodName(); $output .= $class->$methodName($page_number);
} }
} }
} }

6
ObjectHelper.inc

@ -844,7 +844,7 @@ class ObjectHelper {
$objectListOut = theme('fieldset', $object_list_fieldset); $objectListOut = theme('fieldset', $object_list_fieldset);
$output .= $objectListOut . '<br/>'; $output = $objectListOut . '<br/>';
return $output; return $output;
} }
@ -854,7 +854,7 @@ class ObjectHelper {
* gets a list of datastreams and related function that we should use to show datastreams in their own fieldsets * gets a list of datastreams and related function that we should use to show datastreams in their own fieldsets
* from the content model associated with the object * from the content model associated with the object
*/ */
function createExtraFieldsets($pid, $contentModel) { function createExtraFieldsets($pid, $contentModel, $page_number) {
//$models = $collectionHelper->getContentModels($collectionPid, FALSE); //$models = $collectionHelper->getContentModels($collectionPid, FALSE);
// possible problem in below if the collection policy has multiple content models // possible problem in below if the collection policy has multiple content models
//with different pids but same dsid we could get wrong one, low probability and functionality //with different pids but same dsid we could get wrong one, low probability and functionality
@ -865,7 +865,7 @@ class ObjectHelper {
$output = ''; $output = '';
module_load_include('inc', 'fedora_repository', 'ContentModel'); module_load_include('inc', 'fedora_repository', 'ContentModel');
if (($cm = ContentModel :: loadFromModel($contentModel)) !== FALSE && $cm->validate()) { if (($cm = ContentModel :: loadFromModel($contentModel)) !== FALSE && $cm->validate()) {
$output .= $cm->displayExtraFieldset($pid); $output .= $cm->displayExtraFieldset($pid, $page_number);
} }
return $output; return $output;
} }

9
fedora_repository.module

@ -808,9 +808,14 @@ function fedora_repository_get_items($pid = NULL, $dsId = NULL, $collection = NU
$offset = $limit * $pageNumber; $offset = $limit * $pageNumber;
$results = $collectionClass->getRelatedObjects($pid, $limit, $offset, NULL); //updated so we can do paging in query not in xslt //$results = $collectionClass->getRelatedObjects($pid, $limit, $offset, NULL); //updated so we can do paging in query not in xslt
//$results = $collectionClass->getRelatedItems($pid, NULL); //$results = $collectionClass->getRelatedItems($pid, NULL);
$content .= $objectHelper->parseContent($results, $pid, $dsId, $collection, $pageNumber); $content_models = $objectHelper->get_content_models_list($pid);
foreach ($content_models as $content_model) {
$content .= $objectHelper->createExtraFieldsets($pid, $content_model, $pageNumber);
}
//$content .= $objectHelper
//$content .= $objectHelper->parseContent($results, $pid, $dsId, $collection, $pageNumber);
//the below is for islandlives we should be able to do this in the xslt though //the below is for islandlives we should be able to do this in the xslt though
//$css=$path.'/stylesheets/container-large.css'; //$css=$path.'/stylesheets/container-large.css';
//drupal_add_css($css); //drupal_add_css($css);

Loading…
Cancel
Save