summaryrefslogtreecommitdiffstats
path: root/files
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
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')
-rw-r--r--files/css/files.css48
-rw-r--r--files/index.php28
-rw-r--r--files/js/files.js39
-rw-r--r--files/templates/index.php44
4 files changed, 156 insertions, 3 deletions
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 @@
?>
<h1>Files</h1>
-# TBD (again) \ No newline at end of file
+<div class="controls">
+ <p class="actions">
+ <a href="" title="" class="upload">Upload</a><a href="" title="" class="new-dir">New folder</a><a href="" title="" class="download">Download</a><a href="" title="" class="share">Share</a><a href="" title="" class="delete">Delete</a>
+ </p>
+</div>
+
+<p class="nav">
+ <a href="<? echo link_to( "files", "index.php?dir=/" ) ?>"><img src="<? echo image_path( "", "actions/go-home.png" ) ?>" alt="Root" /></a>
+ <? foreach( $_["breadcrumb"] as $crumb ){ ?>
+ <a href="<? echo link_to( "files", "index.php?dir=".$crumb["dir"] ) ?>"><? echo $crumb["name"] ?></a>
+ <? } ?>
+</p>
+
+<table cellspacing="0">
+ <thead>
+ <tr>
+ <th><input type="checkbox" id="select_all" /></th>
+ <th>Name</th>
+ <th>Size</th>
+ <th>Modified</th>
+ <th></th>
+ </tr>
+ </thead>
+ <tbody>
+ <? foreach( $_["files"] as $file ){ ?>
+ <tr>
+ <td class="selection"><input type="checkbox" /></td>
+ <td class="filename"><a style="background-image:url(<? if( $file["type"] == "dir" ) echo mimetype_icon( "dir" ); else echo mimetype_icon( $file["mime"] ) ?>)" 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"] ?></a></td>
+ <td class="filesize"><? if( $file["type"] != "dir" ) echo human_file_size( $file["size"] ) ?></td>
+ <td class="date"><? if( $file["type"] != "dir" ) echo $file["date"] ?></td>
+ <td class="fileaction"><a href="" title=""><img src="images/drop-arrow.png" alt="+" /></a></td>
+ </tr>
+ <? } ?>
+ </tbody>
+</table>
+
+<div id="file_menu">
+ <ul>
+ <li><a href="" title="">Download</a></li>
+ <li><a href="" title="">Share</a></li>
+ <li><a href="" title="">Delete</a></li>
+ </ul>
+</div>