示例#1
0
文件: Pazpar2.php 项目: navtis/xerxes
 /** 
  * URLs for the external versions of a single item
  * identified by IS[B,S]N
  * @param ResultSet $results
  * @param config Engine configuration
  * @return array key => url 
  */
 public function addExternalRecordLinks(ResultSet &$results, $config)
 {
     // dummy foreach - there should only ever be one
     foreach ($results->getRecords() as $result) {
         $issn = $isbn = null;
         $xerxes_record = $result->getXerxesRecord();
         $issns = $xerxes_record->getISSNs();
         $isbns = $xerxes_record->getISBNs();
         /* we will just work with the first one of each */
         if (isset($issns[0])) {
             $issn = $issns[0];
         }
         if (isset($isbns[0])) {
             $isbn = $isbns[0];
         }
         $settings = $config->getConfig("external_isn_link", 'false');
         if ($settings != null) {
             if ($issn != null) {
                 foreach ($settings->option as $option) {
                     if ($option['active'] == 'true' && ($option['type'] == 'issn' || $option['type'] == 'isn')) {
                         $url = preg_replace('/____/', $issn, $option['url']);
                         $result->isn_links[(string) $option['public']] = $url;
                     }
                 }
             }
             if ($isbn != null) {
                 foreach ($settings->option as $option) {
                     if ($option['active'] == 'true' && ($option['type'] == 'isbn' || $option['type'] == 'isn')) {
                         $url = preg_replace('/____/', $isbn, $option['url']);
                         $result->isn_links[(string) $option['public']] = $url;
                     }
                 }
             }
         }
     }
 }
示例#2
0
文件: Search.php 项目: navtis/xerxes
 /**
  * Add links to search results
  * 
  * @param ResultSet $results
  */
 public function addRecordLinks(ResultSet &$results)
 {
     // results
     foreach ($results->getRecords() as $result) {
         $xerxes_record = $result->getXerxesRecord();
         // full-record link
         $result->url = $this->linkFullRecord($xerxes_record);
         $result->url_full = $result->url;
         // backwards compatibility
         // sms link
         $result->url_sms = $this->linkSMS($xerxes_record);
         // save or delete link
         $result->url_save = $this->linkSaveRecord($xerxes_record);
         $result->url_save_delete = $result->url_save;
         // backwards compatibility
         // other links
         $result = $this->linkOther($result);
     }
 }
示例#3
0
 /**
  * Add links to search results
  * 
  * @param ResultSet $results
  */
 public function addRecordLinks(ResultSet &$results)
 {
     // results
     foreach ($results->getRecords() as $result) {
         $xerxes_record = $result->getXerxesRecord();
         // author links
         foreach ($xerxes_record->getAuthors() as $author) {
             $author->url = $this->linkAuthor($author);
             $author->url_title = $this->linkAuthorTitle($author);
         }
         // subject links
         foreach ($xerxes_record->getSubjects() as $subject) {
             $subject->url = $this->linkSubject($subject);
         }
         // related titles link
         foreach ($xerxes_record->getPrecedingTitles() as $title) {
             $title->url = $this->linkRelatedTitle($title);
         }
         foreach ($xerxes_record->getSucceedingTitles() as $title) {
             $title->url = $this->linkRelatedTitle($title);
         }
         // full-record link
         $result->url = $this->linkFullRecord($xerxes_record);
         $result->url_full = $result->url;
         // backwards compatibility
         // sms link
         $result->url_sms = $this->linkSMS($xerxes_record);
         // save or delete link
         $result->url_save = $this->linkSaveRecord($xerxes_record);
         $result->url_save_delete = $result->url_save;
         // backwards compatibility
         // openurl redirect
         $result->url_open_redirect = $this->linkOpenURL($xerxes_record);
         // other links
         $this->linkOther($result);
     }
 }
示例#4
0
 /**
  * Add links to search results
  * 
  * @param ResultSet $results
  */
 public function addRecordLinks(ResultSet &$results)
 {
     // results
     foreach ($results->getRecords() as $result) {
         $xerxes_record = $result->getXerxesRecord();
         $this->addBibRecordLinks($xerxes_record);
         foreach ($xerxes_record->getSucceedingTitles() as $title) {
             $title->url = $this->linkRelatedTitle($title);
         }
         // full-record link
         $result->url = $this->linkFullRecord($xerxes_record);
         $result->url_full = $result->url;
         // backwards compatibility
         // sms link
         $result->url_sms = $this->linkSMS($xerxes_record);
         // save or delete link
         $result->url_save = $this->linkSaveRecord($xerxes_record);
         $result->url_save_delete = $result->url_save;
         // backwards compatibility
         // openurl redirect
         $result->url_open_redirect = $this->linkOpenURL($xerxes_record);
         // other links
         $this->linkOther($result);
     }
 }