Browse Source

Merge branch '7.x' into 7.x-tuque-wrapper

Conflicts:
	islandora.info
pull/243/head
Nigel Banks 12 years ago
parent
commit
6ab6b11a3a
  1. 0
      includes/dublin_core.inc
  2. 0
      includes/mime_detect.inc
  3. 9
      includes/solution_packs.inc
  4. 17
      includes/utilities.inc
  5. 4
      islandora.info

0
includes/DublinCore.inc → includes/dublin_core.inc

0
includes/MimeDetect.inc → includes/mime_detect.inc

9
includes/solution_packs.inc

@ -622,11 +622,14 @@ function theme_islandora_viewers_table($variables) {
* Array or string with data the module needs in order to render a full viewer * Array or string with data the module needs in order to render a full viewer
* @param string $variable_id * @param string $variable_id
* The id of the Drupal variable the viewer settings are saved in * The id of the Drupal variable the viewer settings are saved in
* @param FedoraObject $fedora_object
* The tuque object representing the fedora object being displayed
* @return * @return
* The callback to the viewer module. Returns a rendered viewer. Returns FALSE * The callback to the viewer module. Returns a rendered viewer. Returns FALSE
* if no viewer is set. * if no viewer is set.
*/ */
function islandora_get_viewer($params = NULL, $variable_id = NULL) {
function islandora_get_viewer($params = NULL, $variable_id = NULL, $fedora_object = NULL) {
// get viewer from settings // get viewer from settings
$settings = variable_get($variable_id, array()); $settings = variable_get($variable_id, array());
// make sure a viewer is set // make sure a viewer is set
@ -636,10 +639,10 @@ function islandora_get_viewer($params = NULL, $variable_id = NULL) {
if ($viewer_id AND $params !== NULL) { if ($viewer_id AND $params !== NULL) {
$callback = islandora_get_viewer_callback($viewer_id); $callback = islandora_get_viewer_callback($viewer_id);
// call callback function // call callback function
return $callback($params); return $callback($params, $fedora_object);
} }
} }
return NULL; return FALSE;
} }
/** /**

17
includes/utilities.inc

@ -433,13 +433,26 @@ function islandora_prepare_new_object($namespace = NULL, $label = NULL, $datastr
$mimetype = isset($ds['mimetype']) ? $ds['mimetype'] : 'text/xml'; $mimetype = isset($ds['mimetype']) ? $ds['mimetype'] : 'text/xml';
// Default 'Managed' // Default 'Managed'
$control_group = (isset($ds['control_group']) && in_array($ds['control_group'], array('X', 'M', 'R', 'E'))) ? $ds['control_group'] : 'M'; $control_group = (isset($ds['control_group']) && in_array($ds['control_group'], array('X', 'M', 'R', 'E'))) ? $ds['control_group'] : 'M';
$datastream_file = url($ds['datastream_file'], array('absolute' => TRUE));
$ds_uri = FALSE;
if (file_valid_uri($ds['datastream_file'])) {
$datastream_file = $ds['datastream_file'];
$ds_uri = TRUE;
}
else {
$datastream_file = url($ds['datastream_file'], array('absolute' => TRUE));
}
$datastream = $object->constructDatastream($dsid, $control_group); $datastream = $object->constructDatastream($dsid, $control_group);
$datastream->label = $label; $datastream->label = $label;
$datastream->mimetype = $mimetype; $datastream->mimetype = $mimetype;
switch ($control_group) { switch ($control_group) {
case 'M': case 'M':
$datastream->setContentFromUrl($datastream_file); if ($ds_uri) {
$datastream->setContentFromFile($datastream_file);
}
else {
$datastream->setContentFromUrl($datastream_file);
}
break; break;
case 'X': case 'X':
$datastream->setContentFromString(file_get_contents($datastream_file)); $datastream->setContentFromString(file_get_contents($datastream_file));

4
islandora.info

@ -6,8 +6,8 @@ core = 7.x
configure = admin/islandora/configure configure = admin/islandora/configure
stylesheets[all][] = css/islandora.base.css stylesheets[all][] = css/islandora.base.css
stylesheets[all][] = css/islandora.theme.css stylesheets[all][] = css/islandora.theme.css
files[] = includes/MimeDetect.inc files[] = includes/mime_detect.inc
files[] = includes/DublinCore.inc files[] = includes/dublin_core.inc
files[] = includes/islandora_tuque.inc files[] = includes/islandora_tuque.inc
files[] = includes/islandora_tuque_wrapper.inc files[] = includes/islandora_tuque_wrapper.inc
files[] = tests/islandora_web_test_case.inc files[] = tests/islandora_web_test_case.inc

Loading…
Cancel
Save