rawlist.php 610 B

123456789101112131415161718192021222324252627
  1. <?php
  2. // only need filesystem apps
  3. $RUNTIME_APPTYPES=array('filesystem');
  4. // Init owncloud
  5. require_once('lib/template.php');
  6. OCP\JSON::checkLoggedIn();
  7. // Load the files
  8. $dir = isset( $_GET['dir'] ) ? $_GET['dir'] : '';
  9. $mimetype = isset($_GET['mimetype']) ? $_GET['mimetype'] : '';
  10. // make filelist
  11. $files = array();
  12. foreach( OC_Files::getdirectorycontent( $dir, $mimetype ) as $i ){
  13. $i["date"] = OCP\Util::formatDate($i["mtime"] );
  14. $i['mimetype_icon'] = $i['type'] == 'dir' ? \mimetype_icon('dir'): \mimetype_icon($i['mimetype']);
  15. $files[] = $i;
  16. }
  17. OCP\JSON::success(array('data' => $files));
  18. ?>