Browse Source

Changes based on code review.

pull/439/head
Jordan Dukart 11 years ago
parent
commit
63ce9e2b63
  1. 7
      includes/regenerate_derivatives.form.inc
  2. 4
      theme/theme.inc

7
includes/regenerate_derivatives.form.inc

@ -62,7 +62,7 @@ function islandora_regenerate_object_derivatives_form(array $form, array &$form_
$form_state['object'] = $object;
return confirm_form($form,
t('Are you sure you want to regenerate all the derivatives for %title?', array('%title' => $object->label)),
"islandora/object/{$object}/manage/properties",
"islandora/object/{$object->id}/manage/properties",
t('This will create a new version for every datastream on the object. Please wait while this happens.'),
t('Regenerate'),
t('Cancel')
@ -78,11 +78,10 @@ function islandora_regenerate_object_derivatives_form(array $form, array &$form_
* The Drupal form state.
*/
function islandora_regenerate_object_derivatives_form_submit(array $form, array &$form_state) {
module_load_include('inc', 'islandora', 'includes/derivatives');
$object = $form_state['object'];
$batch = islandora_regenerate_object_derivatives_batch($object);
batch_set($batch);
$form_state['redirect'] = "islandora/object/{$object}/manage/properties";
$form_state['redirect'] = "islandora/object/{$object->id}/manage/properties";
}
/**
@ -95,6 +94,7 @@ function islandora_regenerate_object_derivatives_form_submit(array $form, array
* An array specifying the Drupal batch.
*/
function islandora_regenerate_object_derivatives_batch(AbstractObject $object) {
module_load_include('inc', 'islandora', 'includes/derivatives');
return array(
'title' => t('Regenerating all derivatives for @label', array('@label' => $object->label)),
'operations' => islandora_do_batch_derivatives($object, array('force' => TRUE)),
@ -116,6 +116,7 @@ function islandora_regenerate_object_derivatives_batch(AbstractObject $object) {
* An array specifying the Drupal batch.
*/
function islandora_regenerate_datastream_derivative_batch(AbstractDatastream $datastream) {
module_load_include('inc', 'islandora', 'includes/derivatives');
return array(
'title' => t('Regenerating derivatives for the @dsid datastream', array('@dsid' => $datastream->id)),
'operations' => islandora_do_batch_derivatives($datastream->parent, array(

4
theme/theme.inc

@ -53,7 +53,7 @@ function islandora_preprocess_islandora_default_edit(array &$variables) {
'class' => 'datastream-size',
'data' => islandora_datastream_get_human_readable_size($ds),
);
if (user_access(ISLANDORA_VIEW_DATASTREAM_HISTORY)) {
if (islandora_datastream_access(ISLANDORA_VIEW_DATASTREAM_HISTORY, $ds)) {
$row[] = array(
'class' => 'datastream-versions',
'data' => theme('islandora_datastream_version_link', array(
@ -79,7 +79,7 @@ function islandora_preprocess_islandora_default_edit(array &$variables) {
'datastream' => $ds,
)),
);
if (user_access(ISLANDORA_REGENERATE_DERIVATIVES)) {
if (islandora_datastream_access(ISLANDORA_REGENERATE_DERIVATIVES, $ds)) {
$row[] = array(
'class' => 'datastream-regenerate',
'data' => theme('islandora_datastream_regenerate_link', array(

Loading…
Cancel
Save