summaryrefslogtreecommitdiffstats
path: root/lib/search
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2013-09-25 13:36:30 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2013-09-30 16:36:59 +0200
commit9c9dc276b7a1d2592c4fb0a887888632dc1f1e29 (patch)
treebbe3aed3e09c31c68806bdb8acffef70ba08f51c /lib/search
parenta711399e62d5a9f14d4b748efe4354ee37e61f13 (diff)
downloadnextcloud-server-9c9dc276b7a1d2592c4fb0a887888632dc1f1e29.tar.gz
nextcloud-server-9c9dc276b7a1d2592c4fb0a887888632dc1f1e29.zip
move the private namespace OC into lib/private - OCP will stay in lib/public
Conflicts: lib/private/vcategories.php
Diffstat (limited to 'lib/search')
-rw-r--r--lib/search/provider.php18
-rw-r--r--lib/search/provider/file.php46
-rw-r--r--lib/search/result.php26
3 files changed, 0 insertions, 90 deletions
diff --git a/lib/search/provider.php b/lib/search/provider.php
deleted file mode 100644
index b617b9c5d94..00000000000
--- a/lib/search/provider.php
+++ /dev/null
@@ -1,18 +0,0 @@
-<?php
-/**
- * provides search functionalty
- */
-abstract class OC_Search_Provider {
- private $options;
-
- public function __construct($options) {
- $this->options=$options;
- }
-
- /**
- * search for $query
- * @param string $query
- * @return array An array of OC_Search_Result's
- */
- abstract public function search($query);
-}
diff --git a/lib/search/provider/file.php b/lib/search/provider/file.php
deleted file mode 100644
index 9bd50931517..00000000000
--- a/lib/search/provider/file.php
+++ /dev/null
@@ -1,46 +0,0 @@
-<?php
-
-class OC_Search_Provider_File extends OC_Search_Provider{
- function search($query) {
- $files=\OC\Files\Filesystem::search($query, true);
- $results=array();
- $l=OC_L10N::get('lib');
- foreach($files as $fileData) {
- $path = $fileData['path'];
- $mime = $fileData['mimetype'];
-
- $name = basename($path);
- $container = dirname($path);
- $text = '';
- $skip = false;
- if($mime=='httpd/unix-directory') {
- $link = OC_Helper::linkTo( 'files', 'index.php', array('dir' => $path));
- $type = (string)$l->t('Files');
- }else{
- $link = OC_Helper::linkToRoute( 'download', array('file' => $path));
- $mimeBase = $fileData['mimepart'];
- switch($mimeBase) {
- case 'audio':
- $skip = true;
- break;
- case 'text':
- $type = (string)$l->t('Text');
- break;
- case 'image':
- $type = (string)$l->t('Images');
- break;
- default:
- if($mime=='application/xml') {
- $type = (string)$l->t('Text');
- }else{
- $type = (string)$l->t('Files');
- }
- }
- }
- if(!$skip) {
- $results[] = new OC_Search_Result($name, $text, $link, $type, $container);
- }
- }
- return $results;
- }
-}
diff --git a/lib/search/result.php b/lib/search/result.php
deleted file mode 100644
index 42275c2df11..00000000000
--- a/lib/search/result.php
+++ /dev/null
@@ -1,26 +0,0 @@
-<?php
-/**
- * a result of a search
- */
-class OC_Search_Result{
- public $name;
- public $text;
- public $link;
- public $type;
- public $container;
-
- /**
- * create a new search result
- * @param string $name short name for the result
- * @param string $text some more information about the result
- * @param string $link link for the result
- * @param string $type the type of result as human readable string ('File', 'Music', etc)
- */
- public function __construct($name, $text, $link, $type, $container) {
- $this->name=$name;
- $this->text=$text;
- $this->link=$link;
- $this->type=$type;
- $this->container=$container;
- }
-}