/**
  * QuickLook
  */
 public function QuickLook()
 {
     $vn_object_id = (int) $this->request->getParameter('object_id', pInteger);
     $t_object = new ca_objects($vn_object_id);
     $t_rep = new ca_object_representations($t_object->getPrimaryRepresentationID());
     $this->response->addContent(caGetMediaViewerHTMLBundle($this->request, array('display' => 'media_overlay', 't_subject' => $t_object, 't_representation' => $t_rep, 'containerID' => 'caMediaPanelContentArea')));
 }
 /**
  *
  */
 public function SelectRepresentations()
 {
     $pn_item_id = $this->request->getParameter('item_id', pInteger);
     $pn_object_id = (int) $this->request->getParameter('object_id', pInteger);
     $t_item = new ca_commerce_order_items($pn_item_id);
     $t_object = new ca_objects($pn_object_id);
     $t_rep = new ca_object_representations($t_object->getPrimaryRepresentationID());
     $va_opts = array('use_book_viewer' => true, 'display' => 'media_overlay', 't_subject' => $t_object, 't_representation' => $t_rep, 'order_item_id' => $pn_item_id, 'containerID' => 'caMediaPanelContentArea', 'access' => caGetUserAccessValues($this->request));
     $this->response->addContent(caGetMediaViewerHTMLBundle($this->request, $va_opts, array('sectionsAreSelectable' => true, 'use_book_viewer_when_number_of_representations_exceeds' => 0)));
 }
예제 #3
0
 /**
  * Returns content for overlay containing detail + editor for object representations only (not media attributes)
  *
  * Expects the following request parameters: 
  *		representation_id = the id of the ca_object_representations record to display; the representation must belong to the specified object
  *		reload = return content for reload of existing editor. [Default=false]
  *
  *	Optional request parameters:
  *		version = The version of the representation to display. If omitted the display version configured in media_display.conf is used
  *
  */
 public function GetRepresentationEditor()
 {
     list($vn_subject_id, $t_subject) = $this->_initView();
     $pn_representation_id = $this->request->getParameter('representation_id', pInteger);
     $pb_reload = (bool) $this->request->getParameter('reload', pInteger);
     $t_rep = new ca_object_representations($pn_representation_id);
     if (!$vn_subject_id) {
         if (is_array($va_subject_ids = $t_rep->get($t_subject->tableName() . '.' . $t_subject->primaryKey(), array('returnAsArray' => true))) && sizeof($va_subject_ids)) {
             $vn_subject_id = array_shift($va_subject_ids);
         } else {
             $this->postError(1100, _t('Invalid object/representation'), 'ObjectEditorController->GetRepresentationEditor');
             return;
         }
     }
     $va_opts = array('display' => 'media_editor', 't_subject' => $t_subject, 't_representation' => $t_rep, 'containerID' => 'caMediaPanelContentArea', 'mediaEditor' => true, 'noControls' => $pb_reload);
     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(caGetMediaViewerHTMLBundle($this->request, $va_opts));
 }
예제 #4
0
 /**
  * Returns content for overlay containing details for media attribute
  *
  * Expects the following request parameters: 
  *		value_id = the id of the attribute value (ca_attribute_values) record to display
  *
  *	Optional request parameters:
  *		version = The version of the representation to display. If omitted the display version configured in media_display.conf is used
  *
  */
 public function GetMediaInfo()
 {
     $pn_representation_id = $this->request->getParameter('representation_id', pInteger);
     $pn_value_id = $this->request->getParameter('value_id', pInteger);
     if ($pn_value_id) {
         $t_rep = new ca_object_representations();
         $t_attr_val = new ca_attribute_values($pn_value_id);
         $t_attr = new ca_attributes($t_attr_val->get('attribute_id'));
         $t_subject = $this->opo_datamodel->getInstanceByTableNum($t_attr->get('table_num'), true);
         $t_subject->load($t_attr->get('row_id'));
         $va_rep_display_info = caGetMediaDisplayInfo('media_overlay', $t_attr_val->getMediaInfo('value_blob', 'INPUT', 'MIMETYPE'));
         // check subject_id here
         $va_opts = array('t_attribute_value' => $t_attr_val, 'display' => 'media_overlay', 't_subject' => $t_subject, 'containerID' => 'caMediaPanelContentArea');
         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(caGetMediaViewerHTMLBundle($this->request, $va_opts));
     } elseif ($pn_representation_id) {
         $t_rep = new ca_object_representations($pn_representation_id);
         $t_subject = new ca_objects($vn_subject_id = $this->request->getParameter('object_id', pInteger));
         if (!$vn_subject_id) {
             if (is_array($va_subject_ids = $t_rep->get($t_subject->tableName() . '.' . $t_subject->primaryKey(), array('returnAsArray' => true))) && sizeof($va_subject_ids)) {
                 $vn_subject_id = array_shift($va_subject_ids);
             } else {
                 $this->postError(1100, _t('Invalid object/representation'), 'ObjectEditorController->GetRepresentationInfo');
                 return;
             }
         }
         $va_opts = array('display' => 'media_overlay', 't_subject' => $t_subject, 't_representation' => $t_rep, 'containerID' => 'caMediaPanelContentArea');
         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(caGetMediaViewerHTMLBundle($this->request, $va_opts));
     } else {
         //
     }
     //$pn_value_id 	= $this->request->getParameter('value_id', pInteger);
     //$this->response->addContent(caGetMediaViewerHTMLBundle($this->request, array('display' => 'media_overlay', 't_attribute_value' => $pn_value_id, 'containerID' => 'caMediaPanelContentArea')));
 }