diff --git a/css/styles.css b/css/styles.css index 771c430c723..4fc5a39b8c0 100644 --- a/css/styles.css +++ b/css/styles.css @@ -571,27 +571,6 @@ p.actions a.delete -/* FILE MENU */ - -#file_menu -{ - display: none; - position: absolute; - background-color: #EEE; -} - -#file_menu ul -{ - list-style-type: none; -} - -#file_menu li a -{ - display: block; - padding: 0.5em 5em 0.5em 2em; - text-decoration: none; -} - /* USER SETTINGS ------------------------------------------------------------ */ diff --git a/files/css/files.css b/files/css/files.css new file mode 100644 index 00000000000..8ab07d45241 --- /dev/null +++ b/files/css/files.css @@ -0,0 +1,48 @@ +/* FILE MENU */ + +#file_menu +{ + display: none; + position: absolute; + background-color: #EEE; +} + +#file_menu ul +{ + list-style-type: none; +} + +#file_menu li a +{ + display: block; + padding: 0.5em 5em 0.5em 2em; + text-decoration: none; +} + +/* FILE TABLE */ + +table td.filesize, table td.date +{ + width: 5em; + padding: 0.5em 1em; + text-align: right; +} + +table td.date +{ + width: 11em; +} + +table td.selection, table th.selection, table td.fileaction +{ + width: 2em; + text-align: center; +} + +table td.filename a +{ + display: block; + background-image: url(../img/file.png); + text-decoration: none; +} + 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(); ?> diff --git a/files/js/files.js b/files/js/files.js new file mode 100644 index 00000000000..9ab573ee92b --- /dev/null +++ b/files/js/files.js @@ -0,0 +1,39 @@ +$(document).ready(function() { + // Sets browser table behaviour : + $('.browser tr').hover( + function() { + $(this).addClass('mouseOver'); + }, + function() { + $(this).removeClass('mouseOver'); + } + ); + + // Sets logs table behaviour : + $('.logs tr').hover( + function() { + $(this).addClass('mouseOver'); + }, + function() { + $(this).removeClass('mouseOver'); + } + ); + + // Sets the file-action buttons behaviour : + $('td.fileaction a').click(function() { + $(this).parent().append($('#file_menu')); + $('#file_menu').slideToggle(250); + return false; + }); + + // Sets the select_all checkbox behaviour : + $('#select_all').click(function() { + + if($(this).attr('checked')) + // Check all + $('.browser input:checkbox').attr('checked', true); + else + // Uncheck all + $('.browser input:checkbox').attr('checked', false); + }); +}); diff --git a/files/templates/index.php b/files/templates/index.php index 9e271bbbcd9..fe7ec903c2a 100644 --- a/files/templates/index.php +++ b/files/templates/index.php @@ -5,4 +5,46 @@ ?>
| + | Name | +Size | +Modified | ++ |
|---|---|---|---|---|
| + | )" href=" if( $file["type"] == "dir" ) echo link_to( "files", "index.php?dir=".$file["directory"]."/".$file["name"] ); else echo link_to( "files", "download.php?file=".$file["directory"]."/".$file["name"] ) ?>" title=""> echo $file["name"] ?> | +if( $file["type"] != "dir" ) echo human_file_size( $file["size"] ) ?> | +if( $file["type"] != "dir" ) echo $file["date"] ?> | +![]() |
+