2011-03-04 01:08:54 +03:00
|
|
|
<?php
|
|
|
|
|
2012-03-30 16:39:07 +04:00
|
|
|
// only need filesystem apps
|
|
|
|
$RUNTIME_APPTYPES=array('filesystem');
|
|
|
|
|
2011-03-04 01:08:54 +03:00
|
|
|
// Init owncloud
|
|
|
|
require_once('../../lib/base.php');
|
|
|
|
|
2011-09-24 00:22:59 +04:00
|
|
|
OC_JSON::checkLoggedIn();
|
2011-03-04 01:08:54 +03:00
|
|
|
|
|
|
|
// Load the files
|
|
|
|
$dir = isset( $_GET['dir'] ) ? $_GET['dir'] : '';
|
2011-04-17 17:59:06 +04:00
|
|
|
$doBreadcrumb = isset( $_GET['breadcrumb'] ) ? true : false;
|
|
|
|
$data = array();
|
2011-03-04 01:08:54 +03:00
|
|
|
|
2011-04-17 17:59:06 +04:00
|
|
|
// Make breadcrumb
|
|
|
|
if($doBreadcrumb){
|
|
|
|
$breadcrumb = array();
|
|
|
|
$pathtohere = "/";
|
|
|
|
foreach( explode( "/", $dir ) as $i ){
|
|
|
|
if( $i != "" ){
|
|
|
|
$pathtohere .= "$i/";
|
|
|
|
$breadcrumb[] = array( "dir" => $pathtohere, "name" => $i );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-07-29 23:36:03 +04:00
|
|
|
$breadcrumbNav = new OC_Template( "files", "part.breadcrumb", "" );
|
2011-04-17 17:59:06 +04:00
|
|
|
$breadcrumbNav->assign( "breadcrumb", $breadcrumb );
|
|
|
|
|
|
|
|
$data['breadcrumb'] = $breadcrumbNav->fetchPage();
|
|
|
|
}
|
|
|
|
|
|
|
|
// make filelist
|
2011-03-04 01:08:54 +03:00
|
|
|
$files = array();
|
2011-07-29 23:36:03 +04:00
|
|
|
foreach( OC_Files::getdirectorycontent( $dir ) as $i ){
|
|
|
|
$i["date"] = OC_Util::formatDate($i["mtime"] );
|
2011-03-04 01:08:54 +03:00
|
|
|
$files[] = $i;
|
|
|
|
}
|
|
|
|
|
2011-07-29 23:36:03 +04:00
|
|
|
$list = new OC_Template( "files", "part.list", "" );
|
2011-04-17 17:59:06 +04:00
|
|
|
$list->assign( "files", $files );
|
|
|
|
$data = array('files' => $list->fetchPage());
|
2011-03-04 01:08:54 +03:00
|
|
|
|
2011-09-24 00:22:59 +04:00
|
|
|
OC_JSON::success(array('data' => $data));
|
2011-03-04 01:08:54 +03:00
|
|
|
|
|
|
|
?>
|