zfolders.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. /**
  3. * The root folder entry point for yueku.
  4. *
  5. * @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.cnezsoft.com)
  6. * @license ZPL(http://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
  7. * @author Chunsheng Wang <chunsheng@cnezsoft.com>
  8. * @package entries
  9. * @version 1
  10. * @link https://www.zentao.net
  11. */
  12. class zfoldersEntry extends entry
  13. {
  14. /**
  15. * GET method.
  16. *
  17. * @access public
  18. * @return string
  19. */
  20. public function get()
  21. {
  22. $this->app->loadApiConfig('zdisk');
  23. $nodes = array();
  24. $now = gmdate("Y-m-d\TH:i:s\Z");
  25. foreach($this->config->zdisk->root as $code => $node)
  26. {
  27. $nodes[] = array(
  28. 'id' => $code,
  29. 'parentID' => null,
  30. 'storeID' => 0,
  31. 'name' => $node['name'] . ($node['type'] == 'file' ? '.txt' : ''),
  32. 'type' => $node['type'],
  33. 'size' => 0,
  34. 'createdTime' => $now,
  35. 'accessedTime' => $now,
  36. 'editedTime' => $now,
  37. 'modifiedTime' => $now,
  38. );
  39. }
  40. return $this->send(200, array('nodes' => $nodes));
  41. }
  42. }