summaryrefslogtreecommitdiffstats
path: root/files/index.php
diff options
context:
space:
mode:
authorJakob Sack <kde@jakobsack.de>2011-03-02 23:06:23 +0100
committerJakob Sack <kde@jakobsack.de>2011-03-02 23:06:23 +0100
commit61ffa182ee90e1a08538f438fb5528e32b3cf70a (patch)
treea45392a2a35a3504e2b7c26195a94ec042e7255c /files/index.php
parente5ea0a3daa307d6df6c864d13adcf733a286213e (diff)
downloadnextcloud-server-61ffa182ee90e1a08538f438fb5528e32b3cf70a.tar.gz
nextcloud-server-61ffa182ee90e1a08538f438fb5528e32b3cf70a.zip
Application "files" is able to list the files again, start of splitting css files
Diffstat (limited to 'files/index.php')
-rw-r--r--files/index.php28
1 files changed, 26 insertions, 2 deletions
diff --git a/files/index.php b/files/index.php
index 538bd87971d..25a9f0297dc 100644
--- a/files/index.php
+++ b/files/index.php
@@ -22,19 +22,43 @@
*/
+// Init owncloud
require_once('../lib/base.php');
oc_require( 'template.php' );
+
+// Check if we are a user
if( !OC_USER::isLoggedIn()){
- header( "Location: ".OC_UTIL::linkto( "index.php" ));
+ header( "Location: ".OC_HELPER::linkTo( "index.php" ));
exit();
}
+// Load the files we need
+OC_UTIL::addStyle( "files", "files" );
+OC_UTIL::addScript( "files", "files" );
+
+// Load the files
$dir = isset( $_GET['dir'] ) ? $_GET['dir'] : '';
-$files=OC_FILES::getdirectorycontent( $dir );
+$files = array();
+foreach( OC_FILES::getdirectorycontent( $dir ) as $i ){
+ $i["date"] = date( $CONFIG_DATEFORMAT, $i["mtime"] );
+ $files[] = $i;
+}
+
+// Make breadcrumb
+$breadcrumb = array();
+$pathtohere = "/";
+foreach( explode( "/", $dir ) as $i ){
+ if( $i != "" ){
+ $pathtohere .= "$i/";
+ $breadcrumb[] = array( "dir" => $pathtohere, "name" => $i );
+ }
+}
+// return template
$tmpl = new OC_TEMPLATE( "files", "index", "user" );
$tmpl->assign( "files", $files );
+$tmpl->assign( "breadcrumb", $breadcrumb );
$tmpl->printPage();
?>