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