You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
76 lines
2.1 KiB
76 lines
2.1 KiB
14 years ago
|
<?php
|
||
|
|
||
13 years ago
|
// $Id$
|
||
|
|
||
|
/**
|
||
|
* @file
|
||
13 years ago
|
* FedoraObjectDetailedContent class
|
||
13 years ago
|
*/
|
||
|
|
||
|
/**
|
||
13 years ago
|
* Fedora Object. This class is a plugin called from content models to display a detailed list of
|
||
|
* content of the Fedora Item. This is hard coded into Islandora core, and it can also be called
|
||
|
* from the IslandoraCM stream.
|
||
13 years ago
|
*/
|
||
13 years ago
|
class FedoraObjectDetailedContent {
|
||
13 years ago
|
|
||
|
/**
|
||
|
* Constructor
|
||
|
* @param type $pid
|
||
|
*/
|
||
|
function __construct($pid = '') {
|
||
14 years ago
|
module_load_include('inc', 'fedora_repository', 'api/fedora_item');
|
||
|
if (!empty($pid)) {
|
||
|
|
||
|
$this->pid = $pid;
|
||
|
$this->item = new Fedora_Item($pid);
|
||
|
}
|
||
|
}
|
||
13 years ago
|
|
||
|
/**
|
||
|
* Show Field Sets
|
||
|
* @global type $user
|
||
|
* @return type
|
||
|
*/
|
||
14 years ago
|
public function showFieldSets() {
|
||
14 years ago
|
global $user;
|
||
|
$objectHelper = new ObjectHelper();
|
||
|
$tabset = array();
|
||
|
$show_purge_tab = (!empty($_POST['form_id']) && $_POST['form_id'] == 'fedora_repository_purge_object_form');
|
||
14 years ago
|
$show_edit_tab = (!empty($_POST['form_id']) && $_POST['form_id'] == 'fedora_repository_edit_qdc_form');
|
||
14 years ago
|
$purge_form = drupal_get_form('fedora_repository_purge_object_form', $this->pid, check_plain(substr(request_uri(), strlen(base_path()))));
|
||
14 years ago
|
|
||
|
$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);
|
||
13 years ago
|
|
||
14 years ago
|
$ds_list = $objectHelper->get_formatted_datastream_list($this->pid, NULL, $this->item);
|
||
13 years ago
|
|
||
14 years ago
|
|
||
|
$tabset['fedora_object_details']['tabset']['view'] = array(
|
||
|
'#type' => 'tabpage',
|
||
|
'#title' => t('View'),
|
||
|
'#content' => $dc_html . $ds_list . $purge_form,
|
||
|
);
|
||
13 years ago
|
|
||
14 years ago
|
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'),
|
||
14 years ago
|
'#selected' => $show_edit_tab,
|
||
14 years ago
|
'#content' => $editform,
|
||
|
);
|
||
|
}
|
||
13 years ago
|
|
||
14 years ago
|
return $tabset;
|
||
14 years ago
|
}
|
||
13 years ago
|
|
||
13 years ago
|
}
|