Beispiel #1
0
 /**
  *
  */
 public function SelectRepresentations()
 {
     $pn_item_id = $this->request->getParameter('item_id', pInteger);
     $pn_object_id = $this->request->getParameter('object_id', pInteger);
     $t_item = new ca_set_items($pn_item_id);
     $t_set = new ca_sets($t_item->get('set_id'));
     if (!$t_set->getPrimaryKey() || !$t_set->haveAccessToSet($this->request->getUserID(), __CA_SET_EDIT_ACCESS__)) {
         // TODO: proper error reporting or redirect?
         return;
     }
     $t_object = new ca_objects($pn_object_id);
     if (!$vn_object_id) {
         $vn_object_id = 0;
     }
     $t_rep = new ca_object_representations($t_object->getPrimaryRepresentationID());
     $va_opts = array('use_book_viewer' => true, 'display' => 'media_overlay', 'object_id' => $pn_object_id, 'item_id' => $pn_item_id, 'containerID' => 'caMediaPanelContentArea', 'access' => caGetUserAccessValues($this->request));
     $this->response->addContent($t_rep->getRepresentationViewerHTMLBundle($this->request, $va_opts, array('sectionsAreSelectable' => true, 'use_book_viewer_when_number_of_representations_exceeds' => 0)));
 }
 /**
  * Returns content for overlay containing details for object representation
  *
  * Expects the following request parameters: 
  *		object_id = the id of the ca_objects record to display
  *		representation_id = the id of the ca_object_representations record to display; the representation must belong to the specified object
  *
  *	Optional request parameters:
  *		version = The version of the representation to display. If omitted the display version configured in media_display.conf is used
  *		order_item_id = ca_commerce_order_items.item_id value to limit representation display to
  *
  */
 public function GetRepresentationInfo()
 {
     $pn_object_id = $this->request->getParameter('object_id', pInteger);
     $pn_representation_id = $this->request->getParameter('representation_id', pInteger);
     if (!($ps_display_type = trim($this->request->getParameter('display_type', pString)))) {
         $ps_display_type = 'media_overlay';
     }
     if (!($ps_containerID = trim($this->request->getParameter('containerID', pString)))) {
         $ps_containerID = 'caMediaPanelContentArea';
     }
     if (!$pn_object_id) {
         $pn_object_id = 0;
     }
     $t_rep = new ca_object_representations($pn_representation_id);
     if (!$t_rep->getPrimaryKey()) {
         $this->postError(1100, _t('Invalid object/representation'), 'DetailController->GetRepresentationInfo');
         return;
     }
     $va_opts = array('display' => $ps_display_type, 'object_id' => $pn_object_id, 'containerID' => $ps_containerID, 'access' => caGetUserAccessValues($this->request));
     if (strlen($vs_use_book_viewer = $this->request->getParameter('use_book_viewer', pInteger))) {
         $va_opts['use_book_viewer'] = (bool) $vs_use_book_viewer;
     }
     $vs_output = $t_rep->getRepresentationViewerHTMLBundle($this->request, $va_opts);
     if ($this->request->getParameter('include_tool_bar', pInteger)) {
         $vs_output = "<div class='repViewerContCont'><div id='cont{$vn_rep_id}' class='repViewerCont'>" . $vs_output . caRepToolbar($this->request, $t_rep, $pn_object_id) . "</div></div>";
     }
     $this->response->addContent($vs_output);
 }
 /**
  * Returns content for overlay containing details for object representation
  *
  * Expects the following request parameters: 
  *		object_id = the id of the ca_objects record to display
  *		representation_id = the id of the ca_object_representations record to display; the representation must belong to the specified object
  *
  *	Optional request parameters:
  *		version = The version of the representation to display. If omitted the display version configured in media_display.conf is used
  *		order_item_id = ca_commerce_order_items.item_id value to limit representation display to
  *
  */
 public function GetRepresentationInfo()
 {
     $vn_object_id = $this->request->getParameter('object_id', pInteger);
     $pn_representation_id = $this->request->getParameter('representation_id', pInteger);
     $pn_order_item_id = $this->request->getParameter('order_item_id', pInteger);
     if (!($ps_display_type = trim($this->request->getParameter('display_type', pString)))) {
         $ps_display_type = 'media_overlay';
     }
     if (!($ps_containerID = trim($this->request->getParameter('containerID', pString)))) {
         $ps_containerID = 'caMediaPanelContentArea';
     }
     if (!$vn_object_id) {
         $vn_object_id = 0;
     }
     $t_rep = new ca_object_representations($pn_representation_id);
     $va_opts = array('display' => $ps_display_type, 'object_id' => $vn_object_id, 'order_item_id' => $pn_order_item_id, 'onlyShowRepresentationsInOrder' => $pn_order_item_id ? true : false, 'containerID' => $ps_containerID, 'access' => caGetUserAccessValues($this->request));
     if (strlen($vs_use_book_viewer = $this->request->getParameter('use_book_viewer', pInteger))) {
         $va_opts['use_book_viewer'] = (bool) $vs_use_book_viewer;
     }
     $this->response->addContent($t_rep->getRepresentationViewerHTMLBundle($this->request, $va_opts));
 }