From d94a1f5d1d879fb24bb81380c3e53ff74a916239 Mon Sep 17 00:00:00 2001 From: Marat <1874024+vanilla-thunder@users.noreply.github.com> Date: Sat, 26 Sep 2020 00:58:50 +0200 Subject: [PATCH] response fix --- Application/Controller/Admin/DevTranslations.php | 9 ++------- Application/views/admin/devutils_translations.tpl | 4 ++-- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/Application/Controller/Admin/DevTranslations.php b/Application/Controller/Admin/DevTranslations.php index 80b2109..984de50 100644 --- a/Application/Controller/Admin/DevTranslations.php +++ b/Application/Controller/Admin/DevTranslations.php @@ -27,11 +27,6 @@ class DevTranslations extends \OxidEsales\Eshop\Application\Controller\Admin\Adm { protected $_sThisTemplate = 'devutils_translations.tpl'; - private function _getCustLangFilePath() - { - - } - public function getAllTranslations() { $oConfig = \OxidEsales\Eshop\Core\Registry::getConfig(); @@ -56,7 +51,7 @@ public function getAllTranslations() unset($aAllTranslations["charset"]); ksort($aAllTranslations); - print json_encode($aAllTranslations); + print json_encode(["status" => "ok", "data" => $aAllTranslations]); exit; } @@ -72,7 +67,7 @@ public function getTranslations() $aTranslations = []; foreach ($aLang as $key => $value) $aTranslations[] = ["key" => $key, "value" => $value]; - print json_encode($aTranslations); + print json_encode(["status" => "ok", "data" => $aTranslations]); exit; } diff --git a/Application/views/admin/devutils_translations.tpl b/Application/views/admin/devutils_translations.tpl index 774a9f6..1abc437 100644 --- a/Application/views/admin/devutils_translations.tpl +++ b/Application/views/admin/devutils_translations.tpl @@ -81,7 +81,7 @@ $http.get("[{ $oViewConf->getSelfLink()|oxaddparams:"cl=devtranslations&fnc=getTranslations"|replace:"&":"&" }]") .then(function (res) { - if (res.data.status === 'ok') $scope.translations = res.data; + if (res.data.status === 'ok') $scope.translations = res.data.data; else if (res.data.status === 'error') $scope.response = res.data.msg; else $scope.response = "Übersetzungen konnten nicht geladen werden, bitte prüfe deine Fehler Logs." $scope.loading--; @@ -97,7 +97,7 @@ $http.get("[{ $oViewConf->getSelfLink()|oxaddparams:"cl=devtranslations&fnc=getAllTranslations"|replace:"&":"&" }]") .then(function (res) { - if (res.data.status === 'ok') $scope.allTranslations = res.data; + if (res.data.status === 'ok') $scope.allTranslations = res.data.data; else if (res.data.status === 'error') $scope.response = res.data.msg; else $scope.response = "Übersetzungen konnten nicht geladen werden, bitte prüfe deine Fehler Logs." $scope.loading--;