From b1a369b49f4e2d69fc3a360e9e0828f54c7e2c5a Mon Sep 17 00:00:00 2001
From: Jan-Christoph Borchardt <JanCBorchardt@fsfe.org>
Date: Mon, 8 Aug 2011 11:17:03 +0200
Subject: [PATCH] quick fix for public links, removed expiration date and
 styled correctly

---
 apps/files_publiclink/admin.php           |  1 -
 apps/files_publiclink/css/admin.css       |  2 --
 apps/files_publiclink/js/admin.js         | 17 ++++-------------
 apps/files_publiclink/templates/admin.php |  5 +----
 apps/files_publiclink/templates/files.php |  4 ++--
 core/templates/installation.php           |  2 +-
 6 files changed, 8 insertions(+), 23 deletions(-)
 delete mode 100644 apps/files_publiclink/css/admin.css

diff --git a/apps/files_publiclink/admin.php b/apps/files_publiclink/admin.php
index c095cf1440..f516354796 100644
--- a/apps/files_publiclink/admin.php
+++ b/apps/files_publiclink/admin.php
@@ -35,7 +35,6 @@ if( !OC_User::isLoggedIn()){
 
 OC_App::setActiveNavigationEntry( "files_publiclink_administration" );
 
-OC_Util::addStyle( 'files_publiclink', 'admin' );
 OC_Util::addScript( 'files_publiclink', 'admin' );
 
 if(isset($_SERVER['HTTPS'])) {
diff --git a/apps/files_publiclink/css/admin.css b/apps/files_publiclink/css/admin.css
deleted file mode 100644
index f21b289f04..0000000000
--- a/apps/files_publiclink/css/admin.css
+++ /dev/null
@@ -1,2 +0,0 @@
-td.path{min-width:200px}
-td.expire{width:120px}
\ No newline at end of file
diff --git a/apps/files_publiclink/js/admin.js b/apps/files_publiclink/js/admin.js
index 2185771814..7052992e36 100644
--- a/apps/files_publiclink/js/admin.js
+++ b/apps/files_publiclink/js/admin.js
@@ -1,14 +1,9 @@
 $(document).ready(function() {
-	$( "#expire" ).datepicker({
-		dateFormat:'MM d, yy',
-		altField: "#expire_time",
-		altFormat: "yy-mm-dd"
-	});
 	$( "#path" ).autocomplete({
 		source: "../../files/ajax/autocomplete.php",
 		minLength: 1
 	});
-	$("button.delete").live('click', function( event ) {
+	$(".delete").live('click', function( event ) {
 		event.preventDefault();
 		var token=$(this).attr('data-token');
 		var data="token="+token;
@@ -25,7 +20,7 @@ $(document).ready(function() {
 	$('#newlink').submit(function( event ){
 		event.preventDefault();
 		var path=$('#path').val();
-		var expire=$('#expire_time').val()||0;
+		var expire=0;
 		var data='path='+path+'&expire='+expire;
 		$.ajax({
 			type: 'GET',
@@ -36,17 +31,13 @@ $(document).ready(function() {
 				if(token){
 					var html="<tr class='link' id='"+token+"'>";
 					html+="<td class='path'>"+path+"</td>";
-					var expire=($('#expire').val())?$('#expire').val():'Never'
-					html+="<td class='expire'>"+expire+"</td>"
 					html+="<td class='link'><a href='get.php?token="+token+"'>"+$('#baseUrl').val()+"?token="+token+"</a></td>"
-					html+="<td><button class='delete fancybutton' data-token='"+token+"'>Delete</button></td>"
+					html+="<td><input type='submit' class='delete' data-token='"+token+" value='Delete' /></td>"
 					html+="</tr>"
 					$(html).insertBefore($('#newlink_row'));
-					$('#expire').val('');
-					$('#expire_time').val('');
 					$('#path').val('');
 				}
 			}
 		});
 	});
-});
\ No newline at end of file
+});
diff --git a/apps/files_publiclink/templates/admin.php b/apps/files_publiclink/templates/admin.php
index 04aaf5c430..9ee5e0d0ea 100644
--- a/apps/files_publiclink/templates/admin.php
+++ b/apps/files_publiclink/templates/admin.php
@@ -3,7 +3,6 @@
 	<thead>
 		<tr>
 			<td class='path'><?php echo $l->t( 'Path' ); ?></td>
-			<td class='expire'><?php echo $l->t( 'Expires' ); ?></td>
 			<td class='link'><?php echo $l->t( 'Link' ); ?></td>
 		</tr>
 	</thead>
@@ -11,16 +10,14 @@
 		<?php foreach($_['links'] as $link):?>
 			<tr class='link' id='<?php echo $link['token'];?>'>
 				<td class='path'><?php echo $link['path'];?></td>
-				<td class='expire'><?php echo ($link['expire_time']==0)?'Never':$l->l('date', $link['expire_time']);?></td>
 				<td class='link'><a href='get.php?token=<?php echo $link['token'];?>'><?php echo $_['baseUrl'];?>?token=<?php echo $link['token'];?></a></td>
-				<td><button class='delete fancybutton' data-token='<?php echo $link['token'];?>'><?php echo $l->t( 'Delete' ); ?></button></td>
+				<td><input type="submit" class="delete" data-token="<?php echo $link['token'];?>" value="<?php echo $l->t( 'Delete' ); ?>" /></td>
 			</tr>
 		<?php endforeach;?>
 		<tr id='newlink_row'>
 			<form action='#' id='newlink'>
 				<input type='hidden' id='expire_time'/>
 				<td class='path'><input placeholder='Path' id='path'/></td>
-				<td class='expire'><input placeholder='Expires' id='expire'/></td>
 				<td><input type='submit' value='Share'/></td>
 			</form>
 		</tr>
diff --git a/apps/files_publiclink/templates/files.php b/apps/files_publiclink/templates/files.php
index b4ae17656c..41ff0a1e76 100644
--- a/apps/files_publiclink/templates/files.php
+++ b/apps/files_publiclink/templates/files.php
@@ -4,6 +4,6 @@
 				<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_publiclink", "get.php?token=".$_['token']."&path=".$file["directory"]."/".$file["name"]); else echo link_to("files_publiclink", "get.php?token=".$_['token']."&path=".$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 if($file["type"] != "dir") echo $file["date"]; ?></td>
-				<td class="fileaction"><a href="" title=""><img src="images/drop-arrow.png" alt="+" /></a></td>
+				<td class="fileaction"><a href="" title="">▾</a></td>
 			</tr>
-		<?php endforeach; ?>
\ No newline at end of file
+		<?php endforeach; ?>
diff --git a/core/templates/installation.php b/core/templates/installation.php
index e2392778be..1c840f3db5 100644
--- a/core/templates/installation.php
+++ b/core/templates/installation.php
@@ -28,7 +28,7 @@
 			<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'><strong><?php echo $l->t( 'Advanced' ); ?></strong> <img src='<?php echo OC_Helper::imagePath('','drop-arrow.png'); ?>'></img></a>
+        <a id='showAdvanced'><strong><?php echo $l->t( 'Advanced' ); ?></strong> ▾</a>
         
         <fieldset id='datadirField'>
 			<legend><?php echo $l->t( 'Set where to store the data.' ); ?></legend>
-- 
GitLab