summaryrefslogtreecommitdiffstats
path: root/lib/files.php
diff options
context:
space:
mode:
authorBart Visscher <bartv@thisnet.nl>2013-07-21 22:30:32 +0200
committerBart Visscher <bartv@thisnet.nl>2013-07-21 22:30:32 +0200
commit8c5df31c4951423857e394de02ae25ea5cb53698 (patch)
tree8532d33205c4eebdabf06e1ce8352cf2b4ff4acc /lib/files.php
parentdf8ad46daef960accd1e307f74e7bcb705e9fc7b (diff)
downloadnextcloud-server-8c5df31c4951423857e394de02ae25ea5cb53698.tar.gz
nextcloud-server-8c5df31c4951423857e394de02ae25ea5cb53698.zip
DRY use OC_Template::printErrorPage
Diffstat (limited to 'lib/files.php')
-rw-r--r--lib/files.php28
1 files changed, 9 insertions, 19 deletions
diff --git a/lib/files.php b/lib/files.php
index ce46d13da41..0e5b5d54ff2 100644
--- a/lib/files.php
+++ b/lib/files.php
@@ -220,16 +220,11 @@ class OC_Files {
if (!OC_Config::getValue('allowZipDownload', true)) {
$l = OC_L10N::get('lib');
header("HTTP/1.0 409 Conflict");
- $tmpl = new OC_Template('', 'error', 'user');
- $errors = array(
- array(
- 'error' => $l->t('ZIP download is turned off.'),
- 'hint' => $l->t('Files need to be downloaded one by one.')
- . '<br/><a href="javascript:history.back()">' . $l->t('Back to Files') . '</a>',
- )
+ OC_Template::printErrorPage(
+ $l->t('ZIP download is turned off.'),
+ $l->t('Files need to be downloaded one by one.')
+ . '<br/><a href="javascript:history.back()">' . $l->t('Back to Files') . '</a>'
);
- $tmpl->assign('errors', $errors);
- $tmpl->printPage();
exit;
}
@@ -252,17 +247,12 @@ class OC_Files {
if ($totalsize > $zipLimit) {
$l = OC_L10N::get('lib');
header("HTTP/1.0 409 Conflict");
- $tmpl = new OC_Template('', 'error', 'user');
- $errors = array(
- array(
- 'error' => $l->t('Selected files too large to generate zip file.'),
- 'hint' => 'Download the files in smaller chunks, seperately'
- .' or kindly ask your administrator.<br/><a href="javascript:history.back()">'
- . $l->t('Back to Files') . '</a>',
- )
+ OC_Template::printErrorPage(
+ $l->t('Selected files too large to generate zip file.'),
+ 'Download the files in smaller chunks, seperately'
+ .' or kindly ask your administrator.<br/><a href="javascript:history.back()">'
+ . $l->t('Back to Files') . '</a>'
);
- $tmpl->assign('errors', $errors);
- $tmpl->printPage();
exit;
}
}