Browse Source

ISLANDORA-171 Add purge form to object details tab.

pull/105/head
Alexander O'Neill 14 years ago
parent
commit
6ef66a40f3
  1. 29
      CollectionClass.inc
  2. 7
      fedora_repository.module
  3. 3
      plugins/ShowStreamsInFieldSets.inc
  4. 36
      plugins/fedoraObject.inc

29
CollectionClass.inc

@ -441,32 +441,7 @@ class CollectionClass {
// This will be the content of the tab. // This will be the content of the tab.
'#content' => $add_to_collection, '#content' => $add_to_collection,
); );
$tabset['third_tab'] = array(
'#type' => 'tabpage',
'#title' => t('Description'),
);
$tabset['third_tab']['tabset'] = array(
'#type' => 'tabset',
);
$dc_html = $objectHelper->getFormattedDC($collection_item);
$ds_list = $objectHelper->getFormattedDatastreamList($this->pid, NULL, $collection_item);
$tabset['third_tab']['tabset']['view'] = array(
'#type' => 'tabpage',
'#title' => t('View'),
'#content' => $dc_html . $ds_list,
);
if (fedora_repository_access(OBJECTHELPER :: $EDIT_FEDORA_METADATA, $this->pid, $user)) {
$editform = drupal_get_form('fedora_repository_edit_qdc_form', $this->pid, 'DC');
$tabset['third_tab']['tabset']['edit'] = array(
'#type' => 'tabpage',
'#title' => t('Edit'),
'#content' => $editform,
);
}
return $tabset; return $tabset;
} }
@ -483,7 +458,7 @@ class CollectionClass {
} }
if ($allow) { if ($allow) {
// $ingestObject = '<a title="'. t('Ingest a New object into ') . $collectionName . ' '. $collection_pid . '" href="'. base_path() . // $ingestObject = '<a title="'. t('Ingest a New object into ') . $collectionName . ' '. $collection_pid . '" href="'. base_path() .
$ingestObject = drupal_get_form('fedora_repository_ingest_form', $this->pid, "test hello"); $ingestObject = drupal_get_form('fedora_repository_ingest_form', $this->pid);
} }
} }

7
fedora_repository.module

@ -802,6 +802,7 @@ function fedora_repository_get_items($pid = NULL, $dsId = NULL, $collection = NU
//} //}
module_load_include('inc', 'fedora_repository', 'ContentModel'); module_load_include('inc', 'fedora_repository', 'ContentModel');
module_load_include('inc', 'fedora_repository', 'plugins/fedoraObject');
$breadcrumbs = array(); $breadcrumbs = array();
$objectHelper->getBreadcrumbs($pid, $breadcrumbs); $objectHelper->getBreadcrumbs($pid, $breadcrumbs);
drupal_set_breadcrumb(array_reverse($breadcrumbs)); drupal_set_breadcrumb(array_reverse($breadcrumbs));
@ -829,6 +830,12 @@ function fedora_repository_get_items($pid = NULL, $dsId = NULL, $collection = NU
); );
} }
} }
// Add a 'manage object' tab for all objects, where detailed list of content is shown.
$obj = new FedoraObject($pid);
$object_details = $obj->showFieldSets();
$cmodels_tabs = array_merge($cmodels_tabs, $object_details);
//$content .= $objectHelper //$content .= $objectHelper
//$content .= $objectHelper->parseContent($results, $pid, $dsId, $collection, $pageNumber); //$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

3
plugins/ShowStreamsInFieldSets.inc

@ -81,12 +81,11 @@ class ShowStreamsInFieldSets {
$dc_html = $objectHelper->getFormattedDC($item); $dc_html = $objectHelper->getFormattedDC($item);
$dl_link = l('<div style="float:left; padding: 10px"><img src="'.$tn_url.'"><br />View Document</div>', '/fedora/repository/'.$this->pid.'/OBJ', array('html' => TRUE)); $dl_link = l('<div style="float:left; padding: 10px"><img src="'.$tn_url.'"><br />View Document</div>', '/fedora/repository/'.$this->pid.'/OBJ', array('html' => TRUE));
$ds_list = $objectHelper->getFormattedDatastreamList($this->pid, NULL, $item);
$tabset['first_tab']['tabs']['view'] = array( $tabset['first_tab']['tabs']['view'] = array(
'#type' => 'tabpage', '#type' => 'tabpage',
'#title' => t('View'), '#title' => t('View'),
'#content' => $dl_link . $dc_html . $ds_list, '#content' => $dl_link . $dc_html,
); );
if (fedora_repository_access(OBJECTHELPER :: $EDIT_FEDORA_METADATA, $this->pid, $user)) { if (fedora_repository_access(OBJECTHELPER :: $EDIT_FEDORA_METADATA, $this->pid, $user)) {

36
plugins/fedoraObject.inc

@ -11,8 +11,40 @@ class FedoraObject {
} }
public function showFieldSets() { public function showFieldSets() {
$objHelper = new ObjectHelper(); global $user;
$objectHelper = new ObjectHelper();
$tabset = array();
$show_purge_tab = (!empty($_POST['form_id']) && $_POST['form_id'] == 'fedora_repository_purge_object_form');
$purge_form = drupal_get_form('fedora_repository_purge_object_form', $this->pid);
$tabset['fedora_object_details'] = array(
'#type' => 'tabpage',
'#title' => t('Object Details'),
'#selected' => $show_purge_tab,
);
$tabset['fedora_object_details']['tabset'] = array(
'#type' => 'tabset',
);
$dc_html = $objectHelper->getFormattedDC($this->item);
$ds_list = $objectHelper->getFormattedDatastreamList($this->pid, NULL, $this->item);
$tabset['fedora_object_details']['tabset']['view'] = array(
'#type' => 'tabpage',
'#title' => t('View'),
'#content' => $dc_html . $ds_list . $purge_form,
);
if (fedora_repository_access(OBJECTHELPER :: $EDIT_FEDORA_METADATA, $this->pid, $user)) {
$editform = drupal_get_form('fedora_repository_edit_qdc_form', $this->pid, 'DC');
$tabset['fedora_object_details']['tabset']['edit'] = array(
'#type' => 'tabpage',
'#title' => t('Edit'),
'#content' => $editform,
);
}
return $objHelper->getFormattedDatastreamList($this->pid, NULL); return $tabset;
} }
} }
Loading…
Cancel
Save