Browse Source

Removing passing in the object to prevent any possible confusion and just using the datastream->parent.

pull/637/head
Matthew Perry 9 years ago
parent
commit
c66e087188
  1. 2
      includes/datastream.inc
  2. 8
      includes/utilities.inc
  3. 2
      theme/theme.inc

2
includes/datastream.inc

@ -296,7 +296,7 @@ function islandora_datastream_get_url(AbstractDatastream $datastream, $type = 'd
function islandora_edit_datastream(AbstractDatastream $datastream) { function islandora_edit_datastream(AbstractDatastream $datastream) {
module_load_include('inc', 'islandora', 'includes/utilities'); module_load_include('inc', 'islandora', 'includes/utilities');
$edit_registry = islandora_build_datastream_edit_registry($datastream->parent, $datastream); $edit_registry = islandora_build_datastream_edit_registry($datastream);
$edit_count = count($edit_registry); $edit_count = count($edit_registry);
switch ($edit_count) { switch ($edit_count) {
case 0: case 0:

8
includes/utilities.inc

@ -950,18 +950,16 @@ function islandora_deployed_on_windows() {
/** /**
* Build the edit registry for a given datastream. * Build the edit registry for a given datastream.
* *
* @param AbstractObject $object
* The object being edited.
* @param AbstractDatastream $datastream * @param AbstractDatastream $datastream
* The datastream being edited. * The datastream being edited.
* *
* @return array * @return array
* The built edit registry array. * The built edit registry array.
*/ */
function islandora_build_datastream_edit_registry($object, $datastream) { function islandora_build_datastream_edit_registry(AbstractDatastream $datastream) {
$edit_registry = module_invoke_all(ISLANDORA_EDIT_DATASTREAM_REGISTRY_HOOK, $object, $datastream); $edit_registry = module_invoke_all(ISLANDORA_EDIT_DATASTREAM_REGISTRY_HOOK, $datastream->parent, $datastream);
$context = array( $context = array(
'object' => $object, 'object' => $datastream->parent,
'datastream' => $datastream, 'datastream' => $datastream,
'original_edit_registry' => $edit_registry, 'original_edit_registry' => $edit_registry,
); );

2
theme/theme.inc

@ -535,7 +535,7 @@ function theme_islandora_datastream_edit_link(array $vars) {
$datastream = $vars['datastream']; $datastream = $vars['datastream'];
module_load_include('inc', 'islandora', 'includes/utilities'); module_load_include('inc', 'islandora', 'includes/utilities');
$edit_registry = islandora_build_datastream_edit_registry($datastream->parent, $datastream); $edit_registry = islandora_build_datastream_edit_registry($datastream);
$can_edit = count($edit_registry) > 0 && islandora_datastream_access(ISLANDORA_METADATA_EDIT, $datastream); $can_edit = count($edit_registry) > 0 && islandora_datastream_access(ISLANDORA_METADATA_EDIT, $datastream);

Loading…
Cancel
Save