Skip to content

Commit

Permalink
Merge pull request #15 from bondjimbond/mp4
Browse files Browse the repository at this point in the history
Add configurable video dsid
  • Loading branch information
bondjimbond authored Aug 11, 2020
2 parents 5e0e85b + 1dbfa5f commit a0891a6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions includes/admin.form.inc
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@ print("hi hi");
'#maxlength' => 255,
);

$form['islandora_downloadable_datastreams_video_dsid'] = array(
'#title' => t('Video datastream to make downloadable'),
'#type' => 'textfield',
'#size' => 60,
'#default_value' => variable_get('islandora_downloadable_datastreams_video_dsid', 'MP4'),
'#description' => t('The datastream to provide a download link to.'),
'#maxlength' => 255,
);

$form['islandora_downloadable_datastreams_label'] = array(
'#title' => t('Label for download block'),
'#type' => 'textfield',
Expand Down Expand Up @@ -88,6 +97,7 @@ function islandora_downloadable_datastreams_admin_form_submit(array $form, array
$enabled = array_keys(array_filter($form_state['values']['downloadable_table']));
variable_set('islandora_downloadable_datastreams_selected_cmodels', $enabled);
variable_set('islandora_downloadable_datastreams_image_dsid', $form_state['values']['islandora_downloadable_datastreams_image_dsid']);
variable_set('islandora_downloadable_datastreams_video_dsid', $form_state['values']['islandora_downloadable_datastreams_video_dsid']);
variable_set('islandora_downloadable_datastreams_label', $form_state['values']['islandora_downloadable_datastreams_label']);
drupal_set_message(t("Configuration saved."));
}
2 changes: 1 addition & 1 deletion islandora_downloadable_datastreams.module
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ function islandora_downloadable_datastreams_block_view($delta) {

// For video, assume MP4 datastream until we make it configurable instead.
elseif ($ids['cmodel'] == 'islandora:sp_videoCModel') {
$dsid = "MP4";
$dsid = variable_get('islandora_downloadable_datastreams_video_dsid', 'MP4');
}

// For binary objects
Expand Down

0 comments on commit a0891a6

Please sign in to comment.