From a693c9387ed49f298c12f291ab0a64334f33fbe4 Mon Sep 17 00:00:00 2001 From: wlx Date: Sun, 15 Apr 2012 15:31:43 +0000 Subject: [PATCH] merge r2241, fix import metadata's thumbnail problem --- application/models/ISO19115.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/application/models/ISO19115.php b/application/models/ISO19115.php index fde68f13..c2210741 100755 --- a/application/models/ISO19115.php +++ b/application/models/ISO19115.php @@ -172,6 +172,7 @@ class ISO19115 //删除所有未用到的responsible数据 $sql="delete from responsible where id not in (select distinct(resid) from role)"; $db->query($sql); + $this->view->config = Zend_Registry::get('config'); //if (!empty($this->doi)) $row->doi=$this->doi; //生成空白统计数据,可以转移到数据库端处理(todo) @@ -208,7 +209,11 @@ class ISO19115 $r=$db->fetchRow($sql,array($this->uuid)); if ($r) { - $thumb=base64_encode(file_get_contents($this->view->config->geonetwork->url.'srv/cn/resources.get?access=public&id='.$r->gid.'&fname='.urlencode($this->graph['filename']))); + if ($this->view->config) + $geonetwork=$this->view->config->geonetwork->url; + else + $geonetwork='/geonetwork/'; + $thumb=base64_encode(file_get_contents($geonetwork.'srv/cn/resources.get?access=public&id='.$r->gid.'&fname='.urlencode($this->graph['filename']))); $sql="insert into thumbnail (id,data,filetype,filedesc,filename) values(?,?,?,?,?)"; $db->query($sql,array($id,$thumb,$this->graph['filetype'],$this->graph['filedesc'],$this->graph['filename'])); }