remove unused FilelistController.php

This commit is contained in:
wlx 2011-11-23 03:29:21 +00:00
parent 11c47866fc
commit a94865fccc
1 changed files with 0 additions and 66 deletions

View File

@ -1,66 +0,0 @@
<?php
class FilelistController extends Zend_Controller_Action {
function preDispatch()
{
$this->db=Zend_Registry::get('db');
}
function indexAction() {
$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));
/* $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++;
}
}
}
*/
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender();
echo Zend_Json::encode($files);
}
function subAction() {
$uuid=$this->_request->getParam('uuid');
$subpath=(int)$this->_request->getParam('subpath');
//$subPath=urldecode($getUrl);
//$depth=substr_count($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));
/*
$documents=array();
$i=0;
foreach($files as $subFile) {
if(substr($subFile['file_name'], 0,strlen($subPath))==$subPath) {// start with "/a/"
$subFilePath=str_replace($subPath, '', $subFile['file_name']);
if(!empty($subFilePath)) {
$pos = strpos($subFilePath, '/');
$pathArray=explode("/",$subFilePath);
if(empty($pathArray[1])) {
$documents[$i] = $subFile;
if ($pos === false) {
$documents[$i]['file_name']=$subPath.$pathArray[0];
} else {
$documents[$i]['file_name']=$subPath.$pathArray[0].'/';
}
$i++;
}
}
}
} */
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender();
echo Zend_Json::encode($files);
}
}