This commit is contained in:
4ngle 2010-07-06 06:38:27 +00:00
parent 30f5f9edbd
commit 33e2632543
1 changed files with 9 additions and 12 deletions

View File

@ -4,18 +4,16 @@ class FilelistController extends Zend_Controller_Action {
$uuid=$this->_request->getParam('uuid');
$filelist=new FilelistTable();
$adapter=$filelist->getAdapter();
$db=$adapter->query("select file_name,file_path,id,meta_uuid from westdc_fileinfo where meta_uuid='$uuid' and depth=1 order by isdir desc,file_name");
$db=$adapter->query("select file_name,file_path,id,meta_uuid from westdc_fileinfo where meta_uuid='$uuid' order by id");
$files=$db->fetchAll();
$documents=array();
$i=0;
foreach($files as $file) {
$fileName=$file['file_name'];
if($fileName!=='/uuid.txt') {
$pathArray=explode("/",$fileName);
if(empty($pathArray[2])) {
$documents[$i] = $file;
$i++;
}
$pathArray=explode("/",$fileName);
if(empty($pathArray[2])) {
$documents[$i] = $file;
$i++;
}
}
$this->_helper->layout()->disableLayout();
@ -24,12 +22,11 @@ class FilelistController extends Zend_Controller_Action {
}
function subAction() {
$uuid=$this->_request->getParam('uuid');
$getUrl=$this->_request->getParam('subpath');
$subPath=urldecode($getUrl);
$depth=substr_count($subPath,'/');
$id=$this->_request->getParam('id');
$filelist=new FilelistTable();
$adapter=$filelist->getAdapter();
$db=$adapter->query("select file_name,file_path,id,meta_uuid from westdc_fileinfo where meta_uuid='$uuid' and depth='$depth' and file_name ilike '$subpath%' order by isdir desc,file_name");
$subPath=$adapter->fetchOne("select file_name from westdc_fileinfo where id='$id'");
$db=$adapter->query("select file_name,file_path,id,meta_uuid from westdc_fileinfo where meta_uuid='$uuid' order by id");
$files=$db->fetchAll();
$documents=array();
$i=0;
@ -58,4 +55,4 @@ class FilelistController extends Zend_Controller_Action {
echo Zend_Json::encode($documents);
}
}
}