</div><!-- end row --> <div class="row"> <div class='col-sm-12 col-md-12 col-lg-12'> <?php if ($vn_audio_rep_id) { $t_rep->load($vn_audio_rep_id); $va_annotations = $t_rep->getAnnotations(array("checkAccess" => $this->getVar("access_values"))); #print_r($va_annotations); print $t_rep->getMediaTag("media", $va_audio_media_display_info["display_version"], $va_audio_media_display_info, array("id" => "caPlayer")); } ?> <div id="detailTools"> <div class="detailTool detailToolRight"><span class="glyphicon glyphicon-share-alt"></span>{{{shareLink}}}</div><!-- end detailTool --> <?php print "<div class='detailTool'>"; if (caObjectsDisplayDownloadLink($this->request) && $vn_audio_rep_id) { # -- get version to download configured in media_display.conf $va_download_display_info = caGetMediaDisplayInfo('download', $t_rep->getMediaInfo('media', 'INPUT', 'MIMETYPE')); $vs_download_version = $va_download_display_info['display_version']; print caNavLink($this->request, " <span class='glyphicon glyphicon-download-alt'></span>", '', 'Detail', 'DownloadRepresentation', '', array('representation_id' => $t_rep->getPrimaryKey(), "object_id" => $t_object->get("object_id"), "download" => 1, "version" => $vs_download_version), array("title" => _t("Download"))) . " "; } print $vs_transcript_link; print "</div>"; ?> </div> <HR class="dark"/> </div><!-- end col --> </div><!-- end row --> <div class="row"> <div class='col-sm-12 col-md-6 col-lg-6'> {{{<unit relativeTo="ca_entities" restrictToRelationshipTypes="interviewer" delimiter=";"><H3>Interviewer:</H3><l>^ca_entities.preferred_labels.displayname</l></unit>}}}
$i++; if ($i == $vn_num_cols) { $i = 0; print "<br/>"; } } ?> </div><!-- end caMediaOverlayRepThumbs --> <?php } ?> <!-- Controls - only for media overlay --> <div class="caMediaOverlayControls"> <div class='close'><a href="#" onclick="caMediaPanel.hidePanel(); return false;" title="close"> </a></div> <?php if (caObjectsDisplayDownloadLink($this->request)) { ?> <div class='download'> <?php # -- get version to download configured in media_display.conf $va_download_display_info = caGetMediaDisplayInfo('download', $t_rep->getMediaInfo('media', 'INPUT', 'MIMETYPE')); $vs_download_version = $va_download_display_info['display_version']; print caNavLink($this->request, "<img src='" . $this->request->getThemeUrlPath() . "/graphics/buttons/downloadWhite.png' border='0' title='" . _t("Download Media") . "'>", '', 'Detail', 'Object', 'DownloadRepresentation', array('representation_id' => $t_rep->getPrimaryKey(), "object_id" => $t_object->getPrimaryKey(), "download" => 1, "version" => $vs_download_version)); ?> </div> <?php } ?> <div class='objectInfo'>
/** * Download single representation from currently open object */ public function DownloadRepresentation() { if (!caObjectsDisplayDownloadLink($this->request)) { $this->postError(1100, _t('Cannot download media'), 'DetailController->DownloadMedia'); return; } $vn_object_id = $this->request->getParameter('object_id', pInteger); $t_object = new ca_objects($vn_object_id); $pn_representation_id = $this->request->getParameter('representation_id', pInteger); $ps_version = $this->request->getParameter('version', pString); $this->view->setVar('representation_id', $pn_representation_id); $t_rep = new ca_object_representations($pn_representation_id); $this->view->setVar('t_object_representation', $t_rep); $va_versions = $t_rep->getMediaVersions('media'); if (!in_array($ps_version, $va_versions)) { $ps_version = $va_versions[0]; } $this->view->setVar('version', $ps_version); $va_rep_info = $t_rep->getMediaInfo('media', $ps_version); $this->view->setVar('version_info', $va_rep_info); $va_info = $t_rep->getMediaInfo('media'); $vs_idno_proc = preg_replace('![^A-Za-z0-9_\\-]+!', '_', $t_object->get('idno')); switch ($this->request->user->getPreference('downloaded_file_naming')) { case 'idno': $this->view->setVar('version_download_name', $vs_idno_proc . '.' . $va_rep_info['EXTENSION']); break; case 'idno_and_version': $this->view->setVar('version_download_name', $vs_idno_proc . '_' . $ps_version . '.' . $va_rep_info['EXTENSION']); break; case 'idno_and_rep_id_and_version': $this->view->setVar('version_download_name', $vs_idno_proc . '_representation_' . $pn_representation_id . '_' . $ps_version . '.' . $va_rep_info['EXTENSION']); break; case 'original_name': default: if ($va_info['ORIGINAL_FILENAME']) { $va_tmp = explode('.', $va_info['ORIGINAL_FILENAME']); if (sizeof($va_tmp) > 1) { if (strlen($vs_ext = array_pop($va_tmp)) < 3) { $va_tmp[] = $vs_ext; } } $this->view->setVar('version_download_name', str_replace(" ", "_", join('_', $va_tmp) . '.' . $va_rep_info['EXTENSION'])); } else { $this->view->setVar('version_download_name', $vs_idno_proc . '_representation_' . $pn_representation_id . '_' . $ps_version . '.' . $va_rep_info['EXTENSION']); } break; } // // Perform metadata embedding if ($vs_path = caEmbedMetadataIntoRepresentation($t_object, $t_rep, $ps_version)) { $this->view->setVar('version_path', $vs_path); } else { $this->view->setVar('version_path', $t_rep->getMediaPath('media', $ps_version)); } $this->response->sendHeaders(); $vn_rc = $this->render('Details/object_representation_download_binary.php'); $this->response->sendContent(); if ($vs_path) { unlink($vs_path); } return $vn_rc; }
* * CollectiveAccess is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTIES whatsoever, including any implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * * This source code is free and modifiable under the terms of * GNU General Public License. (http://www.gnu.org/copyleft/gpl.html). See * the "license.txt" file for details, or visit the CollectiveAccess web site at * http://www.CollectiveAccess.org * * ---------------------------------------------------------------------- */ $t_subject = $this->getVar('t_subject'); $t_rep = $this->getVar('t_representation'); $t_attr_val = $this->getVar('t_attribute_value'); $va_pages = $this->getVar('pages'); $va_sections = $this->getVar('sections'); $vs_content_mode = $this->getVar('content_mode'); $vs_title = $this->getVar('title'); $vb_is_searchable = (bool) $this->getVar('is_searchable'); $vn_subject_id = $t_subject->getPrimaryKey(); $vn_representation_id = $t_rep->getPrimaryKey(); $vn_value_id = $t_attr_val->getPrimaryKey(); header("Content-type: application/json"); if ($vn_representation_id) { $va_page_info = array('image' => '', 'subject_id' => $vn_subject_id, 'representation_id' => $vn_representation_id); } else { $va_page_info = array('image' => '', 'subject_id' => $vn_subject_id, 'value_id' => $vn_value_id); } print json_encode(array('title' => $vs_title, 'description' => '', 'id' => 'documentData', 'pages' => sizeof($va_pages), 'annotations' => array(), 'sections' => $va_sections, 'resources' => array('page' => $va_page_info, 'pageList' => $va_pages, 'downloadUrl' => caObjectsDisplayDownloadLink($this->request) ? caNavUrl($this->request, '*', 'Detail', 'DownloadMedia', array($t_subject->primaryKey() => $vn_subject_id, 'representation_id' => $vn_representation_id, 'value_id' => $vn_value_id, 'download' => 1, 'version' => 'original')) : '', 'search' => $vb_is_searchable ? caNavUrl($this->request, '*', '*', 'SearchWithinMedia', array($t_subject->primaryKey() => $vn_subject_id, 'representation_id' => $vn_representation_id)) . "/q/{query}" : null)));
// Create book viewer from hierarchical objects $o_children = $t_object->makeSearchResult('ca_objects', $va_child_ids); $vn_object_id = $t_object->getPrimaryKey(); $vn_c = 1; while ($o_children->nextHit()) { $vs_preview_url = $o_children->getMediaUrl('ca_object_representations.media', 'preview'); $vs_preview_path = $o_children->getMediaPath('ca_object_representations.media', 'preview'); $va_preview_info = $o_children->getMediaInfo('ca_object_representations.media', 'preview'); $vs_large_url = $o_children->getMediaUrl('ca_object_representations.media', 'large'); $vs_large_path = $o_children->getMediaPath('ca_object_representations.media', 'large'); $va_large_info = $o_children->getMediaInfo('ca_object_representations.media', 'large'); $vs_page_url = $o_children->getMediaUrl('ca_object_representations.media', 'page'); $vs_page_path = $o_children->getMediaPath('ca_object_representations.media', 'page'); $va_page_info = $o_children->getMediaInfo('ca_object_representations.media', 'page'); $va_pages[] = array('title' => $vs_title = $o_children->get('ca_objects.preferred_labels.name'), 'object_id' => $vn_object_id, 'representation_id' => $vn_representation_id = (int) $o_children->get('ca_object_representations.representation_id'), 'thumbnail_url' => $vs_preview_url, 'thumbnail_path' => $vs_preview_path, 'thumbnail_width' => $va_preview_info['WIDTH'], 'thumbnail_height' => $va_preview_info['HEIGHT'], 'thumbnail_mimetype' => $va_preview_info['MIMETYPE'], 'normal_url' => $vs_large_url, 'normal_path' => $vs_large_path, 'normal_width' => $va_large_info['WIDTH'], 'normal_height' => $va_large_info['HEIGHT'], 'normal_mimetype' => $va_large_info['MIMETYPE'], 'large_url' => $vs_page_url, 'large_path' => $vs_page_path, 'large_width' => $va_page_info['WIDTH'], 'large_height' => $va_page_info['HEIGHT'], 'large_mimetype' => $va_page_info['MIMETYPE']); $va_sections[] = array('title' => $vs_title, 'page' => $vn_c, 'object_id' => $vn_object_id, 'representation_id' => $vn_representation_id, 'editUrl' => caNavUrl($this->request, '', 'Detail', 'Objects', array('object_id' => $vn_object_id)), 'downloadUrl' => caObjectsDisplayDownloadLink($this->request) ? caNavUrl($this->request, '', 'Detail', 'DownloadRepresentation', array('object_id' => $vn_object_id, 'representation_id' => $vn_representation_id, 'version' => 'original')) : ""); $vn_c++; } $vs_book_viewer_content_mode = 'hierarchy_of_representations'; $vb_use_book_reader = true; } else { if ($vb_should_use_book_viewer && $this->getVar('num_multifiles') > 0) { // Create book viewer from single representation with multifiles $vb_use_book_reader = true; $vn_object_id = $t_object->getPrimaryKey(); $vn_representation_id = $t_rep->getPrimaryKey(); foreach ($t_rep->getFileList(null, 0, null, array('preview', 'large_preview', 'page_preview')) as $vn_id => $va_file) { $va_pages[] = array('object_id' => $vn_object_id, 'representation_id' => $t_rep->getPrimaryKey(), 'thumbnail_url' => $va_file['preview_url'], 'thumbnail_path' => $va_file['preview_path'], 'thumbnail_width' => $va_file['preview_width'], 'thumbnail_height' => $va_file['preview_height'], 'thumbnail_mimetype' => $va_file['preview_mimetype'], 'normal_url' => $va_file['large_preview_url'], 'normal_path' => $va_file['large_preview_path'], 'normal_width' => $va_file['large_preview_width'], 'normal_height' => $va_file['large_preview_height'], 'normal_mimetype' => $va_file['large_preview_mimetype'], 'large_url' => $va_file['page_preview_url'], 'large_path' => $va_file['page_preview_path'], 'large_width' => $va_file['page_preview_width'], 'large_height' => $va_file['page_preview_height'], 'large_mimetype' => $va_file['page_preview_mimetype']); } $vs_book_viewer_content_mode = 'multifiles'; }
$i++; if ($i == $vn_num_cols) { $i = 0; print "<br/>"; } } ?> </div><!-- end caMediaOverlayRepThumbs --> <?php } ?> <!-- Controls - only for media overlay --> <div class="caMediaOverlayControls"> <div class='close'><a href="#" onclick="caMediaPanel.hidePanel(); return false;" title="close"> </a></div> <?php if (caObjectsDisplayDownloadLink($this->request) && $this->request->user->canDoAction('can_download_media')) { ?> <div class='download'> <?php # -- get version to download configured in media_display.conf $va_download_display_info = caGetMediaDisplayInfo('download', $t_rep->getMediaInfo('media', 'INPUT', 'MIMETYPE')); $vs_download_version = $va_download_display_info['display_version']; print caNavLink($this->request, caGetThemeGraphic($this->request, 'buttons/downloadWhite.png', array('title' => _t("Download Media"))), '', '', 'Detail', 'DownloadRepresentation', array('representation_id' => $t_rep->getPrimaryKey(), "object_id" => $t_object->getPrimaryKey(), "download" => 1, "version" => $vs_download_version)); ?> </div> <?php } ?> <div class='objectInfo'> <?php
function caRepToolbar($po_request, $t_representation, $pn_object_id) { $o_set_config = caGetSetsConfig(); $vs_lightbox_icon = $o_set_config->get("add_to_lightbox_icon"); if (!$vs_lightbox_icon) { $vs_lightbox_icon = "<i class='fa fa-suitcase'></i>"; } $va_lightbox_display_name = caGetSetDisplayName($o_set_config); $vs_lightbox_display_name = $va_lightbox_display_name["singular"]; $vs_lightbox_display_name_plural = $va_lightbox_display_name["plural"]; $va_rep_display_info = caGetMediaDisplayInfo('detail', $t_representation->getMediaInfo('media', 'INPUT', 'MIMETYPE')); $va_rep_display_info['poster_frame_url'] = $t_representation->getMediaUrl('media', $va_rep_display_info['poster_frame_version']); $vs_tool_bar = "<div class='detailMediaToolbar'>"; if (!$va_rep_display_info["no_overlay"]) { $vs_tool_bar .= "<a href='#' class='zoomButton' onclick='caMediaPanel.showPanel(\"" . caNavUrl($po_request, '', 'Detail', 'GetRepresentationInfo', array('object_id' => $pn_object_id, 'representation_id' => $t_representation->getPrimaryKey(), 'overlay' => 1)) . "\"); return false;' title='" . _t("Zoom") . "'><span class='glyphicon glyphicon-zoom-in'></span></a>\n"; } if (!$po_request->config->get("disable_my_collections")) { if ($po_request->isLoggedIn()) { $vs_tool_bar .= " <a href='#' class='setsButton' onclick='caMediaPanel.showPanel(\"" . caNavUrl($po_request, '', 'Sets', 'addItemForm', array("object_id" => $pn_object_id)) . "\"); return false;' title='" . _t("Add item to %1", $vs_lightbox_display_name) . "'>" . $vs_lightbox_icon . "</a>\n"; } else { $vs_tool_bar .= " <a href='#' class='setsButton' onclick='caMediaPanel.showPanel(\"" . caNavUrl($po_request, '', 'LoginReg', 'LoginForm') . "\"); return false;' title='" . _t("Login to add item to %1", $vs_lightbox_display_name) . "'>" . $vs_lightbox_icon . "</a>\n"; } } if (caObjectsDisplayDownloadLink($po_request)) { # -- get version to download configured in media_display.conf $va_download_display_info = caGetMediaDisplayInfo('download', $t_representation->getMediaInfo('media', 'INPUT', 'MIMETYPE')); $vs_download_version = $va_download_display_info['display_version']; $vs_tool_bar .= caNavLink($po_request, " <span class='glyphicon glyphicon-download-alt'></span>", 'dlButton', 'Detail', 'DownloadRepresentation', '', array('representation_id' => $t_representation->getPrimaryKey(), "object_id" => $pn_object_id, "download" => 1, "version" => $vs_download_version), array("title" => _t("Download"))); } $vs_tool_bar .= "</div><!-- end detailMediaToolbar -->\n"; return $vs_tool_bar; }