public function info($pa_parameters) { AssetLoadManager::register('panel'); parent::info($pa_parameters); $vn_annotation_id = isset($pa_parameters['annotation_id']) ? $pa_parameters['annotation_id'] : null; $t_annotation = new ca_representation_annotations($vn_annotation_id); $t_rep = new ca_object_representations($t_annotation->get('representation_id')); if ($vn_annotation_id) { $this->view->setVar('screen', $this->request->getActionExtra()); // name of screen // find object editor screen with media bundle $t_ui = ca_editor_uis::loadDefaultUI('ca_object_representations', $this->request, $t_rep->getTypeID()); $this->view->setVar('representation_editor_screen', $t_ui->getScreenWithBundle('ca_representation_annotations', $this->request)); } return $this->render('widget_representation_annotation_info_html.php', true); }
/** * */ public function removeAnnotation($pn_annotation_id) { if (!($vn_representation_id = $this->getPrimaryKey())) { return null; } $t_annotation = new ca_representation_annotations($pn_annotation_id); if ($t_annotation->get('representation_id') == $vn_representation_id) { $t_annotation->setMode(ACCESS_WRITE); $t_annotation->delete(true); if ($t_annotation->numErrors()) { $this->errors = $t_annotation->errors; return false; } return true; } return false; }
print caDetailLink($this->request, '<span class="glyphicon glyphicon-volume-up"></span> ' . $va_audio["label"], '', 'ca_objects', $t_object->get("object_id"), array("representation_id" => $va_audio["representation_id"])) . "<br/>"; } } if (sizeof($va_annotations)) { print "<H3>Clips</H3>"; $t_annotation = new ca_representation_annotations(); foreach ($va_annotations as $va_annotation) { $t_annotation->load($va_annotation["annotation_id"]); $va_labels = caExtractValuesByUserLocale($va_annotation["labels"]); print "<p>"; foreach ($va_labels as $vs_label) { print "<a href='#' onclick='caAnnoEditorPlayerPlay(" . $va_annotation["startTimecode_raw"] . "); return false;'><strong>" . $vs_label . "</strong></a><br/>"; } print "<a href='#' onclick='caAnnoEditorPlayerPlay(" . $va_annotation["startTimecode_raw"] . "); return false;'><span class='glyphicon glyphicon-play-circle'></span></a> " . $va_annotation["startTimecode"] . " - " . $va_annotation["endTimecode"]; print "<div class='indent'>"; if ($t_annotation->get("description")) { print "<p>" . $t_annotation->get("description") . "</p>"; } if ($t_annotation->get("ca_entities.preferred_labels")) { print "<strong class='uppercase'>" . _t("Related people/organizations") . "</strong><br/>" . $t_annotation->get("ca_entities.preferred_labels", array("delimiter" => ", ", "returnAsLink" => true)); } print "</div></p>"; } } ?> </div><!-- end col --> </div><!-- end row --> <div class="row"> <div class='col-sm-12'> <?php
/** * */ public function getClip() { $pn_id = $this->opo_request->getParameter('id', pInteger); $va_data = array(); $t_annotation = new ca_representation_annotations($pn_id); if ($t_annotation->getPrimaryKey()) { $vs_start = $t_annotation->getPropertyValue('startTimecode'); $vs_end = $t_annotation->getPropertyValue('endTimecode'); $va_data['start'] = $vs_start; $va_data['end'] = $vs_end; $t_rep = new ca_object_representations($t_annotation->get('representation_id')); $va_data['file'] = $vs_file = $t_rep->getMediaPath('media', 'original'); $o_media = new Media(); if ($o_media->read($vs_file)) { $o_media->writeClip($vs_file = tempnam('/tmp', 'meow'), $vs_start, $vs_end); } header("Content-type: audio/mpeg"); header("Content-length: " . @filesize($vs_file)); readfile($vs_file); return; } return $this->makeResponse($va_data, 500, "No such clip"); }