add filelistAction and subfilelistAction
This commit is contained in:
parent
45cfd597aa
commit
e59b33adab
|
@ -632,6 +632,29 @@ class ServiceController extends Zend_Controller_Action
|
|||
echo Zend_Json::encode($msg);
|
||||
exit();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function filelistAction()
|
||||
{
|
||||
$uuid=$this->_request->getParam('uuid');
|
||||
$sql="select f.filename,f.id,s.uuid,f.depth from datafile f,dataset s where s.id=f.dsid and s.uuid=? and f.depth=1 and f.filename<>'/uuid.txt' order by f.isdir desc,f.filename";
|
||||
$files=$this->db->fetchAll($this->db->quoteInto($sql,$uuid));
|
||||
$this->_helper->layout()->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender();
|
||||
echo Zend_Json::encode($files);
|
||||
}
|
||||
|
||||
function subfilelistAction()
|
||||
{
|
||||
$uuid=$this->_request->getParam('uuid');
|
||||
$subpath=(int)$this->_request->getParam('subpath');
|
||||
$depth=(int)$this->_request->getParam('depth');
|
||||
$depth++;
|
||||
$sql="select f.filename,f.id,s.uuid,f.depth from datafile f,dataset s where s.id=f.dsid and s.uuid=? and f.depth=".$depth." and f.filename<>'/uuid.txt' and f.filename ilike (select filename from datafile where id=".$subpath.")||'%' order by f.isdir desc,f.filename";
|
||||
$files=$this->db->fetchAll($this->db->quoteInto($sql,$uuid));
|
||||
$this->_helper->layout()->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender();
|
||||
echo Zend_Json::encode($files);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue