minor phpdoc cleanup and imports

remotes/origin/ldap_group_count
Jörn Friedrich Dreyer 11 years ago
parent 5dc2e73fe0
commit 5034bd1b12
  1. 7
      lib/private/search.php
  2. 3
      lib/private/search/provider/file.php
  3. 2
      lib/private/search/result/audio.php
  4. 11
      lib/private/search/result/file.php
  5. 2
      lib/private/search/result/folder.php
  6. 2
      lib/private/search/result/image.php

@ -21,6 +21,7 @@
*/ */
namespace OC; namespace OC;
use OC\Search\Provider;
/** /**
* Provide an interface to all search providers * Provide an interface to all search providers
@ -32,13 +33,14 @@ class Search {
/** /**
* Search all providers for $query * Search all providers for $query
* @param string query * @param string $query
* @return array An array of OC\Search\Result's * @return array An array of OC\Search\Result's
*/ */
public static function search($query) { public static function search($query) {
self::initProviders(); self::initProviders();
$results=array(); $results=array();
foreach(self::$providers as $provider) { foreach(self::$providers as $provider) {
/** @var $provider Provider */
$results=array_merge($results, $provider->search($query)); $results=array_merge($results, $provider->search($query));
} }
return $results; return $results;
@ -69,7 +71,8 @@ class Search {
/** /**
* Register a new search provider to search with * Register a new search provider to search with
* @param string $provider class name of a OC\Search\Provider * @param string $class class name of a OC\Search\Provider
* @param array $options optional
*/ */
public static function registerProvider($class, $options=array()) { public static function registerProvider($class, $options=array()) {
self::$registeredProviders[]=array('class'=>$class, 'options'=>$options); self::$registeredProviders[]=array('class'=>$class, 'options'=>$options);

@ -18,6 +18,7 @@
*/ */
namespace OC\Search\Provider; namespace OC\Search\Provider;
use OC\Files\Filesystem;
/** /**
* Provide search results from the 'files' app * Provide search results from the 'files' app
@ -30,7 +31,7 @@ class File extends \OC\Search\Provider {
* @return \OC\Search\Result * @return \OC\Search\Result
*/ */
function search($query) { function search($query) {
$files = \OC\Files\Filesystem::search($query); $files = Filesystem::search($query);
$results = array(); $results = array();
// edit results // edit results
foreach ($files as $fileData) { foreach ($files as $fileData) {

@ -22,7 +22,7 @@ namespace OC\Search\Result;
/** /**
* A found audio file * A found audio file
*/ */
class Audio extends \OC\Search\Result\File { class Audio extends File {
/** /**
* Type name; translated in templates * Type name; translated in templates

@ -18,7 +18,7 @@
*/ */
namespace OC\Search\Result; namespace OC\Search\Result;
use \OC\Files\Filesystem;
/** /**
* A found file * A found file
*/ */
@ -63,9 +63,6 @@ class File extends \OC\Search\Result {
/** /**
* Create a new file search result * Create a new file search result
* @param string $id unique identifier from application: '[app_name]/[item_identifier_in_app]'
* @param string $name displayed text of result
* @param string $link URL to the result within its app
* @param array $data file data given by provider * @param array $data file data given by provider
*/ */
public function __construct(array $data = null) { public function __construct(array $data = null) {
@ -96,15 +93,15 @@ class File extends \OC\Search\Result {
$fileinfo = pathinfo($path); $fileinfo = pathinfo($path);
$dir = $fileinfo['dirname'] . '/'; $dir = $fileinfo['dirname'] . '/';
// add update permissions // add update permissions
if (\OC_Filesystem::isUpdatable($dir)) { if (Filesystem::isUpdatable($dir)) {
$permissions |= \OCP\PERMISSION_UPDATE; $permissions |= \OCP\PERMISSION_UPDATE;
} }
// add delete permissions // add delete permissions
if (\OC_Filesystem::isDeletable($dir)) { if (Filesystem::isDeletable($dir)) {
$permissions |= \OCP\PERMISSION_DELETE; $permissions |= \OCP\PERMISSION_DELETE;
} }
// add share permissions // add share permissions
if (\OC_Filesystem::isSharable($dir)) { if (Filesystem::isSharable($dir)) {
$permissions |= \OCP\PERMISSION_SHARE; $permissions |= \OCP\PERMISSION_SHARE;
} }
// return // return

@ -22,7 +22,7 @@ namespace OC\Search\Result;
/** /**
* A found folder * A found folder
*/ */
class Folder extends \OC\Search\Result\File { class Folder extends File {
/** /**
* Type name; translated in templates * Type name; translated in templates

@ -22,7 +22,7 @@ namespace OC\Search\Result;
/** /**
* A found image file * A found image file
*/ */
class Image extends \OC\Search\Result\File { class Image extends File {
/** /**
* Type name; translated in templates * Type name; translated in templates

Loading…
Cancel
Save