diff --git a/application/admin/controllers/DataController.php b/application/admin/controllers/DataController.php index f29a1710..a3a059e6 100755 --- a/application/admin/controllers/DataController.php +++ b/application/admin/controllers/DataController.php @@ -67,6 +67,15 @@ class Admin_DataController extends Zend_Controller_Action $this->db->query($sql,array(base64_encode($data),$row->id)); } $this->view->msg='已成功同步缩略图!'; + } elseif ($thumb=='water') { + $sql="select g.id as gid,m.uuid,t.* from thumbnail t left join metadata m on t.id=m.id left join watergn g on m.uuid=g.uuid where t.filetype is not null and t.filename is not null"; + $rows=$this->db->fetchAll($sql); + foreach($rows as $row) { + $data=file_get_contents($this->view->config->geonetwork->url.'srv/cn/resources.get?access=public&id='.$row->gid.'&fname='.urlencode($row->filename)); + $sql="update thumbnail set data=? where id=?"; + $this->db->query($sql,array(base64_encode($data),$row->id)); + } + $this->view->msg='已成功同步缩略图!'; } elseif ($adminuser=='geonetwork') { $sql="select id,username,password,email from users where usertype='administrator'"; $rows=$this->db->fetchAll($sql); diff --git a/application/admin/views/scripts/data/sync.phtml b/application/admin/views/scripts/data/sync.phtml index 065563e0..8a4b5a99 100644 --- a/application/admin/views/scripts/data/sync.phtml +++ b/application/admin/views/scripts/data/sync.phtml @@ -28,6 +28,7 @@
+