add simple odt option

This commit is contained in:
wlx 2013-06-11 09:23:21 +00:00
parent 223b46b6c9
commit 70a968e556
1 changed files with 16 additions and 7 deletions

View File

@ -460,6 +460,7 @@ class ServiceController extends Zend_Controller_Action
$this->_helper->viewRenderer->setNoRender(); $this->_helper->viewRenderer->setNoRender();
$uuid=$this->_request->getParam('uuid'); $uuid=$this->_request->getParam('uuid');
$review=$this->_request->getParam('review'); $review=$this->_request->getParam('review');
$ac=$this->_request->getParam('ac');
//error_reporting(1); //error_reporting(1);
if (!empty($uuid)) if (!empty($uuid))
{ {
@ -572,10 +573,13 @@ class ServiceController extends Zend_Controller_Action
require_once('odtphp/library/odf.php'); require_once('odtphp/library/odf.php');
$config["PATH_TO_TMP"]="/tmp/zip"; $config["PATH_TO_TMP"]="/tmp/zip";
$config["ZIP_PROXY"]="ZipArchive"; $config["ZIP_PROXY"]="ZipArchive";
if ($ac=='simple')
$odf=new Odf("../data/metadata-template-simple.odt",$config);
else
$odf=new Odf("../data/metadata-template.odt",$config); $odf=new Odf("../data/metadata-template.odt",$config);
$odf->setVars('title',$row['title'],true,'utf-8'); $odf->setVars('title',$row['title'],true,'utf-8');
@$odf->setVars('title_en',$row['title_en'],true,'utf-8'); @$odf->setVars('title_en',$row['title_en'],true,'utf-8');
$odf->setVars('uuid',$row['uuid'],true,'utf-8'); @$odf->setVars('uuid',$row['uuid'],true,'utf-8');
$odf->setVars('datetime',date('Y-m-d')); $odf->setVars('datetime',date('Y-m-d'));
$odf->setVars('abstract',$row['description'],true,'utf-8'); $odf->setVars('abstract',$row['description'],true,'utf-8');
@$odf->setVars('theme_keyword',$row['keyword']['theme'],true,'utf-8'); @$odf->setVars('theme_keyword',$row['keyword']['theme'],true,'utf-8');
@ -602,8 +606,13 @@ class ServiceController extends Zend_Controller_Action
@$odf->setVars('south',$row['south'],true,'utf-8'); @$odf->setVars('south',$row['south'],true,'utf-8');
@$odf->setVars('west',$row['west'],true,'utf-8'); @$odf->setVars('west',$row['west'],true,'utf-8');
@$odf->setVars('east',$row['east'],true,'utf-8'); @$odf->setVars('east',$row['east'],true,'utf-8');
$odf->setImage('bigthumb', 'http://westdc.westgis.ac.cn/service/bigthumb/uuid/'.$row['uuid']); if (!$ac=='simple')
$odf->setImage('thumb', 'http://westdc.westgis.ac.cn/service/thumb/uuid/'.$row['uuid']); {
@$odf->setImage('bigthumb', 'http://westdc.westgis.ac.cn/service/bigthumb/uuid/'.$row['uuid']);
@$odf->setImage('thumb', 'http://westdc.westgis.ac.cn/service/thumb/uuid/'.$row['uuid']);
}
$odf->exportAsAttachedFile($row['title'].'.odt'); $odf->exportAsAttachedFile($row['title'].'.odt');
} }