Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add configurable video dsid #15

Merged
merged 1 commit into from
Aug 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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