Пример #1
0
 /**
  * Returns the publication in MARC21 format as an attachment.
  *
  * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.
  *
  * @return  void
  */
 public function display($tpl = null)
 {
     $this->item = $this->get('Item');
     // Add publications helper file
     require_once JPATH_COMPONENT . '/helpers/publication.php';
     // Generate MARC record
     $marc = PublicationHelper::rawMarc($this->item);
     // Set document properties
     $document = JFactory::getDocument();
     $document->setMimeEncoding('text/plain');
     JResponse::setHeader('Content-disposition', 'attachment; filename="marc.txt"', true);
     echo $marc;
 }
Пример #2
0
 /**
  * Returns the publication in MARC21 format as an attachment.
  *
  * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.
  *
  * @return  void
  */
 public function display($tpl = null)
 {
     $this->item = $this->get('Item');
     // Add publications helper file
     require_once JPATH_COMPONENT . '/helpers/publication.php';
     // Load publisher model
     $publisherModel = JModelLegacy::getInstance('publisher', 'IssnregistryModel');
     // Load publisher
     $publisher = $publisherModel->getItem($this->item->publisher_id);
     // Load form model
     $formModel = JModelLegacy::getInstance('form', 'IssnregistryModel');
     // Load form
     $form = $formModel->getItem($this->item->form_id);
     // Generate MARC record
     $marc = PublicationHelper::rawMarc($this->item, $form, $publisher);
     // Set document properties
     $document = JFactory::getDocument();
     $document->setMimeEncoding('text/plain');
     JResponse::setHeader('Content-disposition', 'attachment; filename="marc.txt"', true);
     echo $marc;
 }