]> source.dussan.org Git - nextcloud-server.git/commitdiff
DRY use OC_Template::printErrorPage
authorBart Visscher <bartv@thisnet.nl>
Sun, 21 Jul 2013 20:30:32 +0000 (22:30 +0200)
committerBart Visscher <bartv@thisnet.nl>
Sun, 21 Jul 2013 20:30:32 +0000 (22:30 +0200)
lib/files.php
lib/setup.php

index ce46d13da413154b7b6085738cfacbd035836a44..0e5b5d54ff22edf79f2309d640b4ad169cd3bc52 100644 (file)
@@ -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;
                        }
                }
index 59f4cab75debfafffa3a956b3fa7151887f4d2f1..05a49890976f6d5d9b0d4855218081f6922aadc4 100644 (file)
@@ -185,9 +185,7 @@ class OC_Setup {
                        $hint = $l->t('Please double check the <a href=\'%s\'>installation guides</a>.',
                                'http://doc.owncloud.org/server/5.0/admin_manual/installation.html');
 
-                       $tmpl = new OC_Template('', 'error', 'guest');
-                       $tmpl->assign('errors', array(1 => array('error' => $error, 'hint' => $hint)));
-                       $tmpl->printPage();
+                       OC_Template::printErrorPage($error, $hint);
                        exit();
                }
        }