summaryrefslogtreecommitdiffstats
path: root/files/ajax/autocomplete.php
diff options
context:
space:
mode:
authorGeorg Ehrke <dev@georgswebsite.de>2012-04-18 17:27:34 +0200
committerGeorg Ehrke <dev@georgswebsite.de>2012-04-18 17:27:34 +0200
commit45de7ad221f9e505abdabcc5084dd12c80851469 (patch)
tree9afe2994fe01d35cf7aa2e16389c04bb3e298faf /files/ajax/autocomplete.php
parentdfc92675e0d76ad9550a274b712e084e1738831c (diff)
downloadnextcloud-server-45de7ad221f9e505abdabcc5084dd12c80851469.tar.gz
nextcloud-server-45de7ad221f9e505abdabcc5084dd12c80851469.zip
move files to app folder
Diffstat (limited to 'files/ajax/autocomplete.php')
-rw-r--r--files/ajax/autocomplete.php56
1 files changed, 0 insertions, 56 deletions
diff --git a/files/ajax/autocomplete.php b/files/ajax/autocomplete.php
deleted file mode 100644
index 8cdb6188a02..00000000000
--- a/files/ajax/autocomplete.php
+++ /dev/null
@@ -1,56 +0,0 @@
-<?php
-//provide auto completion of paths for use with jquer ui autocomplete
-
-
-// Init owncloud
-
-
-OC_JSON::checkLoggedIn();
-
-// Get data
-$query = $_GET['term'];
-$dirOnly=(isset($_GET['dironly']))?($_GET['dironly']=='true'):false;
-
-if($query[0]!='/'){
- $query='/'.$query;
-}
-
-if(substr($query,-1,1)=='/'){
- $base=$query;
-}else{
- $base=dirname($query);
-}
-
-$query=substr($query,strlen($base));
-
-if($base!='/'){
- $query=substr($query,1);
-}
-$queryLen=strlen($query);
-$query=strtolower($query);
-
-// echo "$base - $query";
-
-$files=array();
-
-if(OC_Filesystem::file_exists($base) and OC_Filesystem::is_dir($base)){
- $dh = OC_Filesystem::opendir($base);
- if($dh){
- if(substr($base,-1,1)!='/'){
- $base=$base.'/';
- }
- while (($file = readdir($dh)) !== false) {
- if ($file != "." && $file != ".."){
- if(substr(strtolower($file),0,$queryLen)==$query){
- $item=$base.$file;
- if((!$dirOnly or OC_Filesystem::is_dir($item))){
- $files[]=(object)array('id'=>$item,'label'=>$item,'name'=>$item);
- }
- }
- }
- }
- }
-}
-OC_JSON::encodedPrint($files);
-
-?>