';
-
- module_load_include('inc', 'fedora_repository', 'CollectionClass');
- $collectionClass = new CollectionClass();
- module_load_include('inc', 'fedora_repository', 'ContentModel');
- module_load_include('inc', 'fedora_repository', 'plugins/FedoraObjectDetailedContent');
$breadcrumbs = array();
$objectHelper->getBreadcrumbs($pid, $breadcrumbs);
drupal_set_breadcrumb(array_reverse($breadcrumbs));
- $offset = $limit * $page_number;
$content_models = $objectHelper->get_content_models_list($pid);
-// Each content model may return either a tabset array or plain HTML. If it's HTML, stick it in a tab.
- $cmodels_tabs = array(
- '#type' => 'tabset',
+
+ //Get the tabs from all modules...
+ $hook_tabs = module_invoke_all('islandora_tabs', $content_models, $pid, $page_number);
+
+ $cmodels_tabs = array(
+ '#type' => 'tabset',
);
- foreach ($content_models as $content_model) {
- $content_model_fieldset = $content_model->displayExtraFieldset($pid, $page_number);
- if (is_array($content_model_fieldset)) {
- $cmodels_tabs = array_merge($cmodels_tabs, $content_model_fieldset);
- }
- else {
- $cmodels_tabs[$content_model->pid] = array(
- '#type' => 'tabpage',
- '#title' => $content_model->name,
- '#content' => $content_model_fieldset,
- );
- }
- }
+ $cmodels_tabs += $hook_tabs;
-// Add a 'manage object' tab for all objects, where detailed list of content is shown.
- $obj = new FedoraObjectDetailedContent($pid);
+ //Assemble parameters, to pass during alter
+ $params = array(
+ 'content_models' => $content_models,
+ 'pid' => $pid,
+ 'page' => $page_number,
+ );
+
+ //Allow returned tabs to be altered, before return.
+ drupal_alter('islandora_tabs', $cmodels_tabs, $params);
- //can disable showing the object details tab in admin UI
- if (variable_get('fedora_repository_show_object_details_tab', TRUE)) {
- $object_details = $obj->showFieldSets();
- if ($object_details['fedora_object_details']['#selected'] == TRUE) {
- foreach ($cmodels_tabs as &$cmodel_tab) {
- if (is_array($cmodel_tab)) {
- $cmodel_tab['#selected'] = FALSE;
- }
- }
- }
- }
- else {
- $object_details = array();
- }
-
- $hook_tabs = module_invoke_all('islandora_tabs', $content_models, $pid);
- $cmodels_tabs = array_merge($cmodels_tabs, $object_details, $hook_tabs);
-
return tabs_render($cmodels_tabs);
}
@@ -1059,7 +1151,6 @@ function fedora_repository_urlencode_string($str) {
* @return type
*/
function fedora_object_as_attachment($pid, $dsId, $label=NULL, $version=NULL) {
- global $user;
module_load_include('inc', 'fedora_repository', 'ObjectHelper');
if ($pid == NULL || $dsId == NULL) {
@@ -1068,7 +1159,7 @@ function fedora_object_as_attachment($pid, $dsId, $label=NULL, $version=NULL) {
}
$objectHelper = new ObjectHelper();
- $objectHelper->makeObject($pid, $dsId, 1, $label, FALSE, $version);
+ $objectHelper->makeObject($pid, $dsId, TRUE, $label, FALSE, $version);
}
/**
@@ -2273,9 +2364,6 @@ function theme_fedora_repository_solution_packs_list($solution_packs) {
$header = array();
$rows = array();
-
-
-
drupal_add_css(drupal_get_path('module', 'update') . '/update.css');
return $output;
}
diff --git a/formClass.inc b/formClass.inc
index 713f1fcb..a5f9bef6 100644
--- a/formClass.inc
+++ b/formClass.inc
@@ -331,6 +331,13 @@ class formClass {
'#options' => array(ObjectHelper::$DISPLAY_ALWAYS => t('Always'), ObjectHelper::$DISPLAY_NEVER => t('Never'), ObjectHelper::$DISPLAY_NO_MODEL_OUTPUT => t('Only if no Content Model display output.')),
'#description' => t('Determines when to display the list of objects when viewing a collection page.'),
);
+
+ $form['advanced']['fedora_control_group_control_during_ingest'] = array(
+ '#type' => 'checkbox',
+ '#title' => t('Allow control groups select in datastream ingest'),
+ '#description' => t('Whether or not we should allow the user to select which control group to ingest a stream as, or to follow the old paradigm--to add stream IDed as XML as inline, and everything else as managed.'),
+ '#default_value' => variable_get('fedora_control_group_control_during_ingest', FALSE),
+ );
//Export functionality
$form['advanced']['module']['export_area'] = array(
@@ -656,17 +663,21 @@ class formClass {
}
}
- $form['add_datastream_label'] = array(
- '#value' => t('
Add Datastream:
'),
- '#weight' => -10,
+ $form['fieldset'] = array(
+ '#type' => 'fieldset',
+ '#title' => t('Add datastream'),
);
+ //$form['add_datastream_label'] = array(
+ // '#value' => t('
Add Datastream:
'),
+ // '#weight' => -10,
+ //);
- $form['pid'] = array(
+ $form['fieldset']['pid'] = array(
'#type' => 'hidden',
'#value' => "$pid"
);
- $form['stream_label'] = array(
+ $form['fieldset']['stream_label'] = array(
'#title' => 'Datastream Label',
'#required' => 'TRUE',
'#description' => t('A Human readable label'),
@@ -674,35 +685,41 @@ class formClass {
);
$form['#attributes']['enctype'] = 'multipart/form-data';
- $form['add-stream-file-location'] = array(
+ $form['fieldset']['add-stream-file-location'] = array(
'#type' => 'file',
'#title' => t('Upload Document'),
'#size' => 48,
// '#required'=>'TRUE',
- '#description' => t('The file to upload.')
+ '#description' => t('The file to upload. (Only for Managed and Inline)')
);
+
+ if (variable_get('fedora_control_group_control_during_ingest', FALSE)) {
+ $form['fieldset']['ds_reference'] = array(
+ '#type' => 'textfield',
+ '#title' => t('Datastream reference'),
+ '#size' => 48,
+ '#description' => t('A URL reference to resolve for the contents of the datastream. (Required for External and Redirect, but will still work for Managed and Inline.)'),
+ );
+ }
+
$form['#redirect'] = "fedora/repository/$pid/";
- $form['submit'] = array(
+ $form['fieldset']['submit'] = array(
'#type' => 'submit',
'#value' => t('Add Datastream')
);
if (!empty($unused_dsids)) {
- $dsidsForForm = array();
- foreach ($unused_dsids as $dsid) {
- $dsidsForForm[$dsid] = $dsid;
- }
- $form['stream_id'] = array(
+ $form['fieldset']['stream_id'] = array(
'#type' => 'select',
'#title' => t('Datastream ID'),
'#default_value' => variable_get('feed_item_length', 'teaser'),
- '#weight' => '-1',
+ '#weight' => -1,
'#description' => t('Datastream IDs defined by the content model.'),
+ '#options' => array_combine($unused_dsids, $unused_dsids),
);
- $form['stream_id']['#options'] = array_combine($unused_dsids, $unused_dsids);
}
else {
- $form['stream_id'] = array(
+ $form['fieldset']['stream_id'] = array(
'#title' => 'Datastream ID',
'#required' => 'TRUE',
'#description' => t('An ID for this stream that is unique to this object. Must start with a letter and contain only alphanumeric characters and dashes and underscores.'),
@@ -710,6 +727,21 @@ class formClass {
'#weight' => -1,
);
}
+
+ if (variable_get('fedora_control_group_control_during_ingest', FALSE)) {
+ $form['fieldset']['control_group'] = array(
+ '#type' => 'select',
+ '#title' => t('Control group'),
+ '#options' => array(
+ 'X' => t('Inline XML'),
+ 'M' => t('Managed datastream'),
+ 'E' => t('Externally Referenced/managed datastream'),
+ 'R' => t('Redirect datastream'),
+ ),
+ '#description' => t('The manner in which the datastream will be stored. "Inline XML" must be XML and will be placed directly into the FOXML for the object. "Managed" datastreams are made to live on the filesystem as discrete files in the Fedora data directory. Both "Redirect" and "External" streams are URL references; the difference being the redirect stream instruct clients to perform an HTTP redirect, such that the data does not pass though Fedora (useful for streaming). External streams are mediated (by which I mean loaded and streamed from) the Fedora server.'),
+ '#weight' => 0,
+ );
+ }
return $form;
}
@@ -836,12 +868,33 @@ class formClass {
$form = array();
$form['#attributes']['enctype'] = 'multipart/form-data';
- $form['file'] = array(
- '#type' => 'file',
- '#title' => t('Upload Document'),
- '#description' => t('The file to upload.')
- );
-
+
+ module_load_include('inc', 'fedora_repository', 'api/fedora_item');
+ $item = new Fedora_Item($pid);
+ $info = $item->get_datastream_info($dsId);
+ $control_group = $info->datastream->controlGroup;
+ if (in_array($control_group, array('M', 'X'))) {
+ $form['file'] = array(
+ '#type' => 'file',
+ '#title' => t('Upload Document'),
+ '#description' => t('A file with which to replace the contents of this datastream.'),
+ );
+ }
+ if ($control_group != 'X') {
+ $form['reference'] = array(
+ '#type' => 'textfield',
+ '#title' => t('Reference to object'),
+ '#description' => t('A URL the datastream will be updated to reference.'),
+ );
+ }
+ if ($control_group == 'M') {
+ $form['note'] = array(
+ '#type' => 'item',
+ '#title' => t('NOTE'),
+ '#value' => t('If both a file and a reference are given, the file will be given preference.'),
+ );
+ }
+
$form['pid'] = array(
'#type' => 'value',
'#value' => $pid,
diff --git a/plugins/tagging_form.inc b/plugins/tagging_form.inc
index f00274d4..9b7c4658 100644
--- a/plugins/tagging_form.inc
+++ b/plugins/tagging_form.inc
@@ -61,15 +61,16 @@ function fedora_repository_image_tagging_form($form_state, $pid) {
$tagset = new TagSet($obj);
$tags = array();
foreach ($tagset->tags as $tag) {
- $form_tag =& $form['tags-wrapper']['tags'][$tag['name']] = array(
+ $form['tags-wrapper']['tags'][$tag['name']] = array(
'#prefix' => '
',
'#suffix' => '',
);
+ $form_tag =& $form['tags-wrapper']['tags'][$tag['name']];
$tag_title_text = t('Added by @creator.', array(
'@creator' => $tag['creator'],
));
- $tag_mnpl_search_path = "fedora/repository/mnpl_advanced_search/tag:{$tag['name']}"
+ $tag_mnpl_search_path = "fedora/repository/mnpl_advanced_search/tag:{$tag['name']}";
$form_tag['tag'] = array(
'#value' => l($tag['name'], $tag_mnpl_search_path, array('attributes' => array(
'title' => $tag_title_text
diff --git a/xsl/convertQDC.xsl b/xsl/convertQDC.xsl
deleted file mode 100644
index 5d881e35..00000000
--- a/xsl/convertQDC.xsl
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-MetaData |
-
-
-
-
-
- |
-
-
- =
-
-
- |
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/xsl/convertQDC.xsl.deprecated b/xsl/convertQDC.xsl.deprecated
new file mode 100644
index 00000000..724f7c70
--- /dev/null
+++ b/xsl/convertQDC.xsl.deprecated
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ MetaData |
+
+
+
+
+
+
+
+ |
+
+
+
+
+ |
+
+
+
+
+
+
+
+