summaryrefslogtreecommitdiffstats
path: root/apps/files_trashbin
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2013-09-13 21:00:15 +0200
committerVincent Petry <pvince81@owncloud.com>2013-09-13 21:00:15 +0200
commitec2f20f72013f5ed6adcf5724006bd5ada462727 (patch)
tree0d1ee5eca59a1810e2286b47bc10ffdfeab77cd1 /apps/files_trashbin
parent30a2f2f35282a4414269a7650513348b99fb7965 (diff)
downloadnextcloud-server-ec2f20f72013f5ed6adcf5724006bd5ada462727.tar.gz
nextcloud-server-ec2f20f72013f5ed6adcf5724006bd5ada462727.zip
Fixed files_trashbin to also use hash URL part for IE8
Diffstat (limited to 'apps/files_trashbin')
-rw-r--r--apps/files_trashbin/index.php26
-rw-r--r--apps/files_trashbin/templates/index.php3
2 files changed, 27 insertions, 2 deletions
diff --git a/apps/files_trashbin/index.php b/apps/files_trashbin/index.php
index c9468b60bd4..9f17448a757 100644
--- a/apps/files_trashbin/index.php
+++ b/apps/files_trashbin/index.php
@@ -18,7 +18,30 @@ OCP\Util::addscript('files', 'files');
$dir = isset($_GET['dir']) ? stripslashes($_GET['dir']) : '';
-$files = \OCA\files_trashbin\lib\Helper::getTrashFiles($dir);
+$isIE8 = false;
+preg_match('/MSIE (.*?);/', $_SERVER['HTTP_USER_AGENT'], $matches);
+if (count($matches) > 0 && $matches[1] <= 8){
+ $isIE8 = true;
+}
+
+// if IE8 and "?dir=path" was specified, reformat the URL to use a hash like "#?dir=path"
+if ($isIE8 && isset($_GET['dir'])){
+ if ($dir === ''){
+ $dir = '/';
+ }
+ header('Location: ' . OCP\Util::linkTo('files_trashbin', 'index.php') . '#?dir=' . \OCP\Util::encodePath($dir));
+ exit();
+}
+
+$ajaxLoad = false;
+
+if (!$isIE8){
+ $files = \OCA\files_trashbin\lib\Helper::getTrashFiles($dir);
+}
+else{
+ $files = array();
+ $ajaxLoad = true;
+}
// Redirect if directory does not exist
if ($files === null){
@@ -53,5 +76,6 @@ $tmpl->assign('fileList', $list->fetchPage());
$tmpl->assign('files', $files);
$tmpl->assign('dir', $dir);
$tmpl->assign('disableSharing', true);
+$tmpl->assign('ajaxLoad', true);
$tmpl->printPage();
diff --git a/apps/files_trashbin/templates/index.php b/apps/files_trashbin/templates/index.php
index daae7753aeb..82ba0608834 100644
--- a/apps/files_trashbin/templates/index.php
+++ b/apps/files_trashbin/templates/index.php
@@ -5,10 +5,11 @@
</div>
<div id='notification'></div>
-<?php if (isset($_['files']) && count($_['files']) === 0 && $_['dirlisting'] === false):?>
+<?php if (isset($_['files']) && count($_['files']) === 0 && $_['dirlisting'] === false && !$_['ajaxLoad']):?>
<div id="emptycontent"><?php p($l->t('Nothing in here. Your trash bin is empty!'))?></div>
<?php endif; ?>
+<input type="hidden" name="ajaxLoad" id="ajaxLoad" value="<?php p($_['ajaxLoad']); ?>" />
<input type="hidden" id="disableSharing" data-status="<?php p($_['disableSharing']); ?>"></input>
<input type="hidden" name="dir" value="<?php p($_['dir']) ?>" id="dir">