summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--admin/js/users.js32
-rw-r--r--apps/user_ldap/user_ldap.php6
-rw-r--r--core/css/styles.css10
-rw-r--r--core/img/actions/arrow-down.pngbin525 -> 0 bytes
-rw-r--r--core/img/actions/arrow-left.pngbin512 -> 0 bytes
-rw-r--r--core/img/actions/arrow-right.pngbin527 -> 0 bytes
-rw-r--r--core/img/actions/arrow-up.pngbin484 -> 0 bytes
-rw-r--r--core/templates/installation.php25
-rw-r--r--core/templates/layout.admin.php5
-rw-r--r--core/templates/login.php2
-rw-r--r--core/templates/part.searchbox.php8
-rw-r--r--files/css/files.css14
-rw-r--r--files/js/filelist.js2
-rw-r--r--files/js/files.js16
-rw-r--r--files/templates/index.php4
-rw-r--r--files/templates/part.list.php16
-rw-r--r--lib/template.php8
17 files changed, 88 insertions, 60 deletions
diff --git a/admin/js/users.js b/admin/js/users.js
index 1ef02c650a0..48f3b15e3b8 100644
--- a/admin/js/users.js
+++ b/admin/js/users.js
@@ -216,19 +216,25 @@ $(document).ready(function(){
// Create a new user
$( "#createuserbutton" )
.click(function(){
- // Create the post data
- var post = $( "#createuserdata" ).serialize();
-
- // Ajax call
- $.post( 'ajax/createuser.php', post, function(data){
- // If it says "success" then we are happy
- if( data.status == "success" ){
- userCreated( data.data.username, data.data.groups );
- }
- else{
- printError( data.data.message );
- }
- });
+ if(!$( "#createuserbutton" ).data('active')){
+ $( "#createuserbutton" ).data('active',true);
+
+ // Create the post data
+ var post = $( "#createuserdata" ).serialize();
+
+ // Ajax call
+ $.post( 'ajax/createuser.php', post, function(data){
+ $( "#createuserbutton" ).data('active',false);
+
+ // If it says "success" then we are happy
+ if( data.status == "success" ){
+ userCreated( data.data.username, data.data.groups );
+ }
+ else{
+ printError( data.data.message );
+ }
+ });
+ }
return false;
});
diff --git a/apps/user_ldap/user_ldap.php b/apps/user_ldap/user_ldap.php
index d6ed8c741e7..b197aaa2502 100644
--- a/apps/user_ldap/user_ldap.php
+++ b/apps/user_ldap/user_ldap.php
@@ -97,6 +97,9 @@ class OC_USER_LDAP extends OC_USER_BACKEND {
return $entries[0]["dn"];
}
public function checkPassword( $uid, $password ) {
+ if(!self::$configured){
+ return false;
+ }
$dn = $this->getDn( $uid );
if( !$dn )
return false;
@@ -105,6 +108,9 @@ class OC_USER_LDAP extends OC_USER_BACKEND {
}
public function userExists( $uid ) {
+ if(!self::$configured){
+ return false;
+ }
$dn = $this->getDn($uid);
return !empty($dn);
}
diff --git a/core/css/styles.css b/core/css/styles.css
index 5027a6b6fe9..8723fe0eaf2 100644
--- a/core/css/styles.css
+++ b/core/css/styles.css
@@ -5,6 +5,7 @@ body { background:#fefefe url('../img/body_background.jpg') repeat-y left top; f
#owncloud { float:left; margin:0 0 0 2em; }
h1 { margin:1em 3em 1em 0; border-bottom:1px solid #666; text-transform:uppercase; font-weight:normal; font-style:italic; color:#666; }
p.center { text-align:center; }
+a { color:#000; text-decoration:none; }
form { margin:2em 2em 2em 3em; }
form#quota { max-width:600px; }
@@ -17,6 +18,7 @@ form input { padding:0.2em; border:1px solid #ddd; font-size:1.2em; }
form input[type="submit"] { padding:0.1em 1em; border:1px solid #999; font-weight:bold; font-size:0.9em; cursor:pointer; }
form input[type="submit"]:hover, form input[type="submit"]:focus { border:1px solid #999; background-color:#999; outline:0; }
form input[type="submit"]:active { outline:0; }
+form input[type="button"], form input[type="text"] { font-size: 0.9em; }
fieldset { padding:1em; background-color:#f7f7f7; border:1px solid #ddd; }
legend { padding:0 0.5em; font-size:1.2em; }
@@ -199,12 +201,16 @@ div.controls { width:91%; margin:1em 1em 1em 2em; padding:0.5em 0; background-co
#metanav li a:hover, #metanav li a:focus { background:rgba(0,0,0,.5); -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; outline:0; box-shadow:#555 0 1px 0; -moz-box-shadow:#555 0 1px 0; -webkit-box-shadow:#555 0 1px 0; }
#metanav li a img { vertical-align:middle; }
+/* SEARCH --------------------------------------------------------------------- */
+form.searchbox { display:inline; position:fixed; top:2em; right:10em; margin:0; padding:0; }
+
/* NAVIGATION ------------------------------------------------------------- */
#plugins { position:fixed; top:7em; float:left; width:15.7em; padding:0; }
#plugins ul { list-style-type:none; border-top:1px solid #ccc; }
#plugins a { display:block; padding:0.5em 0.5em 0.5em 3em; background-position:1.5em center; background-repeat:no-repeat; border-bottom:1px solid #ddd; border-top:1px solid #fff; text-decoration:none; font-size:1.2em; color:#666; }
#plugins a.active, #plugins a:hover, #plugins a:focus, #plugins a.selected { background-color:#ccc; border-top:1px solid #ccc; border-bottom:1px solid #ccc; color:#000; outline:0; }
#plugins a:active { outline:0; }
+#plugins .subentry { background-color:#ddd; border-top:1px solid #aaa; border-bottom:1px solid #ccc; color:#000; outline:0; }
/* CONTENT ------------------------------------------------------------------ */
#content { margin:7em 0 0 16em; }
@@ -272,7 +278,3 @@ p.actions a.delete, div.actions a.delete { background-image:url('../img/delete.p
#logs_options input[type="submit"].nofloat { float:none; margin:0 2em 0 0; }
#logs_options input[type="text"] { margin:0; padding:0; border:1px solid #ccc; text-align:right; }
li.error{ list-style:none; width:640px; margin:4em auto; padding:1em 1em 1em 4em; background-color:#fee; background-image:url('../img/task-attention.png'); background-position:0.8em 0.8em; background-repeat:no-repeat; border:1px solid #ccc; -moz-border-radius:10px; -webkit-border-radius:10px; border-radius:10px; }
-
-/* SEARCH --------------------------------------------------------------------- */
-form.searchbox{display:inline; position:fixed; top:1.5em; right:9em; margin:0; padding:0;};
-form.searchbox .prettybutton{font-size:1.5em !important}; \ No newline at end of file
diff --git a/core/img/actions/arrow-down.png b/core/img/actions/arrow-down.png
deleted file mode 100644
index 03f201428ad..00000000000
--- a/core/img/actions/arrow-down.png
+++ /dev/null
Binary files differ
diff --git a/core/img/actions/arrow-left.png b/core/img/actions/arrow-left.png
deleted file mode 100644
index b56cfee03df..00000000000
--- a/core/img/actions/arrow-left.png
+++ /dev/null
Binary files differ
diff --git a/core/img/actions/arrow-right.png b/core/img/actions/arrow-right.png
deleted file mode 100644
index 0acee70bcdd..00000000000
--- a/core/img/actions/arrow-right.png
+++ /dev/null
Binary files differ
diff --git a/core/img/actions/arrow-up.png b/core/img/actions/arrow-up.png
deleted file mode 100644
index 5e423213fbd..00000000000
--- a/core/img/actions/arrow-up.png
+++ /dev/null
Binary files differ
diff --git a/core/templates/installation.php b/core/templates/installation.php
index 93c00547ab9..c3bbe692c1c 100644
--- a/core/templates/installation.php
+++ b/core/templates/installation.php
@@ -3,8 +3,8 @@
<form action="index.php" method="post" id="setup_form">
<input type="hidden" name="install" value="true" />
<p class="intro">
- <?php echo $l->t( 'Welcome to <strong>ownCloud</strong>, your personnal cloud.' ); ?><br />
- <?php echo $l->t( 'To finish the installation, please follow the steps below.' ); ?>
+ <?php echo $l->t( '<strong>ownCloud</strong> is your personal web storage.' ); ?><br />
+ <?php echo $l->t( 'Finish the setup by following the steps below.' ); ?>
</p>
<?php if(count($_['errors']) > 0): ?>
@@ -23,12 +23,12 @@
<?php endif; ?>
<fieldset>
- <legend><?php echo $l->t( 'Create an <strong>admin account.</strong>' ); ?></legend>
- <p><label for="adminlogin"><?php echo $l->t( 'Login:' ); ?></label><input type="text" name="adminlogin" id="adminlogin" value="<?php print OC_HELPER::init_var('adminlogin'); ?>" /></p>
- <p><label for="adminpass"><?php echo $l->t( 'Password:' ); ?></label><input type="password" name="adminpass" id="adminpass" value="<?php print OC_HELPER::init_var('adminpass'); ?>" /></p>
+ <legend><?php echo $l->t( 'Create an <strong>admin account</strong>.' ); ?></legend>
+ <p><label for="adminlogin"><?php echo $l->t( 'Username' ); ?></label><input type="text" name="adminlogin" id="adminlogin" value="<?php print OC_HELPER::init_var('adminlogin'); ?>" autofocus /></p>
+ <p><label for="adminpass"><?php echo $l->t( 'Password' ); ?></label><input type="password" name="adminpass" id="adminpass" value="<?php print OC_HELPER::init_var('adminpass'); ?>" /></p>
</fieldset>
- <a id='showAdvanced'><?php echo $l->t( 'Advanced' ); ?> <img src='<?php echo OC_HELPER::imagePath('','drop-arrow.png'); ?>'></img></a>
+ <a id='showAdvanced'><strong><?php echo $l->t( 'Advanced' ); ?></strong> <img src='<?php echo OC_HELPER::imagePath('','drop-arrow.png'); ?>'></img></a>
<fieldset id='datadirField'>
<legend><?php echo $l->t( 'Set where to store the data.' ); ?></legend>
@@ -36,11 +36,11 @@
</fieldset>
<fieldset id='databaseField'>
- <legend><?php echo $l->t( 'Configure your database.' ); ?></legend>
+ <legend><?php echo $l->t( 'Configure the database.' ); ?></legend>
<?php if($_['hasSQLite']): ?>
<input type='hidden' id='hasSQLite' value='true'/>
<?php if(!$_['hasMySQL']): ?>
- <p><?php echo $l->t( 'I will use a SQLite database. You have nothing to do!' ); ?></p>
+ <p><?php echo $l->t( 'SQLite will be used for the database. You have nothing to do.' ); ?></p>
<input type="hidden" id="dbtype" name="dbtype" value="sqlite" />
<?php else: ?>
<p><label class="sqlite" for="sqlite"><?php echo $l->t( 'SQLite' ); ?></label><input type="radio" name="dbtype" value='sqlite' id="sqlite" <?php OC_HELPER::init_radio('dbtype', 'sqlite', 'sqlite'); ?>/></p>
@@ -50,17 +50,18 @@
<?php if($_['hasMySQL']): ?>
<input type='hidden' id='hasMySQL' value='true'/>
<?php if(!$_['hasSQLite']): ?>
- <p><?php echo $l->t( 'I will use a MySQL database.' ); ?></p>
+ <p><?php echo $l->t( 'MySQL will be used for the database.' ); ?></p>
<input type="hidden" id="dbtype" name="dbtype" value="mysql" />
<?php else: ?>
<p><label class="mysql" for="mysql">MySQL </label><input type="radio" name="dbtype" value='mysql' id="mysql" <?php OC_HELPER::init_radio('dbtype', 'mysql', 'sqlite'); ?>/></p>
<?php endif; ?>
<div id="use_mysql">
- <p><label for="dbhost"><?php echo $l->t( 'Host:' ); ?></label><input type="text" name="dbhost" id="dbhost" value="<?php print OC_HELPER::init_var('dbhost', 'localhost'); ?>" /></p>
+ <p><label for="dbuser"><?php echo $l->t( 'MySQL username:' ); ?></label><input type="text" name="dbuser" id="dbuser" value="<?php print OC_HELPER::init_var('dbuser'); ?>" /></p>
+ <p><label for="dbpass"><?php echo $l->t( 'MySQL password:' ); ?></label><input type="password" name="dbpass" id="dbpass" value="<?php print OC_HELPER::init_var('dbpass'); ?>" /></p>
<p><label for="dbname"><?php echo $l->t( 'Database name:' ); ?></label><input type="text" name="dbname" id="dbname" value="<?php print OC_HELPER::init_var('dbname'); ?>" /></p>
+ <p><label for="dbhost"><?php echo $l->t( 'Host:' ); ?></label><input type="text" name="dbhost" id="dbhost" value="<?php print OC_HELPER::init_var('dbhost', 'localhost'); ?>" /></p>
<p><label for="dbtableprefix"><?php echo $l->t( 'Table prefix:' ); ?></label><input type="text" name="dbtableprefix" id="dbtableprefix" value="<?php print OC_HELPER::init_var('dbtableprefix', 'oc_'); ?>" /></p>
- <p><label for="dbuser"><?php echo $l->t( 'MySQL user login:' ); ?></label><input type="text" name="dbuser" id="dbuser" value="<?php print OC_HELPER::init_var('dbuser'); ?>" /></p>
- <p><label for="dbpass"><?php echo $l->t( 'MySQL user password:' ); ?></label><input type="password" name="dbpass" id="dbpass" value="<?php print OC_HELPER::init_var('dbpass'); ?>" /></p>
+
</div>
<?php endif; ?>
</fieldset>
diff --git a/core/templates/layout.admin.php b/core/templates/layout.admin.php
index 8668aa64fda..026e1272237 100644
--- a/core/templates/layout.admin.php
+++ b/core/templates/layout.admin.php
@@ -30,7 +30,6 @@
<body id="body-settings">
<div id="header">
<a href="<?php echo link_to('', 'index.php'); ?>" title="" id="owncloud"><img src="<?php echo image_path('', 'owncloud-logo-small-white.png'); ?>" alt="ownCloud" /></a>
- <?php echo $_['searchbox']?>
<ul id="metanav">
<li><a href="<?php echo link_to('', 'index.php'); ?>" title="Back to files"><img src="<?php echo image_path('', 'layout/back.png'); ?>"></a></li>
<li><a href="<?php echo link_to('', 'index.php?logout=true'); ?>" title="Log out"><img src="<?php echo image_path('', 'layout/logout.png'); ?>"></a></li>
@@ -44,7 +43,7 @@
<li><a style="background-image:url(<?php echo $entry['icon']; ?>)" href="<?php echo $entry['href']; ?>" title="" <?php if( $entry["active"] ): ?> class="active"<?php endif; ?>><?php echo $entry['name'] ?></a></li>
<?php if( sizeof( $entry["subnavigation"] )): ?>
<?php foreach($entry["subnavigation"] as $subentry):?>
- <li><a style="background-color:#FF8800;" href="<?php echo $subentry['href']; ?>" title="" <?php if( $subentry["active"] ): ?> class="active"<?php endif; ?>><?php echo $subentry['name'] ?></a></li>
+ <li><a href="<?php echo $subentry['href']; ?>" title="" <?php if( $subentry["active"] ): ?> class="active"<?php endif; ?>><?php echo $subentry['name'] ?></a></li>
<?php endforeach; ?>
<?php endif; ?>
<?php endforeach; ?>
@@ -53,7 +52,7 @@
<li><a style="background-image:url(<?php echo $entry['icon']; ?>)" href="<?php echo $entry['href']; ?>" title="" <?php if( $entry["active"] ): ?> class="active"<?php endif; ?>><?php echo $entry['name'] ?></a></li>
<?php if( sizeof( $entry["subnavigation"] )): ?>
<?php foreach($entry["subnavigation"] as $subentry):?>
- <li><a style="background-color:#FF8800;" href="<?php echo $subentry['href']; ?>" title=""><?php echo $subentry['name'] ?> <?php if( $subentry["active"] ): ?> active<?php endif; ?></a></li>
+ <li><a class="subentry" href="<?php echo $subentry['href']; ?>" title=""><?php echo $subentry['name'] ?></a></li>
<?php endforeach; ?>
<?php endif; ?>
<?php endforeach; ?>
diff --git a/core/templates/login.php b/core/templates/login.php
index e0f6ce23e2e..0ed4178a984 100644
--- a/core/templates/login.php
+++ b/core/templates/login.php
@@ -5,7 +5,7 @@
<?php if($_['error']): ?>
<?php echo $l->t( 'Login failed!' ); ?>
<?php endif; ?>
- <input type="text" name="user" id="user" value="" />
+ <input type="text" name="user" id="user" value="" autofocus />
<input type="password" name="password" id="password" value="" />
<input type="submit" value="Log in" />
</fieldset>
diff --git a/core/templates/part.searchbox.php b/core/templates/part.searchbox.php
index 7465a7326ee..19b089ef84f 100644
--- a/core/templates/part.searchbox.php
+++ b/core/templates/part.searchbox.php
@@ -1,4 +1,4 @@
-<form class='searchbox' action='<?php echo $_['searchurl']?>' method='post'>
- <input name='query' value='<?php if(isset($_POST['query'])){echo $_POST['query'];};?>'/>
- <input type='submit' value='<?php echo $l->t( 'Search' ); ?>' class='prettybutton'/>
-</form> \ No newline at end of file
+<form class="searchbox" action="<?php echo $_['searchurl']?>" method="post">
+ <input type="text" name="query" value="<?php if(isset($_POST['query'])){echo $_POST['query'];};?>" class="prettybutton" />
+ <input type="submit" value="<?php echo $l->t( 'Search' ); ?>" class="prettybutton" />
+</form>
diff --git a/files/css/files.css b/files/css/files.css
index 702ddefc19c..9e0361327db 100644
--- a/files/css/files.css
+++ b/files/css/files.css
@@ -35,12 +35,12 @@
}
#file_upload_filename {
- background-image:url(../../img/mimetypes/file.png);
+ background-image:url(../img/file.png); font-weight:bold;
}
#file_upload_start {opacity:0;filter: alpha(opacity = 0);}
#file_newfolder_name {
- background-image:url(../../img/places/folder.png); font-weight: bold;
+ background-image:url(../img/folder.png); font-weight:bold;
width: 14em;
}
@@ -65,11 +65,6 @@
width: 3em;
}
-form input[type="button"], form input[type="text"]{
- /* this is a dirty wurgaround, Jan needs to fix it in global css*/
- font-size: 0.9em;
-}
-
#file_upload_target {
display: none;
}
@@ -80,6 +75,9 @@ table {
width: 90%;
}
+tbody tr:hover, tbody tr:active { background-color:#eee; }
+tbody a { color:#000; }
+
table td.filesize, table td.date
{
width: 5em;
@@ -111,4 +109,4 @@ table td.filename a
display: -moz-inline-box; /* fallback for older firefox versions*/
display: inline-block;
background-image:url('../img/drop-arrow.png');
-} \ No newline at end of file
+}
diff --git a/files/js/filelist.js b/files/js/filelist.js
index 089a34581de..2d00c642333 100644
--- a/files/js/filelist.js
+++ b/files/js/filelist.js
@@ -15,7 +15,7 @@ FileList={
addDir:function(name,size,lastModified){
var html='<tr data-file="'+name+'" data-type="dir">';
html+='<td class="selection"><input type="checkbox" /></td>';
- html+='<td class="filename"><a style="background-image:url(img/folder.png)" href="index.php?dir='+$('#dir').val()+'/'+name+'">'+name+'</a></td>';
+ html+='<td class="filename"><a style="background-image:url(img/folder.png)" href="index.php?dir='+$('#dir').val()+'/'+name+'"><strong>'+name+'</strong></a></td>';
html+='<td class="filesize">'+size+'</td>';
html+='<td class="date">'+lastModified+'</td>';
html+='<td class="fileaction"><a href="" title="+" class="dropArrow"></a></td>';
diff --git a/files/js/files.js b/files/js/files.js
index 45931b9bae3..2434fceff43 100644
--- a/files/js/files.js
+++ b/files/js/files.js
@@ -1,8 +1,6 @@
$(document).ready(function() {
$('#file_action_panel').attr('activeAction', false);
- $('#file_newfolder_name').css('width', '14em');
- $('#file_newfolder_submit').css('width', '3em');
-
+
// Sets browser table behaviour :
$('.browser tr').hover(
function() {
@@ -130,7 +128,7 @@ $(document).ready(function() {
$('#file_upload_submit').click(function(){
var name=$('#file_upload_filename').val();
if($('#file_upload_start')[0].files[0] && $('#file_upload_start')[0].files[0].size>0){
- var size=humanFileSize($('#file_upload_start')[0].files[0].size);
+ var size=simpleFileSize($('#file_upload_start')[0].files[0].size);
}else{
var size='Pending';
}
@@ -207,8 +205,16 @@ function humanFileSize(bytes){
return bytes+' GB';
}
+function simpleFileSize(bytes) {
+ mbytes = Math.round(bytes/(1024*1024),1);
+ if(bytes == 0) { return '0'; }
+ else if(mbytes < 0.1) { return '< 0.1'; }
+ else if(mbytes > 1000) { return '> 1000'; }
+ else { return mbytes.toFixed(1); }
+}
+
function formatDate(date){
var monthNames = [ "January", "February", "March", "April", "May", "June",
"July", "August", "September", "October", "November", "December" ];
return monthNames[date.getMonth()]+' '+date.getDate()+', '+date.getFullYear()+', '+((date.getHours()<10)?'0':'')+date.getHours()+':'+date.getMinutes();
-} \ No newline at end of file
+}
diff --git a/files/templates/index.php b/files/templates/index.php
index 6eaa380506d..b9f8c02c93b 100644
--- a/files/templates/index.php
+++ b/files/templates/index.php
@@ -5,7 +5,7 @@
<input type="hidden" class="max_human_file_size" value="(max <?php echo $_["uploadMaxHumanFilesize"]; ?>)">
<input type="hidden" name="dir" value="<?php echo $_["dir"] ?>" id="dir">
<div id='file_upload_wrapper'>
- <input class="prettybutton" id='file_upload_filename' value="Upload (max <?php echo $_["uploadMaxHumanFilesize"];?>)"/>
+ <input class="prettybutton" id='file_upload_filename' value="Upload (max. <?php echo $_["uploadMaxHumanFilesize"];?>)"/>
<input class="prettybutton" type="file" id="file_upload_start" name='file'/>
</div>&nbsp;
<input class="prettybutton" type="button" id="file_upload_submit" name="file_upload_submit" value="OK" />
@@ -32,7 +32,7 @@
<tr>
<th><input type="checkbox" id="select_all" /></th>
<th><?php echo $l->t( 'Name' ); ?></th>
- <th><?php echo $l->t( 'Size' ); ?></th>
+ <th><?php echo $l->t( 'Size (MB)' ); ?></th>
<th><?php echo $l->t( 'Modified' ); ?></th>
<th></th>
</tr>
diff --git a/files/templates/part.list.php b/files/templates/part.list.php
index 16d9d92c040..c7028c3c88c 100644
--- a/files/templates/part.list.php
+++ b/files/templates/part.list.php
@@ -1,9 +1,11 @@
- <?php foreach($_["files"] as $file): ?>
- <tr data-file='<?php echo $file['name'];?>' data-type='<?php echo ($file["type"] == "dir")?'dir':'file'?>' data-mime='<?php echo $file["mime"]?>'>
+ <?php foreach($_['files'] as $file):
+ $simple_file_size = simple_file_size($file['size']);
+ $simple_size_color = 200-intval(pow($simple_file_size,3)); ?>
+ <tr data-file="<?php echo $file['name'];?>" data-type="<?php echo ($file['type'] == 'dir')?'dir':'file'?>" data-mime="<?php echo $file['mime']?>">
<td class="selection"><input type="checkbox" /></td>
- <td class="filename"><a style="background-image:url(<?php if($file["type"] == "dir") echo mimetype_icon("dir"); else echo mimetype_icon($file["mime"]); ?>)" href="<?php 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=""><?php echo htmlspecialchars($file["name"]); ?></a></td>
- <td class="filesize"><?php echo human_file_size($file["size"]); ?></td>
- <td class="date"><?php echo $file["date"]; ?></td>
- <td class="fileaction"><a href="" title="+" class='dropArrow'></a></td>
+ <td class="filename"><a style="background-image:url(<?php if($file['type'] == 'dir') echo mimetype_icon('dir'); else echo mimetype_icon($file['mime']); ?>)" href="<?php 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=""><?php if($file['type'] == 'dir') echo "<strong>"; echo htmlspecialchars($file['name']); if($file['type'] == 'dir') echo "</strong>"; ?></a></td>
+ <td class="filesize" title="<?php echo human_file_size($file['size']); ?>" style="color:rgb(<?php echo $simple_size_color.','.$simple_size_color.','.$simple_size_color ?>)"><?php echo $simple_file_size; ?></td>
+ <td class="date"><?php echo $file['date']; ?></td>
+ <td class="fileaction"><a href="" title="+" class="dropArrow"></a></td>
</tr>
- <?php endforeach; ?> \ No newline at end of file
+ <?php endforeach; ?>
diff --git a/lib/template.php b/lib/template.php
index 9393fe6908e..3c0cdf7e161 100644
--- a/lib/template.php
+++ b/lib/template.php
@@ -67,6 +67,14 @@ function human_file_size( $bytes ){
return OC_HELPER::humanFileSize( $bytes );
}
+function simple_file_size($bytes) {
+ $mbytes = round($bytes/(1024*1024),1);
+ if($bytes == 0) { return '0'; }
+ else if($mbytes < 0.1) { return '< 0.1'; }
+ else if($mbytes > 1000) { return '> 1000'; }
+ else { return number_format($mbytes, 1); }
+}
+
/**
* This class provides the templates for owncloud.
*/