server/apps/files/ajax/rawlist.php

27 lines
610 B
PHP
Raw Normal View History

2012-04-02 17:39:24 +00:00
<?php
// only need filesystem apps
$RUNTIME_APPTYPES=array('filesystem');
// Init owncloud
2012-04-29 23:48:01 +00:00
require_once('lib/template.php');
2012-04-02 17:39:24 +00:00
2012-05-03 10:23:29 +00:00
OCP\JSON::checkLoggedIn();
2012-04-02 17:39:24 +00:00
// Load the files
$dir = isset( $_GET['dir'] ) ? $_GET['dir'] : '';
2012-04-05 21:18:44 +00:00
$mimetype = isset($_GET['mimetype']) ? $_GET['mimetype'] : '';
2012-04-02 17:39:24 +00:00
// make filelist
$files = array();
2012-04-05 21:18:44 +00:00
foreach( OC_Files::getdirectorycontent( $dir, $mimetype ) as $i ){
2012-05-01 19:07:08 +00:00
$i["date"] = OCP\Util::formatDate($i["mtime"] );
$i['mimetype_icon'] = $i['type'] == 'dir' ? \mimetype_icon('dir'): \mimetype_icon($i['mimetype']);
2012-04-02 17:39:24 +00:00
$files[] = $i;
}
2012-05-03 10:23:29 +00:00
OCP\JSON::success(array('data' => $files));
2012-04-02 17:39:24 +00:00
?>