예제 #1
0
 function showQdc()
 {
     module_load_include('php', 'Fedora_Repository', 'ObjectHelper');
     $objectHelper = new ObjectHelper();
     //$returnValue['title']="Description";
     $content = $objectHelper->getQDC($this->pid);
     $collection_fieldset = array('#title' => t('Description'), '#collapsible' => TRUE, '#collapsed' => FALSE, '#value' => $content);
     return theme('fieldset', $collection_fieldset);
 }
예제 #2
0
 function showQdc()
 {
     require_once drupal_get_path('module', 'Fedora_Repository') . '/ObjectHelper.php';
     $objectHelper = new ObjectHelper();
     //$returnValue['title']="Description";
     $content = $objectHelper->getQDC($this->pid);
     $collection_fieldset = array('#title' => t('Description'), '#collapsible' => TRUE, '#collapsed' => TRUE, '#value' => $content);
     return theme('fieldset', $collection_fieldset);
 }
예제 #3
0
 /**
  * gets a list of datastreams and related function that we should use to show datastreams in their own fieldsets
  * from the content model associated with the object
  */
 function createExtraFieldsets($pid, $contentModel)
 {
     //$models = $collectionHelper->getContentModels($collectionPid, false);
     // possible problem in below if the collection policy has multiple content models
     //with different pids but same dsid we could get wrong one,  low probability and functionality
     // will probably change for fedora version 3.
     if (empty($contentModel)) {
         return null;
     }
     try {
         $contentModelXMLStream = $this->getStream($contentModel, 'ISLANDORACM', false);
     } catch (Exception $e) {
     }
     if (empty($contentModelXMLStream)) {
         return null;
     }
     $count = 0;
     $output = '';
     try {
         $xml = new SimpleXMLElement($contentModelXMLStream);
     } catch (Exception $e) {
         //just show default dc or qdc as we could not find a content model
         module_load_include('php', 'Fedora_Repository', 'ObjectHelper');
         $objectHelper = new ObjectHelper();
         $metaDataText = 'Description';
         $body = $objectHelper->getQDC($pid);
         $fieldset = array('#title' => t($metaDataText), '#collapsible' => TRUE, '#collapsed' => TRUE, '#value' => $body);
         $output .= theme('fieldset', $fieldset);
         return $output;
     }
     if ($xml->display_in_fieldset->datastream != null) {
         foreach ($xml->display_in_fieldset->datastream as $datastream) {
             $count++;
             $dsId = $datastream['id'];
             $expanded = $datastream['expanded'];
             $phpFile = '';
             if (!empty($datastream->method->file)) {
                 $phpFile = strip_tags($datastream->method->file->asXML());
             }
             if (!empty($phpFile)) {
                 $phpClass = strip_tags($datastream->method->class_name->asXML());
                 $phpMethod = strip_tags($datastream->method->method_name->asXML());
                 require_once drupal_get_path('module', 'Fedora_Repository') . '/' . $phpFile;
                 $thisClass = new $phpClass($pid);
                 $output .= $thisClass->{$phpMethod}();
             }
         }
     }
     if ($count < 1) {
         //just show default dc or qdc as we could not find a content model
         $metaDataText = 'Description';
         $body = $this->getQDC($pid);
         $fieldset = array('#title' => t($metaDataText), '#collapsible' => TRUE, '#collapsed' => TRUE, '#value' => $body);
         $output .= theme('fieldset', $fieldset);
     }
     if ('ilives:pageCModel' == $contentModel || 'ilives:bookCModel' == $contentModel) {
         global $user;
         $qs = '';
         if ($user->uid != 0) {
             $qs = '?uid=' . base64_encode($user->name . ':' . $user->sid);
         }
         $viewer_url = variable_get('fedora_base_url', '') . '/get/' . $pid . '/ilives:viewerSdef/getViewer' . $qs;
         $html = '<iframe src="' . $viewer_url . '" frameborder="0" style="width: 100%; height: 400px;">Errors: unable to load viewer</iframe>';
         $fieldset = array('#title' => t('Viewer'), '#collapsible' => TRUE, '#collapsed' => $collapsed, '#value' => $html);
         return theme('fieldset', $fieldset);
     }
     return $output;
 }