Browse Source

Merge pull request #298 from jordandukart/7.x

Use build_hook_list so we get correct hook_names when altering.
pull/299/merge
Adam 12 years ago
parent
commit
57a77b8389
  1. 14
      includes/tuque_wrapper.inc

14
includes/tuque_wrapper.inc

@ -35,22 +35,20 @@ $islandora_module_path = drupal_get_path('module', 'islandora');
* Allow modules to alter an object before a mutable event occurs. * Allow modules to alter an object before a mutable event occurs.
*/ */
function islandora_alter_object(AbstractFedoraObject $object, array &$context) { function islandora_alter_object(AbstractFedoraObject $object, array &$context) {
$types = array('islandora_object'); module_load_include('inc', 'islandora', 'includes/utilities');
foreach ($object->models as $model) { drupal_alter(islandora_build_hook_list('islandora_object', $object->models) ,$object, $context);
$types[] = "{$model}_islandora_object";
}
drupal_alter($types, $object, $context);
} }
/** /**
* Allow modules to alter a datastream before a mutable event occurs. * Allow modules to alter a datastream before a mutable event occurs.
*/ */
function islandora_alter_datastream(AbstractFedoraObject $object, AbstractDatastream $datastream, array &$context) { function islandora_alter_datastream(AbstractFedoraObject $object, AbstractDatastream $datastream, array &$context) {
$types = array('islandora_datastream'); module_load_include('inc', 'islandora', 'includes/utilities');
$types = array();
foreach ($object->models as $model) { foreach ($object->models as $model) {
$types[] = "{$model}_{$datastream->id}_islandora_datastream"; $types[] = "{$model}_{$datastream->id}";
} }
drupal_alter($types, $object, $datastream, $context); drupal_alter(islandora_build_hook_list('islandora_datastream', $types), $object, $datastream, $context);
} }
/** /**

Loading…
Cancel
Save