diff options
author | Alessandro Cosentino <cosenal@gmail.com> | 2013-03-03 22:27:18 +0100 |
---|---|---|
committer | Alessandro Cosentino <cosenal@gmail.com> | 2013-03-03 22:27:18 +0100 |
commit | ef450898bb702877dafb755e425fe8f37b23417b (patch) | |
tree | 53162b432a7f5a6c9d99d9eb77aee30d670853ae /external_api/folder.php | |
parent | 0852773340ed26ecc8faa8e61192f38132673bc6 (diff) |
create folder api call
Diffstat (limited to 'external_api/folder.php')
-rw-r--r-- | external_api/folder.php | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/external_api/folder.php b/external_api/folder.php index e2bbeb870..f9dae7535 100644 --- a/external_api/folder.php +++ b/external_api/folder.php @@ -11,10 +11,24 @@ class API_Folder { $bl = $container['FolderBL']; $folders = $bl->getAll(); $serializedFolders = array(); + + //TODO: check the behaviour for nested folders foreach ($folders as $folder) { $serializedFolders[] = $folder->jsonSerialize(); } return new \OC_OCS_Result($serializedFolders); } + + public static function create() { + + $name = $_POST['name']; + $parentId = $_POST['parentid']; + + $container = createDIContainer(); + $bl = $container['FolderBL']; + $bl->create($name, $parentId); + + return new \OC_OCS_Result(); + } } |